]>
git.proxmox.com Git - mirror_edk2.git/blob - UefiCpuPkg/Library/BaseRiscV64CpuExceptionHandlerLib/CpuExceptionHandlerLib.h
3 RISC-V Exception Handler library definition file.
5 Copyright (c) 2019-2022, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #ifndef RISCV_CPU_EXECPTION_HANDLER_LIB_H_
12 #define RISCV_CPU_EXECPTION_HANDLER_LIB_H_
14 #include <Register/RiscV64/RiscVImpl.h>
17 Trap Handler for S-mode
26 // Index of SMode trap register
28 #define SMODE_TRAP_REGS_zero 0
29 #define SMODE_TRAP_REGS_ra 1
30 #define SMODE_TRAP_REGS_sp 2
31 #define SMODE_TRAP_REGS_gp 3
32 #define SMODE_TRAP_REGS_tp 4
33 #define SMODE_TRAP_REGS_t0 5
34 #define SMODE_TRAP_REGS_t1 6
35 #define SMODE_TRAP_REGS_t2 7
36 #define SMODE_TRAP_REGS_s0 8
37 #define SMODE_TRAP_REGS_s1 9
38 #define SMODE_TRAP_REGS_a0 10
39 #define SMODE_TRAP_REGS_a1 11
40 #define SMODE_TRAP_REGS_a2 12
41 #define SMODE_TRAP_REGS_a3 13
42 #define SMODE_TRAP_REGS_a4 14
43 #define SMODE_TRAP_REGS_a5 15
44 #define SMODE_TRAP_REGS_a6 16
45 #define SMODE_TRAP_REGS_a7 17
46 #define SMODE_TRAP_REGS_s2 18
47 #define SMODE_TRAP_REGS_s3 19
48 #define SMODE_TRAP_REGS_s4 20
49 #define SMODE_TRAP_REGS_s5 21
50 #define SMODE_TRAP_REGS_s6 22
51 #define SMODE_TRAP_REGS_s7 23
52 #define SMODE_TRAP_REGS_s8 24
53 #define SMODE_TRAP_REGS_s9 25
54 #define SMODE_TRAP_REGS_s10 26
55 #define SMODE_TRAP_REGS_s11 27
56 #define SMODE_TRAP_REGS_t3 28
57 #define SMODE_TRAP_REGS_t4 29
58 #define SMODE_TRAP_REGS_t5 30
59 #define SMODE_TRAP_REGS_t6 31
60 #define SMODE_TRAP_REGS_sepc 32
61 #define SMODE_TRAP_REGS_sstatus 33
62 #define SMODE_TRAP_REGS_sie 34
63 #define SMODE_TRAP_REGS_last 35
65 #define SMODE_TRAP_REGS_OFFSET(x) ((SMODE_TRAP_REGS_##x) * __SIZEOF_POINTER__)
66 #define SMODE_TRAP_REGS_SIZE SMODE_TRAP_REGS_OFFSET(last)
71 // Below are follow the format of EFI_SYSTEM_CONTEXT
106 // Below are the additional information to
107 // EFI_SYSTEM_CONTEXT, private to supervisor mode trap
108 // and not public to EFI environment.
113 } SMODE_TRAP_REGISTERS
;