mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +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;
|
||||
}
|
||||
|
||||
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")
|
||||
VOID
|
||||
NTAPI
|
||||
|
@ -436,21 +459,8 @@ KiSystemStartup(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
|||
/* Save the loader block */
|
||||
KeLoaderBlock = LoaderBlock;
|
||||
|
||||
/* Set the initial stack, idle thread and process */
|
||||
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);
|
||||
/* Prepare LoaderBlock, PCR, TSS with the P0 boot data */
|
||||
KiInitializeP0BootStructures(LoaderBlock);
|
||||
}
|
||||
|
||||
/* Get Pcr from loader block */
|
||||
|
|
Loading…
Reference in a new issue