diff --git a/repos/base/run/platform_drv.inc b/repos/base/run/platform_drv.inc index 481c707de1..d9fb37c63f 100644 --- a/repos/base/run/platform_drv.inc +++ b/repos/base/run/platform_drv.inc @@ -64,12 +64,26 @@ proc audio_drv_binary { } { return no_audio_drv_available } +proc acpi_drv_name { } { + global use_acpica_as_acpi_drv + if {[info exists use_acpica_as_acpi_drv] && $use_acpica_as_acpi_drv} { + return acpica } + + return acpi_drv +} proc platform_drv_build_components {} { set drv_build_components "" lappend_if [have_platform_drv] drv_build_components drivers/platform - lappend_if [have_spec x86] drv_build_components drivers/acpi lappend_if [have_spec x86] drv_build_components server/report_rom + if {[have_spec x86]} { + if {[acpi_drv_name] eq "acpi_drv"} { + lappend drv_build_components drivers/acpi + } + if {[acpi_drv_name] eq "acpica"} { + lappend drv_build_components app/acpica + } + } return $drv_build_components } @@ -88,7 +102,7 @@ proc platform_drv_boot_modules {} { if {[have_spec muen]} { lappend drv_boot_modules acpi } else { - lappend drv_boot_modules acpi_drv + lappend drv_boot_modules [acpi_drv_name] } } @@ -103,8 +117,18 @@ proc append_platform_drv_boot_modules {} { proc platform_drv_policy {} { - if ([have_spec x86]) { - return { + if (![have_spec x86]) { + return {} + } + + set drv_policy "" + + if {[acpi_drv_name] eq "acpica"} { + append drv_policy { + } + } + + append drv_policy { @@ -118,17 +142,17 @@ proc platform_drv_policy {} { } - } else { - return {} - } + + return $drv_policy } proc platform_drv_priority {} { return "" } proc platform_drv_add_routing {} { - if {[have_spec x86]} { + + if {[acpi_drv_name] eq "acpica"} { return { - } + } } return "" @@ -136,6 +160,11 @@ proc platform_drv_add_routing {} { proc platform_drv_config_config {} { + if {[acpi_drv_name] eq "acpica"} { + return { + } + } + if {[have_spec acpi] || [have_spec arm] || [have_spec muen]} { return { } @@ -153,14 +182,34 @@ proc platform_drv_config {} { append drv_config { - + } + + if {[acpi_drv_name] eq "acpica"} { + append drv_config { + + } + } else { + append drv_config { + } + } + + append drv_config { - + } + + append_if [expr {[acpi_drv_name] eq "acpica"}] drv_config { + + + + + } + + append drv_config { @@ -177,7 +226,12 @@ proc platform_drv_config {} { - + } + + append_if [expr {[acpi_drv_name] eq "acpica"}] drv_config { + } + + append drv_config { diff --git a/repos/libports/run/acpica.run b/repos/libports/run/acpica.run index 1845f93775..fe2514d1fb 100644 --- a/repos/libports/run/acpica.run +++ b/repos/libports/run/acpica.run @@ -21,26 +21,30 @@ set build_components { test/input } +set use_acpica_as_acpi_drv 0 + source ${genode_dir}/repos/base/run/platform_drv.inc -# override default platform driver policy -proc platform_drv_policy {} { - return { - - } -} +if {!$use_acpica_as_acpi_drv} { -# add routing information to dynamically generate change of 'system' ROM -proc platform_drv_add_routing {} { - return { - - } -} + # override default platform driver policy + proc platform_drv_policy {} { + return { + + } + } -# override default config to react on 'system' ROM changes for reset -proc platform_drv_config_config {} { - return { - } + # add routing information + proc platform_drv_add_routing {} { + return { + } + } + + # override default config to react on 'acpi_ready' ROM change + proc platform_drv_config_config {} { + return { + } + } } append_platform_drv_build_components @@ -68,15 +72,12 @@ set config { - - - - + } + +append_if [expr !$use_acpica_as_acpi_drv] config { + + - @@ -218,4 +219,4 @@ build_boot_image $boot_modules append qemu_args "-nographic " -run_genode_until {\[init -\> acpica\].*SCI IRQ:.*\n} 30 +run_genode_until {\[init -\> acpi.*SCI IRQ:.*\n} 30 diff --git a/repos/os/run/pci.run b/repos/os/run/pci.run index 266a2730e9..35664f7ac4 100644 --- a/repos/os/run/pci.run +++ b/repos/os/run/pci.run @@ -4,12 +4,22 @@ assert_spec pci # set build_components { core init test/pci } +set use_acpica_as_acpi_drv 0 + source ${genode_dir}/repos/base/run/platform_drv.inc # override default platform driver policy proc platform_drv_policy {} { - return { + global use_acpica_as_acpi_drv + set policy "" + + append_if $use_acpica_as_acpi_drv policy { + } + + append policy { } + + return $policy } append_platform_drv_build_components