X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fkern%2Fsignal_test.c;h=484c0338e1c2c783a77aa30407866b4b9a2fda08;hb=171251d9de4ef383f9f0feb622da3863076b1fc6;hp=b105cd8d4249f1ec474be9aba6a4bf1031dfef07;hpb=bd7bc85675e6b1370df6227236ceee490560e6f2;p=bertos.git diff --git a/bertos/kern/signal_test.c b/bertos/kern/signal_test.c index b105cd8d..484c0338 100644 --- a/bertos/kern/signal_test.c +++ b/bertos/kern/signal_test.c @@ -44,7 +44,7 @@ * $test$: echo "#define CONFIG_KERN_SIGNALS 1" >> $cfgdir/cfg_signal.h */ -#include +#include "cfg/cfg_timer.h" #include #include @@ -75,16 +75,17 @@ sigmask_t sig_to_slave; /* * 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 { \ @@ -95,8 +96,8 @@ sigmask_t sig_to_slave; 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) @@ -165,12 +166,6 @@ int signal_testSetup(void) { kdbg_init(); - #if CONFIG_KERN_PREEMPT - kprintf("Init Interrupt (preempt mode).."); - irq_init(); - kprintf("Done.\n"); - #endif - kprintf("Init Timer.."); timer_init(); kprintf("Done.\n");