mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:47:47 +00:00
Kernel/PCI: Simplify detect_optimal_access_type function
Instead of getting the kernel commandline argument as function parameter we just take internally in the function.
This commit is contained in:
parent
79522db5d0
commit
ca32ee5714
1 changed files with 3 additions and 4 deletions
|
@ -19,8 +19,9 @@ namespace PCI {
|
||||||
|
|
||||||
static bool test_pci_io();
|
static bool test_pci_io();
|
||||||
|
|
||||||
UNMAP_AFTER_INIT static PCIAccessLevel detect_optimal_access_type(PCIAccessLevel boot_determined)
|
UNMAP_AFTER_INIT static PCIAccessLevel detect_optimal_access_type()
|
||||||
{
|
{
|
||||||
|
auto boot_determined = kernel_command_line().pci_access_level();
|
||||||
if (!ACPI::is_enabled() || !ACPI::Parser::the()->find_table("MCFG").has_value())
|
if (!ACPI::is_enabled() || !ACPI::Parser::the()->find_table("MCFG").has_value())
|
||||||
return PCIAccessLevel::IOAddressing;
|
return PCIAccessLevel::IOAddressing;
|
||||||
|
|
||||||
|
@ -35,9 +36,7 @@ UNMAP_AFTER_INIT static PCIAccessLevel detect_optimal_access_type(PCIAccessLevel
|
||||||
|
|
||||||
UNMAP_AFTER_INIT void initialize()
|
UNMAP_AFTER_INIT void initialize()
|
||||||
{
|
{
|
||||||
auto boot_determined = kernel_command_line().pci_access_level();
|
switch (detect_optimal_access_type()) {
|
||||||
|
|
||||||
switch (detect_optimal_access_type(boot_determined)) {
|
|
||||||
case PCIAccessLevel::MemoryAddressing: {
|
case PCIAccessLevel::MemoryAddressing: {
|
||||||
auto mcfg = ACPI::Parser::the()->find_table("MCFG");
|
auto mcfg = ACPI::Parser::the()->find_table("MCFG");
|
||||||
VERIFY(mcfg.has_value());
|
VERIFY(mcfg.has_value());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue