From 3d7fa72bc2ba2f723e6bcf84180637fb8c84f713 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 12 Sep 2007 15:23:49 +0000 Subject: 2007-09-12 Joel Sherrill PR 1257/bsps * sh7032/score/cpu_asm.c, sh7032/timer/timer.c, sh7045/score/cpu_asm.c, sh7045/timer/timer.c, sh7750/score/cpu_asm.c, sh7750/timer/timer.c: Code outside of cpukit should use the public API for rtems_interrupt_disable/rtems_interrupt_enable. By bypassing the public API and directly accessing _CPU_ISR_Disable and _CPU_ISR_Enable, they were bypassing the compiler memory barrier directive which could lead to problems. This patch also changes the type of the variable passed into these routines and addresses minor style issues. --- c/src/lib/libcpu/sh/sh7045/score/cpu_asm.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'c/src/lib/libcpu/sh/sh7045/score') diff --git a/c/src/lib/libcpu/sh/sh7045/score/cpu_asm.c b/c/src/lib/libcpu/sh/sh7045/score/cpu_asm.c index 6838fe1cb7..8b2f83c5c4 100644 --- a/c/src/lib/libcpu/sh/sh7045/score/cpu_asm.c +++ b/c/src/lib/libcpu/sh/sh7045/score/cpu_asm.c @@ -70,7 +70,7 @@ unsigned int sh_set_irq_priority( uint32_t shiftcount; uint32_t prioreg; uint16_t temp16; - uint32_t level; + ISR_Level level; /* * first check for valid interrupt @@ -114,14 +114,14 @@ unsigned int sh_set_irq_priority( /* * Set the interrupt priority register */ - _CPU_ISR_Disable( level ); + _ISR_Disable( level ); - temp16 = read16( prioreg); - temp16 &= ~( 15 << shiftcount); - temp16 |= prio << shiftcount; - write16( temp16, prioreg); + temp16 = read16( prioreg); + temp16 &= ~( 15 << shiftcount); + temp16 |= prio << shiftcount; + write16( temp16, prioreg); - _CPU_ISR_Enable( level ); + _ISR_Enable( level ); return 0; } @@ -259,9 +259,9 @@ __CPU_Context_restore:\n\ void __ISR_Handler( uint32_t vector) { - register uint32_t level; + ISR_Level level; - _CPU_ISR_Disable( level ); + _ISR_Disable( level ); _Thread_Dispatch_disable_level++; @@ -277,13 +277,13 @@ void __ISR_Handler( uint32_t vector) _ISR_Nest_level++; - _CPU_ISR_Enable( level ); + _ISR_Enable( level ); /* call isp */ if( _ISR_Vector_table[ vector]) (*_ISR_Vector_table[ vector ])( vector ); - _CPU_ISR_Disable( level ); + _ISR_Disable( level ); _Thread_Dispatch_disable_level--; @@ -296,7 +296,7 @@ void __ISR_Handler( uint32_t vector) stack_ptr = _old_stack_ptr; #endif - _CPU_ISR_Enable( level ); + _ISR_Enable( level ); if ( _ISR_Nest_level ) return; -- cgit v1.2.3