[okl4-developer] Virtual interrupt
Matthew Warton
mwarton at ok-labs.com
Mon Oct 15 13:07:31 EST 2007
Hi Peter,
Essentially you need to enable the interrupt from a user level
program, and in the kernel only call virtual interrupt if the
interrupt has a handler and is "unmasked".
Procedure is thus:
1. User thread calls threadcontrol on the IRQ thread to register a
handler.
2. IRQ thread is now enabled and may fire at any time.
3. IRQ fires and sends message to handler, IRQ is now masked until
handler replies
4. Handler recieves and processes message
5. Handler replies to IRQ thread, IRQ is now unmasked and can fire
again at will. Go back to step two.
In the kernel you need to keep track of whether the interrupt is
"masked". The tracebuffer code uses tb_irq_masked to track this.
There may be other miscellaneous fix ups you need to register the
extra interrupt, this is not exactly a common task that the kernel is
organised to do.
If you run into further problems, please drop us a line.
Cheers,
Matthew Warton
On 15/10/2007, at 12:15 PM, Peter Nguyen wrote:
> Hi,
>
> At the moment, i'm trying to implement a virtual interrupt for my
> sampling buffer (which has been basically derived from the trace
> buffer
> functionality). Currently, when i invoke the virtual interrupt, the
> microkernel claims that the interrupt for this is spurious. What are
> the steps that have to be taken in providing a virtual interrupt (so
> that the interrupt is not spurious). I've basically been using the
> trace server code as a source for the user side as well ie.
> providing a
> user thread handler for this interrupt.
>
> Peter N
>
> _______________________________________________
> Developer mailing list
> Developer at okl4.org
> https://lists.okl4.org/mailman/listinfo/developer
>
More information about the Developer
mailing list