From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id 00FF91BAE8 for ; Fri, 13 Apr 2018 15:23:03 +0200 (CEST) Received: by mail-wm0-f66.google.com with SMTP id b21so4171197wme.4 for ; Fri, 13 Apr 2018 06:23:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=gerWU3cf5ls8bayi2HII2hVSGyl+fhAcDFRxrjbP6iA=; b=WiYGim4UHM4deUg6c3gLAcuMNrP/p34v4UI2X0xZ7Swxul/VPDgF/vX33IrQycDtMA 8nFaya63fftlbiDsNTXZphmCQH6cHgazpwMn5qKp/SD4EhxEabkgCWHqkblOOVLXF7DP R3kk/e5iwoTYEgNXWbKVit84yz9MYYo9EtZ3mekO5WZKuFbs29z5EPc8Y/23y6uX1pmz ONCCOVr3k8Jt4DQ0UVtN4Sg9f+MNTeU9lqQFlr7397o//fS5kDIsrDloFBEZZcWvD8OQ i4M/9wJihwe60o9LUVC1Ed2oK22PY+nE0NhUJojB7aWdGgA2d2SLQalgBkAyqZJk4NLq UdDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=gerWU3cf5ls8bayi2HII2hVSGyl+fhAcDFRxrjbP6iA=; b=RGwVz6ogUeVuDeqLJSE+LLZkF7r2kcz3lOgh+E5G245Pxf4GKBurrbxA+/2u2CdleK CIBuArBtO06sSdbS0XKXwOAg1EQ28IdKFpnYk7D3r2NLrzXE/9iCyJRuRXfaBPp2yYj/ vUDjCWB86INe16bCZSQ42GjnVnV7NZy2Z0FBH7hDFr1pRjXTRnxvbnvluyJ6yUWFObbv T2FtO+HQY19ovgHlpKDxL6z74oy5+zZW9egHJBi38x3qWYYJ7LbXY60awdLVo/mJ7R4D dxKoOTOLyuB0M1fFlbXlLb6aZGzmClJlaeejOL0J3nae9rdZb0DapKzK7mXo6xc4FAij NfOg== X-Gm-Message-State: ALQs6tBsBMsNgljhnK8Xg76tRqso5TVlKIXOVnCNC2tqjzIdnqQE/Lyp CV3+xiny3+qW/UtRthp/+zHJm3Fi X-Google-Smtp-Source: AIpwx49CXmrbrD0JcS/uTHwUOwceSnBrU4VgzqAt7oEvJRa0/f+N8hi6++M1Psvd4Bw9815NLpX25Q== X-Received: by 10.28.52.17 with SMTP id b17mr3462495wma.142.1523625782389; Fri, 13 Apr 2018 06:23:02 -0700 (PDT) Received: from bidouze.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id r200sm2377244wmb.9.2018.04.13.06.23.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Apr 2018 06:23:01 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Fri, 13 Apr 2018 15:22:19 +0200 Message-Id: <79746db25465ac62ab7707378eb0f3e1030ac342.1523625525.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v6 04/22] eal: introduce dtor macros X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2018 13:23:03 -0000 Signed-off-by: Gaetan Rivet --- lib/librte_eal/common/include/rte_common.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h index 69e5ed1e3..d48e0ec56 100644 --- a/lib/librte_eal/common/include/rte_common.h +++ b/lib/librte_eal/common/include/rte_common.h @@ -112,6 +112,29 @@ static void __attribute__((constructor(RTE_PRIO(prio)), used)) func(void) RTE_INIT_PRIO(func, LAST) /** + * Run after main() with low priority. + * + * @param func + * Destructor function name. + * @param prio + * Priority number must be above 100. + * Lowest number is the last to run. + */ +#define RTE_FINI_PRIO(func, prio) \ +static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void) + +/** + * Run after main() with high priority. + * + * The destructor will be run *before* prioritized destructors. + * + * @param func + * Destructor function name. + */ +#define RTE_FINI(func) \ + RTE_FINI_PRIO(func, LAST) + +/** * Force a function to be inlined */ #define __rte_always_inline inline __attribute__((always_inline)) -- 2.11.0