forked from Imagelibrary/rtems
i386: prepare for paravirtualized interrupts
This commit is contained in:
@@ -11,10 +11,9 @@
|
|||||||
|
|
||||||
void _CPU_Fatal_halt(uint32_t source, uint32_t error)
|
void _CPU_Fatal_halt(uint32_t source, uint32_t error)
|
||||||
{
|
{
|
||||||
uint32_t _error_lvalue = ( _error );
|
|
||||||
__asm__ volatile (
|
__asm__ volatile (
|
||||||
"cli ; movl %0,%%eax ; hlt"
|
"cli ; movl %0,%%eax ; hlt"
|
||||||
: "=r" ((_error_lvalue))
|
: "=r" ((error))
|
||||||
: "0" ((_error_lvalue))
|
: "0" ((error))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,7 +115,11 @@ uint32_t _CPU_ISR_Get_level( void )
|
|||||||
{
|
{
|
||||||
uint32_t level;
|
uint32_t level;
|
||||||
|
|
||||||
|
#if !defined(RTEMS_PARAVIRT)
|
||||||
i386_get_interrupt_level( level );
|
i386_get_interrupt_level( level );
|
||||||
|
#else
|
||||||
|
level = i386_get_interrupt_level();
|
||||||
|
#endif
|
||||||
|
|
||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -395,6 +395,7 @@ extern Context_Control_fp _CPU_Null_fp_context;
|
|||||||
* + set a particular level
|
* + set a particular level
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if !defined(RTEMS_PARAVIRT)
|
||||||
#define _CPU_ISR_Disable( _level ) i386_disable_interrupts( _level )
|
#define _CPU_ISR_Disable( _level ) i386_disable_interrupts( _level )
|
||||||
|
|
||||||
#define _CPU_ISR_Enable( _level ) i386_enable_interrupts( _level )
|
#define _CPU_ISR_Enable( _level ) i386_enable_interrupts( _level )
|
||||||
@@ -406,6 +407,12 @@ extern Context_Control_fp _CPU_Null_fp_context;
|
|||||||
if ( _new_level ) __asm__ volatile ( "cli" ); \
|
if ( _new_level ) __asm__ volatile ( "cli" ); \
|
||||||
else __asm__ volatile ( "sti" ); \
|
else __asm__ volatile ( "sti" ); \
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#define _CPU_ISR_Disable( _level ) _level = i386_disable_interrupts( )
|
||||||
|
#define _CPU_ISR_Enable( _level ) i386_enable_interrupts( _level )
|
||||||
|
#define _CPU_ISR_Flash( _level ) i386_flash_interrupts( _level )
|
||||||
|
#define _CPU_ISR_Set_level( _new_level ) i386_set_interrupt_level( _new_level)
|
||||||
|
#endif
|
||||||
|
|
||||||
uint32_t _CPU_ISR_Get_level( void );
|
uint32_t _CPU_ISR_Get_level( void );
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ typedef int (*rtems_raw_irq_is_enabled) (const struct __rtems_raw_irq_connect_d
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
/**@{**/
|
/**@{**/
|
||||||
|
#if !defined(RTEMS_PARAVIRT)
|
||||||
#define i386_disable_interrupts( _level ) \
|
#define i386_disable_interrupts( _level ) \
|
||||||
{ \
|
{ \
|
||||||
__asm__ volatile ( "pushf ; \
|
__asm__ volatile ( "pushf ; \
|
||||||
@@ -71,6 +71,13 @@ typedef int (*rtems_raw_irq_is_enabled) (const struct __rtems_raw_irq_connect_d
|
|||||||
\
|
\
|
||||||
_level = (_eflags & EFLAGS_INTR_ENABLE) ? 0 : 1; \
|
_level = (_eflags & EFLAGS_INTR_ENABLE) ? 0 : 1; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
#else
|
||||||
|
uint32_t i386_disable_interrupts( void );
|
||||||
|
void i386_enable_interrupts(uint32_t level);
|
||||||
|
void i386_flash_interrupts(uint32_t level);
|
||||||
|
void i386_set_interrupt_level(uint32_t new_level);
|
||||||
|
uint32_t i386_get_interrupt_level( void );
|
||||||
|
#endif /* PARAVIRT */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user