03cf352f7ea431d9cd92849c3ebfeb5d080e7b60
[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_KERNEL_MESSAGE_T 0x18
6
7 #ifndef __ASSEMBLER__
8
9 #include <ros/common.h>
10 #include <ros/arch/trapframe.h>
11 #include <arch/sparc.h>
12
13 /* the struct trapframe and friends are in ros/arch/trapframe.h */
14
15 void data_access_exception(trapframe_t* state);
16 void real_fp_exception(trapframe_t* state, ancillary_state_t* astate);
17 void address_unaligned(trapframe_t* state);
18 void illegal_instruction(trapframe_t* state);
19
20 void save_fp_state(ancillary_state_t* silly);
21 void restore_fp_state(ancillary_state_t* silly);
22 void emulate_fpu(trapframe_t* state, ancillary_state_t* astate);
23
24 static inline bool in_kernel(struct trapframe *tf)
25 {
26         return tf->psr & PSR_PS;
27 }
28
29 #endif /* !__ASSEMBLER__ */
30
31 #endif /* !ROS_INC_ARCH_TRAP_H */