mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:52:57 +00:00
[NTOS:KE/x64] Factor out KiIntializeProcessorBootStructures
This commit is contained in:
parent
8c466c3e36
commit
d0f6874d92
1 changed files with 43 additions and 15 deletions
|
@ -270,6 +270,38 @@ KiInitializeTss(
|
||||||
Tss->Ist[3] = (ULONG64)NmiStack;
|
Tss->Ist[3] = (ULONG64)NmiStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CODE_SEG("INIT")
|
||||||
|
VOID
|
||||||
|
KiInitializeProcessorBootStructures(
|
||||||
|
_In_ ULONG ProcessorNumber,
|
||||||
|
_Out_ PKIPCR Pcr,
|
||||||
|
_In_ PKGDTENTRY64 GdtBase,
|
||||||
|
_In_ PKIDTENTRY64 IdtBase,
|
||||||
|
_In_ PKTSS64 TssBase,
|
||||||
|
_In_ PKTHREAD IdleThread,
|
||||||
|
_In_ PVOID KernelStack,
|
||||||
|
_In_ PVOID DpcStack,
|
||||||
|
_In_ PVOID DoubleFaultStack,
|
||||||
|
_In_ PVOID NmiStack)
|
||||||
|
{
|
||||||
|
/* Initialize the PCR */
|
||||||
|
KiInitializePcr(Pcr,
|
||||||
|
ProcessorNumber,
|
||||||
|
GdtBase,
|
||||||
|
IdtBase,
|
||||||
|
TssBase,
|
||||||
|
IdleThread,
|
||||||
|
DpcStack);
|
||||||
|
|
||||||
|
|
||||||
|
/* Setup the TSS descriptor and entries */
|
||||||
|
KiInitializeTss(Pcr,
|
||||||
|
TssBase,
|
||||||
|
KernelStack,
|
||||||
|
DoubleFaultStack,
|
||||||
|
NmiStack);
|
||||||
|
}
|
||||||
|
|
||||||
CODE_SEG("INIT")
|
CODE_SEG("INIT")
|
||||||
static
|
static
|
||||||
VOID
|
VOID
|
||||||
|
@ -294,20 +326,16 @@ KiInitializeP0BootStructures(
|
||||||
TssEntry = KiGetGdtEntry(GdtDescriptor.Base, KGDT64_SYS_TSS);
|
TssEntry = KiGetGdtEntry(GdtDescriptor.Base, KGDT64_SYS_TSS);
|
||||||
TssBase = KiGetGdtDescriptorBase(TssEntry);
|
TssBase = KiGetGdtDescriptorBase(TssEntry);
|
||||||
|
|
||||||
/* Initialize the PCR */
|
/* Initialize PCR and TSS */
|
||||||
KiInitializePcr(&KiInitialPcr,
|
KiInitializeProcessorBootStructures(0,
|
||||||
0,
|
&KiInitialPcr,
|
||||||
GdtDescriptor.Base,
|
GdtDescriptor.Base,
|
||||||
IdtDescriptor.Base,
|
IdtDescriptor.Base,
|
||||||
TssBase,
|
TssBase,
|
||||||
&KiInitialThread.Tcb,
|
&KiInitialThread.Tcb,
|
||||||
KiP0DoubleFaultStack);
|
|
||||||
|
|
||||||
/* Setup the TSS descriptors and entries */
|
|
||||||
KiInitializeTss(&KiInitialPcr,
|
|
||||||
KiInitialPcr.TssBase,
|
|
||||||
KiP0BootStack,
|
KiP0BootStack,
|
||||||
KiP0DoubleFaultStack,
|
KiP0DoubleFaultStack,
|
||||||
|
KiP0DoubleFaultStack,
|
||||||
KiP0DoubleFaultStack);
|
KiP0DoubleFaultStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue