microblaze: Decouple exceptions from interrupts

Exception handling should be enabled at all times during execution to
ensure that exceptions are not ignored which would cause further
problems. This separates use of the exception enable bit from use of the
interrupt enable bit in the machine status register so that they can be
manipulated independently.
This commit is contained in:
Kinsey Moore
2022-02-18 10:05:25 -06:00
committed by Joel Sherrill
parent ea1a4fd29b
commit dbdf38ea7b
3 changed files with 11 additions and 8 deletions

View File

@@ -81,6 +81,9 @@ _crtinit:
#ifndef __rtems__
brlid r15, main /* Execute the program */
#else
mfs r3, rmsr
ori r3, r3, 0x100 /* Set Exception Enable MSR flag */
mts rmsr, r3
brlid r15, boot_card
#endif /* __rtems__ */
addi r5, r0, 0

View File

@@ -142,9 +142,9 @@ void _CPU_ISR_Set_level( uint32_t level )
_CPU_MSR_GET( microblaze_switch_reg );
if ( level == 0 ) {
microblaze_switch_reg |= (MICROBLAZE_MSR_IE | MICROBLAZE_MSR_EE);
microblaze_switch_reg |= MICROBLAZE_MSR_IE;
} else {
microblaze_switch_reg &= ~(MICROBLAZE_MSR_IE | MICROBLAZE_MSR_EE);
microblaze_switch_reg &= ~(MICROBLAZE_MSR_IE);
}
_CPU_MSR_SET( microblaze_switch_reg );
@@ -158,7 +158,7 @@ uint32_t _CPU_ISR_Get_level( void )
/* This is unique. The MSR register contains an interrupt enable flag where
* most other architectures have an interrupt disable flag. */
return ( level & (MICROBLAZE_MSR_IE | MICROBLAZE_MSR_EE) ) == 0;
return ( level & MICROBLAZE_MSR_IE ) == 0;
}
void _CPU_ISR_install_vector(

View File

@@ -212,7 +212,7 @@ typedef struct {
{ \
unsigned int _new_msr; \
_CPU_MSR_GET(_isr_cookie); \
_new_msr = (_isr_cookie) & ~(MICROBLAZE_MSR_IE | MICROBLAZE_MSR_EE); \
_new_msr = (_isr_cookie) & ~(MICROBLAZE_MSR_IE); \
_CPU_MSR_SET(_new_msr); \
}
@@ -221,9 +221,9 @@ typedef struct {
uint32_t _microblaze_interrupt_enable; \
uint32_t _microblaze_switch_reg; \
\
_microblaze_interrupt_enable = (_isr_cookie) & (MICROBLAZE_MSR_IE | MICROBLAZE_MSR_EE); \
_microblaze_interrupt_enable = (_isr_cookie) & (MICROBLAZE_MSR_IE); \
_CPU_MSR_GET(_microblaze_switch_reg); \
_microblaze_switch_reg &= ~(MICROBLAZE_MSR_IE | MICROBLAZE_MSR_EE); \
_microblaze_switch_reg &= ~(MICROBLAZE_MSR_IE); \
_microblaze_switch_reg |= _microblaze_interrupt_enable; \
_CPU_MSR_SET(_microblaze_switch_reg); \
}
@@ -232,7 +232,7 @@ typedef struct {
{ \
unsigned int _new_msr; \
_CPU_MSR_SET(_isr_cookie); \
_new_msr = (_isr_cookie) & ~(MICROBLAZE_MSR_IE | MICROBLAZE_MSR_EE); \
_new_msr = (_isr_cookie) & ~(MICROBLAZE_MSR_IE); \
_CPU_MSR_SET(_new_msr); \
}
@@ -242,7 +242,7 @@ uint32_t _CPU_ISR_Get_level( void );
RTEMS_INLINE_ROUTINE bool _CPU_ISR_Is_enabled( uint32_t level )
{
return ( level & (MICROBLAZE_MSR_IE | MICROBLAZE_MSR_EE) ) != 0;
return ( level & MICROBLAZE_MSR_IE ) != 0;
}
void _CPU_Context_Initialize(