From a87731e262c909f2127a57f42563ece410789abe Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 15 Mar 2003 09:51:22 +0000 Subject: Update. 2003-03-15 Ulrich Drepper * sysdeps/x86_64/pthreaddef.h (CURRENT_STACK_FRAME): Don't use __builtin_frame_address, use stack pointer. * sysdeps/unix/sysv/linux/jmp-unwind.c: Use CURRENT_STACK_FRAME instead of __builtin_frame_pointer. --- nptl/sysdeps/x86_64/pthreaddef.h | 7 ++++--- nptl/sysdeps/x86_64/tls.h | 12 ++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'nptl/sysdeps/x86_64') diff --git a/nptl/sysdeps/x86_64/pthreaddef.h b/nptl/sysdeps/x86_64/pthreaddef.h index 697329c9e4..8fe610004f 100644 --- a/nptl/sysdeps/x86_64/pthreaddef.h +++ b/nptl/sysdeps/x86_64/pthreaddef.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. @@ -34,8 +34,9 @@ #define SIGCANCEL __SIGRTMIN -/* Location of current stack frame. */ -#define CURRENT_STACK_FRAME __builtin_frame_address (0) +/* Location of current stack frame. The frame pointer is not usable. */ +#define CURRENT_STACK_FRAME \ + ({ char *frame; asm ("movq %%rsp, %0" : "=r" (frame)); frame; }) /* XXX Until we have a better place keep the definitions here. */ diff --git a/nptl/sysdeps/x86_64/tls.h b/nptl/sysdeps/x86_64/tls.h index e7fab7a1b2..f382db2861 100644 --- a/nptl/sysdeps/x86_64/tls.h +++ b/nptl/sysdeps/x86_64/tls.h @@ -253,6 +253,18 @@ typedef struct }}) +#define CALL_THREAD_FCT(descr) \ + ({ void *__res; \ + asm volatile ("movq %%fs:%P2, %%rdi\n\t" \ + "callq *%%fs:%P1" \ + : "=a" (__res) \ + : "i" (offsetof (struct pthread, start_routine)), \ + "i" (offsetof (struct pthread, arg)) \ + : "di", "si", "cx", "dx", "r8", "r9", "r10", "r11", \ + "memory", "cc"); \ + __res; }) + + #endif /* __ASSEMBLER__ */ #endif /* tls.h */ -- cgit 1.4.1