From: Jerin Jacob Date: Wed, 3 Apr 2019 19:28:40 +0000 (+0000) Subject: eal: allow to override init macros per OS X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4b3997680ab61636df489299d7980102e00bcf0a;p=dpdk.git eal: allow to override init macros per OS baremetal execution environments may have a different method to enable RTE_INIT instead of using compiler constructor and/or OS specific linker scheme. Allow an option to override RTE_INIT* macros using rte_os.h or appropriate header file. Signed-off-by: Jerin Jacob Acked-by: Thomas Monjalon --- diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h index 1d3c33021b..b475f767af 100644 --- a/lib/librte_eal/common/include/rte_common.h +++ b/lib/librte_eal/common/include/rte_common.h @@ -106,8 +106,10 @@ typedef uint16_t unaligned_uint16_t; * Priority number must be above 100. * Lowest number is the first to run. */ +#ifndef RTE_INIT_PRIO /* Allow to override from EAL */ #define RTE_INIT_PRIO(func, prio) \ static void __attribute__((constructor(RTE_PRIO(prio)), used)) func(void) +#endif /** * Run function before main() with low priority. @@ -129,8 +131,10 @@ static void __attribute__((constructor(RTE_PRIO(prio)), used)) func(void) * Priority number must be above 100. * Lowest number is the last to run. */ +#ifndef RTE_FINI_PRIO /* Allow to override from EAL */ #define RTE_FINI_PRIO(func, prio) \ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void) +#endif /** * Run after main() with high priority.