Re: [pok-devel] [Discussion] IRQ handling: chaining && pending IRQs

[ Thread Index | Date Index | More lists.tuxfamily.org/pok-devel Archives ]


Hi,

I further refined the interrupt handling for partitions. A partition can
now enable/disable interrupt delivery to itself.
Therefore I have introduced two new syscalls:
POK_SYSCALL_IRQ_PARTITION_ENABLE (27)
POK_SYSCALL_IRQ_PARTITION_DISABLE (28)

and two new functions in bsp.h and x86-qemu/bsp.c:
pok_bsp_irq_partition_enable
pok_bsp_irq_partition_disable

these two function increment/decrement a partition specific counter. If
the counter is 0, no further decrementing is possible and interrupts are
delivered to the partition. Else interrupts are disabled.

Therefore _C_isr_handler is checking the array, before invoking the
partition's handler.

One problem showed up during my tests. I have a static variable in the
partition, which is incremented by the handler. If I print this variable
via GDB it changes, if I just print it in a loop in the user code it
stays 0.
I need to make a transition from kernel to user space, between invoking
the kernel and the partition handler in _C_isr_handler.
Does someone know how to implement this switch?

Cheers,
Philipp

On 08/18/2013 08:51 PM, Philipp Eppelt wrote:
> Hi,
> 
> in my current working version, POK can administer one interrupt handler
> per partition plus one for the kernel.
> If a kernel interrupt handler is registered, it is called first and then
> the handler of the currently scheduled partition, if one is registered.
> 
> To register a interrupt handler from inside a partition, I introduced a
> new syscall: POK_SYSCALL_IRQ_REGISTER_HANDLER (25). In syscall.c I have
> a #ifdef i386 guard (i386 is set by gcc), as the functionality is x86
> only and syscall.c is shared among all architectures.
> 
> So far I tested it with a little application on qemu. The kernel and
> partition handler got notified. The offset between them - the partition
> handler is registered later - was constant for the first 1k ticks.
> 
> Another change is the invokation of pok_pic_eoi. This is now done, by
> _C_isr_handler, before it calls the first handler.
> 
> Comments? Objections? Questions?
> 
> Source code:
> https://github.com/phipse/pok
> 
> Cheers,
> Philipp
> 
> 
> 
> On 08/18/2013 01:07 AM, Philipp Eppelt wrote:
>> Hi,
>>
>> I have the interrupt handling up and running.
>>
>> I still don't count interrupts to deliver them to not scheduled, but
>> registered partitions.
>>
>> I just wrote a blog post including source code excerpts:
>> http://phipse.github.io/rtems/blog/2013/08/17/pok-hardware-interrupt-handling/
>>
>> I haven't run the full testsuite yet, but if I fiddle with the
>> POK_NEEDS_GETTICK switch I can print the occurred ticks with a test
>> application and they are not just 0. So at least the clock tick is
>> working correctly.
>>
>> ToDo:
>> - Rewrite all HW IRQ handler, as they use the old macro.
>> - Modify all functions registering HW IRQs to use
>> pok_bsp_irq_register_hw function.
>> - POK_NEEDS_GETTICK issue.
>> - Test more examples.
>>
>> Source code:
>> https://github.com/phipse/pok
>>
>>
>> Cheers,
>> Philipp
>>
>>
> 
> 
> 




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/