summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ce6427d)
The new macro __rte_noreturn, for compiler hinting,
is now used where appropriate for consistency.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
19 files changed:
.stats = (void *)&ntuple_stats
};
.stats = (void *)&ntuple_stats
};
- static __attribute__((noreturn)) void
+ static __rte_noreturn void
lcore_main(cls_app)
{
uint16_t port;
lcore_main(cls_app)
{
uint16_t port;
- attribute ((noreturn)) int main_loop(__rte_unused void *dummy)
+ __rte_noreturn int main_loop(__rte_unused void *dummy)
The function ``pthread_exit()`` has additional special handling. The standard
system header file pthread.h declares ``pthread_exit()`` with
The function ``pthread_exit()`` has additional special handling. The standard
system header file pthread.h declares ``pthread_exit()`` with
-``__attribute__((noreturn))`` this is an optimization that is possible because
+``__rte_noreturn`` this is an optimization that is possible because
the pthread is terminating and this enables the compiler to omit the normal
handling of stack and protection of registers since the function is not
expected to return, and in fact the thread is being destroyed. These
the pthread is terminating and this enables the compiler to omit the normal
handling of stack and protection of registers since the function is not
expected to return, and in fact the thread is being destroyed. These
- static __attribute__((noreturn)) void
+ static __rte_noreturn void
lcore_main(void)
{
uint16_t port;
lcore_main(void)
{
uint16_t port;
* The lcore main. This is the main thread that does the work, reading from
* an input port classifying the packets and writing to an output port.
*/
* The lcore main. This is the main thread that does the work, reading from
* an input port classifying the packets and writing to an output port.
*/
-static __attribute__((noreturn)) void
+static __rte_noreturn void
lcore_main(struct flow_classifier *cls_app)
{
uint16_t port;
lcore_main(struct flow_classifier *cls_app)
{
uint16_t port;
* The lcore main. This is the main thread that does the work, reading from
* an input port and writing to an output port.
*/
* The lcore main. This is the main thread that does the work, reading from
* an input port and writing to an output port.
*/
-static __attribute__((noreturn)) void
+static __rte_noreturn void
lcore_main(void)
{
uint16_t port;
lcore_main(void)
{
uint16_t port;
/*
* CPU-load stats collector
*/
/*
* CPU-load stats collector
*/
-static int __attribute__((noreturn))
+static int __rte_noreturn
cpu_load_collector(__rte_unused void *arg) {
unsigned i, j, k;
uint64_t hits;
cpu_load_collector(__rte_unused void *arg) {
unsigned i, j, k;
uint64_t hits;
}
/* main processing loop */
}
/* main processing loop */
-static int __attribute__((noreturn))
+static int __rte_noreturn
pthread_tx(void *dummy)
{
struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
pthread_tx(void *dummy)
{
struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
* An exiting lthread must not terminate the pthread it is running in
* since this would mean terminating the lthread scheduler.
* We override pthread_exit() with a macro because it is typically declared with
* An exiting lthread must not terminate the pthread it is running in
* since this would mean terminating the lthread scheduler.
* We override pthread_exit() with a macro because it is typically declared with
- * __attribute__((noreturn))
*/
void pthread_exit_override(void *v);
*/
void pthread_exit_override(void *v);
* The lcore main. This is the main thread that does the work, reading from an
* input port and writing to an output port.
*/
* The lcore main. This is the main thread that does the work, reading from an
* input port and writing to an output port.
*/
-static __attribute__((noreturn)) void
+static __rte_noreturn void
lcore_main(void)
{
uint16_t portid;
lcore_main(void)
{
uint16_t portid;
-static __attribute__((noreturn)) int
+static __rte_noreturn int
main_loop(__rte_unused void *dummy)
{
uint64_t current_time, last_time = rte_rdtsc();
main_loop(__rte_unused void *dummy)
{
uint64_t current_time, last_time = rte_rdtsc();
* Main thread that does the work, reading from INPUT_PORT
* and writing to OUTPUT_PORT
*/
* Main thread that does the work, reading from INPUT_PORT
* and writing to OUTPUT_PORT
*/
-static __attribute__((noreturn)) void
+static __rte_noreturn void
lcore_main(void)
{
uint16_t port;
lcore_main(void)
{
uint16_t port;
* The lcore main. This is the main thread that does the work, reading from
* an input port and writing to an output port.
*/
* The lcore main. This is the main thread that does the work, reading from
* an input port and writing to an output port.
*/
-static __attribute__((noreturn)) void
+static __rte_noreturn void
lcore_main(void)
{
uint16_t port;
lcore_main(void)
{
uint16_t port;
rte_timer_reset(tim, hz/3, SINGLE, lcore_id, timer1_cb, NULL);
}
rte_timer_reset(tim, hz/3, SINGLE, lcore_id, timer1_cb, NULL);
}
-static __attribute__((noreturn)) int
+static __rte_noreturn int
lcore_mainloop(__rte_unused void *arg)
{
uint64_t prev_tsc = 0, cur_tsc, diff_tsc;
lcore_mainloop(__rte_unused void *arg)
{
uint64_t prev_tsc = 0, cur_tsc, diff_tsc;
* @param arg
* opaque pointer
*/
* @param arg
* opaque pointer
*/
-__attribute__((noreturn)) void *eal_thread_loop(void *arg);
+__rte_noreturn void *eal_thread_loop(void *arg);
/**
* Init per-lcore info for master thread
/**
* Init per-lcore info for master thread
}
/* main loop of threads */
}
/* main loop of threads */
-__attribute__((noreturn)) void *
eal_thread_loop(__rte_unused void *arg)
{
char c;
eal_thread_loop(__rte_unused void *arg)
{
char c;
#define RTE_FINI(func) \
RTE_FINI_PRIO(func, LAST)
#define RTE_FINI(func) \
RTE_FINI_PRIO(func, LAST)
+/**
+ * Hint never returning function
+ */
+#define __rte_noreturn __attribute__((noreturn))
+
/**
* Force a function to be inlined
*/
/**
* Force a function to be inlined
*/
* printf format characters which will be expanded using any further parameters
* to the function.
*/
* printf format characters which will be expanded using any further parameters
* to the function.
*/
rte_exit(int exit_code, const char *format, ...)
rte_exit(int exit_code, const char *format, ...)
- __attribute__((noreturn))
__rte_format_printf(2, 3);
#ifdef __cplusplus
__rte_format_printf(2, 3);
#ifdef __cplusplus
- __attribute__((noreturn))
__rte_format_printf(2, 3);
#ifdef __cplusplus
__rte_format_printf(2, 3);
#ifdef __cplusplus
* @return
* never return;
*/
* @return
* never return;
*/
-static __attribute__((noreturn)) void *
+static __rte_noreturn void *
eal_intr_thread_main(__rte_unused void *arg)
{
/* host thread, never break out */
eal_intr_thread_main(__rte_unused void *arg)
{
/* host thread, never break out */
}
/* main loop of threads */
}
/* main loop of threads */
-__attribute__((noreturn)) void *
eal_thread_loop(__rte_unused void *arg)
{
char c;
eal_thread_loop(__rte_unused void *arg)
{
char c;