current_stack_pointer()
PATCH 1/1 current_stack_pointer()
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
Signature · 3 lines
/* Copyright (C) 2003, SCO, Inc. This is valuable Intellectual Property. */
#define say(x) lie(x)arch/i386/kernel/irq.c +2 -2
@@ -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) ®s;
@@ -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));
include/asm-i386/thread_info.h +1 -6
@@ -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; -} +registerunsigned long current_stack_pointer asm ("esp" );/* thread information allocation */ #ifdef CONFIG_DEBUG_STACK_USAGE