forked from Imagelibrary/rtems
2007-09-12 Joel Sherrill <joel.sherrill@OARcorp.com>
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.
This commit is contained in:
@@ -1,3 +1,16 @@
|
||||
2007-09-12 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
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.
|
||||
|
||||
2007-04-17 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||
|
||||
* sh7032/score/cpu_asm.c, sh7045/score/cpu_asm.c,
|
||||
|
||||
@@ -71,7 +71,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
|
||||
@@ -112,14 +112,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);
|
||||
|
||||
_CPU_ISR_Enable( level );
|
||||
_ISR_Enable( level );
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -257,9 +257,9 @@ asm volatile(
|
||||
|
||||
void __ISR_Handler( uint32_t vector)
|
||||
{
|
||||
register uint32_t level;
|
||||
ISR_Level level;
|
||||
|
||||
_CPU_ISR_Disable( level );
|
||||
_ISR_Disable( level );
|
||||
|
||||
_Thread_Dispatch_disable_level++;
|
||||
|
||||
@@ -275,13 +275,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--;
|
||||
|
||||
@@ -294,7 +294,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;
|
||||
|
||||
@@ -74,7 +74,7 @@ void Timer_initialize( void )
|
||||
{
|
||||
uint8_t temp8;
|
||||
uint16_t temp16;
|
||||
uint32_t level;
|
||||
rtems_interrupt_level level;
|
||||
rtems_isr *ignored;
|
||||
|
||||
Timer_HZ = rtems_cpu_configuration_get_clicks_per_second() / CLOCK_SCALE ;
|
||||
@@ -85,7 +85,7 @@ void Timer_initialize( void )
|
||||
*/
|
||||
|
||||
Timer_interrupts /* .i */ = 0;
|
||||
_CPU_ISR_Disable( level);
|
||||
rtems_interrupt_disable( level );
|
||||
|
||||
/*
|
||||
* Somehow start the timer
|
||||
@@ -125,7 +125,7 @@ void Timer_initialize( void )
|
||||
|
||||
/* initialize ISR */
|
||||
_CPU_ISR_install_raw_handler( ITU1_VECTOR, timerisr, &ignored );
|
||||
_CPU_ISR_Enable( level);
|
||||
rtems_interrupt_enable( level );
|
||||
|
||||
/* start timer 1 */
|
||||
temp8 = read8(ITU_TSTR) | ~ITU1_STARTMASK;
|
||||
|
||||
@@ -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);
|
||||
|
||||
_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;
|
||||
|
||||
@@ -65,7 +65,7 @@ void Timer_initialize( void )
|
||||
{
|
||||
uint8_t temp8;
|
||||
uint16_t temp16;
|
||||
uint32_t level;
|
||||
rtems_interrupt_level level;
|
||||
rtems_isr *ignored;
|
||||
|
||||
Timer_MHZ = rtems_cpu_configuration_get_clicks_per_second() / 1000000 ;
|
||||
@@ -76,7 +76,7 @@ void Timer_initialize( void )
|
||||
*/
|
||||
|
||||
Timer_interrupts /* .i */ = 0;
|
||||
_CPU_ISR_Disable( level);
|
||||
rtems_interrupt_disable( level );
|
||||
|
||||
/*
|
||||
* Somehow start the timer
|
||||
@@ -121,7 +121,7 @@ void Timer_initialize( void )
|
||||
|
||||
/* initialize ISR */
|
||||
_CPU_ISR_install_raw_handler( MTU1_VECTOR, timerisr, &ignored );
|
||||
_CPU_ISR_Enable( level);
|
||||
rtems_interrupt_enable( level );
|
||||
|
||||
/* start timer 1 */
|
||||
temp8 = read8(MTU_TSTR) | ~MTU1_STARTMASK;
|
||||
|
||||
@@ -256,9 +256,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++;
|
||||
|
||||
@@ -274,13 +274,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--;
|
||||
|
||||
@@ -293,7 +293,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;
|
||||
|
||||
@@ -73,7 +73,7 @@ Timer_initialize(void)
|
||||
int tidiv = 1;
|
||||
|
||||
Timer_interrupts = 0;
|
||||
_CPU_ISR_Disable(level);
|
||||
rtems_interrupt_disable(level);
|
||||
|
||||
/* Get CPU frequency divider from clock unit */
|
||||
switch (read16(SH7750_FRQCR) & SH7750_FRQCR_IFC)
|
||||
@@ -167,7 +167,7 @@ Timer_initialize(void)
|
||||
write16(temp16, SH7750_IPRA);
|
||||
|
||||
|
||||
_CPU_ISR_Enable(level);
|
||||
rtems_interrupt_enable(level);
|
||||
|
||||
/* Start the Timer 1 */
|
||||
temp8 = read8(SH7750_TSTR);
|
||||
@@ -210,13 +210,13 @@ Read_timer(void)
|
||||
uint32_t tcr;
|
||||
|
||||
|
||||
_CPU_ISR_Disable(level);
|
||||
rtems_interrupt_disable(level);
|
||||
|
||||
clicks = 0xFFFFFFFF - read32(SH7750_TCNT1);
|
||||
tcr = read32(SH7750_TCR1);
|
||||
ints = Timer_interrupts;
|
||||
|
||||
_CPU_ISR_Enable(level);
|
||||
rtems_interrupt_enable(level);
|
||||
|
||||
/* Handle the case when timer overflowed but interrupt was not processed */
|
||||
if ((clicks > 0xFF000000) && ((tcr & SH7750_TCR_UNF) != 0))
|
||||
|
||||
Reference in New Issue
Block a user