+2009-01-29 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/i386/stackinfo.h (stackinfo_get_sp): Define.
+ (stackinfo_sub_sp): Define.
+
2009-01-28 Ulrich Drepper <drepper@redhat.com>
[BZ #9750]
-/* Copyright (C) 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 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
/* On x86 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 %%esp, %0" : "=r" (p__)); p__; })
+#define stackinfo_sub_sp(ptr) \
+ ({ ptrdiff_t d__; \
+ asm volatile ("sub %%esp, %0" : "=r" (d__) : "0" (ptr)); \
+ d__; })
+
#endif /* stackinfo.h */