genode/repos/libports/run/acpica.run
Norman Feske 9662d89cfb Replace input filter with event filter
This commit applies the transition from the "Input" session to the "Event"
session to the event-filtering mechansim. The functionality of the
input_filter is now provided by the event_filter. The event filter
requests only one "Event" session as destination for the filter result,
which is usually routed to the nitpicker GUI server. It provides an
"Event" service to which any number of event sources can connect.

The configuration of the filter chain remains almost the same. Only the
declaration of the <input> nodes is no longer needed. Instead, the
configuration must specify <policy> nodes, which define the mapping of
"Event" clients (event sources) to the inputs used in the filter chain.

The patch adjusts all uses of the nitpicker GUI server accordingly such
that the event filter reports events to nitpicker's event service
instead of having nitpicker request an "Input" session. This dissolves
the dependency of nitpicker from input drivers.

Issue #3827
2020-08-25 11:49:43 +02:00

252 lines
6.9 KiB
Plaintext

assert_spec acpi
if {
![have_spec hw] &&
![have_spec nova] &&
![have_spec sel4]
} {
puts "Platform is unsupported."
exit 0
}
set build_components {
core init timer
drivers/input
server/acpi_input
server/dynamic_rom
server/event_filter
server/report_rom
server/event_dump
app/acpica
app/input_event_client
}
set use_acpica_as_acpi_drv 0
source ${genode_dir}/repos/base/run/platform_drv.inc
if {!$use_acpica_as_acpi_drv} {
# override default platform driver policy
proc platform_drv_policy {} {
return {
<policy label_prefix="ps2_drv"> <device name="PS2"/> </policy>
<policy label_prefix="acpica"> <pci class="ALL"/> </policy>}
}
# add routing information
proc platform_drv_add_routing {} {
return {
<service name="ROM" label="acpi_ready"> <child name="acpi_state"/> </service>}
}
# override default config to react on 'acpi_ready' ROM change
proc platform_drv_config_config {} {
return {
<config acpi_ready="yes">}
}
}
append_platform_drv_build_components
build $build_components
create_boot_directory
set config {
<config>
<parent-provides>
<service name="IRQ"/>
<service name="ROM"/>
<service name="LOG"/>
<service name="RM"/>
<service name="PD"/>
<service name="CPU"/>
<service name="IO_MEM" />
<service name="IO_PORT" />
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="2M"/>
<provides><service name="Timer"/></provides>
</start>}
append_if [expr !$use_acpica_as_acpi_drv] config {
<start name="acpica" caps="150">
<resource name="RAM" quantum="5M"/>
<config ld_verbose="yes" reset="no" poweroff="no" report="yes" acpi_ready="yes">
</config>
<route>
<service name="ROM" label="system"> <child name="dynamic_rom"/> </service>
<service name="Report"> <child name="acpi_state"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>}
append config {
<start name="acpi_state">
<binary name="report_rom"/>
<resource name="RAM" quantum="2M"/>
<provides>
<service name="ROM" />
<service name="Report" />
</provides>
<config verbose="yes">
<policy label="platform_drv -> acpi_ready" report="acpica -> acpi_ready"/>
<policy label="acpi_input -> acpi_ac" report="acpica -> acpi_ac"/>
<policy label="acpi_input -> acpi_battery" report="acpica -> acpi_battery"/>
<policy label="acpi_input -> acpi_ec" report="acpica -> acpi_ec"/>
<policy label="acpi_input -> acpi_fixed" report="acpica -> acpi_fixed"/>
<policy label="acpi_input -> acpi_lid" report="acpica -> acpi_lid"/>
</config>
<route>
<any-service> <parent/> </any-service>
</route>
</start>}
append config {
<start name="dynamic_rom">
<resource name="RAM" quantum="4M"/>
<provides><service name="ROM"/></provides>
<config verbose="yes">
<rom name="system">
<inline description="set system state to 'normal'">
<system state="normal"/>
</inline>
<sleep milliseconds="5000" />
<inline description="set system state to 'reset'">
<system state="reset"/>
</inline>
<!--
<inline description="set system state to 'poweroff'">
<system state="poweroff"/>
</inline>
-->
<sleep milliseconds="500" />
</rom>
</config>
</start>}
append config {
<start name="event_filter">
<resource name="RAM" quantum="1M" />
<provides> <service name="Event" /> </provides>
<config>
<output>
<merge>
<input name="ps2"/>
<input name="acpi"/>
</merge>
</output>
<policy label="ps2" input="ps2"/>
<policy label="acpi" input="acpi"/>
</config>
<route>
<service name="Event"> <child name="event_dump" /> </service>
<any-service> <parent/> </any-service>
</route>
</start>}
append config {
<start name="ps2_drv">
<resource name="RAM" quantum="2M"/>
<provides><service name="Input"/></provides>
<config verbose_keyboard="no" verbose_mouse="no" verbose_scancodes="no"/>
<route>
<service name="Platform"> <child name="platform_drv"/> </service>
<service name="Timer"> <child name="timer"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="ps2" caps="90">
<resource name="RAM" quantum="1M"/>
<binary name="input_event_client"/>
<config/>
<route>
<service name="Event"> <child name="event_filter" label="ps2"/> </service>
<service name="Input"> <child name="ps2_drv"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="event_dump">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Event"/> </provides>
<route>
<service name="Timer"> <child name="timer"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>}
append config {
<start name="acpi" caps="90">
<resource name="RAM" quantum="1M"/>
<binary name="input_event_client"/>
<config/>
<route>
<service name="Event"> <child name="event_filter" label="acpi"/> </service>
<service name="Input"> <child name="acpi_input"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="acpi_input">
<resource name="RAM" quantum="1M"/>
<provides><service name="Input"/></provides>
<config>
<!-- example mapping - adapt to your target notebook !!! -->
<!-- as="PRESS_RELEASE" is default if nothing specified -->
<map acpi="ec" value="25" to_key="KEY_VENDOR"/>
<map acpi="ec" value="20" to_key="KEY_BRIGHTNESSUP"/>
<map acpi="ec" value="21" to_key="KEY_BRIGHTNESSDOWN"/>
<map acpi="fixed" value="0" to_key="KEY_POWER" as="PRESS_RELEASE"/>
<map acpi="lid" value="CLOSED" to_key="KEY_SLEEP" as="PRESS"/>
<map acpi="lid" value="OPEN" to_key="KEY_SLEEP" as="RELEASE"/>
<map acpi="ac" value="ONLINE" to_key="KEY_WAKEUP"/>
<map acpi="ac" value="OFFLINE" to_key="KEY_SLEEP"/>
<map acpi="battery" value="0" to_key="KEY_BATTERY"/>
</config>
<route>
<service name="ROM" label="acpi_ac"> <child name="acpi_state"/> </service>
<service name="ROM" label="acpi_battery"> <child name="acpi_state"/> </service>
<service name="ROM" label="acpi_ec"> <child name="acpi_state"/> </service>
<service name="ROM" label="acpi_fixed"> <child name="acpi_state"/> </service>
<service name="ROM" label="acpi_lid"> <child name="acpi_state"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>}
append_platform_drv_config
append config {
</config>
}
install_config $config
set boot_modules {
core init
ld.lib.so
timer
ps2_drv
event_filter
report_rom
dynamic_rom
acpica
acpi_input
event_dump
input_event_client
}
append_platform_drv_boot_modules
build_boot_image $boot_modules
append qemu_args "-nographic "
run_genode_until {\[init -\> acpi.*SCI IRQ:.*\n} 30