From 04cca1edb1ae0c67927a5d66faf996e3fab9e1a7 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Tue, 6 Oct 2015 16:45:35 +0200 Subject: [PATCH] platform_drv: use shared irq path for ps/2 Issue #1740 --- .../platform/spec/x86/nonpci_devices.cc | 18 ++++++++++++------ .../platform/spec/x86/pci_device_component.h | 4 ++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/repos/os/src/drivers/platform/spec/x86/nonpci_devices.cc b/repos/os/src/drivers/platform/spec/x86/nonpci_devices.cc index c04d045928..3fe8758279 100644 --- a/repos/os/src/drivers/platform/spec/x86/nonpci_devices.cc +++ b/repos/os/src/drivers/platform/spec/x86/nonpci_devices.cc @@ -10,8 +10,8 @@ * under the terms of the GNU General Public License version 2. */ -#include #include "pci_session_component.h" +#include "irq.h" namespace Nonpci { class Ps2; } @@ -29,18 +29,24 @@ class Nonpci::Ps2 : public Platform::Device_component REG_STATUS = 0x64, }; - Genode::Irq_connection _irq_mouse; - Genode::Io_port_connection _data; - Genode::Io_port_connection _status; + Platform::Irq_session_component _irq_mouse; + Genode::Io_port_connection _data; + Genode::Io_port_connection _status; public: Ps2(Genode::Rpc_entrypoint * ep, Platform::Session_component * session) : Platform::Device_component(ep, session, IRQ_KEYBOARD), - _irq_mouse(IRQ_MOUSE), + _irq_mouse(IRQ_MOUSE, ~0UL), _data(REG_DATA, ACCESS_WIDTH), _status(REG_STATUS, ACCESS_WIDTH) - { } + { + ep->manage(&_irq_mouse); + } + + ~Ps2() { + ep()->dissolve(&_irq_mouse); + } Genode::Irq_session_capability irq(Genode::uint8_t virt_irq) override { diff --git a/repos/os/src/drivers/platform/spec/x86/pci_device_component.h b/repos/os/src/drivers/platform/spec/x86/pci_device_component.h index 0365cd7815..ea20dc389d 100644 --- a/repos/os/src/drivers/platform/spec/x86/pci_device_component.h +++ b/repos/os/src/drivers/platform/spec/x86/pci_device_component.h @@ -180,6 +180,10 @@ class Platform::Device_component : public Genode::Rpc_object, } + protected: + + Genode::Rpc_entrypoint * ep() { return _ep; } + public: /**