From 840f383e468f71df41e0fd8076b334aa852e5430 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 22 Apr 2020 16:15:56 +0200 Subject: [PATCH] Remove input_merger component Fixes #3736 --- doc/components.txt | 6 +- repos/libports/run/acpica.run | 14 +- repos/os/src/server/input_merger/README | 25 ---- repos/os/src/server/input_merger/main.cc | 141 --------------------- repos/os/src/server/input_merger/target.mk | 3 - repos/ports/run/vbox_share.inc | 23 +++- repos/ports/run/vbox_win.inc | 21 ++- repos/ports/run/virtualbox_nic_router.run | 14 +- 8 files changed, 54 insertions(+), 193 deletions(-) delete mode 100644 repos/os/src/server/input_merger/README delete mode 100644 repos/os/src/server/input_merger/main.cc delete mode 100644 repos/os/src/server/input_merger/target.mk diff --git a/doc/components.txt b/doc/components.txt index 3fb7b3a5d..9e78068f9 100644 --- a/doc/components.txt +++ b/doc/components.txt @@ -463,9 +463,9 @@ Separate components: by providing an encrypted connection to a remote host. It is plugged between NIC server (such as a network driver) and NIC client. -:'os/src/server/input_merger': - A component that merges input events from multiple sources into a single - stream. +:'os/src/server/input_filter': + A component that transforms and merges input events from multiple sources + into a single stream. :'libports/src/server/acpi_input': A component that transforms ACPI events into Genode input events. diff --git a/repos/libports/run/acpica.run b/repos/libports/run/acpica.run index 89fe19e42..dc0c9d0b6 100644 --- a/repos/libports/run/acpica.run +++ b/repos/libports/run/acpica.run @@ -14,7 +14,7 @@ set build_components { drivers/input server/acpi_input server/dynamic_rom - server/input_merger + server/input_filter server/report_rom app/acpica test/input @@ -130,12 +130,18 @@ append config { } append config { - + + + + + + + @@ -159,7 +165,7 @@ append config { - + @@ -205,7 +211,7 @@ set boot_modules { ld.lib.so timer ps2_drv - input_merger + input_filter report_rom dynamic_rom acpica diff --git a/repos/os/src/server/input_merger/README b/repos/os/src/server/input_merger/README deleted file mode 100644 index 71c768185..000000000 --- a/repos/os/src/server/input_merger/README +++ /dev/null @@ -1,25 +0,0 @@ -This component merges the input events of multiple sources. - -Example configuration: - - - - - - - - - - - - - - - - - - - -For each 'input' config node, the component opens an 'Input' session with the -configured label. This label is then evaluated by 'init' to route the session -request to a specific input source component. diff --git a/repos/os/src/server/input_merger/main.cc b/repos/os/src/server/input_merger/main.cc deleted file mode 100644 index 0d1146de8..000000000 --- a/repos/os/src/server/input_merger/main.cc +++ /dev/null @@ -1,141 +0,0 @@ -/* - * \brief Input event merger - * \author Christian Prochaska - * \date 2014-09-29 - */ - -/* - * Copyright (C) 2014-2017 Genode Labs GmbH - * - * This file is part of the Genode OS framework, which is distributed - * under the terms of the GNU Affero General Public License version 3. - */ - -/* Genode includes */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -namespace Input_merger -{ - using namespace Genode; - - struct Input_source; - struct Main; - - typedef List Input_sources; - typedef String Label; -} - - -struct Input_merger::Input_source : Input_sources::Element -{ - Input::Connection conn; - Input::Session_component &sink; - - Genode::Signal_handler event_handler; - - void handle_events() - { - conn.for_each_event([&] (Input::Event const &e) { sink.submit(e); }); - } - - Input_source(Genode::Env &env, Label const &label, Input::Session_component &sink) - : - conn(env, label.string()), sink(sink), - event_handler(env.ep(), *this, &Input_source::handle_events) - { - conn.sigh(event_handler); - } -}; - - -/****************** - ** Main program ** - ******************/ - -struct Input_merger::Main -{ - Env &env; - - Attached_rom_dataspace config_rom { env, "config" }; - - Heap heap { env.ram(), env.rm() }; - - Input_sources input_source_list { }; - - /* - * Input session provided to our client - */ - Input::Session_component input_session_component { env, env.ram() }; - - /* - * Attach root interface to the entry point - */ - Static_root input_root { env.ep().manage(input_session_component) }; - - void handle_config_update() - { - config_rom.update(); - - while (Input_source *input_source = input_source_list.first()) { - input_source_list.remove(input_source); - destroy(heap, input_source); - } - - config_rom.xml().for_each_sub_node("input", [&] (Xml_node input_node) { - try { - Label label = input_node.attribute_value("label", Label()); - - try { - Input_source *input_source = new (heap) - Input_source(env, label.string(), input_session_component); - - input_source_list.insert(input_source); - - } catch (Genode::Service_denied) { - error("parent denied input source '", label, "'"); - } - } catch (Xml_node::Nonexistent_attribute) { - error("ignoring invalid input node '", input_node); - } - }); - } - - Signal_handler
config_update_handler - { env.ep(), *this, &Main::handle_config_update }; - - /** - * Constructor - */ - Main(Genode::Env &env) : env(env) - { - input_session_component.event_queue().enabled(true); - - /* - * Apply initial configuration - */ - handle_config_update(); - - /* - * Register signal handler - */ - config_rom.sigh(config_update_handler); - - /* - * Announce service - */ - env.parent().announce(env.ep().manage(input_root)); - } - -}; - - -void Component::construct(Genode::Env &env) { static Input_merger::Main inst(env); } diff --git a/repos/os/src/server/input_merger/target.mk b/repos/os/src/server/input_merger/target.mk deleted file mode 100644 index 03b068334..000000000 --- a/repos/os/src/server/input_merger/target.mk +++ /dev/null @@ -1,3 +0,0 @@ -TARGET = input_merger -SRC_CC = main.cc -LIBS = base diff --git a/repos/ports/run/vbox_share.inc b/repos/ports/run/vbox_share.inc index 08a8d2ac3..ad904774e 100644 --- a/repos/ports/run/vbox_share.inc +++ b/repos/ports/run/vbox_share.inc @@ -102,7 +102,7 @@ catch { exec dd if=/dev/urandom of=bin/test.bin bs=4096 count=8160 } # Step 1: prepare and start the actual VM # set build_components { - server/input_merger + server/input_filter server/report_rom server/fs_rom server/vfs server/tcp_terminal drivers/nic lib/vfs/lwip lib/vfs/pipe lib/vfs/import @@ -118,7 +118,7 @@ set boot_modules { vfs fs_rom posix.lib.so bash.tar coreutils.tar tcp_terminal vfs_lwip.lib.so vfs_pipe.lib.so vfs_import.lib.so - ipxe_nic_drv report_rom input_merger + ipxe_nic_drv report_rom input_filter test.bin template.bat } @@ -245,17 +245,26 @@ set config_of_app { - + } append_if [expr $use_ps2] config_of_app { - } + } append_if [expr $use_usb] config_of_app { - } + } append config_of_app { + + } +append_if [expr $use_ps2] config_of_app { + } +append_if [expr $use_usb] config_of_app { + } +append config_of_app { + + } append_if [expr $use_ps2] config_of_app { @@ -272,7 +281,7 @@ append config_of_app { - + @@ -337,7 +346,7 @@ append config_of_app { - + diff --git a/repos/ports/run/vbox_win.inc b/repos/ports/run/vbox_win.inc index 2ac14230c..f57ca453d 100644 --- a/repos/ports/run/vbox_win.inc +++ b/repos/ports/run/vbox_win.inc @@ -25,7 +25,7 @@ if {[info exists flavor_extension]} { } set build_components { - server/input_merger + server/input_filter drivers/nic drivers/audio server/report_rom @@ -33,7 +33,7 @@ set build_components { } set boot_modules { - input_merger + input_filter ipxe_nic_drv audio_drv report_rom @@ -45,17 +45,26 @@ if {$use_vbox5_nova} { set virtualbox5_binary "virtualbox5-nova" } set config_of_app { - + } append_if [expr $use_ps2] config_of_app { - } + } append_if [expr $use_usb] config_of_app { - } + } append config_of_app { + + } +append_if [expr $use_ps2] config_of_app { + } +append_if [expr $use_usb] config_of_app { + } +append config_of_app { + + } append_if [expr $use_ps2] config_of_app { @@ -120,7 +129,7 @@ append config_of_app { - + diff --git a/repos/ports/run/virtualbox_nic_router.run b/repos/ports/run/virtualbox_nic_router.run index b872c892d..030e8cf63 100644 --- a/repos/ports/run/virtualbox_nic_router.run +++ b/repos/ports/run/virtualbox_nic_router.run @@ -25,7 +25,7 @@ append build_components { drivers/input } append build_components { drivers/rtc } append build_components { drivers/usb } append build_components { drivers/nic } -append build_components { server/input_merger } +append build_components { server/input_filter } append_platform_drv_build_components @@ -110,7 +110,7 @@ append config { - + @@ -118,6 +118,12 @@ append config { + + + + + + @@ -339,7 +345,7 @@ append config { - + @@ -389,7 +395,7 @@ append boot_modules { rtc_drv } append boot_modules { usb_drv } append boot_modules { vfs.lib.so } append boot_modules { ipxe_nic_drv } -append boot_modules { input_merger } +append boot_modules { input_filter } append boot_modules { log_terminal } append_platform_drv_boot_modules