Questions about Shared Memory Area and IRQ

Björn Döbel doebel at
Fri Aug 10 08:50:08 CEST 2012

On 10.08.2012 07:14, ZhangEditing wrote:
> Hello.
> I have been trying to use the shared memory library and have learnt
> that it uses signals to notify parties that participate in
> communication. When I looked into the library code, I found that it
> implements signals with IRQs.
> However, I could not figure out which IRQ the library use. I have
> noticed that l4shmc_add_signal creates an IRQ object, but no IRQ
> number is used. The only thing that appear like an IRQ number is the
> second argument of l4_irq_attach, which is called by
> l4shmc_attach_signal_to. But I haven't found any clue about the
> meaning of the argument. Would you please tell me what the second
> argument of l4_irq_attach is?

The IRQ objects you see there are software interrupts provided by the
microkernel. You create one using the l4_factory_create_irq() system
call and can then be used using the IRQ interface specified in

IRQ objects are managed by the kernel and only a single thread may be
attached to any specific IRQ. However, this thread may be attached to
multiple IRQs at the same time. In this case, it can use the
l4_irq_wait() call to wait for a message from any IRQ object.

As you can see, irq_wait() also contains the label argument, which is
the second argument to irq_attach(). This label is a user-defined unique
identifier, which you can use to determine which of your IRQ objects
triggered a (software) interrupt when returning from irq_wait(). To be
able to do so, you need to set it in irq_attach().

> I have also noticed that l4shmc_add_signal registered an IRQ object
> to the namespace of the shared memory area. Does this mean that the
> IRQs used to implement signals are guaranteed not to conflict with
> any IRQ used by the hardware or any other software IRQ, regardless of
> the ORDER in which they are created?

Hardware and software interrupts are provided through the same
mechanism, but the kernel makes sure that software interrupts are not
tied to specific hardware ones, so there is no overlap.

Dipl.-Inf. Bjoern Doebel    Mail:  doebel at
TU Dresden, OS Chair        Phone: +49 351 463 38 799
Noethnitzer Str. 46         Fax:   +49 351 463 38 284
01187 Dresden, Germany      WWW:
"Futbol no es en simple juego. Es una arma de la revolucion!"

More information about the l4-hackers mailing list