9ab0e53da2ca14b5daf9be1d298b83ac9f9ec9b8
[reactos.git] / reactos / include / ndk / arm / ketypes.h
1 /*++ NDK Version: 0098
2
3 Copyright (c) Alex Ionescu. All rights reserved.
4
5 Header Name:
6
7 ketypes.h (ARM)
8
9 Abstract:
10
11 ARM Type definitions for the Kernel services.
12
13 Author:
14
15 Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
16
17 --*/
18
19 #ifndef _ARM_KETYPES_H
20 #define _ARM_KETYPES_H
21
22 //
23 // Dependencies
24 //
25
26 //
27 // IPI Types
28 //
29 #define IPI_APC 1
30 #define IPI_DPC 2
31 #define IPI_FREEZE 4
32 #define IPI_PACKET_READY 8
33 #define IPI_SYNCH_REQUEST 16
34
35 //
36 // PRCB Flags
37 //
38 #define PRCB_MAJOR_VERSION 1
39 #define PRCB_BUILD_DEBUG 1
40 #define PRCB_BUILD_UNIPROCESSOR 2
41
42 //
43 // No LDTs on ARM
44 //
45 #define LDT_ENTRY ULONG
46
47 //
48 // HAL Variables
49 //
50 #define INITIAL_STALL_COUNT 0x64
51
52 //
53 // Static Kernel-Mode Address start (use MM_KSEG0_BASE for actual)
54 //
55 #define KSEG0_BASE 0x80000000
56
57 //
58 // Trap Frame Definition
59 //
60 typedef struct _KTRAP_FRAME
61 {
62 ULONG R0;
63 ULONG R1;
64 ULONG R2;
65 ULONG R3;
66 ULONG R4;
67 ULONG R5;
68 ULONG R6;
69 ULONG R7;
70 ULONG R8;
71 ULONG R9;
72 ULONG R10;
73 ULONG R11;
74 ULONG R12;
75 ULONG Sp;
76 ULONG Lr;
77 ULONG Pc;
78 ULONG Psr;
79 UCHAR ExceptionRecord[(sizeof(EXCEPTION_RECORD) + 7) & (~7)];
80 UCHAR OldIrql;
81 UCHAR PreviousMode;
82 ULONG Fpscr;
83 ULONG FpExc;
84 ULONG S[33];
85 ULONG FpExtra[8];
86 } KTRAP_FRAME, *PKTRAP_FRAME;
87
88 #ifndef NTOS_MODE_USER
89
90 //
91 // Exception Frame Definition
92 //
93 typedef struct _KEXCEPTION_FRAME
94 {
95 ULONG PlaceHolder;
96 } KEXCEPTION_FRAME, *PKEXCEPTION_FRAME;
97
98 //
99 // Processor State
100 //
101 typedef struct _KPROCESSOR_STATE
102 {
103 struct _CONTEXT ContextFrame;
104 } KPROCESSOR_STATE, *PKPROCESSOR_STATE;
105
106 //
107 // Processor Region Control Block
108 //
109 typedef struct _KPRCB
110 {
111 USHORT MinorVersion;
112 USHORT MajorVersion;
113 struct _KTHREAD *CurrentThread;
114 struct _KTHREAD *NextThread;
115 struct _KTHREAD *IdleThread;
116 UCHAR Number;
117 UCHAR Reserved;
118 USHORT BuildType;
119 KAFFINITY SetMember;
120 KPROCESSOR_STATE ProcessorState;
121 ULONG KernelReserved[16];
122 ULONG HalReserved[16];
123 KSPIN_LOCK_QUEUE LockQueue[LockQueueMaximumLock];
124 struct _KTHREAD *NpxThread;
125 ULONG InterruptCount;
126 ULONG KernelTime;
127 ULONG UserTime;
128 ULONG DpcTime;
129 ULONG DebugDpcTime;
130 ULONG InterruptTime;
131 ULONG AdjustDpcThreshold;
132 ULONG PageColor;
133 UCHAR SkipTick;
134 UCHAR DebuggerSavedIRQL;
135 UCHAR NodeColor;
136 UCHAR Spare1;
137 ULONG NodeShiftedColor;
138 struct _KNODE *ParentNode;
139 ULONG MultiThreadProcessorSet;
140 struct _KPRCB *MultiThreadSetMaster;
141 ULONG SecondaryColorMask;
142 LONG Sleeping;
143 ULONG CcFastReadNoWait;
144 ULONG CcFastReadWait;
145 ULONG CcFastReadNotPossible;
146 ULONG CcCopyReadNoWait;
147 ULONG CcCopyReadWait;
148 ULONG CcCopyReadNoWaitMiss;
149 ULONG KeAlignmentFixupCount;
150 ULONG SpareCounter0;
151 ULONG KeDcacheFlushCount;
152 ULONG KeExceptionDispatchCount;
153 ULONG KeFirstLevelTbFills;
154 ULONG KeIcacheFlushCount;
155 ULONG KeSecondLevelTbFills;
156 ULONG KeSystemCalls;
157 volatile ULONG IoReadOperationCount;
158 volatile ULONG IoWriteOperationCount;
159 volatile ULONG IoOtherOperationCount;
160 LARGE_INTEGER IoReadTransferCount;
161 LARGE_INTEGER IoWriteTransferCount;
162 LARGE_INTEGER IoOtherTransferCount;
163 PP_LOOKASIDE_LIST PPLookasideList[16];
164 PP_LOOKASIDE_LIST PPNPagedLookasideList[32];
165 PP_LOOKASIDE_LIST PPPagedLookasideList[32];
166 volatile ULONG PacketBarrier;
167 volatile ULONG ReverseStall;
168 PVOID IpiFrame;
169 volatile PVOID CurrentPacket[3];
170 volatile ULONG TargetSet;
171 volatile PKIPI_WORKER WorkerRoutine;
172 volatile ULONG IpiFrozen;
173 volatile ULONG RequestSummary;
174 volatile struct _KPRCB *SignalDone;
175 struct _KDPC_DATA DpcData[2];
176 PVOID DpcStack;
177 ULONG MaximumDpcQueueDepth;
178 ULONG DpcRequestRate;
179 ULONG MinimumDpcRate;
180 volatile UCHAR DpcInterruptRequested;
181 volatile UCHAR DpcThreadRequested;
182 volatile UCHAR DpcRoutineActive;
183 volatile UCHAR DpcThreadActive;
184 ULONG PrcbLock;
185 ULONG DpcLastCount;
186 volatile ULONG TimerHand;
187 volatile ULONG TimerRequest;
188 PVOID DpcThread;
189 KEVENT DpcEvent;
190 UCHAR ThreadDpcEnable;
191 volatile BOOLEAN QuantumEnd;
192 volatile UCHAR IdleSchedule;
193 LONG DpcSetEventRequest;
194 LONG TickOffset;
195 KDPC CallDpc;
196 LIST_ENTRY WaitListHead;
197 ULONG ReadySummary;
198 ULONG QueueIndex;
199 LIST_ENTRY DispatcherReadyListHead[32];
200 SINGLE_LIST_ENTRY DeferredReadyListHead;
201 PVOID ChainedInterruptList;
202 LONG LookasideIrpFloat;
203 volatile LONG MmPageFaultCount;
204 volatile LONG MmCopyOnWriteCount;
205 volatile LONG MmTransitionCount;
206 volatile LONG MmCacheTransitionCount;
207 volatile LONG MmDemandZeroCount;
208 volatile LONG MmPageReadCount;
209 volatile LONG MmPageReadIoCount;
210 volatile LONG MmCacheReadCount;
211 volatile LONG MmCacheIoCount;
212 volatile LONG MmDirtyPagesWriteCount;
213 volatile LONG MmDirtyWriteIoCount;
214 volatile LONG MmMappedPagesWriteCount;
215 volatile LONG MmMappedWriteIoCount;
216 CHAR VendorString[13];
217 ULONG MHz;
218 ULONG FeatureBits;
219 volatile LARGE_INTEGER IsrTime;
220 PROCESSOR_POWER_STATE PowerState;
221 } KPRCB, *PKPRCB;
222
223 //
224 // Macro to get current KPRCB
225 //
226 FORCEINLINE
227 struct _KPRCB *
228 KeGetCurrentPrcb(VOID)
229 {
230 return PCR->Prcb;
231 }
232
233 #endif
234 #endif