Re: BUILD_SMP_TIMER_INTERRUPT not needed movl

Linus Torvalds (torvalds@transmeta.com)
Tue, 11 Aug 1998 11:43:59 -0700 (PDT)


On Tue, 11 Aug 1998, Andrea Arcangeli wrote:
>
> #define BUILD_SMP_TIMER_INTERRUPT(x) \
> asmlinkage void x(struct pt_regs * regs); \
> __asm__( \
> "\n"__ALIGN_STR"\n" \
> SYMBOL_NAME_STR(x) ":\n\t" \
> "pushl $-1\n\t" \
> SAVE_ALL \
> "movl %esp,%eax\n\t" \
> ^^^^^^^^^^^^^^^^^^^^^^
> "pushl %eax\n\t" \
> "call "SYMBOL_NAME_STR(smp_##x)"\n\t" \
> "addl $4,%esp\n\t" \
> "jmp ret_from_intr\n");
>
> I don' t think that the underlined line is needed. Why not to push %esp
> directly?

Because I'm anal. The trouble is that intel has changed the semantics of
"pushl %esp" before. It's a fundamentally flawed thing to do, as it's not
clear whether the pushed value is the one that was active before the
instruction or the decremented one.

I think intel documents that they push the value before the instruction,
and it would be fine to do what you say. But now you know why I didn't
write it that way..

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html