Hardware irq and vcpu entry

Pierre Larus pierre.larus at laposte.net
Fri Jun 8 17:27:37 CEST 2012


Hi

I am porting an RTOS on L4RE.
The RTOS run in a l4_thread and I am currently trying to handle hardware
timer irq.

I would like to know if it is possible to attach an hardware irq (timer
irq) to a vcpu entry ?
I try to do this in a vpcu thread:

    vcpu_state->state     = L4_VCPU_F_EXCEPTIONS | L4_VCPU_F_IRQ;
    vcpu_state->entry_ip  = (l4_addr_t)&vcpu_entry;
    vcpu_state->user_task = L4_INVALID_CAP;

    InitClockDevice();

    icucap = l4re_get_env_cap("icu");
    irqcap = l4re_util_cap_alloc();
    l4_factory_create_irq(l4re_global_env->factory, irqcap);
    l4_icu_bind(icucap, 38, irqcap);
    l4_irq_attach(irqcap, 0x38, current_thread_cap);

    StartUpMain();

But this solution does not work.
The thread vcpu support works because when I use the l4_irq_trigger()
function the irq are catched by the vcpu entry.
The irq attach also works because I can handle hardware interrupt using a
dedicated thread:

    icucap = l4re_get_env_cap("icu");
    irqcap = l4re_util_cap_alloc();
    l4_factory_create_irq(l4re_global_env->factory, irqcap);
    l4_icu_bind(icucap, 38, irqcap);
    l4_irq_attach(irqcap, 0x38, current_thread_cap);

    while (1) {
        l4_irq_receive(irqcap, L4_IPC_NEVER);
        isr_handler();
    }

Regards,

Pierre LARUS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://os.inf.tu-dresden.de/pipermail/l4-hackers/attachments/20120608/afec328c/attachment.html>


More information about the l4-hackers mailing list