Support new risc-v calling convention
[akaros.git] / kern / arch / riscv / ros / trapframe.h
1 #ifndef ROS_INC_ARCH_TRAPFRAME_H
2 #define ROS_INC_ARCH_TRAPFRAME_H
3
4 #ifndef ROS_INC_TRAPFRAME_H
5 #error "Do not include include ros/arch/trapframe.h directly"
6 #endif
7
8 #include <ros/common.h>
9 #include <stdint.h>
10
11 struct hw_trapframe
12 {
13   uintptr_t gpr[32];
14   uintptr_t sr;
15   uintptr_t epc;
16   uintptr_t badvaddr;
17   long cause;
18 };
19
20 struct sw_trapframe {
21         /* TODO */
22 };
23
24 #define GPR_RA 1
25 #define GPR_SP 14
26 #define GPR_A0 18
27 #define GPR_A1 19
28
29 typedef struct ancillary_state
30 {
31         uint64_t fpr[32];
32         uint32_t fsr;
33 } ancillary_state_t;
34
35 #endif /* ROS_INC_ARCH_TRAPFRAME_H */