From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id 4B82E7D30 for ; Thu, 15 Mar 2018 18:50:12 +0100 (CET) Received: by mail-wr0-f195.google.com with SMTP id f14so9154343wre.8 for ; Thu, 15 Mar 2018 10:50:12 -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=z1CBV2pTvy5tipj0N6GsGPeyjj//aSH2uZxGzZ4OGxWFX2R/A8jryvXbTpS7F9HdWM ec8GnAnG5NyJSb8w7Jthbe3zQFjBUkFii+IMVbKt0MCU5qI89ciEsn26EXocP0XWlVIz ZocPi8hVJmXxlloHotL1LjBkCKPE9cYUJiXn8bZhxoVEMSTrI9HrsvIT4kT7Dfe58qHf oe0f0bYS8I2MLv3g0pv7PCNo2+zF23w5RLhyAFWm9pmmRbn+vkzJqJ+vDpPjuJ5mz0ED OmQu22ms45H11MKTPbFA1LQaj/rGNNIoS85sqsf4fWEH2HdgRHXIoAjRulJXamgnd7Sd hYeA== 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=uGGKgGjCmS7UBNnHaFZdXc+B66dB8LVKrz2v5IycL2yV3dubpHRtLzvV9e7z60wv9j G+SyK7P8dyJRn2xpQkKKAkEKADgvPmXbdNdxW4luUdllN2Cft+VZ8vCjTPWT2SopX/HZ g4CanSK1oxzi2AaIVOQJLL+OeKQXradW/r9H7ymW/hKYeSyYexHjnAtHSpAGDxCW3BB/ Z8HqxJftQqpymhmGBGejKQHHHVk6JZwda5tlSBla/zJv5zTxRZVQYCYdnmeDv+0m9EsB nmz/CGRDJZBJ/er9If7yx2xHo6CzH9reGds29JICg8Ze8RGUcVfbUS5fUr6AKqpnVZ8v JxlA== X-Gm-Message-State: AElRT7GiqLpRf3SUOVGx4074EG4Kky6EHAKa0YE1zQS+4WkJ741uGEUi D3Rh/K/mz09kZpjtCSdV9UTDVIDP X-Google-Smtp-Source: AG47ELu+oBAaW7xWp4EUbhhElCKmu6O9aXgTg7/sZmMRiqEwtnfJy/xrP1haNWcAOyWWWiCWNjGaGQ== X-Received: by 10.223.133.209 with SMTP id 17mr8013647wru.143.1521136211555; Thu, 15 Mar 2018 10:50:11 -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 69sm4756596wmp.36.2018.03.15.10.50.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Mar 2018 10:50:10 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Thu, 15 Mar 2018 18:49:31 +0100 Message-Id: <5e05cca28cd3dab0c9a3f3a431ba50bc6e98b976.1521124599.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 v1 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: Thu, 15 Mar 2018 17:50:12 -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