mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Fixed definition of KPCR_TIB to match W32API/NT5 defintion. Fixed bug in Makefile (fixed by Filip)
svn path=/trunk/; revision=11307
This commit is contained in:
parent
a5262fdf54
commit
020a7e0b2d
3 changed files with 628 additions and 631 deletions
|
@ -36,13 +36,8 @@ else
|
|||
OBJECTS_KDBG :=
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(SDK_PATH_INC)),)
|
||||
TARGET_ASFLAGS = -I./include
|
||||
TARGET_CFLAGS = -I./include $(CFLAGS_KDBG) -Wall -Werror $(CFLAGS_OPT)
|
||||
else
|
||||
TARGET_ASFLAGS = -I./include -I$(SDK_PATH_INC)
|
||||
TARGET_CFLAGS = -I./include -I$(SDK_PATH_INC) -D__NTOSKRNL__ $(CFLAGS_KDBG) -Wall -Werror $(CFLAGS_OPT)
|
||||
endif
|
||||
|
||||
# require os code to explicitly request A/W version of structs/functions
|
||||
TARGET_CFLAGS += -D_DISABLE_TIDENTS
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
#define KPCR_EXCEPTION_LIST 0x0
|
||||
#define KPCR_SELF 0x18
|
||||
#define KPCR_TSS 0x3C
|
||||
#define KPCR_TSS 0x40
|
||||
#define KPCR_CURRENT_THREAD 0x124
|
||||
|
||||
#ifndef __ASM__
|
||||
|
@ -205,6 +205,7 @@ typedef struct _KPCR_TIB {
|
|||
DWORD Version; /* 10 */
|
||||
};
|
||||
PVOID ArbitraryUserPointer; /* 14 */
|
||||
struct _KPCR_TIB* Self; /* 18 */
|
||||
} KPCR_TIB, *PKPCR_TIB; /* 18 */
|
||||
|
||||
/*
|
||||
|
@ -235,7 +236,7 @@ typedef struct _KPCR {
|
|||
ULONG L2CacheSize; /* 8C */
|
||||
ULONG HalReserved[16]; /* 90 */
|
||||
ULONG InterruptMode; /* D0 */
|
||||
UCHAR KernelReserved2[0x4C]; /* D4 */
|
||||
UCHAR KernelReserved2[0x48]; /* D4 */
|
||||
KPRCB PrcbData; /* 120 */
|
||||
} KPCR, *PKPCR;
|
||||
|
||||
|
|
|
@ -134,30 +134,30 @@ KePrepareForApplicationProcessorInit(ULONG Id)
|
|||
VOID
|
||||
KeApplicationProcessorInit(VOID)
|
||||
{
|
||||
PKPCR Pcr;
|
||||
PKPCR KPCR;
|
||||
ULONG Offset;
|
||||
|
||||
/*
|
||||
* Create a PCR for this processor
|
||||
*/
|
||||
Offset = InterlockedIncrement((LONG *)&PcrsAllocated) - 1;
|
||||
Pcr = (PKPCR)(KPCR_BASE + (Offset * PAGE_SIZE));
|
||||
MmCreateVirtualMappingForKernel((PVOID)Pcr,
|
||||
KPCR = (PKPCR)(KPCR_BASE + (Offset * PAGE_SIZE));
|
||||
MmCreateVirtualMappingForKernel((PVOID)KPCR,
|
||||
PAGE_READWRITE,
|
||||
&PcrPages[Offset],
|
||||
1);
|
||||
memset(Pcr, 0, PAGE_SIZE);
|
||||
Pcr->ProcessorNumber = (UCHAR)Offset;
|
||||
Pcr->Self = Pcr;
|
||||
Pcr->Irql = HIGH_LEVEL;
|
||||
memset(KPCR, 0, PAGE_SIZE);
|
||||
KPCR->ProcessorNumber = (UCHAR)Offset;
|
||||
KPCR->Tib.Self = &KPCR->Tib;
|
||||
KPCR->Irql = HIGH_LEVEL;
|
||||
|
||||
/* Mark the end of the exception handler list */
|
||||
Pcr->Tib.ExceptionList = (PVOID)-1;
|
||||
KPCR->Tib.ExceptionList = (PVOID)-1;
|
||||
|
||||
/*
|
||||
* Initialize the GDT
|
||||
*/
|
||||
KiInitializeGdt(Pcr);
|
||||
KiInitializeGdt(KPCR);
|
||||
|
||||
/*
|
||||
* It is now safe to process interrupts
|
||||
|
@ -216,6 +216,7 @@ KeInit1(PCHAR CommandLine, PULONG LastKernelAddress)
|
|||
memset(KPCR, 0, PAGE_SIZE);
|
||||
KPCR->Self = (PKPCR)KPCR_BASE;
|
||||
KPCR->Irql = HIGH_LEVEL;
|
||||
KPCR->Tib.Self = &KPCR->Tib;
|
||||
KPCR->GDT = KiBootGdt;
|
||||
KPCR->IDT = (PUSHORT)KiIdt;
|
||||
KPCR->TSS = &KiBootTss;
|
||||
|
|
Loading…
Reference in a new issue