Interrupt gate in x86

Fered a_Fered at yahoo.com
Mon Jul 2 12:44:09 UTC 2012


Hi;

RTEMS uses "interrupt gate" for all handlers. Then at the first of execution 
of handlers, IF flag is cleared. But just before calling of "C_dispatch_isr", 
it set IF by STI instruction. Therefore we can receive nested interrupts at 
the middle of execution of "C_dispatch_isr".

Thanks for your contribution.


Cláudio Silva wrote:
> Hi,
> 
> I am not knowledgeable about the x86 interrupt management but it seems
> to me that the ISR_Handler enables processor interrupts and changes
> the PIC mask. So higher priority interrupts can still occur.
> You need the _ISR_Nest_level variable to keep track of the interrupt
> nesting of the current interrupt. Only the outer interrupt can change
> from the tasks' stack to the ISR's stack and call _Thread_Dispatch.
> 
> Regards,
> Cláudio
> 
> On Mon, Jul 2, 2012 at 5:28 AM, Fered <a_Fered at yahoo.com> wrote:
> > Hi;
> > 
> > My question is about Interrupt Descriptor Table (IDT) initialization.
> > RTEMS
> > initializes all descriptors as "Interrupt Gate". If you are familiar with
> > x86 architecture, it have 3 gates for execution of handlers:
> > Interrupt gate, trap gate and task gate.
> > If we use "interrupt gate", processor clears IF flag, then all maskable
> > interrupts masked. If interrupts masked, then we have no interrupt at the
> > middle of execution of the handler. Then nested interrupting is disabled.
> > I saw "irq_asm.S" and as I said, "_ISR_Nest_level" increases before
> > dispatching of Interrupt handler. But I think if we use "Interrupt Gate"
> > then "_ISR_Nest_level" doesn't exceed one.
> > My question is "Is it true what I said about the variable?".
> > Thanks
> > 
> > you wrote:
> >> Have a look here wherever you've installed RTEMS --
> >> c/src/lib/libbsp/i386/shared/irq/irq_asm.S
> >> 
> >> 
> >> -- dc
> >> 
> >> On Sun, Jul 1, 2012 at 7:26 AM, Fered <a_Fered at yahoo.com> wrote:
> >> > Nobody can help me?!
> >> > 
> >> > Fered wrote:
> >> >> Hi;
> >> >> 
> >> >> In the following file:
> >> >> c/src/lib/libbsp/i386/shared/irq/idt.c
> >> >> in the following function:
> >> >> create_interrupt_gate_descriptor ()
> >> >> interrupt descriptor type, set to 0xe. It mean "Interrupt Gate" has
> >> >> been
> >> >> used. Interrupt gate clears IF flag then prevents nested interrupts.
> >> >> But
> >> >> I
> >> >> think nested interrupt handling implemented in RTEMS, according to
> >> >> usage
> >> >> of
> >> >> "_ISR_Nest_level" variable.
> >> >> Can anyone tell me how nesting implemented in interrupt handler of
> >> >> RTEMS?
> >> >> 
> >> >> Thanks.
> >> >> _______________________________________________
> >> >> rtems-devel mailing list
> >> >> rtems-devel at rtems.org
> >> >> http://www.rtems.org/mailman/listinfo/rtems-devel
> >> > 
> >> > _______________________________________________
> >> > rtems-devel mailing list
> >> > rtems-devel at rtems.org
> >> > http://www.rtems.org/mailman/listinfo/rtems-devel
> > 
> > _______________________________________________
> > rtems-devel mailing list
> > rtems-devel at rtems.org
> > http://www.rtems.org/mailman/listinfo/rtems-devel




More information about the devel mailing list