From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f172.google.com (mail-wr0-f172.google.com [209.85.128.172]) by dpdk.org (Postfix) with ESMTP id A217E1BDF1 for ; Tue, 26 Jun 2018 18:56:52 +0200 (CEST) Received: by mail-wr0-f172.google.com with SMTP id c13-v6so8020126wrq.2 for ; Tue, 26 Jun 2018 09:56:52 -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=kjK0X93uJ8qR12GsXLADuXLvB/fMaIlBtKWcJvWWVLY=; b=OM8spMOyE7QfVGZsyYrE0vrinBAa5l3Rbb45v3pCqoawStzP2MspeRz1+gNKSOXMI9 0dxQRKvpFLqvanVxhgHi4k3rpZ01yYlcm1CzMgtnl4rSJxmCbE4zSb7QEjW/E3d6vkS6 pQzxGDWrnUGIdpScEZvVKRN9EMV6bC/EnX+Ylh98lalKnQoO5lrzrcpFeoxfWwdB1voM oP1nhaF+LqhvoiyP/cabo1E5ecAEALsSnffDVwQ5Liel+8TtAplQsGysFDC1kFNgBBfb 3Rq/Qr3bp1lGRFIBm6rgRuR7L+r3+nLhUTq1mxLrdx2xuE7zAMGmVlCCjN82OalIoX53 R7LA== 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=kjK0X93uJ8qR12GsXLADuXLvB/fMaIlBtKWcJvWWVLY=; b=PLoJUJtoGJAlAVnTfsrgeApTYFbW0eB8UxCrozNfd41oIZEh8Y/XDPUugZLWqzP0/d ck+oVYqSNLbvUpYYbbO6dCzZxrbp5gRzOTyClOYLPprr5aEqRTTZVm0xU1mojQaDQpwN xhDuq9mxW3r7FdnZ9pVZ2uq6JztdbsBaOLn3JvYiT1uJFaakouDce5pDUBmx5KV/nyvn sU7VPSJeQhM8W+Mynw0SpL1a1UnZauYLhr+EEWOuFQV3XLVNjvC5qXsStpTWxI7YWdaM 6OzZmLADAZAy0aYuDAEbd7KZ3C1HsQOlEjE4sGyGGkU4tJRE8kEKVFEG/XXUQkReG8F8 lwIg== X-Gm-Message-State: APt69E3ll3DX3uhcgR5OWMTjhnEyxdd+PoVpr0cd13NSlxHULLV9SVE7 XpIJIJjCQ7qz6kre6/qjK/7DSCzP X-Google-Smtp-Source: AAOMgpcjFfQ5xZT4mp7tLdKzR0tuDYqlDH0n/YdQT4Oq+UuKVz1iPPzZiuFoU2UlH2lSYqXW9+0eQg== X-Received: by 2002:adf:df86:: with SMTP id z6-v6mr2139835wrl.113.1530032211938; Tue, 26 Jun 2018 09:56:51 -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 p5-v6sm2680880wre.83.2018.06.26.09.56.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jun 2018 09:56:51 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Tue, 26 Jun 2018 18:56:07 +0200 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v8 04/21] 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: Tue, 26 Jun 2018 16:56:53 -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 434adfd45..0dd832728 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