Merge remote branch 'origin/sparc-dev'
[akaros.git] / kern / arch / sparc / trap.h
1 #ifndef ROS_INC_ARCH_TRAP_H
2 #define ROS_INC_ARCH_TRAP_H
3
4 #define SIZEOF_TRAPFRAME_T      0xA8
5 #define SIZEOF_ACTIVE_MESSAGE_T 0x18
6
7 #ifndef __ASSEMBLER__
8
9 #include <ros/common.h>
10
11 typedef struct
12 {
13         uint32_t gpr[32] __attribute__((aligned (8)));
14         uint32_t psr;
15         uint32_t pc;
16         uint32_t npc;
17         uint32_t wim;
18         uint32_t tbr;
19         uint32_t y;
20         uint32_t fault_status;
21         uint32_t fault_addr;
22         uint64_t timestamp;
23 } trapframe_t;
24
25 typedef struct
26 {
27         uint32_t fpr[32] __attribute__((aligned (8)));
28         uint32_t fsr;
29 } ancillary_state_t;
30
31 void access_exception(trapframe_t* state);
32 void real_fp_exception(trapframe_t* state, ancillary_state_t* astate);
33 void address_unaligned(trapframe_t* state);
34 void illegal_instruction(trapframe_t* state);
35
36 void save_fp_state(ancillary_state_t* silly);
37 void restore_fp_state(ancillary_state_t* silly);
38 void emulate_fpu(trapframe_t* state, ancillary_state_t* astate);
39
40 #endif /* !__ASSEMBLER__ */
41
42 #endif /* !ROS_INC_ARCH_TRAP_H */