Example of an interrupt service routine.
#include <l4/sys/utcb.h>
#include <stdio.h>
int main(void)
{
int irqno = 1;
int err;
{
printf("Did not find an ICU\n");
return 1;
}
return 1;
{
printf(
"Could not create IRQ object: %lx\n",
l4_error(tag));
return 1;
}
{
printf("Binding IRQ%d to the ICU failed\n", irqno);
return 1;
}
{
printf("Error binding to IRQ %d: %d\n", irqno, err);
return 1;
}
printf("Attached to key IRQ %d\nPress keys now, Shift-Q to exit\n", irqno);
while (1)
{
unsigned long label = 0;
printf("Error on IRQ receive: %d\n", err);
else
{
printf("Got IRQ with label 0x%lX\n", label);
}
}
printf("Error detach from IRQ: %d\n", err);
return 0;
}
Capability allocator C interface.
Common factory related definitions.
l4_cap_idx_t l4re_util_cap_alloc(void) L4_NOTHROW
Get free capability index at capability allocator.
l4_cap_idx_t l4re_env_get_cap(char const *name) L4_NOTHROW
Get the capability selector for the object named name.
l4re_env_t * l4re_env(void) L4_NOTHROW
Get L4Re initial environment.
unsigned long l4_cap_idx_t
L4 Capability selector Type.
unsigned l4_is_invalid_cap(l4_cap_idx_t c) L4_NOTHROW
Test if a capability selector is the invalid capability.
l4_msgtag_t l4_factory_create_irq(l4_cap_idx_t factory, l4_cap_idx_t target_cap) L4_NOTHROW
Create a new IRQ sender.
l4_msgtag_t l4_icu_bind(l4_cap_idx_t icu, unsigned irqnum, l4_cap_idx_t irq) L4_NOTHROW
Bind an interrupt line of an interrupt controller to an interrupt object.
long l4_error(l4_msgtag_t tag) L4_NOTHROW
Return error code of a system call return message tag or the tag label.
l4_umword_t l4_ipc_error(l4_msgtag_t tag, l4_utcb_t *utcb) L4_NOTHROW
Get the error code for an object invocation.
l4_msgtag_t l4_irq_detach(l4_cap_idx_t irq) L4_NOTHROW
Detach from an interrupt source.
l4_msgtag_t l4_irq_receive(l4_cap_idx_t irq, l4_timeout_t to) L4_NOTHROW
Unmask and wait for specified IRQ.
l4_msgtag_t l4_rcv_ep_bind_thread(l4_cap_idx_t ep, l4_cap_idx_t thread, l4_umword_t label)
Bind the IPC gate to a thread.
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
Namespace functions, C interface.
Message tag data structure.
l4_cap_idx_t factory
Object-capability of the factory available to the task.