Discussion:
PATCH: Use RSP_LP in CURRENT_STACK_FRAME
H.J. Lu
2012-03-19 21:34:50 UTC
Permalink
Hi,

This patch uses RSP_LP in CURRENT_STACK_FRAME.


H.J.
---
2012-03-19 H.J. Lu <***@intel.com>

* sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Use
RSP_LP.

diff --git a/nptl/sysdeps/x86_64/pthreaddef.h b/nptl/sysdeps/x86_64/pthreaddef.h
index 7e45be4..5475e30 100644
--- a/nptl/sysdeps/x86_64/pthreaddef.h
+++ b/nptl/sysdeps/x86_64/pthreaddef.h
@@ -41,7 +41,7 @@

/* Location of current stack frame. The frame pointer is not usable. */
#define CURRENT_STACK_FRAME \
- ({ char *frame; asm ("movq %%rsp, %0" : "=r" (frame)); frame; })
+ ({ char *frame; asm ("mov %%" RSP_LP ", %0" : "=r" (frame)); frame; })


/* XXX Until we have a better place keep the definitions here. */
--
1.7.6.5
Richard Henderson
2012-03-19 22:10:41 UTC
Permalink
Post by H.J. Lu
#define CURRENT_STACK_FRAME \
- ({ char *frame; asm ("movq %%rsp, %0" : "=r" (frame)); frame; })
+ ({ char *frame; asm ("mov %%" RSP_LP ", %0" : "=r" (frame)); frame; })
I'm pretty sure

({ register void *esp __asm__("esp"); esp; })

will work without the unneeded copy.


r~

Loading...