From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 2639E5F4D for ; Wed, 21 Mar 2018 18:16:01 +0100 (CET) Received: by mail-wm0-f65.google.com with SMTP id h76so11147058wme.4 for ; Wed, 21 Mar 2018 10:16:00 -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=ttNNgk8ai4hfhwqtYqdc7ruDXdK757Xls5meCsWhiEM=; b=jCWKVu+ajDIms4LCJM7ucMAZc4HDVo+1/jReI0VuP1Tw8ZBzvncq115P7VCIpXnI8Q ybGLPsp/L+f8XNKZLWa+cQ8TLcdC3lww+/azqV4s1j4TGFcEvcLKscuFJf9nG32c0bVX zG2dDEwj+FawOwP3YplLfEFrOzrHt3jhWhOXFrSn1qK+jEhS9B6NypeizeYgvuYZhCRx YILLumVLjVAQtGUcblWWp23G+0NiJR/tn5KwwzoLp91UUZ0ZXwt9chW0dvjWXkivcg6d 8zsX9FZRk9bCMJskabfy4qs7JfrrXzHgYJdjNcvzBS9p9psSn6K2VESWkxrYh0mr/58B 26TQ== 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=ttNNgk8ai4hfhwqtYqdc7ruDXdK757Xls5meCsWhiEM=; b=LnLuAkOaupz/PpcQhFRK4UE4aOBpQ+gqzr3tIdSDyMnrM1fRqdl/KKwJjHYJ2o1ti4 8fiUg4FwzCZT5YIw3h0KnDdyM4SbAcIqr9TzFJA6223hDcTeZLQpQohMkQx8EAqCTedQ w93jSdyCKmlwTNkxA5JfdJDNRuA9+tImsX7oyvR/HOyHnVJo54+wxnxIY4g2OceZMA3s FCB9uhZO/Fc5d0Svinhg7P0jGW1S1scl1YTbhlnlmgLhHaXo58IUb+zGmU56vsYqXDvj s4iq+Vro1Aj1mF/lmKhRNU8LZZKZPqyfZ+p5ixVT1PQHuA/aPbUVGdsNAppQgNhRn1Sg Lwzw== X-Gm-Message-State: AElRT7HIxkOK3v3J3cga0flqCYeW/k9ATH1+XgnFf/eHpy9ASPKfrxYC vB9D2CvlbeRpM1GMEmWpusqygVIL X-Google-Smtp-Source: AG47ELs64gWjYN4iJf2xbryEUOLfHqedGPRErTQBGnuKvBkPjqWJ8xs+/WGWS0QIfTwv+r34Udr1kg== X-Received: by 10.28.109.27 with SMTP id i27mr3500620wmc.109.1521652560225; Wed, 21 Mar 2018 10:16:00 -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 l10sm4224101wrf.37.2018.03.21.10.15.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Mar 2018 10:15:59 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Wed, 21 Mar 2018 18:15:22 +0100 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 01/18] 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: Wed, 21 Mar 2018 17:16:02 -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 c7803e41c..500fc3adb 100644 --- a/lib/librte_eal/common/include/rte_common.h +++ b/lib/librte_eal/common/include/rte_common.h @@ -105,6 +105,29 @@ static void __attribute__((constructor, used)) func(void) static void __attribute__((constructor(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) \ +static void __attribute__((destructor, used)) func(void) + +/** + * 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(prio), used)) func(void) + +/** * Force a function to be inlined */ #define __rte_always_inline inline __attribute__((always_inline)) -- 2.11.0