Migrate HL subsystem to C++
All checks were successful
Builds / ExectOS (amd64, release) (push) Successful in 28s
Builds / ExectOS (amd64, debug) (push) Successful in 30s
Builds / ExectOS (i686, debug) (push) Successful in 29s
Builds / ExectOS (i686, release) (push) Successful in 27s

This commit is contained in:
2025-09-13 19:15:13 +02:00
parent a2fe39defd
commit 4592955da1
41 changed files with 1279 additions and 795 deletions

47
xtoskrnl/hl/x86/cpu.cc Normal file
View File

@@ -0,0 +1,47 @@
/**
* PROJECT: ExectOS
* COPYRIGHT: See COPYING.md in the top level directory
* FILE: xtoskrnl/hl/x86/cpu.cc
* DESCRIPTION: HAL x86 (i686/AMD64) processor support
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
*/
#include <xtos.hh>
/**
* Initializes the processor.
*
* @param CpuNumber
* Supplies the number of the CPU, that is being initialized.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTAPI
VOID
HL::Cpu::InitializeProcessor(VOID)
{
PKPROCESSOR_BLOCK ProcessorBlock;
KAFFINITY Affinity;
/* Get current processor block */
ProcessorBlock = KE::Processor::GetCurrentProcessorBlock();
/* Set initial stall factor, CPU number and mask interrupts */
ProcessorBlock->StallScaleFactor = INITIAL_STALL_FACTOR;
ProcessorBlock->Idr = 0xFFFFFFFF;
/* Set processor affinity */
Affinity = (KAFFINITY) 1 << ProcessorBlock->CpuNumber;
/* Apply affinity to a set of processors */
ActiveProcessors |= Affinity;
/* Initialize APIC for this processor */
Pic::InitializePic();
/* Set the APIC running level */
HL::RunLevel::SetRunLevel(KeGetCurrentProcessorBlock()->RunLevel);
}