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 DD7471B8D9 for ; Fri, 13 Apr 2018 15:23:01 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id g8so5182050wmd.2 for ; Fri, 13 Apr 2018 06:23:01 -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=AvYrzoRcMZHfvRG1lNtXbYNg5lPA+k5iDJDOcEmN02w=; b=HorH3/KgRyHZAvb8/2w7HubaaODbHiytEuImnMOWt8XYuRYJUd1GeYKTaUVqgATvLM 2nlzuafW51VqJ8Es/M6PNRM8F300dUzsJznN+pAU++bLT2cse8GZmx0Idg2WblmV5rZH twdJGkHRPj32NUtdTKbnvVoJ5mD0d5eq3szp8ja9DtmXxJaTBthoV6EHwhKt0U1cR6It +M9f6bhj8Khzp0pTRbJ7YnjpGhztThSivCZ8lTYPl0GPHP40tVL36GkPCFRLbWFruN5e ydSewZamwfFkDQfKSzg8hcvNgwaetxGAed6DR82nZQjvOIfLx4vlVBBrwOOJqd2ffAaH RwYA== 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=AvYrzoRcMZHfvRG1lNtXbYNg5lPA+k5iDJDOcEmN02w=; b=ezjnn01WA7h4aRoWMeNl3JRubXLg8K7mUKAeGuZE9mYohhXqJgSAqgdU2RHxAk8FST 94cWi+Ypdgpq+NN4nDe9EcTRbK8kRl2dHGEU1uCbA+zgh2F64S8cXz4kvlRVDfCmg932 M36T+355wJE68kSqOewlRLg9dQFNK4Q5a0hsFDq076XfwFIiZJ26ueTltJNPydnyartg 3Z5JZzlUF8VATOc9o3fjXJZPK5bl10Ue9aqKnbo+HVndPANQLESbyxjr2sr8Px/nvkks KgzVYO6KeiRhe9JjBGJzki50zvWJDVFjTSe6+WFJObjbN77Ddkjs+NmitTbMLGA5oERq SZqQ== X-Gm-Message-State: ALQs6tDfOe1jEmEiY+BeLdx4jG7DzyedpFUurTSkepDnS4E/HAHwh202 IacuIW1A8PhET2FuQRlyWG+UVE+v X-Google-Smtp-Source: AIpwx48oi5G2qgqjbAtTr3Zbek8lKnm/roIGlrhQ/YPCFvnEgZ4CioPuxg0T+GhcsO/QbeQdOKNAYg== X-Received: by 10.28.1.131 with SMTP id 125mr3488171wmb.96.1523625781247; Fri, 13 Apr 2018 06:23:01 -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.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Apr 2018 06:23:00 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Fri, 13 Apr 2018 15:22:18 +0200 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v6 03/22] eal: add last init priority 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:02 -0000 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