Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/include/exception.h

    r7a0359b rd99c1d2  
    2828 */
    2929
    30 /** @addtogroup arm32
     30/** @addtogroup arm32   
    3131 * @{
    3232 */
     
    4040#include <typedefs.h>
    4141#include <arch/regutils.h>
    42 #include <trace.h>
    4342
    4443/** If defined, forces using of high exception vectors. */
     
    4645
    4746#ifdef HIGH_EXCEPTION_VECTORS
    48         #define EXC_BASE_ADDRESS  0xffff0000
     47        #define EXC_BASE_ADDRESS        0xffff0000
    4948#else
    50         #define EXC_BASE_ADDRESS  0x0
     49        #define EXC_BASE_ADDRESS        0x0
    5150#endif
    5251
    5352/* Exception Vectors */
    54 #define EXC_RESET_VEC           (EXC_BASE_ADDRESS + 0x0)
    55 #define EXC_UNDEF_INSTR_VEC     (EXC_BASE_ADDRESS + 0x4)
    56 #define EXC_SWI_VEC             (EXC_BASE_ADDRESS + 0x8)
    57 #define EXC_PREFETCH_ABORT_VEC  (EXC_BASE_ADDRESS + 0xc)
    58 #define EXC_DATA_ABORT_VEC      (EXC_BASE_ADDRESS + 0x10)
    59 #define EXC_IRQ_VEC             (EXC_BASE_ADDRESS + 0x18)
    60 #define EXC_FIQ_VEC             (EXC_BASE_ADDRESS + 0x1c)
     53#define EXC_RESET_VEC          (EXC_BASE_ADDRESS + 0x0)
     54#define EXC_UNDEF_INSTR_VEC    (EXC_BASE_ADDRESS + 0x4)
     55#define EXC_SWI_VEC            (EXC_BASE_ADDRESS + 0x8)
     56#define EXC_PREFETCH_ABORT_VEC (EXC_BASE_ADDRESS + 0xc)
     57#define EXC_DATA_ABORT_VEC     (EXC_BASE_ADDRESS + 0x10)
     58#define EXC_IRQ_VEC            (EXC_BASE_ADDRESS + 0x18)
     59#define EXC_FIQ_VEC            (EXC_BASE_ADDRESS + 0x1c)
    6160
    6261/* Exception numbers */
     
    6968#define EXC_FIQ             6
    7069
     70
    7171/** Kernel stack pointer.
    7272 *
    7373 * It is set when thread switches to user mode,
    7474 * and then used for exception handling.
    75  *
    7675 */
    7776extern uintptr_t supervisor_sp;
     77
    7878
    7979/** Temporary exception stack pointer.
     
    8181 * Temporary stack is used in exceptions handling routines
    8282 * before switching to thread's kernel stack.
    83  *
    8483 */
    8584extern uintptr_t exc_stack;
     85
    8686
    8787/** Struct representing CPU state saved when an exception occurs. */
     
    9090        uint32_t sp;
    9191        uint32_t lr;
    92        
     92
    9393        uint32_t r0;
    9494        uint32_t r1;
     
    104104        uint32_t fp;
    105105        uint32_t r12;
    106        
     106
    107107        uint32_t pc;
    108108} istate_t;
    109109
    110 /** Set Program Counter member of given istate structure.
     110
     111/** Sets Program Counter member of given istate structure.
    111112 *
    112  * @param istate  istate structure
     113 * @param istate istate structure
    113114 * @param retaddr new value of istate's PC member
    114  *
    115115 */
    116 NO_TRACE static inline void istate_set_retaddr(istate_t *istate,
    117     uintptr_t retaddr)
     116static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr)
    118117{
    119         istate->pc = retaddr;
     118        istate->pc = retaddr;
    120119}
    121120
    122 /** Return true if exception happened while in userspace. */
    123 NO_TRACE static inline int istate_from_uspace(istate_t *istate)
     121
     122/** Returns true if exception happened while in userspace. */
     123static inline int istate_from_uspace(istate_t *istate)
    124124{
    125         return (istate->spsr & STATUS_REG_MODE_MASK) == USER_MODE;
     125        return (istate->spsr & STATUS_REG_MODE_MASK) == USER_MODE;
    126126}
    127127
    128 /** Return Program Counter member of given istate structure. */
    129 NO_TRACE static inline unative_t istate_get_pc(istate_t *istate)
     128
     129/** Returns Program Counter member of given istate structure. */
     130static inline unative_t istate_get_pc(istate_t *istate)
    130131{
    131         return istate->pc;
     132        return istate->pc;
    132133}
    133134
    134 NO_TRACE static inline unative_t istate_get_fp(istate_t *istate)
     135static inline unative_t istate_get_fp(istate_t *istate)
    135136{
    136137        return istate->fp;
    137138}
    138139
     140
    139141extern void install_exception_handlers(void);
    140142extern void exception_init(void);
     143extern void print_istate(istate_t *istate);
    141144extern void reset_exception_entry(void);
    142145extern void irq_exception_entry(void);
     
    147150extern void swi_exception_entry(void);
    148151
     152
    149153#endif
    150154
Note: See TracChangeset for help on using the changeset viewer.