3 Copyright (c) Alex Ionescu. All rights reserved.
11 ARM Type definitions for the Kernel services.
15 Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
19 #ifndef _ARM_KETYPES_H
20 #define _ARM_KETYPES_H
29 #define PASSIVE_LEVEL 0
32 #define DISPATCH_LEVEL 2
35 #define PROFILE_LEVEL 8
37 #define SYNCH_LEVEL (IPI_LEVEL - 1)
45 #define IPI_PACKET_READY 8
46 #define IPI_SYNCH_REQUEST 16
51 #define PRCB_MAJOR_VERSION 1
52 #define PRCB_BUILD_DEBUG 1
53 #define PRCB_BUILD_UNIPROCESSOR 2
58 #define INITIAL_STALL_COUNT 0x64
61 // Static Kernel-Mode Address start (use MM_KSEG0_BASE for actual)
63 #define KSEG0_BASE 0x80000000
68 #define KIPCR 0xFFFFF000
69 #define USPCR 0x7FFF0000
70 #define PCR ((volatile KPCR * const)USPCR)
71 #define USERPCR ((volatile KPCR * const)KIPCR)
74 // Synchronization-level IRQL
76 #define SYNCH_LEVEL DISPATCH_LEVEL
79 // Trap Frame Definition
81 typedef struct _KTRAP_FRAME
100 UCHAR ExceptionRecord
[(sizeof(EXCEPTION_RECORD
) + 7) & (~7)];
107 } KTRAP_FRAME
, *PKTRAP_FRAME
;
110 // Processor Control Region
111 // On ARM, it's actually readable from user-mode, much like KUSER_SHARED_DATA
113 #ifdef NTOS_MODE_USER
114 #define PKINTERRUPT_ROUTINE PVOID // Hack!
120 PKINTERRUPT_ROUTINE InterruptRoutine
[64];
122 ULONG FirstLevelDcacheSize
;
123 ULONG FirstLevelDcacheFillSize
;
124 ULONG FirstLevelIcacheSize
;
125 ULONG FirstLevelIcacheFillSize
;
126 ULONG SecondLevelDcacheSize
;
127 ULONG SecondLevelDcacheFillSize
;
128 ULONG SecondLevelIcacheSize
;
129 ULONG SecondLevelIcacheFillSize
;
133 ULONG DcacheFillSize
;
134 ULONG IcacheAlignment
;
135 ULONG IcacheFillSize
;
137 ULONG ProfileInterval
;
139 ULONG StallExecutionCount
;
140 ULONG StallScaleFactor
;
143 PVOID InstructionBusError
;
149 struct _KTHREAD
*CurrentThread
;
151 ULONG SystemReserved
[6];
152 ULONG DcacheAlignment
;
153 ULONG HalReserved
[64];
154 BOOLEAN FirstLevelActive
;
155 BOOLEAN DpcRoutineActive
;
157 BOOLEAN OnInterruptStack
;
158 PVOID SavedInitialStack
;
159 PVOID SavedStackLimit
;
160 PVOID SystemServiceDispatchStart
;
161 PVOID SystemServiceDispatchEnd
;
162 PVOID InterruptStack
;
170 #ifndef NTOS_MODE_USER
174 typedef struct _KFLOATING_SAVE
177 } KFLOATING_SAVE
, *PKFLOATING_SAVE
;
180 // Processor Region Control Block
182 typedef struct _KPRCB
186 struct _KTHREAD
*CurrentThread
;
187 struct _KTHREAD
*NextThread
;
188 struct _KTHREAD
*IdleThread
;
196 // Macro to get current KPRCB
200 KeGetCurrentPrcb(VOID
)
206 // Macro to get current CPU
211 KeGetCurrentProcessorNumber(VOID
)