Messages in this thread | | | Date | Wed, 3 Nov 2004 10:07:10 +0100 | From | Andrea Arcangeli <> | Subject | Re: 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) ®s; > - *--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/
| |