Author: sir_richard
Date: Tue Feb 9 03:06:29 2010
New Revision: 45510
URL:
http://svn.reactos.org/svn/reactos?rev=45510&view=rev
Log:
[ARM DDK]: Use the closest possible approximation to the x86 KPCR/KPRCB (in fact, the
public KPCR is identical, just the KIPCR is different, internally), instead of a mashup of
PPC and MIPS structures.
Modified:
trunk/reactos/include/ndk/arm/ketypes.h
Modified: trunk/reactos/include/ndk/arm/ketypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/arm/ketypes.h?…
==============================================================================
--- trunk/reactos/include/ndk/arm/ketypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/arm/ketypes.h [iso-8859-1] Tue Feb 9 03:06:29 2010
@@ -316,9 +316,13 @@
UCHAR Reserved;
USHORT BuildType;
KAFFINITY SetMember;
+ UCHAR CpuType;
+ UCHAR CpuID;
+ USHORT CpuStep;
KPROCESSOR_STATE ProcessorState;
ULONG KernelReserved[16];
ULONG HalReserved[16];
+ UCHAR PrcbPad0[92];
KSPIN_LOCK_QUEUE LockQueue[LockQueueMaximumLock];
struct _KTHREAD *NpxThread;
ULONG InterruptCount;
@@ -334,7 +338,6 @@
UCHAR NodeColor;
UCHAR Spare1;
ULONG NodeShiftedColor;
- ULONG PcrPage;
struct _KNODE *ParentNode;
ULONG MultiThreadProcessorSet;
struct _KPRCB *MultiThreadSetMaster;
@@ -361,19 +364,22 @@
LARGE_INTEGER IoReadTransferCount;
LARGE_INTEGER IoWriteTransferCount;
LARGE_INTEGER IoOtherTransferCount;
- ULONG KeContextSwitches;
+ ULONG SpareCounter1[8];
PP_LOOKASIDE_LIST PPLookasideList[16];
PP_LOOKASIDE_LIST PPNPagedLookasideList[32];
PP_LOOKASIDE_LIST PPPagedLookasideList[32];
volatile ULONG PacketBarrier;
volatile ULONG ReverseStall;
PVOID IpiFrame;
+ UCHAR PrcbPad2[52];
volatile PVOID CurrentPacket[3];
volatile ULONG TargetSet;
volatile PKIPI_WORKER WorkerRoutine;
volatile ULONG IpiFrozen;
+ UCHAR PrcbPad3[40];
volatile ULONG RequestSummary;
volatile struct _KPRCB *SignalDone;
+ UCHAR PrcbPad4[56];
struct _KDPC_DATA DpcData[2];
PVOID DpcStack;
ULONG MaximumDpcQueueDepth;
@@ -391,15 +397,19 @@
KEVENT DpcEvent;
UCHAR ThreadDpcEnable;
volatile BOOLEAN QuantumEnd;
+ UCHAR PrcbPad50;
volatile UCHAR IdleSchedule;
LONG DpcSetEventRequest;
+ UCHAR PrcbPad5[18];
LONG TickOffset;
KDPC CallDpc;
+ ULONG PrcbPad7[8];
LIST_ENTRY WaitListHead;
ULONG ReadySummary;
ULONG QueueIndex;
LIST_ENTRY DispatcherReadyListHead[32];
SINGLE_LIST_ENTRY DeferredReadyListHead;
+ ULONG PrcbPad72[11];
PVOID ChainedInterruptList;
LONG LookasideIrpFloat;
volatile LONG MmPageFaultCount;
@@ -415,12 +425,78 @@
volatile LONG MmDirtyWriteIoCount;
volatile LONG MmMappedPagesWriteCount;
volatile LONG MmMappedWriteIoCount;
+ ULONG SpareFields0[1];
CHAR VendorString[13];
+ UCHAR InitialApicId;
+ UCHAR LogicalProcessorsPerPhysicalProcessor;
ULONG MHz;
ULONG FeatureBits;
+ LARGE_INTEGER UpdateSignature;
volatile LARGE_INTEGER IsrTime;
+ LARGE_INTEGER SpareField1;
+ //FX_SAVE_AREA NpxSaveArea;
PROCESSOR_POWER_STATE PowerState;
} KPRCB, *PKPRCB;
+
+//
+// Processor Control Region
+//
+typedef struct _KIPCR
+{
+ union
+ {
+ NT_TIB NtTib;
+ struct
+ {
+ struct _EXCEPTION_REGISTRATION_RECORD *Used_ExceptionList; // Unused
+ PVOID Used_StackBase; // Unused
+ PVOID PerfGlobalGroupMask;
+ PVOID TssCopy; // Unused
+ ULONG ContextSwitches;
+ KAFFINITY SetMemberCopy; // Unused
+ PVOID Used_Self;
+ };
+ };
+ struct _KPCR *Self;
+ struct _KPRCB *Prcb;
+ KIRQL Irql;
+ ULONG IRR; // Unused
+ ULONG IrrActive; // Unused
+ ULONG IDR; // Unused
+ PVOID KdVersionBlock;
+ PVOID IDT; // Unused
+ PVOID GDT; // Unused
+ PVOID TSS; // Unused
+ USHORT MajorVersion;
+ USHORT MinorVersion;
+ KAFFINITY SetMember;
+ ULONG StallScaleFactor;
+ UCHAR SpareUnused;
+ UCHAR Number;
+ // arm part
+ UCHAR Spare0[2];
+ UCHAR IrqlMask[32];
+ ULONG IrqlTable[32];
+ PKINTERRUPT_ROUTINE InterruptRoutine[32];
+ ULONG ReservedVectors;
+ ULONG FirstLevelDcacheSize;
+ ULONG FirstLevelDcacheFillSize;
+ ULONG FirstLevelIcacheSize;
+ ULONG FirstLevelIcacheFillSize;
+ ULONG SecondLevelDcacheSize;
+ ULONG SecondLevelDcacheFillSize;
+ ULONG SecondLevelIcacheSize;
+ ULONG SecondLevelIcacheFillSize;
+ ULONG DcacheFillSize;
+ ULONG DcacheAlignment;
+ ULONG IcacheAlignment;
+ ULONG IcacheFillSize;
+ ULONG ProcessorId;
+ PVOID InterruptStack;
+ PVOID PanicStack;
+ PVOID InitialStack;
+ KPRCB PrcbData;
+} KIPCR, *PKIPCR;
//
// Macro to get current KPRCB
@@ -432,5 +508,17 @@
return PCR->Prcb;
}
+//
+// Just read it from the PCR
+//
+#define KeGetCurrentProcessorNumber() (int)PCR->Number
+#define KeGetCurrentIrql() PCR->Irql
+#define _KeGetCurrentThread() KeGetCurrentPrcb()->CurrentThread
+#define _KeGetPreviousMode()
KeGetCurrentPrcb()->CurrentThread->PreviousMode
+#define _KeIsExecutingDpc() (KeGetCurrentPrcb()->DpcRoutineActive != 0)
+#define KeGetCurrentThread() _KeGetCurrentThread()
+#define KeGetPreviousMode() _KeGetPreviousMode()
+#define KeGetDcacheFillSize() PCR->DcacheFillSize
+
#endif
#endif