Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified kernel/arch/abs32le/include/interrupt.h

    rd32358f r598f90e  
    3636#define KERN_abs32le_INTERRUPT_H_
    3737
    38 #include <arch/types.h>
     38#include <typedefs.h>
     39#include <arch/istate.h>
    3940
    4041#define IVT_ITEMS  0
     
    4344#define VECTOR_TLB_SHOOTDOWN_IPI  0
    4445
    45 /*
    46  * On real hardware this stores the registers which
    47  * need to be preserved during interupts.
    48  */
    49 typedef struct istate {
    50         uintptr_t ip;
    51         uintptr_t fp;
    52         uint32_t stack[];
    53 } istate_t;
    54 
    55 static inline int istate_from_uspace(istate_t *istate)
    56 {
    57         /* On real hardware this checks whether the interrupted
    58            context originated from user space. */
    59        
    60         return !(istate->ip & 0x80000000);
    61 }
    62 
    63 static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr)
    64 {
    65         /* On real hardware this sets the instruction pointer. */
    66        
    67         istate->ip = retaddr;
    68 }
    69 
    70 static inline unative_t istate_get_pc(istate_t *istate)
    71 {
    72         /* On real hardware this returns the instruction pointer. */
    73        
    74         return istate->ip;
    75 }
    76 
    77 static inline unative_t istate_get_fp(istate_t *istate)
    78 {
    79         /* On real hardware this returns the frame pointer. */
    80        
    81         return istate->fp;
    82 }
    83 
    8446#endif
    8547
Note: See TracChangeset for help on using the changeset viewer.