From c6e8efa22e0931f63e987b04b9cd6200943849a6 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 13 Mar 2023 23:59:55 +0200 Subject: [PATCH] Added SIMD option in kernel arguments --- Core/CPU.cpp | 3 +++ KConfig.cpp | 14 ++++++++++++++ include/kconfig.hpp | 1 + 3 files changed, 18 insertions(+) diff --git a/Core/CPU.cpp b/Core/CPU.cpp index 1b4705b..ad75a03 100644 --- a/Core/CPU.cpp +++ b/Core/CPU.cpp @@ -218,6 +218,9 @@ namespace CPU SSESupport = true; } + if (!Config.SIMD) + SSESupport = false; + if (PGESupport) { debug("Enabling global pages support..."); diff --git a/KConfig.cpp b/KConfig.cpp index 0082208..730472b 100644 --- a/KConfig.cpp +++ b/KConfig.cpp @@ -72,6 +72,12 @@ static struct cag_option ConfigOptions[] = { .value_name = "BOOL", .description = "Enable Interrupts On Crash. If enabled, the navigation keys will be enabled on crash"}, + {.identifier = 's', + .access_letters = NULL, + .access_name = "simd", + .value_name = "BOOL", + .description = "Enable SIMD instructions"}, + {.identifier = 'h', .access_letters = "h", .access_name = "help", @@ -90,6 +96,7 @@ KernelConfig ParseConfig(char *Config) true, 0, 0, + false, false}; if (Config == NULL) @@ -382,6 +389,13 @@ ParseSuccess: KPrint("\eAAFFAAUnlocking the deadlock after 10 retries"); break; } + case 's': + { + value = cag_option_get_value(&context); + strcmp(value, "true") ? config.SIMD = false : config.SIMD = true; + KPrint("\eAAFFAASingle Instruction, Multiple Data (SIMD): %s", value); + break; + } case 'h': { KPrint("\n---------------------------------------------------------------------------\nUsage: kernel.fsys [OPTION]...\nKernel configuration."); diff --git a/include/kconfig.hpp b/include/kconfig.hpp index e78c222..0a979a9 100644 --- a/include/kconfig.hpp +++ b/include/kconfig.hpp @@ -14,6 +14,7 @@ struct KernelConfig int Cores; int IOAPICInterruptCore; bool UnlockDeadLock; + bool SIMD; }; KernelConfig ParseConfig(char *Config);