[rtems commit] arm: Move inline functions
Sebastian Huber
sebh at rtems.org
Mon Jan 7 14:05:04 UTC 2013
Module: rtems
Branch: master
Commit: 8df0e91ab0f9a890b0ba9c3c2428c91cde09a0e8
Changeset: http://git.rtems.org/rtems/commit/?id=8df0e91ab0f9a890b0ba9c3c2428c91cde09a0e8
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Fri Jan 4 16:22:18 2013 +0100
arm: Move inline functions
---
c/src/lib/libbsp/arm/lpc24xx/irq/irq-dispatch.c | 2 +
cpukit/score/cpu/arm/rtems/score/armv4.h | 34 +++++++++++++++++++++++
cpukit/score/cpu/arm/rtems/score/cpu.h | 34 -----------------------
3 files changed, 36 insertions(+), 34 deletions(-)
diff --git a/c/src/lib/libbsp/arm/lpc24xx/irq/irq-dispatch.c b/c/src/lib/libbsp/arm/lpc24xx/irq/irq-dispatch.c
index 2f8a23c..8eeb677 100644
--- a/c/src/lib/libbsp/arm/lpc24xx/irq/irq-dispatch.c
+++ b/c/src/lib/libbsp/arm/lpc24xx/irq/irq-dispatch.c
@@ -20,6 +20,8 @@
* http://www.rtems.com/license/LICENSE.
*/
+#include <rtems/score/armv4.h>
+
#include <bsp.h>
#include <bsp/irq.h>
#include <bsp/irq-generic.h>
diff --git a/cpukit/score/cpu/arm/rtems/score/armv4.h b/cpukit/score/cpu/arm/rtems/score/armv4.h
index 8c000f1..98ac846 100644
--- a/cpukit/score/cpu/arm/rtems/score/armv4.h
+++ b/cpukit/score/cpu/arm/rtems/score/armv4.h
@@ -55,6 +55,40 @@ void _ARMV4_Exception_irq_default( void );
void _ARMV4_Exception_fiq_default( void );
+static inline uint32_t arm_status_irq_enable( void )
+{
+ uint32_t arm_switch_reg;
+ uint32_t psr;
+
+ RTEMS_COMPILER_MEMORY_BARRIER();
+
+ __asm__ volatile (
+ ARM_SWITCH_TO_ARM
+ "mrs %[psr], cpsr\n"
+ "bic %[arm_switch_reg], %[psr], #0x80\n"
+ "msr cpsr, %[arm_switch_reg]\n"
+ ARM_SWITCH_BACK
+ : [arm_switch_reg] "=&r" (arm_switch_reg), [psr] "=&r" (psr)
+ );
+
+ return psr;
+}
+
+static inline void arm_status_restore( uint32_t psr )
+{
+ ARM_SWITCH_REGISTERS;
+
+ __asm__ volatile (
+ ARM_SWITCH_TO_ARM
+ "msr cpsr, %[psr]\n"
+ ARM_SWITCH_BACK
+ : ARM_SWITCH_OUTPUT
+ : [psr] "r" (psr)
+ );
+
+ RTEMS_COMPILER_MEMORY_BARRIER();
+}
+
#endif /* ARM_MULTILIB_ARCH_V4 */
#ifdef __cplusplus
diff --git a/cpukit/score/cpu/arm/rtems/score/cpu.h b/cpukit/score/cpu/arm/rtems/score/cpu.h
index d04a09e..ed1ce3b 100644
--- a/cpukit/score/cpu/arm/rtems/score/cpu.h
+++ b/cpukit/score/cpu/arm/rtems/score/cpu.h
@@ -503,40 +503,6 @@ typedef enum {
ARM_EXCEPTION_MAKE_ENUM_32_BIT = 0xffffffff
} Arm_symbolic_exception_name;
-static inline uint32_t arm_status_irq_enable( void )
-{
- uint32_t arm_switch_reg;
- uint32_t psr;
-
- RTEMS_COMPILER_MEMORY_BARRIER();
-
- __asm__ volatile (
- ARM_SWITCH_TO_ARM
- "mrs %[psr], cpsr\n"
- "bic %[arm_switch_reg], %[psr], #0x80\n"
- "msr cpsr, %[arm_switch_reg]\n"
- ARM_SWITCH_BACK
- : [arm_switch_reg] "=&r" (arm_switch_reg), [psr] "=&r" (psr)
- );
-
- return psr;
-}
-
-static inline void arm_status_restore( uint32_t psr )
-{
- ARM_SWITCH_REGISTERS;
-
- __asm__ volatile (
- ARM_SWITCH_TO_ARM
- "msr cpsr, %[psr]\n"
- ARM_SWITCH_BACK
- : ARM_SWITCH_OUTPUT
- : [psr] "r" (psr)
- );
-
- RTEMS_COMPILER_MEMORY_BARRIER();
-}
-
/** @} */
typedef struct {
More information about the vc
mailing list