Ignore:
File:
1 edited

Legend:

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

    r598f90e rd32358f  
    3636#define KERN_abs32le_INTERRUPT_H_
    3737
    38 #include <typedefs.h>
    39 #include <arch/istate.h>
     38#include <arch/types.h>
    4039
    4140#define IVT_ITEMS  0
     
    4443#define VECTOR_TLB_SHOOTDOWN_IPI  0
    4544
     45/*
     46 * On real hardware this stores the registers which
     47 * need to be preserved during interupts.
     48 */
     49typedef struct istate {
     50        uintptr_t ip;
     51        uintptr_t fp;
     52        uint32_t stack[];
     53} istate_t;
     54
     55static 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
     63static 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
     70static 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
     77static 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
    4684#endif
    4785
Note: See TracChangeset for help on using the changeset viewer.