PATCH: Use __asm__("rsp") to get URRENT_STACK_FRAME

H.J. Lu hjl.tools@gmail.com
Mon Mar 19 22:36:00 GMT 2012


On Mon, Mar 19, 2012 at 3:10 PM, Richard Henderson <rth@twiddle.net> wrote:
> On 03/19/12 14:34, H.J. Lu wrote:
>>  #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.
>

Thanks for the pointer.  Here is the updated patch.  OK to install?

Thanks.

-- 
H.J.
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libc-frame.patch
Type: text/x-patch
Size: 664 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120319/f119fe02/attachment.bin>


More information about the Libc-alpha mailing list