[rtems commit] powerpc: Use wrtee for e6500 multilib
Sebastian Huber
sebh at rtems.org
Fri Oct 2 06:06:32 UTC 2015
Module: rtems
Branch: master
Commit: 08317ef3ff739b5abce2cbc0fc8bc2d9eb310b99
Changeset: http://git.rtems.org/rtems/commit/?id=08317ef3ff739b5abce2cbc0fc8bc2d9eb310b99
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Fri Oct 2 07:30:13 2015 +0200
powerpc: Use wrtee for e6500 multilib
This reduces the code size.
---
cpukit/score/cpu/powerpc/rtems/powerpc/registers.h | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/cpukit/score/cpu/powerpc/rtems/powerpc/registers.h b/cpukit/score/cpu/powerpc/rtems/powerpc/registers.h
index 5502120..c982e46 100644
--- a/cpukit/score/cpu/powerpc/rtems/powerpc/registers.h
+++ b/cpukit/score/cpu/powerpc/rtems/powerpc/registers.h
@@ -620,6 +620,14 @@ static inline uint32_t ppc_interrupt_get_disable_mask( void )
static inline uint32_t ppc_interrupt_disable( void )
{
uint32_t level;
+
+#if defined(__PPC_CPU_E6500__)
+ __asm__ volatile (
+ "mfmsr %0;"
+ "wrteei 0"
+ : "=r" (level)
+ );
+#else
uint32_t mask;
__asm__ volatile (
@@ -630,17 +638,26 @@ static inline uint32_t ppc_interrupt_disable( void )
"mtmsr %1"
: "=r" (level), "=r" (mask)
);
+#endif
return level;
}
static inline void ppc_interrupt_enable( uint32_t level )
{
+#if defined(__PPC_CPU_E6500__)
+ __asm__ volatile (
+ "wrtee %0"
+ :
+ : "r" (level)
+ );
+#else
__asm__ volatile (
"mtmsr %0"
:
: "r" (level)
);
+#endif
}
static inline void ppc_interrupt_flash( uint32_t level )
More information about the vc
mailing list