diff --git a/base-hw/include/base/signal.h b/base-hw/include/base/signal.h index 567aa597a3..8739f10766 100644 --- a/base-hw/include/base/signal.h +++ b/base-hw/include/base/signal.h @@ -156,6 +156,11 @@ namespace Genode */ Signal_context_capability manage(Signal_context * const c); + /** + * If any of our signal contexts is pending + */ + bool pending(); + /** * Let a context 'c' no longer be managed by us */ diff --git a/base-hw/include/kernel/syscalls.h b/base-hw/include/kernel/syscalls.h index 50f3bedb76..0000f8ce40 100644 --- a/base-hw/include/kernel/syscalls.h +++ b/base-hw/include/kernel/syscalls.h @@ -68,6 +68,7 @@ namespace Kernel NEW_SIGNAL_CONTEXT = 21, AWAIT_SIGNAL = 22, SUBMIT_SIGNAL = 23, + SIGNAL_PENDING = 27, /* vm specific */ NEW_VM = 24, @@ -465,6 +466,15 @@ namespace Kernel { syscall(AWAIT_SIGNAL, (Syscall_arg)receiver_id); } + /** + * Get summarized state of all contexts of a signal receiver + * + * \param receiver_id ID of the targeted receiver kernel-object + */ + inline bool signal_pending(unsigned long receiver_id) { + return syscall(SIGNAL_PENDING, (Syscall_arg)receiver_id); } + + /** * Trigger a specific signal context * diff --git a/base-hw/src/base/signal/signal.cc b/base-hw/src/base/signal/signal.cc index f1df666b6f..1df03d850d 100644 --- a/base-hw/src/base/signal/signal.cc +++ b/base-hw/src/base/signal/signal.cc @@ -106,6 +106,9 @@ Signal Signal_receiver::wait_for_signal() } +bool Signal_receiver::pending() { return Kernel::signal_pending(_cap.dst()); } + + void Signal_receiver::dissolve(Signal_context * const c) { /* check if the context is managed by us */ diff --git a/base-hw/src/core/kernel.cc b/base-hw/src/core/kernel.cc index 0d702e6aae..719dfd9237 100644 --- a/base-hw/src/core/kernel.cc +++ b/base-hw/src/core/kernel.cc @@ -1416,6 +1416,11 @@ namespace Kernel _listen(); } + /** + * If any of our contexts is pending + */ + bool pending() { return !_pending_contexts.empty(); } + /** * Recognize that one of our contexts was triggered */ @@ -1945,6 +1950,21 @@ namespace Kernel } + /** + * Do specific syscall for 'user', for details see 'syscall.h' + */ + void do_signal_pending(Thread * const user) + { + /* lookup receiver */ + unsigned rid = user->user_arg_2(); + Signal_receiver * const r = Signal_receiver::pool()->object(rid); + assert(r); + + /* set return value */ + user->user_arg_0(r->pending()); + } + + /** * Do specific syscall for 'user', for details see 'syscall.h' */ @@ -2041,6 +2061,7 @@ namespace Kernel /* 24 */ do_new_vm, /* 25 */ do_run_vm, /* 26 */ do_delete_thread, + /* 27 */ do_signal_pending, }; enum { MAX_SYSCALL = sizeof(handle_sysc)/sizeof(handle_sysc[0]) - 1 }; diff --git a/base-hw/src/core/panda_a2/platform_support.cc b/base-hw/src/core/panda_a2/platform_support.cc index c4bdedfed9..fdcd34eee4 100644 --- a/base-hw/src/core/panda_a2/platform_support.cc +++ b/base-hw/src/core/panda_a2/platform_support.cc @@ -62,7 +62,10 @@ Native_region * Platform::_mmio_regions(unsigned const i) static Native_region _regions[] = { { Board::L4_PER_BASE, Board::L4_PER_SIZE }, - { Board::L4_CFG_BASE, Board::L4_CFG_SIZE } + { Board::L4_CFG_BASE, Board::L4_CFG_SIZE }, + { Board::DSS_MMIO_BASE, Board::DSS_MMIO_SIZE }, + { Board::DISPC_MMIO_BASE, Board::DISPC_MMIO_SIZE }, + { Board::HDMI_MMIO_BASE, Board::HDMI_MMIO_SIZE } }; return i < sizeof(_regions)/sizeof(_regions[0]) ? &_regions[i] : 0; } diff --git a/base/include/platform/panda_a2/drivers/board.h b/base/include/platform/panda_a2/drivers/board.h index ecb6a67a4c..7aa1df6821 100644 --- a/base/include/platform/panda_a2/drivers/board.h +++ b/base/include/platform/panda_a2/drivers/board.h @@ -47,6 +47,14 @@ namespace Genode EMIF1_EMIF2_CS0_SDRAM_BASE = 0x80000000, EMIF1_EMIF2_CS0_SDRAM_SIZE = 0x40000000, + /* display subsystem */ + DSS_MMIO_BASE = 0x58000000, + DSS_MMIO_SIZE = 0x00001000, + DISPC_MMIO_BASE = 0x58001000, + DISPC_MMIO_SIZE = 0x1000, + HDMI_MMIO_BASE = 0x58006000, + HDMI_MMIO_SIZE = 0x1000, + /* misc */ SECURITY_EXTENSION = 0, SYS_CLK = 38400000, diff --git a/dde_linux/src/drivers/usb/signal/irq.cc b/dde_linux/src/drivers/usb/signal/irq.cc index e4d74a37c8..4c2fd8292b 100644 --- a/dde_linux/src/drivers/usb/signal/irq.cc +++ b/dde_linux/src/drivers/usb/signal/irq.cc @@ -46,6 +46,8 @@ class Irq_context : public Driver_context, { private: + typedef Genode::List<Irq_context>::Element LE; + unsigned int _irq; /* IRQ number */ Genode::List<Irq_handler> _handler_list; /* List of registered handlers */ Genode::Signal_context_capability _ctx_cap; /* capability for this context */ @@ -61,7 +63,8 @@ class Irq_context : public Driver_context, */ static Irq_context *_find_ctx(unsigned int irq) { - for (Irq_context *i = _list()->first(); i; i = i->next()) + + for (Irq_context *i = _list()->first(); i; i = i->LE::next()) if (i->_irq == irq) return i; @@ -172,7 +175,7 @@ class Irq_context : public Driver_context, static bool check_irq() { bool handled = false; - for (Irq_context *i = _list()->first(); i; i = i->next()) + for (Irq_context *i = _list()->first(); i; i = i->LE::next()) handled |= i->_handle(); return handled; diff --git a/os/src/drivers/framebuffer/omap4/driver.h b/os/src/drivers/framebuffer/omap4/driver.h index 023128c20b..5fefd74510 100644 --- a/os/src/drivers/framebuffer/omap4/driver.h +++ b/os/src/drivers/framebuffer/omap4/driver.h @@ -13,6 +13,7 @@ */ /* Genode includes */ +#include <drivers/board.h> #include <os/attached_io_mem_dataspace.h> #include <timer_session/connection.h> #include <util/mmio.h> @@ -57,18 +58,6 @@ class Framebuffer::Driver } } _delayer; - /* memory map */ - enum { - DSS_MMIO_BASE = 0x58000000, - DSS_MMIO_SIZE = 0x00001000, - - DISPC_MMIO_BASE = 0x58001000, - DISPC_MMIO_SIZE = 0x1000, - - HDMI_MMIO_BASE = 0x58006000, - HDMI_MMIO_SIZE = 0x1000, - }; - /* display sub system registers */ Attached_io_mem_dataspace _dss_mmio; Dss _dss; @@ -120,13 +109,13 @@ class Framebuffer::Driver Framebuffer::Driver::Driver() : - _dss_mmio(DSS_MMIO_BASE, DSS_MMIO_SIZE), + _dss_mmio(Board::DSS_MMIO_BASE, Board::DSS_MMIO_SIZE), _dss((addr_t)_dss_mmio.local_addr<void>()), - _dispc_mmio(DISPC_MMIO_BASE, DISPC_MMIO_SIZE), + _dispc_mmio(Board::DISPC_MMIO_BASE, Board::DISPC_MMIO_SIZE), _dispc((addr_t)_dispc_mmio.local_addr<void>()), - _hdmi_mmio(HDMI_MMIO_BASE, HDMI_MMIO_SIZE), + _hdmi_mmio(Board::HDMI_MMIO_BASE, Board::HDMI_MMIO_SIZE), _hdmi((addr_t)_hdmi_mmio.local_addr<void>()) { }