mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 14:23:18 +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 :=
|
OBJECTS_KDBG :=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(SDK_PATH_INC)),)
|
|
||||||
TARGET_ASFLAGS = -I./include
|
TARGET_ASFLAGS = -I./include
|
||||||
TARGET_CFLAGS = -I./include $(CFLAGS_KDBG) -Wall -Werror $(CFLAGS_OPT)
|
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
|
# require os code to explicitly request A/W version of structs/functions
|
||||||
TARGET_CFLAGS += -D_DISABLE_TIDENTS
|
TARGET_CFLAGS += -D_DISABLE_TIDENTS
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
#define KPCR_EXCEPTION_LIST 0x0
|
#define KPCR_EXCEPTION_LIST 0x0
|
||||||
#define KPCR_SELF 0x18
|
#define KPCR_SELF 0x18
|
||||||
#define KPCR_TSS 0x3C
|
#define KPCR_TSS 0x40
|
||||||
#define KPCR_CURRENT_THREAD 0x124
|
#define KPCR_CURRENT_THREAD 0x124
|
||||||
|
|
||||||
#ifndef __ASM__
|
#ifndef __ASM__
|
||||||
|
@ -205,6 +205,7 @@ typedef struct _KPCR_TIB {
|
||||||
DWORD Version; /* 10 */
|
DWORD Version; /* 10 */
|
||||||
};
|
};
|
||||||
PVOID ArbitraryUserPointer; /* 14 */
|
PVOID ArbitraryUserPointer; /* 14 */
|
||||||
|
struct _KPCR_TIB* Self; /* 18 */
|
||||||
} KPCR_TIB, *PKPCR_TIB; /* 18 */
|
} KPCR_TIB, *PKPCR_TIB; /* 18 */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -235,7 +236,7 @@ typedef struct _KPCR {
|
||||||
ULONG L2CacheSize; /* 8C */
|
ULONG L2CacheSize; /* 8C */
|
||||||
ULONG HalReserved[16]; /* 90 */
|
ULONG HalReserved[16]; /* 90 */
|
||||||
ULONG InterruptMode; /* D0 */
|
ULONG InterruptMode; /* D0 */
|
||||||
UCHAR KernelReserved2[0x4C]; /* D4 */
|
UCHAR KernelReserved2[0x48]; /* D4 */
|
||||||
KPRCB PrcbData; /* 120 */
|
KPRCB PrcbData; /* 120 */
|
||||||
} KPCR, *PKPCR;
|
} KPCR, *PKPCR;
|
||||||
|
|
||||||
|
|
|
@ -134,30 +134,30 @@ KePrepareForApplicationProcessorInit(ULONG Id)
|
||||||
VOID
|
VOID
|
||||||
KeApplicationProcessorInit(VOID)
|
KeApplicationProcessorInit(VOID)
|
||||||
{
|
{
|
||||||
PKPCR Pcr;
|
PKPCR KPCR;
|
||||||
ULONG Offset;
|
ULONG Offset;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create a PCR for this processor
|
* Create a PCR for this processor
|
||||||
*/
|
*/
|
||||||
Offset = InterlockedIncrement((LONG *)&PcrsAllocated) - 1;
|
Offset = InterlockedIncrement((LONG *)&PcrsAllocated) - 1;
|
||||||
Pcr = (PKPCR)(KPCR_BASE + (Offset * PAGE_SIZE));
|
KPCR = (PKPCR)(KPCR_BASE + (Offset * PAGE_SIZE));
|
||||||
MmCreateVirtualMappingForKernel((PVOID)Pcr,
|
MmCreateVirtualMappingForKernel((PVOID)KPCR,
|
||||||
PAGE_READWRITE,
|
PAGE_READWRITE,
|
||||||
&PcrPages[Offset],
|
&PcrPages[Offset],
|
||||||
1);
|
1);
|
||||||
memset(Pcr, 0, PAGE_SIZE);
|
memset(KPCR, 0, PAGE_SIZE);
|
||||||
Pcr->ProcessorNumber = (UCHAR)Offset;
|
KPCR->ProcessorNumber = (UCHAR)Offset;
|
||||||
Pcr->Self = Pcr;
|
KPCR->Tib.Self = &KPCR->Tib;
|
||||||
Pcr->Irql = HIGH_LEVEL;
|
KPCR->Irql = HIGH_LEVEL;
|
||||||
|
|
||||||
/* Mark the end of the exception handler list */
|
/* Mark the end of the exception handler list */
|
||||||
Pcr->Tib.ExceptionList = (PVOID)-1;
|
KPCR->Tib.ExceptionList = (PVOID)-1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize the GDT
|
* Initialize the GDT
|
||||||
*/
|
*/
|
||||||
KiInitializeGdt(Pcr);
|
KiInitializeGdt(KPCR);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* It is now safe to process interrupts
|
* It is now safe to process interrupts
|
||||||
|
@ -216,6 +216,7 @@ KeInit1(PCHAR CommandLine, PULONG LastKernelAddress)
|
||||||
memset(KPCR, 0, PAGE_SIZE);
|
memset(KPCR, 0, PAGE_SIZE);
|
||||||
KPCR->Self = (PKPCR)KPCR_BASE;
|
KPCR->Self = (PKPCR)KPCR_BASE;
|
||||||
KPCR->Irql = HIGH_LEVEL;
|
KPCR->Irql = HIGH_LEVEL;
|
||||||
|
KPCR->Tib.Self = &KPCR->Tib;
|
||||||
KPCR->GDT = KiBootGdt;
|
KPCR->GDT = KiBootGdt;
|
||||||
KPCR->IDT = (PUSHORT)KiIdt;
|
KPCR->IDT = (PUSHORT)KiIdt;
|
||||||
KPCR->TSS = &KiBootTss;
|
KPCR->TSS = &KiBootTss;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue