base_hw & omap4: USB HID and framebuffer driver.

Implement 'Signal_receiver::pending()'.

Provide display-subsystem MMIO.

Avoid method ambiguousness in 'Irq_context' in
'dde_linux/src/drivers/usb/signal/irq.cc'
(it derives from two list element classes when using 'base_hw').

Enables demo scenario with 'hw_panda_a2'.
This commit is contained in:
Martin Stein 2012-10-24 16:03:31 +02:00 committed by Norman Feske
parent 612735732a
commit cfa0a40d5e
8 changed files with 60 additions and 18 deletions

View File

@ -156,6 +156,11 @@ namespace Genode
*/ */
Signal_context_capability manage(Signal_context * const c); 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 * Let a context 'c' no longer be managed by us
*/ */

View File

@ -68,6 +68,7 @@ namespace Kernel
NEW_SIGNAL_CONTEXT = 21, NEW_SIGNAL_CONTEXT = 21,
AWAIT_SIGNAL = 22, AWAIT_SIGNAL = 22,
SUBMIT_SIGNAL = 23, SUBMIT_SIGNAL = 23,
SIGNAL_PENDING = 27,
/* vm specific */ /* vm specific */
NEW_VM = 24, NEW_VM = 24,
@ -465,6 +466,15 @@ namespace Kernel
{ syscall(AWAIT_SIGNAL, (Syscall_arg)receiver_id); } { 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 * Trigger a specific signal context
* *

View File

@ -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) void Signal_receiver::dissolve(Signal_context * const c)
{ {
/* check if the context is managed by us */ /* check if the context is managed by us */

View File

@ -1416,6 +1416,11 @@ namespace Kernel
_listen(); _listen();
} }
/**
* If any of our contexts is pending
*/
bool pending() { return !_pending_contexts.empty(); }
/** /**
* Recognize that one of our contexts was triggered * 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' * Do specific syscall for 'user', for details see 'syscall.h'
*/ */
@ -2041,6 +2061,7 @@ namespace Kernel
/* 24 */ do_new_vm, /* 24 */ do_new_vm,
/* 25 */ do_run_vm, /* 25 */ do_run_vm,
/* 26 */ do_delete_thread, /* 26 */ do_delete_thread,
/* 27 */ do_signal_pending,
}; };
enum { MAX_SYSCALL = sizeof(handle_sysc)/sizeof(handle_sysc[0]) - 1 }; enum { MAX_SYSCALL = sizeof(handle_sysc)/sizeof(handle_sysc[0]) - 1 };

View File

@ -62,7 +62,10 @@ Native_region * Platform::_mmio_regions(unsigned const i)
static Native_region _regions[] = static Native_region _regions[] =
{ {
{ Board::L4_PER_BASE, Board::L4_PER_SIZE }, { 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; return i < sizeof(_regions)/sizeof(_regions[0]) ? &_regions[i] : 0;
} }

View File

@ -47,6 +47,14 @@ namespace Genode
EMIF1_EMIF2_CS0_SDRAM_BASE = 0x80000000, EMIF1_EMIF2_CS0_SDRAM_BASE = 0x80000000,
EMIF1_EMIF2_CS0_SDRAM_SIZE = 0x40000000, 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 */ /* misc */
SECURITY_EXTENSION = 0, SECURITY_EXTENSION = 0,
SYS_CLK = 38400000, SYS_CLK = 38400000,

View File

@ -46,6 +46,8 @@ class Irq_context : public Driver_context,
{ {
private: private:
typedef Genode::List<Irq_context>::Element LE;
unsigned int _irq; /* IRQ number */ unsigned int _irq; /* IRQ number */
Genode::List<Irq_handler> _handler_list; /* List of registered handlers */ Genode::List<Irq_handler> _handler_list; /* List of registered handlers */
Genode::Signal_context_capability _ctx_cap; /* capability for this context */ 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) 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) if (i->_irq == irq)
return i; return i;
@ -172,7 +175,7 @@ class Irq_context : public Driver_context,
static bool check_irq() static bool check_irq()
{ {
bool handled = false; 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(); handled |= i->_handle();
return handled; return handled;

View File

@ -13,6 +13,7 @@
*/ */
/* Genode includes */ /* Genode includes */
#include <drivers/board.h>
#include <os/attached_io_mem_dataspace.h> #include <os/attached_io_mem_dataspace.h>
#include <timer_session/connection.h> #include <timer_session/connection.h>
#include <util/mmio.h> #include <util/mmio.h>
@ -57,18 +58,6 @@ class Framebuffer::Driver
} }
} _delayer; } _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 */ /* display sub system registers */
Attached_io_mem_dataspace _dss_mmio; Attached_io_mem_dataspace _dss_mmio;
Dss _dss; Dss _dss;
@ -120,13 +109,13 @@ class Framebuffer::Driver
Framebuffer::Driver::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>()), _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>()), _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>()) _hdmi((addr_t)_hdmi_mmio.local_addr<void>())
{ } { }