Use the new sig_send() and sig_post() primitives.
authorarighi <arighi@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 25 Mar 2010 14:56:25 +0000 (14:56 +0000)
committerarighi <arighi@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 25 Mar 2010 14:56:25 +0000 (14:56 +0000)
Replace the old sig_signal() calls with the new sig_send() and
sig_post() functions.

git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3270 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/cpu/arm/drv/adc_at91.c
bertos/cpu/avr/drv/adc_avr.c
bertos/kern/proc_test.c
bertos/kern/signal_test.c
bertos/mware/event.c
examples/avr-kern/avr-kern.mk
examples/avr-kern/main.c
examples/benchmark/kernel-core_avr/main.c
examples/benchmark/kernel-only_arm/main.c

index 7fd50ddf24eae8ff05fe80a0f3b21953720de41e..fadaa4bebeec70a37fba9506af604ec1f05a3ecb 100644 (file)
@@ -86,7 +86,7 @@
         */
        static DECLARE_ISR(adc_conversion_end_irq)
        {
-               sig_signal(adc_process, SIG_ADC_COMPLETE);
+               sig_post(adc_process, SIG_ADC_COMPLETE);
 
                /* Inform hw that we have served the IRQ */
                AIC_EOICR = 0;
index 20aa2a192de4144c4c1634516d9f7f2ebf8a9da1..0aae674332faf44875a6fc7ce9f6aa2a161c294c 100644 (file)
@@ -89,7 +89,7 @@
         */
        ISR(ADC_vect)
        {
-               sig_signal(adc_process, SIG_ADC_COMPLETE);
+               sig_post(adc_process, SIG_ADC_COMPLETE);
        }
 #endif /* CONFIG_KERN */
 
index b8de22d7d1c483622e3e20a7412b54c5c497d5a1..b2319faafdb18d09333af17745e5212004db1061 100644 (file)
@@ -296,7 +296,7 @@ static int preempt_worker_test(void)
 { \
        struct Process *main_proc = (struct Process *) proc_currentUserData(); \
        kputs("> Process: " #num "\n"); \
-       sig_signal(main_proc, SIG_USER##num); \
+       sig_send(main_proc, SIG_USER##num); \
 }
 
 // Default priority is 0
index 484c0338e1c2c783a77aa30407866b4b9a2fda08..8169f496c6cb749b30aa31354cc6491092e7ba71 100644 (file)
@@ -76,21 +76,18 @@ 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 NORETURN proc_signalTest##index(void) \
+static void proc_signalTest##index(void) \
 { \
-       for(;;) \
-       { \
-               kputs("> Slave [" #index "]: Wait signal [" #signal "]\n"); \
-               sig_wait(signal); \
-               kputs("> Slave [" #index "]: send signal [" #signal "]\n"); \
-               sig_signal(proc_currentUserData(), signal); \
-       } \
+       kputs("> Slave [" #index "]: Wait signal [" #signal "]\n"); \
+       sig_wait(signal); \
+       kputs("> Slave [" #index "]: send signal [" #signal "]\n"); \
+       sig_send(proc_currentUserData(), signal); \
 }
 
 #define MAIN_CHECK_SIGNAL(index, slave) \
        do { \
                kprintf("> Main: send signal [%d]\n", test_signal[index]); \
-               sig_signal(slave, test_signal[index]); \
+               sig_send(slave, test_signal[index]); \
                kprintf("> Main: wait signal [%d]\n", test_signal[index]); \
                sig_wait(test_signal[index]); \
                count++; \
index a0419fbfa393d3b40bd89d7f058b4113011b3563..c596e12fa4d591d3af461cf404997e94ff892f77 100644 (file)
@@ -47,7 +47,7 @@ void event_hook_ignore(UNUSED_ARG(Event *, e))
 #if defined(CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS
 void event_hook_signal(Event *e)
 {
-       sig_signal((e)->Ev.Sig.sig_proc, (e)->Ev.Sig.sig_bit);
+       sig_post((e)->Ev.Sig.sig_proc, (e)->Ev.Sig.sig_bit);
 }
 #endif
 
index f241fd7f11c426347bcdbc7e3b9a512b184b0b98..d4e2891cf52125f65697ea5689ce0eebf1d5508f 100644 (file)
@@ -16,6 +16,7 @@ avr-kern_PROGRAMMER_PORT = none
 avr-kern_USER_CSRC = \
        examples/avr-kern/main.c \
        bertos/kern/proc_test.c \
+       bertos/kern/signal_test.c \
        bertos/mware/sprintf.c \
        #
 
index b1e502c3c141139c53672a7575e6103a5c40e833..ed2113e71af9274ca99a3098bcf9255476d0f6ae 100644 (file)
@@ -4,6 +4,7 @@
 #include <cpu/irq.h>
 #include <drv/timer.h>
 #include <kern/proc.h>
+#include <kern/signal.h>
 #include <stdio.h>
 
 static void init(void)
@@ -27,6 +28,7 @@ int main(void)
        kputs("\n");
 
        proc_testRun();
+       signal_testRun();
        while (1)
                cpu_relax();
 
index 190c33842422dd4e0ce1d85cb337d714d88a2251..052e484d11f673df7fcafe6ea30cab575e1f1fde 100644 (file)
@@ -49,7 +49,7 @@ int main(void)
        
        while (1)
        {
-               sig_signal(p, SIG_USER0);
+               sig_send(p, SIG_USER0);
                proc_yield();
        }
 
index 1c81b5651e40695efc6a32ae035bd7d4527b1a62..2455abf119ff8950d592d1af0f2289154bb0ff5e 100644 (file)
@@ -34,7 +34,7 @@ int main(void)
        Msg *msg_re = msg_get(&in_port);
        msg_reply(msg_re);
        // generate code for signals
-       sig_signal(p, SIG_USER0);
+       sig_send(p, SIG_USER0);
        sig_wait(SIG_USER0);
 
        return 0;