Use eal's RTE_INIT abstraction for defining constructors.
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
.command = RTE_STR(name), \
.callback = test_func_##name, \
}; \
- static void __attribute__((constructor, used)) \
- test_register_##name(void) \
+ RTE_INIT(test_register_##name) \
{ \
add_test_command(&test_struct_##name); \
}
.begin = b, \
.end = e, \
}; \
-static void __attribute__((constructor, used)) resinitfn_ ##n(void) \
+RTE_INIT(resinitfn_ ##n) \
{ \
resource_register(&linkres_ ##n); \
}
.command = RTE_STR(cmd), \
.callback = func, \
}; \
- static void __attribute__((constructor, used)) \
- test_register_##cmd(void) \
+ RTE_INIT(test_register_##cmd) \
{ \
add_test_command(&test_struct_##cmd); \
}
* Note that the rte_mempool_register_ops fails silently here when
* more than RTE_MEMPOOL_MAX_OPS_IDX is registered.
*/
-#define MEMPOOL_REGISTER_OPS(ops) \
- void mp_hdlr_init_##ops(void); \
- void __attribute__((constructor, used)) mp_hdlr_init_##ops(void)\
- { \
+#define MEMPOOL_REGISTER_OPS(ops) \
+ RTE_INIT(mp_hdlr_init_##ops) \
+ { \
rte_mempool_register_ops(&ops); \
}