mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 17:05:44 +00:00
[NTOS:KE/x64] Factor out KiInitializeP0BootStructures
This commit is contained in:
parent
e655594609
commit
d2a3b1c791
1 changed files with 25 additions and 15 deletions
|
@ -279,6 +279,29 @@ KiInitializeTss(
|
||||||
Tss->Ist[3] = (ULONG64)NmiStack;
|
Tss->Ist[3] = (ULONG64)NmiStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CODE_SEG("INIT")
|
||||||
|
static
|
||||||
|
VOID
|
||||||
|
KiInitializeP0BootStructures(
|
||||||
|
_Inout_ PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||||
|
{
|
||||||
|
/* Set the initial stack, idle thread and process for processor 0 */
|
||||||
|
LoaderBlock->KernelStack = (ULONG_PTR)KiP0BootStack;
|
||||||
|
LoaderBlock->Thread = (ULONG_PTR)&KiInitialThread;
|
||||||
|
LoaderBlock->Process = (ULONG_PTR)&KiInitialProcess.Pcb;
|
||||||
|
LoaderBlock->Prcb = (ULONG_PTR)&KiInitialPcr.Prcb;
|
||||||
|
|
||||||
|
/* Initialize the PCR */
|
||||||
|
KiInitializePcr(&KiInitialPcr, 0, &KiInitialThread.Tcb, KiP0DoubleFaultStack);
|
||||||
|
|
||||||
|
/* Setup the TSS descriptors and entries */
|
||||||
|
KiInitializeTss(&KiInitialPcr,
|
||||||
|
KiInitialPcr.TssBase,
|
||||||
|
KiP0BootStack,
|
||||||
|
KiP0DoubleFaultStack,
|
||||||
|
KiP0DoubleFaultStack);
|
||||||
|
}
|
||||||
|
|
||||||
CODE_SEG("INIT")
|
CODE_SEG("INIT")
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
|
@ -436,21 +459,8 @@ KiSystemStartup(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||||
/* Save the loader block */
|
/* Save the loader block */
|
||||||
KeLoaderBlock = LoaderBlock;
|
KeLoaderBlock = LoaderBlock;
|
||||||
|
|
||||||
/* Set the initial stack, idle thread and process */
|
/* Prepare LoaderBlock, PCR, TSS with the P0 boot data */
|
||||||
LoaderBlock->KernelStack = (ULONG_PTR)KiP0BootStack;
|
KiInitializeP0BootStructures(LoaderBlock);
|
||||||
LoaderBlock->Thread = (ULONG_PTR)&KiInitialThread;
|
|
||||||
LoaderBlock->Process = (ULONG_PTR)&KiInitialProcess.Pcb;
|
|
||||||
LoaderBlock->Prcb = (ULONG_PTR)&KiInitialPcr.Prcb;
|
|
||||||
|
|
||||||
/* Initialize the PCR */
|
|
||||||
KiInitializePcr(&KiInitialPcr, 0, &KiInitialThread.Tcb, KiP0DoubleFaultStack);
|
|
||||||
|
|
||||||
/* Setup the TSS descriptors and entries */
|
|
||||||
KiInitializeTss(&KiInitialPcr,
|
|
||||||
KiInitialPcr.TssBase,
|
|
||||||
KiP0BootStack,
|
|
||||||
KiP0DoubleFaultStack,
|
|
||||||
KiP0DoubleFaultStack);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get Pcr from loader block */
|
/* Get Pcr from loader block */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue