DISABLE_INTS/ENABLE_INTS: Convert to IRQ_DISABLE/IRQ_ENABLE.
authorbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 13 Dec 2004 11:51:08 +0000 (11:51 +0000)
committerbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 13 Dec 2004 11:51:08 +0000 (11:51 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@314 38d2e660-2303-0410-9eaa-f027e97ec537

drv/ser_avr.c
drv/ser_i196.c
drv/timer_i196.h
kern/proc.c

index 8a31159ecef085373c1f2f8c6840b8564bb67ef9..55665a40acb333ae048b14b9bc9ac314229c676b 100755 (executable)
@@ -38,6 +38,9 @@
 
 /*#*
  *#* $Log$
+ *#* Revision 1.19  2004/12/13 11:51:08  bernie
+ *#* DISABLE_INTS/ENABLE_INTS: Convert to IRQ_DISABLE/IRQ_ENABLE.
+ *#*
  *#* Revision 1.18  2004/12/08 08:03:48  bernie
  *#* Doxygen fixes.
  *#*
@@ -748,7 +751,7 @@ SIGNAL(SIG_UART0_RECV)
 
        /* Disable Recv complete IRQ */
        //UCSR0B &= ~BV(RXCIE);
-       //ENABLE_INTS;
+       //IRQ_ENABLE;
 
        /* Should be read before UDR */
        ser_uart0->status |= UCSR0A & (SERRF_RXSROVERRUN | SERRF_FRAMEERROR);
@@ -772,7 +775,7 @@ SIGNAL(SIG_UART0_RECV)
        }
 
        /* Reenable receive complete int */
-       //DISABLE_INTS;
+       //IRQ_DISABLE;
        //UCSR0B |= BV(RXCIE);
 
        SER_STROBE_OFF;
@@ -798,7 +801,7 @@ SIGNAL(SIG_UART1_RECV)
 
        /* Disable Recv complete IRQ */
        //UCSR1B &= ~BV(RXCIE);
-       //ENABLE_INTS;
+       //IRQ_ENABLE;
 
        /* Should be read before UDR */
        ser_uart1->status |= UCSR1A & (SERRF_RXSROVERRUN | SERRF_FRAMEERROR);
index dc77f39f1c67e4b38885bdce03f4efb662ecd952..812053bfae3043b780998d4caf303e7a57579ce2 100755 (executable)
@@ -15,6 +15,9 @@
 
 /*#*
  *#* $Log$
+ *#* Revision 1.5  2004/12/13 11:51:08  bernie
+ *#* DISABLE_INTS/ENABLE_INTS: Convert to IRQ_DISABLE/IRQ_ENABLE.
+ *#*
  *#* Revision 1.4  2004/08/25 14:12:08  rasky
  *#* Aggiornato il comment block dei log RCS
  *#*
 #include "serhw.h"
 
 #define SER_HW_ENABLE_TX \
-       DISABLE_INTS; \
-       if (!ser_sending) \
-       { \
-               ser_sending = true; \
-               (INT_PEND1 |= INT1F_TI) \
-       } \
-       ENABLE_INTS;
+       ATOMIC( \
+               if (!ser_sending) \
+               { \
+                       ser_sending = true; \
+                       (INT_PEND1 |= INT1F_TI) \
+               } \
+       );
 
 static volatile bool ser_sending;
 
index f2a0f9eba8b5b1e4185d31bb288672f2ed5efc2d..858ac4f308c642f8cae6f88547c3d0287c4defd2 100755 (executable)
@@ -15,6 +15,9 @@
 
 /*#*
  *#* $Log$
+ *#* Revision 1.4  2004/12/13 11:51:08  bernie
+ *#* DISABLE_INTS/ENABLE_INTS: Convert to IRQ_DISABLE/IRQ_ENABLE.
+ *#*
  *#* Revision 1.3  2004/08/25 14:12:08  rasky
  *#* Aggiornato il comment block dei log RCS
  *#*
 #      define TIMER_INIT \
                TIMER2 = (65535 - TICKS_RATE); \
                INT_MASK1 |= INT1F_T2OVF; \
-               \
-               DISABLE_INTS; \
-               WSR = 1; \
-               IOC3 |= IOC3F_T2_ENA; \
-               WSR = 0; \
-               ENABLE_INTS
+               ATOMIC( \
+                       WSR = 1; \
+                       IOC3 |= IOC3F_T2_ENA; \
+                       WSR = 0; \
+               )
 
 #define DEFINE_TIMER_ISR \
        INTERRUPT(0x38) void TM2_OVFL_interrupt(void);  \
index e25cb7dd92c2d755ba58a0be4f1f2d94a428a456..2301cee05c862bc5fe86c7722363c50e39db5d8a 100755 (executable)
@@ -17,6 +17,9 @@
 
 /*#*
  *#* $Log$
+ *#* Revision 1.22  2004/12/13 11:51:08  bernie
+ *#* DISABLE_INTS/ENABLE_INTS: Convert to IRQ_DISABLE/IRQ_ENABLE.
+ *#*
  *#* Revision 1.21  2004/11/28 23:20:25  bernie
  *#* Remove obsolete INITLIST macro.
  *#*
@@ -284,7 +287,7 @@ void proc_schedule(void)
         * the compiler might put them on the stack of the process
         * being switched out.
         */
-       static Process *old_process;
+       static struct Process *old_process;
        static cpuflags_t flags;
 
        /* Remember old process to save its context later */
@@ -292,7 +295,7 @@ void proc_schedule(void)
 
        /* Poll on the ready queue for the first ready process */
        DISABLE_IRQSAVE(flags);
-       while (!(CurrentProcess = (struct Process*)REMHEAD(&ProcReadyList)))
+       while (!(CurrentProcess = (struct Process *)REMHEAD(&ProcReadyList)))
        {
                /*
                 * Make sure we physically reenable interrupts here, no matter what
@@ -300,22 +303,23 @@ void proc_schedule(void)
                 * are idle-spinning, we must allow interrupts, otherwise no
                 * process will ever wake up.
                 *
-                * \todo If there was a way to code sig_wait so that it does not
+                * \todo If there was a way to write sig_wait() so that it does not
                 * disable interrupts while waiting, there would not be any
                 * reason to do this.
                 */
-               ENABLE_INTS;
+               IRQ_ENABLE;
                SCHEDULER_IDLE;
-               DISABLE_INTS;
+               IRQ_DISABLE;
        }
        ENABLE_IRQRESTORE(flags);
 
-       /* Optimization: don't switch contexts when the active
+       /*
+        * Optimization: don't switch contexts when the active
         * process has not changed.
         */
        if (CurrentProcess != old_process)
        {
-               static cpustack_tdummy;
+               static cpustack_t *dummy;
 
 #if CONFIG_KERN_PREEMPTIVE
                /* Reset quantum for this process */