Ignore:
File:
1 edited

Legend:

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

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