diff options
author | Jakub Jelinek <jakub@redhat.com> | 2009-02-04 22:36:03 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2009-02-04 22:36:03 +0000 |
commit | 73c5dd45bc405428148ee740cac61a1279fe57d4 (patch) | |
tree | 878555d8c116d7ac9cb716b79e10d240fde946a3 /sysdeps/x86_64/stackinfo.h | |
parent | 23a4b43d6a98912d505458daeced44b22830a773 (diff) |
Updated to fedora-glibc-20090204T2135cvs/fedora-glibc-2_9_90-3
Diffstat (limited to 'sysdeps/x86_64/stackinfo.h')
-rw-r--r-- | sysdeps/x86_64/stackinfo.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sysdeps/x86_64/stackinfo.h b/sysdeps/x86_64/stackinfo.h index 60668d10b1..b11849d9ab 100644 --- a/sysdeps/x86_64/stackinfo.h +++ b/sysdeps/x86_64/stackinfo.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -25,4 +25,14 @@ /* On x86_64 the stack grows down. */ #define _STACK_GROWS_DOWN 1 +/* Access to the stack pointer. The macros are used in alloca_account + for which they need to act as barriers as well, hence the additional + (unnecessary) parameters. */ +#define stackinfo_get_sp() \ + ({ void *p__; asm volatile ("mov %%rsp, %0" : "=r" (p__)); p__; }) +#define stackinfo_sub_sp(ptr) \ + ({ ptrdiff_t d__; \ + asm volatile ("sub %%rsp, %0" : "=r" (d__) : "0" (ptr)); \ + d__; }) + #endif /* stackinfo.h */ |