summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2020-02-05 21:07:12 +0200
committerAndreas Kling <kling@serenityos.org>2020-02-05 23:01:41 +0100
commit0bce5f7403f40b4dfc5e759cd079d0de6463980d (patch)
treef997f4b35682e0bc5b5018a9e9ed04cb1727abf6
parent8a412564974cb54d22eb170427657be71526f3b1 (diff)
downloadserenity-0bce5f7403f40b4dfc5e759cd079d0de6463980d.zip
Kernel Commandline: Change nopci_mmio to be pci_mmio
Instead of having nopci_mmio, the boot argument now is pci_mmio='on|off'.
-rw-r--r--Kernel/init.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/Kernel/init.cpp b/Kernel/init.cpp
index b201f939a1..0d8a832922 100644
--- a/Kernel/init.cpp
+++ b/Kernel/init.cpp
@@ -76,6 +76,7 @@
static void setup_serial_debug();
static void setup_acpi();
static void setup_vmmouse();
+static void setup_pci();
VirtualConsole* tty0;
@@ -142,8 +143,7 @@ extern "C" [[noreturn]] void init()
// Sample test to see if the ACPI parser is working...
kprintf("ACPI: HPET table @ P 0x%x\n", ACPIParser::the().find_table("HPET"));
- PCI::Initializer::the().test_and_initialize(KParams::the().has("nopci_mmio"));
- PCI::Initializer::the().dismiss();
+ setup_pci();
PIT::initialize();
@@ -437,3 +437,22 @@ void setup_vmmouse()
kprintf("vmmouse boot argmuent has an invalid value.\n");
hang();
}
+
+void setup_pci()
+{
+ if (!KParams::the().has("pci_mmio")) {
+ PCI::Initializer::the().test_and_initialize(false);
+ PCI::Initializer::the().dismiss();
+ return;
+ }
+ auto pci_mmio = KParams::the().get("pci_mmio");
+ if (pci_mmio == "on") {
+ PCI::Initializer::the().test_and_initialize(false);
+ } else if (pci_mmio == "off") {
+ PCI::Initializer::the().test_and_initialize(true);
+ } else {
+ kprintf("pci_mmio boot argmuent has an invalid value.\n");
+ hang();
+ }
+ PCI::Initializer::the().dismiss();
+}