Re: Dummy irq

Adam Lackorzynski <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.devel
Message-ID <[email protected]>
On Thu Oct 30, 2014 at 11:00:22 -0400, teclis High Elf wrote:
> If I wanted to create a dummy irq that didn't actually exist in hardware
> but I could use for asynchronous notification between processes or between
> a hypervisor and a VM how would I do that in L4Re? What would the dummy
> entry look like in the .devs file?

You do not need any dummy IRQ entry or similar, nor IO or anything in
there. Creating an Irq object works like creating any other object:

  L4::Cap<L4::Irq> irq = L4Re::chkcap(L4Re::Util::cap_alloc.alloc<L4::Irq>());
  L4Re::chksys(L4Re::Env::env()->factory()->create_irq(irq),
               "IRQ creation failed");

  In one thread you bind the IRQ to the thread, e.g.:
  L4Re::chksys(irq->attach(label, L4Re::Env::env()->main_thread()),
               "Attaching IRQ failed");
  Then you wait.

  On the other side you call trigger():
  irq->trigger();

There's an example in l4/pkg/examples/sys/map_irq which does this
between two tasks.



Adam
-- 
Adam                 [email protected]
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.