From: bernie Date: Mon, 13 Dec 2004 11:51:08 +0000 (+0000) Subject: DISABLE_INTS/ENABLE_INTS: Convert to IRQ_DISABLE/IRQ_ENABLE. X-Git-Tag: 1.0.0~927 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=5b25ae54d86d894e5d01adeef10938df1bb10e16;p=bertos.git DISABLE_INTS/ENABLE_INTS: Convert to IRQ_DISABLE/IRQ_ENABLE. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@314 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/drv/ser_avr.c b/drv/ser_avr.c index 8a31159e..55665a40 100755 --- a/drv/ser_avr.c +++ b/drv/ser_avr.c @@ -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); diff --git a/drv/ser_i196.c b/drv/ser_i196.c index dc77f39f..812053bf 100755 --- a/drv/ser_i196.c +++ b/drv/ser_i196.c @@ -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 *#* @@ -30,13 +33,13 @@ #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; diff --git a/drv/timer_i196.h b/drv/timer_i196.h index f2a0f9eb..858ac4f3 100755 --- a/drv/timer_i196.h +++ b/drv/timer_i196.h @@ -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 *#* @@ -38,12 +41,11 @@ # 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); \ diff --git a/kern/proc.c b/kern/proc.c index e25cb7dd..2301cee0 100755 --- a/kern/proc.c +++ b/kern/proc.c @@ -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_t* dummy; + static cpustack_t *dummy; #if CONFIG_KERN_PREEMPTIVE /* Reset quantum for this process */