7 #define PASSIVE_LEVEL 0
10 #define DISPATCH_LEVEL 2
13 #define PROFILE_LEVEL 8
15 #define SYNCH_LEVEL (IPI_LEVEL - 1)
20 #define KIPCR 0xFFFFF000
21 #define USPCR 0x7FFF0000
22 #define PCR ((volatile KPCR * const)USPCR)
23 #define USERPCR ((volatile KPCR * const)KIPCR)
26 // Just read it from the PCR
28 #define KeGetCurrentProcessorNumber() ((ULONG)(PCR->Number))
33 typedef struct _KFLOATING_SAVE
36 } KFLOATING_SAVE
, *PKFLOATING_SAVE
;
39 // Processor Control Region
40 // On ARM, it's actually readable from user-mode, much like KUSER_SHARED_DATA
43 #define PKINTERRUPT_ROUTINE PVOID // Hack!
49 PKINTERRUPT_ROUTINE InterruptRoutine
[64];
51 ULONG FirstLevelDcacheSize
;
52 ULONG FirstLevelDcacheFillSize
;
53 ULONG FirstLevelIcacheSize
;
54 ULONG FirstLevelIcacheFillSize
;
55 ULONG SecondLevelDcacheSize
;
56 ULONG SecondLevelDcacheFillSize
;
57 ULONG SecondLevelIcacheSize
;
58 ULONG SecondLevelIcacheFillSize
;
63 ULONG IcacheAlignment
;
66 ULONG ProfileInterval
;
68 ULONG StallExecutionCount
;
69 ULONG StallScaleFactor
;
72 PVOID InstructionBusError
;
78 struct _KTHREAD
*CurrentThread
;
80 ULONG SystemReserved
[6];
81 ULONG DcacheAlignment
;
82 ULONG HalReserved
[64];
83 BOOLEAN FirstLevelActive
;
84 BOOLEAN DpcRoutineActive
;
86 BOOLEAN OnInterruptStack
;
87 PVOID SavedInitialStack
;
88 PVOID SavedStackLimit
;
89 PVOID SystemServiceDispatchStart
;
90 PVOID SystemServiceDispatchEnd
;
100 // Get the current TEB
103 struct _TEB
* NtCurrentTeb(VOID
)
105 return (struct _TEB
*)USERPCR
->Teb
;
109 // IRQL Support on ARM is similar to MIPS/ALPHA
117 KeRaiseIrqlToSynchLevel(
122 KeRaiseIrqlToDpcLevel(
126 #define KeLowerIrql(NewIrql) KeSwapIrql(NewIrql)
127 #define KeRaiseIrql(NewIrql, OldIrql) *(OldIrql) = KeSwapIrql(NewIrql)