All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [i386] current_stack_pointer()
@ 2004-10-14  5:24 Paweł Sikora
  0 siblings, 0 replies; only message in thread
From: Paweł Sikora @ 2004-10-14  5:24 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 411 bytes --]

Hi,

This trivial fix simplifies the output code.

testcase).

volatile unsigned long tmp = current_stack_pointer

without fix).

#APP
        movl    %esp, %eax      # ti
#NO_APP
        movl    %eax, tmp       # ti, tmp

with fix).

        movl    %esp, tmp       # __esp, tmp

-- 
/* Copyright (C) 2003, SCO, Inc. This is valuable Intellectual Property. */

                           #define say(x) lie(x)

[-- Attachment #2: 0.diff --]
[-- Type: text/x-diff, Size: 1581 bytes --]

diff -uNr linux-2.6.9-rc4.orig/arch/i386/kernel/irq.c linux-2.6.9-rc4/arch/i386/kernel/irq.c
--- linux-2.6.9-rc4.orig/arch/i386/kernel/irq.c	2004-10-11 04:57:02.000000000 +0200
+++ linux-2.6.9-rc4/arch/i386/kernel/irq.c	2004-10-12 18:35:56.734235704 +0200
@@ -515,7 +515,7 @@
 			/* 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();
+			irqctx->tinfo.previous_esp = current_stack_pointer;
 
 			*--isp = (u32) action;
 			*--isp = (u32) &regs;
@@ -1135,7 +1135,7 @@
 		curctx = current_thread_info();
 		irqctx = softirq_ctx[smp_processor_id()];
 		irqctx->tinfo.task = curctx->task;
-		irqctx->tinfo.previous_esp = current_stack_pointer();
+		irqctx->tinfo.previous_esp = current_stack_pointer;
 
 		/* build the stack frame on the softirq stack */
 		isp = (u32*) ((char*)irqctx + sizeof(*irqctx));
diff -uNr linux-2.6.9-rc4.orig/include/asm-i386/thread_info.h linux-2.6.9-rc4/include/asm-i386/thread_info.h
--- linux-2.6.9-rc4.orig/include/asm-i386/thread_info.h	2004-10-11 04:57:04.000000000 +0200
+++ linux-2.6.9-rc4/include/asm-i386/thread_info.h	2004-10-12 18:35:41.420563736 +0200
@@ -92,12 +92,7 @@
 }
 
 /* how to get the current stack pointer from C */
-static inline unsigned long current_stack_pointer(void)
-{
-	unsigned long ti;
-	__asm__("movl %%esp,%0; ":"=r" (ti) : );
-	return ti;
-}
+register unsigned long current_stack_pointer asm ("esp");
 
 /* thread information allocation */
 #ifdef CONFIG_DEBUG_STACK_USAGE

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-10-14  5:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-14  5:24 [PATCH] [i386] current_stack_pointer() Paweł Sikora

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.