Kernel messages infrastructure
[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      0xB0
5 #define SIZEOF_KERNEL_MESSAGE_T 0x18
6
7 #ifndef __ASSEMBLER__
8
9 #include <ros/common.h>
10 #include <ros/arch/trapframe.h>
11
12 /* the struct trapframe and friends are in ros/arch/trapframe.h */
13
14 void data_access_exception(trapframe_t* state);
15 void real_fp_exception(trapframe_t* state, ancillary_state_t* astate);
16 void address_unaligned(trapframe_t* state);
17 void illegal_instruction(trapframe_t* state);
18
19 void save_fp_state(ancillary_state_t* silly);
20 void restore_fp_state(ancillary_state_t* silly);
21 void emulate_fpu(trapframe_t* state, ancillary_state_t* astate);
22
23 static inline void set_errno(trapframe_t* tf, uint32_t errno)
24 {
25         tf->gpr[9] = errno;
26 }
27
28 /* TODO: Need to determine if the TF was in the kernel. */
29 static inline bool in_kernel(struct trapframe *tf)
30 {
31         static_assert(0);
32         return LIES;
33 }
34
35 #endif /* !__ASSEMBLER__ */
36
37 #endif /* !ROS_INC_ARCH_TRAP_H */