mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-11 13:03:11 +00:00
dde_linux: decouple Lx_kit::Irq and Platform::Device
Follow-up commit to fix the old usb_drv. Under rpi one and the same irq can be requested several times. Therefore, we've to track the Irq_connection objects. Ref #3865
This commit is contained in:
parent
ace172ebf3
commit
e29485fa59
@ -47,9 +47,20 @@ void Lx::backend_free(Genode::Ram_dataspace_capability cap) {
|
|||||||
extern "C" int request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags,
|
extern "C" int request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags,
|
||||||
const char *name, void *dev)
|
const char *name, void *dev)
|
||||||
{
|
{
|
||||||
Genode::Irq_connection * irq_con = new (Lx_kit::env().heap())
|
struct Irq : Genode::List<Irq>::Element {
|
||||||
Genode::Irq_connection(Lx_kit::env().env(), irq);
|
unsigned const nr;
|
||||||
Lx::Irq::irq().request_irq(irq_con->cap(), irq, handler, dev);
|
Genode::Irq_connection irq_con { Lx_kit::env().env(), nr };
|
||||||
|
Irq(unsigned const irq, Genode::List<Irq> & list)
|
||||||
|
: nr(irq) { list.insert(this); }
|
||||||
|
};
|
||||||
|
|
||||||
|
static Genode::List<Irq> irq_list;
|
||||||
|
|
||||||
|
Irq * i = irq_list.first();
|
||||||
|
for (; i; i = i->next()) { if (i->nr == irq) break; }
|
||||||
|
if (!i) i = new (Lx_kit::env().heap()) Irq(irq, irq_list);
|
||||||
|
|
||||||
|
Lx::Irq::irq().request_irq(i->irq_con.cap(), irq, handler, dev);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user