lkml.org 
[lkml]   [2004]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: RFC: avoid asmlinkage on x86 traps/interrupts
On Tue, Nov 02, 2004 at 12:56:54PM -0800, Linus Torvalds wrote:
> if (curctx != irqctx) {
> + int arg1, arg2, ebx;
> +
> /* build the stack frame on the IRQ stack */
> isp = (u32*) ((char*)irqctx + sizeof(*irqctx));
> irqctx->tinfo.task = curctx->tinfo.task;
> irqctx->tinfo.previous_esp = current_stack_pointer();
>
> - *--isp = (u32) &regs;
> - *--isp = (u32) irq;
> -
> asm volatile(
> " xchgl %%ebx,%%esp \n"
> " call __do_IRQ \n"
> - " xchgl %%ebx,%%esp \n"
> - : : "b"(isp)
> - : "memory", "cc", "eax", "edx", "ecx"
> + " movl %%ebx,%%esp \n"
> + : "=a" (arg1), "=d" (arg2), "=b" (ebx)
> + : "0" (irq), "1" (regs), "2" (isp)
> + : "memory", "cc", "ecx"
> );

why do you restore the parameters into arg1/arg2/ebx? since it's
volatile I doubt gcc can optimize them away despite they're clearly
going to be discarded.

I guess it'd be nicer to simply move the output into the input with "a",
"d", "b", and the not add any output at all, and put "eax/edx" back into
the clobbers.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.050 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site