diff options
Diffstat (limited to 'cpukit/score/cpu/arm/rtems/score/cpu.h')
-rw-r--r-- | cpukit/score/cpu/arm/rtems/score/cpu.h | 135 |
1 files changed, 34 insertions, 101 deletions
diff --git a/cpukit/score/cpu/arm/rtems/score/cpu.h b/cpukit/score/cpu/arm/rtems/score/cpu.h index c1ffb0765d..bbcded682c 100644 --- a/cpukit/score/cpu/arm/rtems/score/cpu.h +++ b/cpukit/score/cpu/arm/rtems/score/cpu.h @@ -1,9 +1,7 @@ /** * @file * - * @ingroup ScoreCPU - * - * @brief ARM architecture support API. + * @brief ARM Architecture Support API */ /* @@ -42,9 +40,8 @@ * @ingroup ScoreCPU * * @brief ARM specific support. - * - * @{ */ +/**@{**/ #ifdef __thumb__ #define ARM_SWITCH_REGISTERS uint32_t arm_switch_reg @@ -62,9 +59,8 @@ /** * @name Program Status Register - * - * @{ */ +/**@{**/ #define ARM_PSR_N (1 << 31) #define ARM_PSR_Z (1 << 30) @@ -97,9 +93,8 @@ /** * @addtogroup ScoreCPU - * - * @{ */ +/**@{**/ /* If someone uses THUMB we assume she wants minimal code size */ #ifdef __thumb__ @@ -227,9 +222,8 @@ extern "C" { /** * @addtogroup ScoreCPU - * - * @{ */ +/**@{**/ typedef struct { #if defined(ARM_MULTILIB_ARCH_V4) @@ -399,8 +393,7 @@ void _CPU_Context_Initialize( } while (0); /** - * @brief CPU Initialize - * + * @brief CPU initialization. */ void _CPU_Initialize( void ); @@ -411,8 +404,7 @@ void _CPU_ISR_install_vector( ); /** - * @brief CPU Context Switch - * + * @brief CPU switch context. */ void _CPU_Context_switch( Context_Control *run, Context_Control *heir ); @@ -482,35 +474,12 @@ static inline uint16_t CPU_swap_u16( uint16_t value ) /** @} */ -#if defined(ARM_MULTILIB_ARCH_V4) - /** * @addtogroup ScoreCPUARM - * - * @{ */ +/**@{**/ -typedef struct { - uint32_t r0; - uint32_t r1; - uint32_t r2; - uint32_t r3; - uint32_t r4; - uint32_t r5; - uint32_t r6; - uint32_t r7; - uint32_t r8; - uint32_t r9; - uint32_t r10; - uint32_t r11; - uint32_t r12; - uint32_t sp; - uint32_t lr; - uint32_t pc; - uint32_t cpsr; -} arm_cpu_context; - -typedef void arm_exc_abort_handler( arm_cpu_context *context ); +#if defined(ARM_MULTILIB_ARCH_V4) typedef enum { ARM_EXCEPTION_RESET = 0, @@ -521,81 +490,45 @@ typedef enum { ARM_EXCEPTION_RESERVED = 5, ARM_EXCEPTION_IRQ = 6, ARM_EXCEPTION_FIQ = 7, - MAX_EXCEPTIONS = 8 + MAX_EXCEPTIONS = 8, + 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(); -} - -void arm_exc_data_abort_set_handler( arm_exc_abort_handler handler ); - -void arm_exc_data_abort( void ); - -void arm_exc_prefetch_abort_set_handler( arm_exc_abort_handler handler ); - -void arm_exc_prefetch_abort( void ); - -void bsp_interrupt_dispatch( void ); - -void arm_exc_interrupt( void ); - -void arm_exc_undefined( void ); - -/** @} */ +#endif /* defined(ARM_MULTILIB_ARCH_V4) */ -/* XXX This is out of date */ typedef struct { uint32_t register_r0; uint32_t register_r1; uint32_t register_r2; uint32_t register_r3; - uint32_t register_ip; - uint32_t register_lr; + uint32_t register_r4; + uint32_t register_r5; + uint32_t register_r6; + uint32_t register_r7; + uint32_t register_r8; + uint32_t register_r9; + uint32_t register_r10; + uint32_t register_r11; + uint32_t register_r12; + uint32_t register_sp; + void *register_lr; + void *register_pc; +#if defined(ARM_MULTILIB_ARCH_V4) + uint32_t register_cpsr; + Arm_symbolic_exception_name vector; +#elif defined(ARM_MULTILIB_ARCH_V7M) + uint32_t register_xpsr; + uint32_t vector; +#endif } CPU_Exception_frame; typedef CPU_Exception_frame CPU_Interrupt_frame; -#else /* !defined(ARM_MULTILIB_ARCH_V4) */ - -typedef void CPU_Interrupt_frame; - -/* FIXME */ -typedef CPU_Interrupt_frame CPU_Exception_frame; +void _CPU_Exception_frame_print( const CPU_Exception_frame *frame ); -#endif /* !defined(ARM_MULTILIB_ARCH_V4) */ +void _ARM_Exception_default( CPU_Exception_frame *frame ); -void _CPU_Exception_frame_print( const CPU_Exception_frame *frame ); +/** @} */ #ifdef __cplusplus } |