From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gaetan Rivet Subject: [PATCH v7 03/22] eal: add last init priority Date: Sun, 15 Apr 2018 17:07:32 +0200 Message-ID: References: Cc: Gaetan Rivet To: dev@dpdk.org Return-path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id BFC241B3FE for ; Sun, 15 Apr 2018 17:08:14 +0200 (CEST) Received: by mail-wr0-f193.google.com with SMTP id w3so2668452wrg.2 for ; Sun, 15 Apr 2018 08:08:14 -0700 (PDT) In-Reply-To: In-Reply-To: References: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add the priority RTE_PRIORITY_LAST, used for initialization routines meant to be run after all other constructors. This priority becomes the default priority for all DPDK constructors. Signed-off-by: Gaetan Rivet --- lib/librte_eal/common/include/rte_common.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h index 8f04518f7..69e5ed1e3 100644 --- a/lib/librte_eal/common/include/rte_common.h +++ b/lib/librte_eal/common/include/rte_common.h @@ -83,22 +83,12 @@ typedef uint16_t unaligned_uint16_t; #define RTE_PRIORITY_LOG 101 #define RTE_PRIORITY_BUS 110 +#define RTE_PRIORITY_LAST 65535 #define RTE_PRIO(prio) \ RTE_PRIORITY_ ## prio /** - * Run function before main() with low priority. - * - * The constructor will be run after prioritized constructors. - * - * @param func - * Constructor function. - */ -#define RTE_INIT(func) \ -static void __attribute__((constructor, used)) func(void) - -/** * Run function before main() with high priority. * * @param func @@ -111,6 +101,17 @@ static void __attribute__((constructor, used)) func(void) static void __attribute__((constructor(RTE_PRIO(prio)), used)) func(void) /** + * Run function before main() with low priority. + * + * The constructor will be run after prioritized constructors. + * + * @param func + * Constructor function. + */ +#define RTE_INIT(func) \ + RTE_INIT_PRIO(func, LAST) + +/** * Force a function to be inlined */ #define __rte_always_inline inline __attribute__((always_inline)) -- 2.11.0