xref: /reactos/sdk/include/xdk/arm64/ke.h (revision 09dde2cf)
1 $if (_WDMDDK_)
2 /** Kernel definitions for ARM64 **/
3 
4 /* Interrupt request levels */
5 #define PASSIVE_LEVEL           0
6 #define LOW_LEVEL               0
7 #define APC_LEVEL               1
8 #define DISPATCH_LEVEL          2
9 #define CLOCK_LEVEL             13
10 #define IPI_LEVEL               14
11 #define DRS_LEVEL               14
12 #define POWER_LEVEL             14
13 #define PROFILE_LEVEL           15
14 #define HIGH_LEVEL              15
15 
16 #define SharedUserData          ((KUSER_SHARED_DATA * const)KI_USER_SHARED_DATA)
17 
18 #define PAGE_SIZE               0x1000
19 #define PAGE_SHIFT              12L
20 
21 #define PAUSE_PROCESSOR YieldProcessor();
22 
23 /* FIXME: Based on AMD64 but needed to compile apps */
24 #define KERNEL_STACK_SIZE                   12288
25 #define KERNEL_LARGE_STACK_SIZE             61440
26 #define KERNEL_LARGE_STACK_COMMIT KERNEL_STACK_SIZE
27 /* FIXME End */
28 
29 #define EXCEPTION_READ_FAULT    0
30 #define EXCEPTION_WRITE_FAULT   1
31 #define EXCEPTION_EXECUTE_FAULT 8
32 
33 NTSYSAPI
34 PKTHREAD
35 NTAPI
36 KeGetCurrentThread(VOID);
37 
38 #define DbgRaiseAssertionFailure() __break(0xf001)
39 
40 $endif (_WDMDDK_)
41 $if (_NTDDK_)
42 
43 #define ARM64_MAX_BREAKPOINTS 8
44 #define ARM64_MAX_WATCHPOINTS 2
45 
46 typedef union NEON128 {
47     struct {
48         ULONGLONG Low;
49         LONGLONG High;
50     } DUMMYSTRUCTNAME;
51     double D[2];
52     float  S[4];
53     USHORT H[8];
54     UCHAR  B[16];
55 } NEON128, *PNEON128;
56 typedef NEON128 NEON128, *PNEON128;
57 
58 typedef struct _CONTEXT {
59 
60     //
61     // Control flags.
62     //
63 
64     ULONG ContextFlags;
65 
66     //
67     // Integer registers
68     //
69 
70     ULONG Cpsr;
71     union {
72         struct {
73             ULONG64 X0;
74             ULONG64 X1;
75             ULONG64 X2;
76             ULONG64 X3;
77             ULONG64 X4;
78             ULONG64 X5;
79             ULONG64 X6;
80             ULONG64 X7;
81             ULONG64 X8;
82             ULONG64 X9;
83             ULONG64 X10;
84             ULONG64 X11;
85             ULONG64 X12;
86             ULONG64 X13;
87             ULONG64 X14;
88             ULONG64 X15;
89             ULONG64 X16;
90             ULONG64 X17;
91             ULONG64 X18;
92             ULONG64 X19;
93             ULONG64 X20;
94             ULONG64 X21;
95             ULONG64 X22;
96             ULONG64 X23;
97             ULONG64 X24;
98             ULONG64 X25;
99             ULONG64 X26;
100             ULONG64 X27;
101             ULONG64 X28;
102     		ULONG64 Fp;
103             ULONG64 Lr;
104         } DUMMYSTRUCTNAME;
105         ULONG64 X[31];
106     } DUMMYUNIONNAME;
107 
108     ULONG64 Sp;
109     ULONG64 Pc;
110 
111     //
112     // Floating Point/NEON Registers
113     //
114 
115     NEON128 V[32];
116     ULONG Fpcr;
117     ULONG Fpsr;
118 
119     //
120     // Debug registers
121     //
122 
123     ULONG Bcr[ARM64_MAX_BREAKPOINTS];
124     ULONG64 Bvr[ARM64_MAX_BREAKPOINTS];
125     ULONG Wcr[ARM64_MAX_WATCHPOINTS];
126     ULONG64 Wvr[ARM64_MAX_WATCHPOINTS];
127 
128 } CONTEXT, *PCONTEXT;
129 $endif
130