8 #define PAGE_SIZE 0x1000
15 #define PASSIVE_LEVEL 0
18 #define DISPATCH_LEVEL 2
19 #define SYNCH_LEVEL DISPATCH_LEVEL
20 #define PROFILE_LEVEL 27
21 #define CLOCK1_LEVEL 28
22 #define CLOCK2_LEVEL 28
24 #define POWER_LEVEL 30
31 #define KIP0PCRADDRESS 0xFFDFF000
32 #define KI_USER_SHARED_DATA 0xFFDF0000
33 #define USPCR 0x7FFF0000
34 #define PCR ((KPCR * const)KIP0PCRADDRESS)
35 #define USERPCR ((volatile KPCR * const)USPCR)
36 #define KeGetPcr() PCR
38 #define SharedUserData ((KUSER_SHARED_DATA * const)KI_USER_SHARED_DATA)
41 // Address space layout
43 extern PVOID MmHighestUserAddress
;
44 extern PVOID MmSystemRangeStart
;
45 extern ULONG_PTR MmUserProbeAddress
;
46 #define MM_HIGHEST_USER_ADDRESS MmHighestUserAddress
47 #define MM_SYSTEM_RANGE_START MmSystemRangeStart
48 #define MM_USER_PROBE_ADDRESS MmUserProbeAddress
49 #define MM_LOWEST_USER_ADDRESS (PVOID)0x10000
50 #define MM_LOWEST_SYSTEM_ADDRESS (PVOID)0xC0800000
55 #define MAXIMUM_VECTOR 16
59 // Used to contain PFNs and PFN counts
61 typedef ULONG PFN_COUNT
;
62 typedef ULONG PFN_NUMBER
, *PPFN_NUMBER
;
63 typedef LONG SPFN_NUMBER
, *PSPFN_NUMBER
;
68 typedef struct _KFLOATING_SAVE
71 } KFLOATING_SAVE
, *PKFLOATING_SAVE
;
73 /* The following flags control the contents of the CONTEXT structure. */
74 #define CONTEXT_ARM 0x0000040
75 #define CONTEXT_CONTROL (CONTEXT_ARM | 0x00000001L)
76 #define CONTEXT_INTEGER (CONTEXT_ARM | 0x00000002L)
77 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER)
79 typedef struct _CONTEXT
{
80 /* The flags values within this flag control the contents of
83 If the context record is used as an input parameter, then
84 for each portion of the context record controlled by a flag
85 whose value is set, it is assumed that that portion of the
86 context record contains valid context. If the context record
87 is being used to modify a thread's context, then only that
88 portion of the threads context will be modified.
90 If the context record is used as an IN OUT parameter to capture
91 the context of a thread, then only those portions of the thread's
92 context corresponding to set flags will be returned.
94 The context record is never used as an OUT only parameter. */
98 /* This section is specified/returned if the ContextFlags word contains
99 the flag CONTEXT_INTEGER. */
122 // Processor Control Region
134 struct _EXCEPTION_REGISTRATION_RECORD
*Used_ExceptionList
; // Unused
135 PVOID Used_StackBase
; // Unused
136 PVOID PerfGlobalGroupMask
;
137 PVOID TssCopy
; // Unused
138 ULONG ContextSwitches
;
139 KAFFINITY SetMemberCopy
; // Unused
147 ULONG IrrActive
; // Unused
149 PVOID KdVersionBlock
;
156 ULONG StallScaleFactor
;
162 // Get the current TEB
165 struct _TEB
* NtCurrentTeb(VOID
)
167 return (struct _TEB
*)USERPCR
->Used_Self
;
172 // IRQL Support on ARM is similar to MIPS/ALPHA
185 KeRaiseIrqlToSynchLevel(
190 KeRaiseIrqlToDpcLevel(
194 #define KeLowerIrql(NewIrql) KfLowerIrql(NewIrql)
195 #define KeRaiseIrql(NewIrql, OldIrql) *(OldIrql) = KfRaiseIrql(NewIrql)
198 // Cache clean and flush
214 #define InterlockedDecrement _InterlockedDecrement
215 #define InterlockedIncrement _InterlockedIncrement
216 #define InterlockedExchange _InterlockedExchange