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)
28 typedef struct _KFLOATING_SAVE
31 } KFLOATING_SAVE
, *PKFLOATING_SAVE
;
34 // Processor Control Region
35 // On ARM, it's actually readable from user-mode, much like KUSER_SHARED_DATA
38 #define PKINTERRUPT_ROUTINE PVOID // Hack!
44 PKINTERRUPT_ROUTINE InterruptRoutine
[64];
46 ULONG FirstLevelDcacheSize
;
47 ULONG FirstLevelDcacheFillSize
;
48 ULONG FirstLevelIcacheSize
;
49 ULONG FirstLevelIcacheFillSize
;
50 ULONG SecondLevelDcacheSize
;
51 ULONG SecondLevelDcacheFillSize
;
52 ULONG SecondLevelIcacheSize
;
53 ULONG SecondLevelIcacheFillSize
;
58 ULONG IcacheAlignment
;
61 ULONG ProfileInterval
;
63 ULONG StallExecutionCount
;
64 ULONG StallScaleFactor
;
67 PVOID InstructionBusError
;
73 struct _KTHREAD
*CurrentThread
;
75 ULONG SystemReserved
[6];
76 ULONG DcacheAlignment
;
77 ULONG HalReserved
[64];
78 BOOLEAN FirstLevelActive
;
79 BOOLEAN DpcRoutineActive
;
81 BOOLEAN OnInterruptStack
;
82 PVOID SavedInitialStack
;
83 PVOID SavedStackLimit
;
84 PVOID SystemServiceDispatchStart
;
85 PVOID SystemServiceDispatchEnd
;
95 // Get the current TEB
98 struct _TEB
* NtCurrentTeb(VOID
)
100 return (struct _TEB
*)USERPCR
->Teb
;
104 // IRQL Support on ARM is similar to MIPS/ALPHA
112 KeRaiseIrqlToSynchLevel(
117 KeRaiseIrqlToDpcLevel(
121 #define KeLowerIrql(NewIrql) KeSwapIrql(NewIrql)
122 #define KeRaiseIrql(NewIrql, OldIrql) *(OldIrql) = KeSwapIrql(NewIrql)