/*
* These macros generate the code needed to create the test process functions.
*/
-#define PROC_TEST_SLAVE(index, signal) static void proc_test##index(void) \
+#define PROC_TEST_SLAVE(index, signal) \
+static void NORETURN proc_signalTest##index(void) \
{ \
for(;;) \
{ \
- kprintf("> Slave [%d]: Wait signal [%d]\n", index, signal); \
+ kputs("> Slave [" #index "]: Wait signal [" #signal "]\n"); \
sig_wait(signal); \
- kprintf("> Slave [%d]: send signal [%d]\n", index, signal); \
+ kputs("> Slave [" #index "]: send signal [" #signal "]\n"); \
sig_signal(proc_currentUserData(), signal); \
} \
-} \
+}
#define MAIN_CHECK_SIGNAL(index, slave) \
do { \
count++; \
} while(0) \
-#define PROC_TEST_SLAVE_STACK(index) static cpu_stack_t proc_test##index##_stack[CONFIG_KERN_MINSTACKSIZE / sizeof(cpu_stack_t)];
-#define PROC_TEST_SLAVE_INIT(index, master_process) proc_new(proc_test##index, master_process, sizeof(proc_test##index##_stack), proc_test##index##_stack)
+#define PROC_TEST_SLAVE_STACK(index) PROC_DEFINE_STACK(proc_signal_test##index##_stack, KERN_MINSTACKSIZE);
+#define PROC_TEST_SLAVE_INIT(index, master_process) proc_new(proc_signalTest##index, master_process, sizeof(proc_signal_test##index##_stack), proc_signal_test##index##_stack)
// Generate the code for signal test.
PROC_TEST_SLAVE(0, SIG_USER0)