Rename ProcSup class to ProcessorSupport and update all callers
This commit is contained in:
@@ -25,7 +25,7 @@ namespace AR
|
|||||||
IN UINT_PTR Value);
|
IN UINT_PTR Value);
|
||||||
};
|
};
|
||||||
|
|
||||||
class ProcSup
|
class ProcessorSupport
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
STATIC XTAPI VOID GetTrampolineInformation(IN TRAMPOLINE_TYPE TrampolineType,
|
STATIC XTAPI VOID GetTrampolineInformation(IN TRAMPOLINE_TYPE TrampolineType,
|
||||||
|
|||||||
@@ -1032,7 +1032,7 @@ Protocol::InstallXtLoaderProtocol()
|
|||||||
LoaderProtocol.Boot.RegisterMenu = XtLoader::RegisterBootMenu;
|
LoaderProtocol.Boot.RegisterMenu = XtLoader::RegisterBootMenu;
|
||||||
LoaderProtocol.Boot.RegisterProtocol = RegisterBootProtocol;
|
LoaderProtocol.Boot.RegisterProtocol = RegisterBootProtocol;
|
||||||
LoaderProtocol.BootUtils.GetBooleanParameter = BootUtils::GetBooleanParameter;
|
LoaderProtocol.BootUtils.GetBooleanParameter = BootUtils::GetBooleanParameter;
|
||||||
LoaderProtocol.BootUtils.GetTrampolineInformation = AR::ProcSup::GetTrampolineInformation;
|
LoaderProtocol.BootUtils.GetTrampolineInformation = AR::ProcessorSupport::GetTrampolineInformation;
|
||||||
LoaderProtocol.Config.GetBooleanValue = Configuration::GetBooleanValue;
|
LoaderProtocol.Config.GetBooleanValue = Configuration::GetBooleanValue;
|
||||||
LoaderProtocol.Config.GetBootOptionValue = Configuration::GetBootOptionValue;
|
LoaderProtocol.Config.GetBootOptionValue = Configuration::GetBootOptionValue;
|
||||||
LoaderProtocol.Config.GetEditableOptions = Configuration::GetEditableOptions;
|
LoaderProtocol.Config.GetEditableOptions = Configuration::GetEditableOptions;
|
||||||
|
|||||||
@@ -10,25 +10,25 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Initial kernel boot stack */
|
/* Initial kernel boot stack */
|
||||||
UCHAR AR::ProcSup::BootStack[KERNEL_STACK_SIZE] = {};
|
UCHAR AR::ProcessorSupport::BootStack[KERNEL_STACK_SIZE] = {};
|
||||||
|
|
||||||
/* Initial kernel fault stack */
|
/* Initial kernel fault stack */
|
||||||
UCHAR AR::ProcSup::FaultStack[KERNEL_STACK_SIZE] = {};
|
UCHAR AR::ProcessorSupport::FaultStack[KERNEL_STACK_SIZE] = {};
|
||||||
|
|
||||||
/* Initial GDT */
|
/* Initial GDT */
|
||||||
KGDTENTRY AR::ProcSup::InitialGdt[GDT_ENTRIES] = {};
|
KGDTENTRY AR::ProcessorSupport::InitialGdt[GDT_ENTRIES] = {};
|
||||||
|
|
||||||
/* Initial IDT */
|
/* Initial IDT */
|
||||||
KIDTENTRY AR::ProcSup::InitialIdt[IDT_ENTRIES] = {};
|
KIDTENTRY AR::ProcessorSupport::InitialIdt[IDT_ENTRIES] = {};
|
||||||
|
|
||||||
/* Initial Processor Block */
|
/* Initial Processor Block */
|
||||||
KPROCESSOR_BLOCK AR::ProcSup::InitialProcessorBlock;
|
KPROCESSOR_BLOCK AR::ProcessorSupport::InitialProcessorBlock;
|
||||||
|
|
||||||
/* Initial TSS */
|
/* Initial TSS */
|
||||||
KTSS AR::ProcSup::InitialTss;
|
KTSS AR::ProcessorSupport::InitialTss;
|
||||||
|
|
||||||
/* Initial kernel NMI stack */
|
/* Initial kernel NMI stack */
|
||||||
UCHAR AR::ProcSup::NmiStack[KERNEL_STACK_SIZE] = {};
|
UCHAR AR::ProcessorSupport::NmiStack[KERNEL_STACK_SIZE] = {};
|
||||||
|
|
||||||
/* Unhandled interrupt routine */
|
/* Unhandled interrupt routine */
|
||||||
PINTERRUPT_HANDLER AR::Traps::UnhandledInterruptRoutine = NULLPTR;
|
PINTERRUPT_HANDLER AR::Traps::UnhandledInterruptRoutine = NULLPTR;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
PVOID
|
PVOID
|
||||||
AR::ProcSup::GetBootStack(VOID)
|
AR::ProcessorSupport::GetBootStack(VOID)
|
||||||
{
|
{
|
||||||
/* Return base address of kernel boot stack */
|
/* Return base address of kernel boot stack */
|
||||||
return (PVOID)((ULONG_PTR)BootStack + KERNEL_STACK_SIZE);
|
return (PVOID)((ULONG_PTR)BootStack + KERNEL_STACK_SIZE);
|
||||||
@@ -26,9 +26,9 @@ AR::ProcSup::GetBootStack(VOID)
|
|||||||
|
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::GetTrampolineInformation(IN TRAMPOLINE_TYPE TrampolineType,
|
AR::ProcessorSupport::GetTrampolineInformation(IN TRAMPOLINE_TYPE TrampolineType,
|
||||||
OUT PVOID *TrampolineCode,
|
OUT PVOID *TrampolineCode,
|
||||||
OUT PULONG_PTR TrampolineSize)
|
OUT PULONG_PTR TrampolineSize)
|
||||||
{
|
{
|
||||||
/* Get trampoline information */
|
/* Get trampoline information */
|
||||||
switch(TrampolineType)
|
switch(TrampolineType)
|
||||||
@@ -63,7 +63,7 @@ AR::ProcSup::GetTrampolineInformation(IN TRAMPOLINE_TYPE TrampolineType,
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::IdentifyProcessor(VOID)
|
AR::ProcessorSupport::IdentifyProcessor(VOID)
|
||||||
{
|
{
|
||||||
PKPROCESSOR_CONTROL_BLOCK Prcb;
|
PKPROCESSOR_CONTROL_BLOCK Prcb;
|
||||||
CPUID_REGISTERS CpuRegisters;
|
CPUID_REGISTERS CpuRegisters;
|
||||||
@@ -137,7 +137,7 @@ AR::ProcSup::IdentifyProcessor(VOID)
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::IdentifyProcessorFeatures(VOID)
|
AR::ProcessorSupport::IdentifyProcessorFeatures(VOID)
|
||||||
{
|
{
|
||||||
ULONG MaxExtendedLeaf, MaxStandardLeaf;
|
ULONG MaxExtendedLeaf, MaxStandardLeaf;
|
||||||
PKPROCESSOR_CONTROL_BLOCK Prcb;
|
PKPROCESSOR_CONTROL_BLOCK Prcb;
|
||||||
@@ -278,7 +278,7 @@ AR::ProcSup::IdentifyProcessorFeatures(VOID)
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::InitializeGdt(IN PKPROCESSOR_BLOCK ProcessorBlock)
|
AR::ProcessorSupport::InitializeGdt(IN PKPROCESSOR_BLOCK ProcessorBlock)
|
||||||
{
|
{
|
||||||
/* Initialize GDT entries */
|
/* Initialize GDT entries */
|
||||||
SetGdtEntry(ProcessorBlock->GdtBase, KGDT_NULL, 0x0, 0x0, KGDT_TYPE_NONE, KGDT_DPL_SYSTEM, 1);
|
SetGdtEntry(ProcessorBlock->GdtBase, KGDT_NULL, 0x0, 0x0, KGDT_TYPE_NONE, KGDT_DPL_SYSTEM, 1);
|
||||||
@@ -307,7 +307,7 @@ AR::ProcSup::InitializeGdt(IN PKPROCESSOR_BLOCK ProcessorBlock)
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::InitializeIdt(IN PKPROCESSOR_BLOCK ProcessorBlock)
|
AR::ProcessorSupport::InitializeIdt(IN PKPROCESSOR_BLOCK ProcessorBlock)
|
||||||
{
|
{
|
||||||
UINT Vector;
|
UINT Vector;
|
||||||
|
|
||||||
@@ -355,7 +355,7 @@ AR::ProcSup::InitializeIdt(IN PKPROCESSOR_BLOCK ProcessorBlock)
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::InitializeProcessor(IN PVOID ProcessorStructures)
|
AR::ProcessorSupport::InitializeProcessor(IN PVOID ProcessorStructures)
|
||||||
{
|
{
|
||||||
PVOID KernelBootStack, KernelFaultStack, KernelNmiStack;
|
PVOID KernelBootStack, KernelFaultStack, KernelNmiStack;
|
||||||
KDESCRIPTOR GdtDescriptor, IdtDescriptor;
|
KDESCRIPTOR GdtDescriptor, IdtDescriptor;
|
||||||
@@ -440,11 +440,11 @@ AR::ProcSup::InitializeProcessor(IN PVOID ProcessorStructures)
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::InitializeProcessorBlock(OUT PKPROCESSOR_BLOCK ProcessorBlock,
|
AR::ProcessorSupport::InitializeProcessorBlock(OUT PKPROCESSOR_BLOCK ProcessorBlock,
|
||||||
IN PKGDTENTRY Gdt,
|
IN PKGDTENTRY Gdt,
|
||||||
IN PKIDTENTRY Idt,
|
IN PKIDTENTRY Idt,
|
||||||
IN PKTSS Tss,
|
IN PKTSS Tss,
|
||||||
IN PVOID DpcStack)
|
IN PVOID DpcStack)
|
||||||
{
|
{
|
||||||
/* Set processor block and processor control block */
|
/* Set processor block and processor control block */
|
||||||
ProcessorBlock->Self = ProcessorBlock;
|
ProcessorBlock->Self = ProcessorBlock;
|
||||||
@@ -490,7 +490,7 @@ AR::ProcSup::InitializeProcessorBlock(OUT PKPROCESSOR_BLOCK ProcessorBlock,
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::InitializeProcessorRegisters(VOID)
|
AR::ProcessorSupport::InitializeProcessorRegisters(VOID)
|
||||||
{
|
{
|
||||||
ULONGLONG PatAttributes;
|
ULONGLONG PatAttributes;
|
||||||
|
|
||||||
@@ -563,13 +563,13 @@ AR::ProcSup::InitializeProcessorRegisters(VOID)
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::InitializeProcessorStructures(IN PVOID ProcessorStructures,
|
AR::ProcessorSupport::InitializeProcessorStructures(IN PVOID ProcessorStructures,
|
||||||
OUT PKGDTENTRY *Gdt,
|
OUT PKGDTENTRY *Gdt,
|
||||||
OUT PKTSS *Tss,
|
OUT PKTSS *Tss,
|
||||||
OUT PKPROCESSOR_BLOCK *ProcessorBlock,
|
OUT PKPROCESSOR_BLOCK *ProcessorBlock,
|
||||||
OUT PVOID *KernelBootStack,
|
OUT PVOID *KernelBootStack,
|
||||||
OUT PVOID *KernelFaultStack,
|
OUT PVOID *KernelFaultStack,
|
||||||
OUT PVOID *KernelNmiStack)
|
OUT PVOID *KernelNmiStack)
|
||||||
{
|
{
|
||||||
UINT_PTR Address;
|
UINT_PTR Address;
|
||||||
|
|
||||||
@@ -631,7 +631,7 @@ AR::ProcSup::InitializeProcessorStructures(IN PVOID ProcessorStructures,
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::InitializeSegments(VOID)
|
AR::ProcessorSupport::InitializeSegments(VOID)
|
||||||
{
|
{
|
||||||
/* Initialize segments */
|
/* Initialize segments */
|
||||||
AR::CpuFunc::LoadSegment(SEGMENT_CS, KGDT_R0_CODE);
|
AR::CpuFunc::LoadSegment(SEGMENT_CS, KGDT_R0_CODE);
|
||||||
@@ -657,10 +657,10 @@ AR::ProcSup::InitializeSegments(VOID)
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::InitializeTss(IN PKPROCESSOR_BLOCK ProcessorBlock,
|
AR::ProcessorSupport::InitializeTss(IN PKPROCESSOR_BLOCK ProcessorBlock,
|
||||||
IN PVOID KernelBootStack,
|
IN PVOID KernelBootStack,
|
||||||
IN PVOID KernelFaultStack,
|
IN PVOID KernelFaultStack,
|
||||||
IN PVOID KernelNmiStack)
|
IN PVOID KernelNmiStack)
|
||||||
{
|
{
|
||||||
/* Fill TSS with zeroes */
|
/* Fill TSS with zeroes */
|
||||||
RtlZeroMemory(ProcessorBlock->TssBase, sizeof(KTSS));
|
RtlZeroMemory(ProcessorBlock->TssBase, sizeof(KTSS));
|
||||||
@@ -703,13 +703,13 @@ AR::ProcSup::InitializeTss(IN PKPROCESSOR_BLOCK ProcessorBlock,
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::SetGdtEntry(IN PKGDTENTRY Gdt,
|
AR::ProcessorSupport::SetGdtEntry(IN PKGDTENTRY Gdt,
|
||||||
IN USHORT Selector,
|
IN USHORT Selector,
|
||||||
IN ULONG_PTR Base,
|
IN ULONG_PTR Base,
|
||||||
IN ULONG Limit,
|
IN ULONG Limit,
|
||||||
IN UCHAR Type,
|
IN UCHAR Type,
|
||||||
IN UCHAR Dpl,
|
IN UCHAR Dpl,
|
||||||
IN UCHAR SegmentMode)
|
IN UCHAR SegmentMode)
|
||||||
{
|
{
|
||||||
PKGDTENTRY GdtEntry;
|
PKGDTENTRY GdtEntry;
|
||||||
UCHAR Granularity;
|
UCHAR Granularity;
|
||||||
@@ -769,9 +769,9 @@ AR::ProcSup::SetGdtEntry(IN PKGDTENTRY Gdt,
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::SetGdtEntryBase(IN PKGDTENTRY Gdt,
|
AR::ProcessorSupport::SetGdtEntryBase(IN PKGDTENTRY Gdt,
|
||||||
IN USHORT Selector,
|
IN USHORT Selector,
|
||||||
IN ULONG_PTR Base)
|
IN ULONG_PTR Base)
|
||||||
{
|
{
|
||||||
PKGDTENTRY GdtEntry;
|
PKGDTENTRY GdtEntry;
|
||||||
|
|
||||||
@@ -815,13 +815,13 @@ AR::ProcSup::SetGdtEntryBase(IN PKGDTENTRY Gdt,
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::SetIdtGate(IN PKIDTENTRY Idt,
|
AR::ProcessorSupport::SetIdtGate(IN PKIDTENTRY Idt,
|
||||||
IN USHORT Vector,
|
IN USHORT Vector,
|
||||||
IN PVOID Handler,
|
IN PVOID Handler,
|
||||||
IN USHORT Selector,
|
IN USHORT Selector,
|
||||||
IN USHORT Ist,
|
IN USHORT Ist,
|
||||||
IN USHORT Dpl,
|
IN USHORT Dpl,
|
||||||
IN USHORT Type)
|
IN USHORT Type)
|
||||||
{
|
{
|
||||||
/* Set the handler's address */
|
/* Set the handler's address */
|
||||||
Idt[Vector].OffsetLow = ((ULONG_PTR)Handler & 0xFFFF);
|
Idt[Vector].OffsetLow = ((ULONG_PTR)Handler & 0xFFFF);
|
||||||
|
|||||||
@@ -10,31 +10,31 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Initial kernel boot stack */
|
/* Initial kernel boot stack */
|
||||||
UCHAR AR::ProcSup::BootStack[KERNEL_STACK_SIZE] = {};
|
UCHAR AR::ProcessorSupport::BootStack[KERNEL_STACK_SIZE] = {};
|
||||||
|
|
||||||
/* Double Fault gate */
|
/* Double Fault gate */
|
||||||
UCHAR AR::ProcSup::DoubleFaultTss[KTSS_IO_MAPS];
|
UCHAR AR::ProcessorSupport::DoubleFaultTss[KTSS_IO_MAPS];
|
||||||
|
|
||||||
/* Initial kernel fault stack */
|
/* Initial kernel fault stack */
|
||||||
UCHAR AR::ProcSup::FaultStack[KERNEL_STACK_SIZE] = {};
|
UCHAR AR::ProcessorSupport::FaultStack[KERNEL_STACK_SIZE] = {};
|
||||||
|
|
||||||
/* Initial GDT */
|
/* Initial GDT */
|
||||||
KGDTENTRY AR::ProcSup::InitialGdt[GDT_ENTRIES] = {};
|
KGDTENTRY AR::ProcessorSupport::InitialGdt[GDT_ENTRIES] = {};
|
||||||
|
|
||||||
/* Initial IDT */
|
/* Initial IDT */
|
||||||
KIDTENTRY AR::ProcSup::InitialIdt[IDT_ENTRIES] = {};
|
KIDTENTRY AR::ProcessorSupport::InitialIdt[IDT_ENTRIES] = {};
|
||||||
|
|
||||||
/* Initial Processor Block */
|
/* Initial Processor Block */
|
||||||
KPROCESSOR_BLOCK AR::ProcSup::InitialProcessorBlock;
|
KPROCESSOR_BLOCK AR::ProcessorSupport::InitialProcessorBlock;
|
||||||
|
|
||||||
/* Initial TSS */
|
/* Initial TSS */
|
||||||
KTSS AR::ProcSup::InitialTss;
|
KTSS AR::ProcessorSupport::InitialTss;
|
||||||
|
|
||||||
/* Initial kernel NMI stack */
|
/* Initial kernel NMI stack */
|
||||||
UCHAR AR::ProcSup::NmiStack[KERNEL_STACK_SIZE] = {};
|
UCHAR AR::ProcessorSupport::NmiStack[KERNEL_STACK_SIZE] = {};
|
||||||
|
|
||||||
/* NMI task gate */
|
/* NMI task gate */
|
||||||
UCHAR AR::ProcSup::NonMaskableInterruptTss[KTSS_IO_MAPS];
|
UCHAR AR::ProcessorSupport::NonMaskableInterruptTss[KTSS_IO_MAPS];
|
||||||
|
|
||||||
/* Unhandled interrupt routine */
|
/* Unhandled interrupt routine */
|
||||||
PINTERRUPT_HANDLER AR::Traps::UnhandledInterruptRoutine = NULLPTR;
|
PINTERRUPT_HANDLER AR::Traps::UnhandledInterruptRoutine = NULLPTR;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
PVOID
|
PVOID
|
||||||
AR::ProcSup::GetBootStack(VOID)
|
AR::ProcessorSupport::GetBootStack(VOID)
|
||||||
{
|
{
|
||||||
/* Return base address of kernel boot stack */
|
/* Return base address of kernel boot stack */
|
||||||
return (PVOID)((ULONG_PTR)BootStack + KERNEL_STACK_SIZE);
|
return (PVOID)((ULONG_PTR)BootStack + KERNEL_STACK_SIZE);
|
||||||
@@ -26,9 +26,9 @@ AR::ProcSup::GetBootStack(VOID)
|
|||||||
|
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::GetTrampolineInformation(IN TRAMPOLINE_TYPE TrampolineType,
|
AR::ProcessorSupport::GetTrampolineInformation(IN TRAMPOLINE_TYPE TrampolineType,
|
||||||
OUT PVOID *TrampolineCode,
|
OUT PVOID *TrampolineCode,
|
||||||
OUT PULONG_PTR TrampolineSize)
|
OUT PULONG_PTR TrampolineSize)
|
||||||
{
|
{
|
||||||
/* Get trampoline information */
|
/* Get trampoline information */
|
||||||
switch(TrampolineType)
|
switch(TrampolineType)
|
||||||
@@ -56,7 +56,7 @@ AR::ProcSup::GetTrampolineInformation(IN TRAMPOLINE_TYPE TrampolineType,
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::IdentifyProcessor(VOID)
|
AR::ProcessorSupport::IdentifyProcessor(VOID)
|
||||||
{
|
{
|
||||||
PKPROCESSOR_CONTROL_BLOCK Prcb;
|
PKPROCESSOR_CONTROL_BLOCK Prcb;
|
||||||
CPUID_REGISTERS CpuRegisters;
|
CPUID_REGISTERS CpuRegisters;
|
||||||
@@ -130,7 +130,7 @@ AR::ProcSup::IdentifyProcessor(VOID)
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::IdentifyProcessorFeatures(VOID)
|
AR::ProcessorSupport::IdentifyProcessorFeatures(VOID)
|
||||||
{
|
{
|
||||||
ULONG MaxExtendedLeaf, MaxStandardLeaf;
|
ULONG MaxExtendedLeaf, MaxStandardLeaf;
|
||||||
PKPROCESSOR_CONTROL_BLOCK Prcb;
|
PKPROCESSOR_CONTROL_BLOCK Prcb;
|
||||||
@@ -271,7 +271,7 @@ AR::ProcSup::IdentifyProcessorFeatures(VOID)
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::InitializeGdt(IN PKPROCESSOR_BLOCK ProcessorBlock)
|
AR::ProcessorSupport::InitializeGdt(IN PKPROCESSOR_BLOCK ProcessorBlock)
|
||||||
{
|
{
|
||||||
/* Initialize GDT entries */
|
/* Initialize GDT entries */
|
||||||
SetGdtEntry(ProcessorBlock->GdtBase, KGDT_NULL, 0x0, 0x0, KGDT_TYPE_NONE, KGDT_DPL_SYSTEM, 0);
|
SetGdtEntry(ProcessorBlock->GdtBase, KGDT_NULL, 0x0, 0x0, KGDT_TYPE_NONE, KGDT_DPL_SYSTEM, 0);
|
||||||
@@ -302,7 +302,7 @@ AR::ProcSup::InitializeGdt(IN PKPROCESSOR_BLOCK ProcessorBlock)
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::InitializeIdt(IN PKPROCESSOR_BLOCK ProcessorBlock)
|
AR::ProcessorSupport::InitializeIdt(IN PKPROCESSOR_BLOCK ProcessorBlock)
|
||||||
{
|
{
|
||||||
UINT Vector;
|
UINT Vector;
|
||||||
|
|
||||||
@@ -351,7 +351,7 @@ AR::ProcSup::InitializeIdt(IN PKPROCESSOR_BLOCK ProcessorBlock)
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::InitializeProcessor(IN PVOID ProcessorStructures)
|
AR::ProcessorSupport::InitializeProcessor(IN PVOID ProcessorStructures)
|
||||||
{
|
{
|
||||||
KDESCRIPTOR GdtDescriptor, IdtDescriptor;
|
KDESCRIPTOR GdtDescriptor, IdtDescriptor;
|
||||||
PVOID KernelBootStack, KernelFaultStack, KernelNmiStack;
|
PVOID KernelBootStack, KernelFaultStack, KernelNmiStack;
|
||||||
@@ -432,11 +432,11 @@ AR::ProcSup::InitializeProcessor(IN PVOID ProcessorStructures)
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::InitializeProcessorBlock(OUT PKPROCESSOR_BLOCK ProcessorBlock,
|
AR::ProcessorSupport::InitializeProcessorBlock(OUT PKPROCESSOR_BLOCK ProcessorBlock,
|
||||||
IN PKGDTENTRY Gdt,
|
IN PKGDTENTRY Gdt,
|
||||||
IN PKIDTENTRY Idt,
|
IN PKIDTENTRY Idt,
|
||||||
IN PKTSS Tss,
|
IN PKTSS Tss,
|
||||||
IN PVOID DpcStack)
|
IN PVOID DpcStack)
|
||||||
{
|
{
|
||||||
/* Set processor block and processor control block */
|
/* Set processor block and processor control block */
|
||||||
ProcessorBlock->Self = ProcessorBlock;
|
ProcessorBlock->Self = ProcessorBlock;
|
||||||
@@ -478,7 +478,7 @@ AR::ProcSup::InitializeProcessorBlock(OUT PKPROCESSOR_BLOCK ProcessorBlock,
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::InitializeProcessorRegisters(VOID)
|
AR::ProcessorSupport::InitializeProcessorRegisters(VOID)
|
||||||
{
|
{
|
||||||
/* Clear EFLAGS register */
|
/* Clear EFLAGS register */
|
||||||
AR::CpuFunc::WriteEflagsRegister(0);
|
AR::CpuFunc::WriteEflagsRegister(0);
|
||||||
@@ -514,13 +514,13 @@ AR::ProcSup::InitializeProcessorRegisters(VOID)
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::InitializeProcessorStructures(IN PVOID ProcessorStructures,
|
AR::ProcessorSupport::InitializeProcessorStructures(IN PVOID ProcessorStructures,
|
||||||
OUT PKGDTENTRY *Gdt,
|
OUT PKGDTENTRY *Gdt,
|
||||||
OUT PKTSS *Tss,
|
OUT PKTSS *Tss,
|
||||||
OUT PKPROCESSOR_BLOCK *ProcessorBlock,
|
OUT PKPROCESSOR_BLOCK *ProcessorBlock,
|
||||||
OUT PVOID *KernelBootStack,
|
OUT PVOID *KernelBootStack,
|
||||||
OUT PVOID *KernelFaultStack,
|
OUT PVOID *KernelFaultStack,
|
||||||
OUT PVOID *KernelNmiStack)
|
OUT PVOID *KernelNmiStack)
|
||||||
{
|
{
|
||||||
UINT_PTR Address;
|
UINT_PTR Address;
|
||||||
|
|
||||||
@@ -582,7 +582,7 @@ AR::ProcSup::InitializeProcessorStructures(IN PVOID ProcessorStructures,
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::InitializeSegments(VOID)
|
AR::ProcessorSupport::InitializeSegments(VOID)
|
||||||
{
|
{
|
||||||
/* Initialize segments */
|
/* Initialize segments */
|
||||||
AR::CpuFunc::LoadSegment(SEGMENT_CS, KGDT_R0_CODE);
|
AR::CpuFunc::LoadSegment(SEGMENT_CS, KGDT_R0_CODE);
|
||||||
@@ -605,10 +605,10 @@ AR::ProcSup::InitializeSegments(VOID)
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::InitializeTss(IN PKPROCESSOR_BLOCK ProcessorBlock,
|
AR::ProcessorSupport::InitializeTss(IN PKPROCESSOR_BLOCK ProcessorBlock,
|
||||||
IN PVOID KernelBootStack,
|
IN PVOID KernelBootStack,
|
||||||
IN PVOID KernelFaultStack,
|
IN PVOID KernelFaultStack,
|
||||||
IN PVOID KernelNmiStack)
|
IN PVOID KernelNmiStack)
|
||||||
{
|
{
|
||||||
PKGDTENTRY TssEntry;
|
PKGDTENTRY TssEntry;
|
||||||
|
|
||||||
@@ -665,8 +665,8 @@ AR::ProcSup::InitializeTss(IN PKPROCESSOR_BLOCK ProcessorBlock,
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::SetDoubleFaultTssEntry(IN PKPROCESSOR_BLOCK ProcessorBlock,
|
AR::ProcessorSupport::SetDoubleFaultTssEntry(IN PKPROCESSOR_BLOCK ProcessorBlock,
|
||||||
IN PVOID KernelFaultStack)
|
IN PVOID KernelFaultStack)
|
||||||
{
|
{
|
||||||
PKGDTENTRY TaskGateEntry, TssEntry;
|
PKGDTENTRY TaskGateEntry, TssEntry;
|
||||||
PKTSS Tss;
|
PKTSS Tss;
|
||||||
@@ -736,13 +736,13 @@ AR::ProcSup::SetDoubleFaultTssEntry(IN PKPROCESSOR_BLOCK ProcessorBlock,
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::SetGdtEntry(IN PKGDTENTRY Gdt,
|
AR::ProcessorSupport::SetGdtEntry(IN PKGDTENTRY Gdt,
|
||||||
IN USHORT Selector,
|
IN USHORT Selector,
|
||||||
IN ULONG_PTR Base,
|
IN ULONG_PTR Base,
|
||||||
IN ULONG Limit,
|
IN ULONG Limit,
|
||||||
IN UCHAR Type,
|
IN UCHAR Type,
|
||||||
IN UCHAR Dpl,
|
IN UCHAR Dpl,
|
||||||
IN UCHAR SegmentMode)
|
IN UCHAR SegmentMode)
|
||||||
{
|
{
|
||||||
PKGDTENTRY GdtEntry;
|
PKGDTENTRY GdtEntry;
|
||||||
UCHAR Granularity;
|
UCHAR Granularity;
|
||||||
@@ -800,9 +800,9 @@ AR::ProcSup::SetGdtEntry(IN PKGDTENTRY Gdt,
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::SetGdtEntryBase(IN PKGDTENTRY Gdt,
|
AR::ProcessorSupport::SetGdtEntryBase(IN PKGDTENTRY Gdt,
|
||||||
IN USHORT Selector,
|
IN USHORT Selector,
|
||||||
IN ULONG_PTR Base)
|
IN ULONG_PTR Base)
|
||||||
{
|
{
|
||||||
PKGDTENTRY GdtEntry;
|
PKGDTENTRY GdtEntry;
|
||||||
|
|
||||||
@@ -845,13 +845,13 @@ AR::ProcSup::SetGdtEntryBase(IN PKGDTENTRY Gdt,
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::SetIdtGate(IN PKIDTENTRY Idt,
|
AR::ProcessorSupport::SetIdtGate(IN PKIDTENTRY Idt,
|
||||||
IN USHORT Vector,
|
IN USHORT Vector,
|
||||||
IN PVOID Handler,
|
IN PVOID Handler,
|
||||||
IN USHORT Selector,
|
IN USHORT Selector,
|
||||||
IN USHORT Ist,
|
IN USHORT Ist,
|
||||||
IN USHORT Dpl,
|
IN USHORT Dpl,
|
||||||
IN USHORT Type)
|
IN USHORT Type)
|
||||||
{
|
{
|
||||||
/* Set the handler's address */
|
/* Set the handler's address */
|
||||||
Idt[Vector].Offset = (USHORT)((ULONG)Handler & 0xFFFF);
|
Idt[Vector].Offset = (USHORT)((ULONG)Handler & 0xFFFF);
|
||||||
@@ -879,8 +879,8 @@ AR::ProcSup::SetIdtGate(IN PKIDTENTRY Idt,
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
VOID
|
VOID
|
||||||
AR::ProcSup::SetNonMaskableInterruptTssEntry(IN PKPROCESSOR_BLOCK ProcessorBlock,
|
AR::ProcessorSupport::SetNonMaskableInterruptTssEntry(IN PKPROCESSOR_BLOCK ProcessorBlock,
|
||||||
IN PVOID KernelNmiStack)
|
IN PVOID KernelNmiStack)
|
||||||
{
|
{
|
||||||
PKGDTENTRY TaskGateEntry, TssEntry;
|
PKGDTENTRY TaskGateEntry, TssEntry;
|
||||||
PKTSS Tss;
|
PKTSS Tss;
|
||||||
|
|||||||
@@ -205,13 +205,13 @@ HL::Irq::RegisterInterruptHandler(IN ULONG Vector,
|
|||||||
ProcessorBlock = KE::Processor::GetCurrentProcessorBlock();
|
ProcessorBlock = KE::Processor::GetCurrentProcessorBlock();
|
||||||
|
|
||||||
/* Update interrupt handler */
|
/* Update interrupt handler */
|
||||||
AR::ProcSup::SetIdtGate(ProcessorBlock->IdtBase,
|
AR::ProcessorSupport::SetIdtGate(ProcessorBlock->IdtBase,
|
||||||
Vector,
|
Vector,
|
||||||
Handler,
|
Handler,
|
||||||
KGDT_R0_CODE,
|
KGDT_R0_CODE,
|
||||||
0,
|
0,
|
||||||
KIDT_ACCESS_RING0,
|
KIDT_ACCESS_RING0,
|
||||||
AMD64_INTERRUPT_GATE);
|
AMD64_INTERRUPT_GATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -204,13 +204,13 @@ HL::Irq::RegisterInterruptHandler(IN ULONG Vector,
|
|||||||
ProcessorBlock = KE::Processor::GetCurrentProcessorBlock();
|
ProcessorBlock = KE::Processor::GetCurrentProcessorBlock();
|
||||||
|
|
||||||
/* Update interrupt handler */
|
/* Update interrupt handler */
|
||||||
AR::ProcSup::SetIdtGate(ProcessorBlock->IdtBase,
|
AR::ProcessorSupport::SetIdtGate(ProcessorBlock->IdtBase,
|
||||||
Vector,
|
Vector,
|
||||||
Handler,
|
Handler,
|
||||||
KGDT_R0_CODE,
|
KGDT_R0_CODE,
|
||||||
0,
|
0,
|
||||||
KIDT_ACCESS_RING0,
|
KIDT_ACCESS_RING0,
|
||||||
I686_INTERRUPT_GATE);
|
I686_INTERRUPT_GATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ HL::Cpu::StartAllProcessors(VOID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Get trampoline information */
|
/* Get trampoline information */
|
||||||
AR::ProcSup::GetTrampolineInformation(TrampolineApStartup, &TrampolineCode, &TrampolineCodeSize);
|
AR::ProcessorSupport::GetTrampolineInformation(TrampolineApStartup, &TrampolineCode, &TrampolineCodeSize);
|
||||||
|
|
||||||
/* Verify trampoline information */
|
/* Verify trampoline information */
|
||||||
if(TrampolineCode == NULLPTR || TrampolineCodeSize == 0)
|
if(TrampolineCode == NULLPTR || TrampolineCodeSize == 0)
|
||||||
@@ -161,8 +161,8 @@ HL::Cpu::StartAllProcessors(VOID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Get ProcessorBlock and Stack address */
|
/* Get ProcessorBlock and Stack address */
|
||||||
AR::ProcSup::InitializeProcessorStructures(CpuStructures, NULLPTR, NULLPTR, &ProcessorBlock,
|
AR::ProcessorSupport::InitializeProcessorStructures(CpuStructures, NULLPTR, NULLPTR, &ProcessorBlock,
|
||||||
&StartBlock->Stack, NULLPTR, NULLPTR);
|
&StartBlock->Stack, NULLPTR, NULLPTR);
|
||||||
|
|
||||||
/* Set processor number directly in the processor block */
|
/* Set processor number directly in the processor block */
|
||||||
ProcessorBlock->CpuNumber = CpuNumber;
|
ProcessorBlock->CpuNumber = CpuNumber;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
/* Architecture-specific Library */
|
/* Architecture-specific Library */
|
||||||
namespace AR
|
namespace AR
|
||||||
{
|
{
|
||||||
class ProcSup
|
class ProcessorSupport
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
STATIC UCHAR BootStack[KERNEL_STACK_SIZE];
|
STATIC UCHAR BootStack[KERNEL_STACK_SIZE];
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
/* Architecture-specific Library */
|
/* Architecture-specific Library */
|
||||||
namespace AR
|
namespace AR
|
||||||
{
|
{
|
||||||
class ProcSup
|
class ProcessorSupport
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
STATIC UCHAR BootStack[KERNEL_STACK_SIZE];
|
STATIC UCHAR BootStack[KERNEL_STACK_SIZE];
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ KE::KernelInit::BootstrapApplicationProcessor(IN PPROCESSOR_START_BLOCK StartBlo
|
|||||||
PKPROCESSOR_BLOCK ProcessorBlock;
|
PKPROCESSOR_BLOCK ProcessorBlock;
|
||||||
|
|
||||||
/* Initialize application CPU */
|
/* Initialize application CPU */
|
||||||
AR::ProcSup::InitializeProcessor(StartBlock->ProcessorStructures);
|
AR::ProcessorSupport::InitializeProcessor(StartBlock->ProcessorStructures);
|
||||||
|
|
||||||
/* Initialize processor */
|
/* Initialize processor */
|
||||||
HL::Cpu::InitializeProcessor();
|
HL::Cpu::InitializeProcessor();
|
||||||
@@ -96,7 +96,7 @@ KE::KernelInit::BootstrapKernel(VOID)
|
|||||||
|
|
||||||
/* Initialize Idle thread */
|
/* Initialize Idle thread */
|
||||||
KE::KThread::InitializeThread(CurrentProcess, CurrentThread, NULLPTR, NULLPTR, NULLPTR,
|
KE::KThread::InitializeThread(CurrentProcess, CurrentThread, NULLPTR, NULLPTR, NULLPTR,
|
||||||
NULLPTR, NULLPTR, AR::ProcSup::GetBootStack(), TRUE);
|
NULLPTR, NULLPTR, AR::ProcessorSupport::GetBootStack(), TRUE);
|
||||||
CurrentThread->NextProcessor = Prcb->CpuNumber;
|
CurrentThread->NextProcessor = Prcb->CpuNumber;
|
||||||
CurrentThread->Priority = THREAD_HIGH_PRIORITY;
|
CurrentThread->Priority = THREAD_HIGH_PRIORITY;
|
||||||
CurrentThread->State = Running;
|
CurrentThread->State = Running;
|
||||||
@@ -185,7 +185,7 @@ KE::KernelInit::SwitchBootStack(VOID)
|
|||||||
PVOID StartKernel;
|
PVOID StartKernel;
|
||||||
|
|
||||||
/* Calculate the stack pointer at the top of the buffer, ensuring it is properly aligned as required by the ABI */
|
/* Calculate the stack pointer at the top of the buffer, ensuring it is properly aligned as required by the ABI */
|
||||||
Stack = ((ULONG_PTR)AR::ProcSup::GetBootStack() & ~(STACK_ALIGNMENT - 1));
|
Stack = ((ULONG_PTR)AR::ProcessorSupport::GetBootStack() & ~(STACK_ALIGNMENT - 1));
|
||||||
|
|
||||||
/* Get address of KernelInit::StartKernel() */
|
/* Get address of KernelInit::StartKernel() */
|
||||||
StartKernel = (PVOID)KE::KernelInit::BootstrapKernel;
|
StartKernel = (PVOID)KE::KernelInit::BootstrapKernel;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ KE::KernelInit::BootstrapApplicationProcessor(IN PPROCESSOR_START_BLOCK StartBlo
|
|||||||
PKPROCESSOR_BLOCK ProcessorBlock;
|
PKPROCESSOR_BLOCK ProcessorBlock;
|
||||||
|
|
||||||
/* Initialize application CPU */
|
/* Initialize application CPU */
|
||||||
AR::ProcSup::InitializeProcessor(StartBlock->ProcessorStructures);
|
AR::ProcessorSupport::InitializeProcessor(StartBlock->ProcessorStructures);
|
||||||
|
|
||||||
/* Initialize processor */
|
/* Initialize processor */
|
||||||
HL::Cpu::InitializeProcessor();
|
HL::Cpu::InitializeProcessor();
|
||||||
@@ -96,7 +96,7 @@ KE::KernelInit::BootstrapKernel(VOID)
|
|||||||
|
|
||||||
/* Initialize Idle thread */
|
/* Initialize Idle thread */
|
||||||
KE::KThread::InitializeThread(CurrentProcess, CurrentThread, NULLPTR, NULLPTR, NULLPTR,
|
KE::KThread::InitializeThread(CurrentProcess, CurrentThread, NULLPTR, NULLPTR, NULLPTR,
|
||||||
NULLPTR, NULLPTR, AR::ProcSup::GetBootStack(), TRUE);
|
NULLPTR, NULLPTR, AR::ProcessorSupport::GetBootStack(), TRUE);
|
||||||
CurrentThread->NextProcessor = Prcb->CpuNumber;
|
CurrentThread->NextProcessor = Prcb->CpuNumber;
|
||||||
CurrentThread->Priority = THREAD_HIGH_PRIORITY;
|
CurrentThread->Priority = THREAD_HIGH_PRIORITY;
|
||||||
CurrentThread->State = Running;
|
CurrentThread->State = Running;
|
||||||
@@ -185,7 +185,7 @@ KE::KernelInit::SwitchBootStack(VOID)
|
|||||||
PVOID StartKernel;
|
PVOID StartKernel;
|
||||||
|
|
||||||
/* Calculate the stack pointer at the top of the buffer, ensuring it is properly aligned as required by the ABI */
|
/* Calculate the stack pointer at the top of the buffer, ensuring it is properly aligned as required by the ABI */
|
||||||
Stack = ((ULONG_PTR)AR::ProcSup::GetBootStack() & ~(STACK_ALIGNMENT - 1));
|
Stack = ((ULONG_PTR)AR::ProcessorSupport::GetBootStack() & ~(STACK_ALIGNMENT - 1));
|
||||||
|
|
||||||
/* Get address of KernelInit::StartKernel() */
|
/* Get address of KernelInit::StartKernel() */
|
||||||
StartKernel = (PVOID)KE::KernelInit::BootstrapKernel;
|
StartKernel = (PVOID)KE::KernelInit::BootstrapKernel;
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ KeStartXtSystem(IN PKERNEL_INITIALIZATION_BLOCK Parameters)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize boot CPU and set the unhandled interrupt routine */
|
/* Initialize boot CPU and set the unhandled interrupt routine */
|
||||||
AR::ProcSup::InitializeProcessor(NULLPTR);
|
AR::ProcessorSupport::InitializeProcessor(NULLPTR);
|
||||||
AR::Traps::SetUnhandledInterruptRoutine(HL::Irq::HandleUnexpectedInterrupt);
|
AR::Traps::SetUnhandledInterruptRoutine(HL::Irq::HandleUnexpectedInterrupt);
|
||||||
|
|
||||||
/* Initialize system resources */
|
/* Initialize system resources */
|
||||||
|
|||||||
Reference in New Issue
Block a user