eal: add doc for constructor macros
PATCH 1/1 eal: add doc for constructor macros
It is a reminder that the constructors without priority get the lowest priority.
Signed-off-by Thomas Monjalon <[email protected]>
--- lib/librte_eal/common/include/rte_eal.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
lib/librte_eal/common/include/rte_eal.h +17 -0
@@ -287,9 +287,26 @@ static inline int rte_gettid(void)return RTE_PER_LCORE (_thread_id); } +/** +* 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 +* Constructor function. +* @param prio +* Priority number must be above 100. +* Lowest number is the first to run. +*/ #define RTE_INIT_PRIO (func, prio) \ static void __attribute__((constructor(prio), used)) func(void)
Signature · 1 line
2.14.1
Quoted 4 lines · Thomas Monjalon
It is a reminder that the constructors without priority get the lowest priority.
Signed-off-by Thomas Monjalon <[email protected]>
Reviewed-by Ferruh Yigit <[email protected]>
Thomas Monjalon
Applied02/10/2017 20:57, Ferruh Yigit:
Quoted 7 lines · Thomas Monjalon
Quoted 4 lines
It is a reminder that the constructors without priority get the lowest priority.
Signed-off-by Thomas Monjalon <[email protected]>Reviewed-by Ferruh Yigit <[email protected]>
Applied
Mcnamara, John
Acked-byQuoted 18 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Thomas Monjalon
Sent: Tuesday, October 3, 2017 10:15 AM
To: [email protected]
Cc: Yigit, Ferruh <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] eal: add doc for constructor macros02/10/2017 20:57, Ferruh Yigit:
Quoted 7 lines · Thomas Monjalon
Quoted 4 lines
It is a reminder that the constructors without priority get the lowest priority.
Signed-off-by Thomas Monjalon <[email protected]>Reviewed-by Ferruh Yigit <[email protected]>
Acked-by John McNamara <[email protected]>