Re: fast_IRQ##_interrupt() Question(s)

Michael Hohmuth (hohmuth@irs.inf.tu-dresden.de)
Tue, 14 May 1996 12:46:57 +0200


In article <Pine.LNX.3.93.960513210745.13345A-100000@pc5829.hil.siemens.co.at>
Ingo Molnar <mingo@pc5829.hil.siemens.co.at> writes:

> in arch/asm-i386/irq.h,

> B) and a related question. The slow interrupt handlers start with this code:
>
> SYMBOL_NAME_STR(IRQ) #nr "_interrupt:\n\t" \
> "pushl $-"#nr"-2\n\t" \
>
> why is "-nr-2" pushed to the stack? A few lines later we do:
>
> "pushl $" #nr "\n\t" \
>
> which is "nr" to the stack. my best guess is that this is some kind
> identification. But why twice?

Slow interrupt handlers must create a stack layout as specified in
<asm-i386/ptrace.h> (struct pt_regs) so that they can leave the kernel
via ret_from_sys_call (in arch/i386/kernel/entry.S). The first push
ist for the structure's orig_eax element.

I believe the value stored in orig_eax is never evaluated by any
interrupt handler. -nr-2 is probably used to be more in line with
what other kernel entrys leave in this field (system call number (>=
0) or -1 for faults).

Michael

-- 
Email: hohmuth@inf.tu-dresden.de
WWW:   http://www.inf.tu-dresden.de/~mh1/