//
#define MAXIMUM_VECTOR 16
+#define KERNEL_STACK_SIZE 12288
+#define KERNEL_LARGE_STACK_SIZE 61440
+#define KERNEL_LARGE_STACK_COMMIT 12288
//
// Used to contain PFNs and PFN counts
//
-typedef ULONG PFN_COUNT;
-typedef ULONG PFN_NUMBER, *PPFN_NUMBER;
-typedef LONG SPFN_NUMBER, *PSPFN_NUMBER;
+//typedef ULONG PFN_COUNT;
+//typedef ULONG PFN_NUMBER, *PPFN_NUMBER;
+//typedef LONG SPFN_NUMBER, *PSPFN_NUMBER;
//
// Stub
#ifdef _WINNT_H
#define KIRQL ULONG
#endif
+
+typedef struct _NT_TIB_KPCR {
+ struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList;
+ PVOID StackBase;
+ PVOID StackLimit;
+ PVOID SubSystemTib;
+ _ANONYMOUS_UNION union {
+ PVOID FiberData;
+ ULONG Version;
+ } DUMMYUNIONNAME;
+ PVOID ArbitraryUserPointer;
+ struct _NT_TIB_KPCR *Self;
+} NT_TIB_KPCR,*PNT_TIB_KPCR;
+
typedef struct _KPCR
{
union
{
- NT_TIB NtTib;
+ NT_TIB_KPCR NtTib;
struct
{
struct _EXCEPTION_REGISTRATION_RECORD *Used_ExceptionList; // Unused
ULONG StallScaleFactor;
UCHAR SpareUnused;
UCHAR Number;
+ UCHAR Spare0;
+ UCHAR SecondLevelCacheAssociativity;
+ ULONG VdmAlert;
+ ULONG KernelReserved[14];
+ ULONG SecondLevelCacheSize;
+ ULONG HalReserved[16];
} KPCR, *PKPCR;
//
return (struct _TEB*)USERPCR->Used_Self;
}
+NTSYSAPI
+struct _KTHREAD*
+NTAPI
+KeGetCurrentThread(VOID);
+
+extern volatile struct _KSYSTEM_TIME KeTickCount;
+
+#ifndef YieldProcessor
+#define YieldProcessor __yield
+#endif
+
+#define ASSERT_BREAKPOINT BREAKPOINT_COMMAND_STRING + 1
+
+#define DbgRaiseAssertionFailure() __break(ASSERT_BREAKPOINT)
+
+#define PCR_MINOR_VERSION 1
+#define PCR_MAJOR_VERSION 1
+
+#define RESULT_ZERO 0
+#define RESULT_NEGATIVE 1
+#define RESULT_POSITIVE 2
+
+DECLSPEC_IMPORT
+VOID
+__fastcall
+KfReleaseSpinLock(
+ IN OUT ULONG_PTR* SpinLock,
+ IN KIRQL NewIrql);
+
+DECLSPEC_IMPORT
+KIRQL
+__fastcall
+KfAcquireSpinLock(
+ IN OUT ULONG_PTR* SpinLock);
+
#ifndef _WINNT_H
//
// IRQL Support on ARM is similar to MIPS/ALPHA
HalSweepIcache(
VOID
);
+
+FORCEINLINE
+VOID
+_KeQueryTickCount(
+ OUT PLARGE_INTEGER CurrentCount)
+{
+ for (;;) {
+#ifdef NONAMELESSUNION
+ CurrentCount->s.HighPart = KeTickCount.High1Time;
+ CurrentCount->s.LowPart = KeTickCount.LowPart;
+ if (CurrentCount->s.HighPart == KeTickCount.High2Time) break;
+#else
+ CurrentCount->HighPart = KeTickCount.High1Time;
+ CurrentCount->LowPart = KeTickCount.LowPart;
+ if (CurrentCount->HighPart == KeTickCount.High2Time) break;
+#endif
+ YieldProcessor();
+ }
+}
+#define KeQueryTickCount(CurrentCount) _KeQueryTickCount(CurrentCount)
#endif
//