Hardware irq and vcpu entry

Pierre Larus <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.devel
Message-ID <CAJPtDgrng7sx3WVkihe9GA_qb0MLNvmVyA+mQB_iJmGxvNsu0g@mail.gmail.com>
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

_______________________________________________
l4-hackers mailing list
[email protected]
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
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.