Subversion Repositories HelenOS

Rev

Rev 2071 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2071 Rev 2089
Line 34... Line 34...
34
 
34
 
35
#ifndef KERN_mips32_EXCEPTION_H_
35
#ifndef KERN_mips32_EXCEPTION_H_
36
#define KERN_mips32_EXCEPTION_H_
36
#define KERN_mips32_EXCEPTION_H_
37
 
37
 
38
#include <arch/types.h>
38
#include <arch/types.h>
39
#include <typedefs.h>
-
 
40
#include <arch/cp0.h>
39
#include <arch/cp0.h>
41
 
40
 
42
#define EXC_Int     0
41
#define EXC_Int     0
43
#define EXC_Mod     1
42
#define EXC_Mod     1
44
#define EXC_TLBL    2
43
#define EXC_TLBL    2
Line 56... Line 55...
56
#define EXC_VCEI    14
55
#define EXC_VCEI    14
57
#define EXC_FPE     15
56
#define EXC_FPE     15
58
#define EXC_WATCH   23
57
#define EXC_WATCH   23
59
#define EXC_VCED    31
58
#define EXC_VCED    31
60
 
59
 
61
struct istate {
60
typedef struct {
62
    uint32_t at;
61
    uint32_t at;
63
    uint32_t v0;
62
    uint32_t v0;
64
    uint32_t v1;
63
    uint32_t v1;
65
    uint32_t a0;
64
    uint32_t a0;
66
    uint32_t a1;
65
    uint32_t a1;
Line 93... Line 92...
93
    uint32_t hi;
92
    uint32_t hi;
94
 
93
 
95
    uint32_t status; /* cp0_status */
94
    uint32_t status; /* cp0_status */
96
    uint32_t epc; /* cp0_epc */
95
    uint32_t epc; /* cp0_epc */
97
    uint32_t k1; /* We use it as thread-local pointer */
96
    uint32_t k1; /* We use it as thread-local pointer */
98
};
97
} istate_t;
99
 
98
 
100
static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr)
99
static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr)
101
{
100
{
102
    istate->epc = retaddr;
101
    istate->epc = retaddr;
103
}
102
}