Fix for SIMD not being initialized

This commit is contained in:
Alex 2023-03-14 06:23:57 +02:00
parent f54b46149d
commit 855384aead
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD
3 changed files with 17 additions and 14 deletions

View File

@ -218,8 +218,11 @@ namespace CPU
SSESupport = true; SSESupport = true;
} }
if (!Config.SIMD) if (Config.SIMD == false)
{
debug("Disabling SSE support...");
SSESupport = false; SSESupport = false;
}
if (PGESupport) if (PGESupport)
{ {

View File

@ -378,21 +378,21 @@ ParseSuccess:
case 'o': case 'o':
{ {
value = cag_option_get_value(&context); value = cag_option_get_value(&context);
strcmp(value, "true") ? config.InterruptsOnCrash = false : config.InterruptsOnCrash = true; strcmp(value, "true") == 0 ? config.InterruptsOnCrash = true : config.InterruptsOnCrash = false;
KPrint("\eAAFFAAInterrupts on crash: %s", value); KPrint("\eAAFFAAInterrupts on crash: %s", value);
break; break;
} }
case 'l': case 'l':
{ {
value = cag_option_get_value(&context); value = cag_option_get_value(&context);
strcmp(value, "true") ? config.UnlockDeadLock = false : config.UnlockDeadLock = true; strcmp(value, "true") == 0 ? config.UnlockDeadLock = true : config.UnlockDeadLock = false;
KPrint("\eAAFFAAUnlocking the deadlock after 10 retries"); KPrint("\eAAFFAAUnlocking the deadlock after 10 retries");
break; break;
} }
case 's': case 's':
{ {
value = cag_option_get_value(&context); value = cag_option_get_value(&context);
strcmp(value, "true") ? config.SIMD = false : config.SIMD = true; strcmp(value, "true") == 0 ? config.SIMD = true : config.SIMD = false;
KPrint("\eAAFFAASingle Instruction, Multiple Data (SIMD): %s", value); KPrint("\eAAFFAASingle Instruction, Multiple Data (SIMD): %s", value);
break; break;
} }

View File

@ -182,6 +182,8 @@ EXTERNC NIF void Main(BootInfo *Info)
KPrint("CPU: \e8822AA%s \e8888FF%s (\e058C19%s\e8888FF)", CPU::Vendor(), CPU::Name(), CPU::Hypervisor()); KPrint("CPU: \e8822AA%s \e8888FF%s (\e058C19%s\e8888FF)", CPU::Vendor(), CPU::Name(), CPU::Hypervisor());
KPrint("Initializing GDT and IDT"); KPrint("Initializing GDT and IDT");
Interrupts::Initialize(0); Interrupts::Initialize(0);
KPrint("Reading Kernel Parameters");
Config = ParseConfig((char *)bInfo->Kernel.CommandLine);
KPrint("Initializing CPU Features"); KPrint("Initializing CPU Features");
CPU::InitializeFeatures(0); CPU::InitializeFeatures(0);
@ -193,8 +195,6 @@ EXTERNC NIF void Main(BootInfo *Info)
KPrint("Loading Kernel Symbols"); KPrint("Loading Kernel Symbols");
KernelSymbolTable = new SymbolResolver::Symbols((uintptr_t)Info->Kernel.FileBase); KernelSymbolTable = new SymbolResolver::Symbols((uintptr_t)Info->Kernel.FileBase);
KPrint("Reading Kernel Parameters");
Config = ParseConfig((char *)bInfo->Kernel.CommandLine);
KPrint("Initializing Power Manager"); KPrint("Initializing Power Manager");
PowerManager = new Power::Power; PowerManager = new Power::Power;
KPrint("Initializing PCI Manager"); KPrint("Initializing PCI Manager");
@ -380,17 +380,17 @@ EXTERNC __no_stack_protector NIF void BeforeShutdown()
/* TODO: Announce shutdown */ /* TODO: Announce shutdown */
trace("\n\n\n#################### SYSTEM SHUTTING DOWN ####################\n\n"); trace("\n\n\n#################### SYSTEM SHUTTING DOWN ####################\n\n");
delete NIManager; delete NIManager, NIManager = nullptr;
delete DiskManager; delete DiskManager, DiskManager = nullptr;
delete DriverManager; delete DriverManager, DriverManager = nullptr;
TaskManager->SignalShutdown(); TaskManager->SignalShutdown();
delete TaskManager; delete TaskManager, TaskManager = nullptr;
if (RecoveryScreen) if (RecoveryScreen)
delete RecoveryScreen; delete RecoveryScreen, RecoveryScreen = nullptr;
delete vfs; delete vfs, vfs = nullptr;
delete TimeManager; delete TimeManager, TimeManager = nullptr;
delete Display; delete Display, Display = nullptr;
// PowerManager should not be called // PowerManager should not be called
// https://wiki.osdev.org/Calling_Global_Constructors // https://wiki.osdev.org/Calling_Global_Constructors