forked from Imagelibrary/rtems
powerpc: Use wrtee for e6500 multilib
This reduces the code size.
This commit is contained in:
@@ -620,6 +620,14 @@ static inline uint32_t ppc_interrupt_get_disable_mask( void )
|
|||||||
static inline uint32_t ppc_interrupt_disable( void )
|
static inline uint32_t ppc_interrupt_disable( void )
|
||||||
{
|
{
|
||||||
uint32_t level;
|
uint32_t level;
|
||||||
|
|
||||||
|
#if defined(__PPC_CPU_E6500__)
|
||||||
|
__asm__ volatile (
|
||||||
|
"mfmsr %0;"
|
||||||
|
"wrteei 0"
|
||||||
|
: "=r" (level)
|
||||||
|
);
|
||||||
|
#else
|
||||||
uint32_t mask;
|
uint32_t mask;
|
||||||
|
|
||||||
__asm__ volatile (
|
__asm__ volatile (
|
||||||
@@ -630,17 +638,26 @@ static inline uint32_t ppc_interrupt_disable( void )
|
|||||||
"mtmsr %1"
|
"mtmsr %1"
|
||||||
: "=r" (level), "=r" (mask)
|
: "=r" (level), "=r" (mask)
|
||||||
);
|
);
|
||||||
|
#endif
|
||||||
|
|
||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void ppc_interrupt_enable( uint32_t level )
|
static inline void ppc_interrupt_enable( uint32_t level )
|
||||||
{
|
{
|
||||||
|
#if defined(__PPC_CPU_E6500__)
|
||||||
|
__asm__ volatile (
|
||||||
|
"wrtee %0"
|
||||||
|
:
|
||||||
|
: "r" (level)
|
||||||
|
);
|
||||||
|
#else
|
||||||
__asm__ volatile (
|
__asm__ volatile (
|
||||||
"mtmsr %0"
|
"mtmsr %0"
|
||||||
:
|
:
|
||||||
: "r" (level)
|
: "r" (level)
|
||||||
);
|
);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void ppc_interrupt_flash( uint32_t level )
|
static inline void ppc_interrupt_flash( uint32_t level )
|
||||||
|
|||||||
Reference in New Issue
Block a user