summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-01-04 16:22:18 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-01-07 15:07:41 +0100
commit8df0e91ab0f9a890b0ba9c3c2428c91cde09a0e8 (patch)
tree02f456157017ea8a06a1c3930a84907aa9bbb84d
parent13cf9520f4fd223337d5b450cad2b7cfe0361779 (diff)
downloadrtems-8df0e91ab0f9a890b0ba9c3c2428c91cde09a0e8.tar.bz2
arm: Move inline functions
-rw-r--r--c/src/lib/libbsp/arm/lpc24xx/irq/irq-dispatch.c2
-rw-r--r--cpukit/score/cpu/arm/rtems/score/armv4.h34
-rw-r--r--cpukit/score/cpu/arm/rtems/score/cpu.h34
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 2f8a23c576..8eeb677680 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 8c000f1150..98ac84666e 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 d04a09eaf0..ed1ce3ba90 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 {