2.9
[glibc/nacl-glibc.git] / sysdeps / mach / powerpc / machine-sp.h
blob267707bce0bc7f09d2264ff55ec41c692c073c9d
1 /* Machine-specific function to return the stack pointer. PowerPC version.
2 Copyright (C) 2001, 2007 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
20 #ifndef _MACHINE_SP_H
21 #define _MACHINE_SP_H
23 /* Return the current stack pointer. */
25 #ifndef _EXTERN_INLINE
26 /* Make sure this function is included in hurd/threadvar-inlines.c. */
27 # ifdef _HURD_THREADVAR_H_EXTERN_INLINE
28 # define _EXTERN_INLINE _HURD_THREADVAR_H_EXTERN_INLINE
29 # else
30 # define _EXTERN_INLINE __extern_inline
31 # endif
32 #endif
34 _EXTERN_INLINE void *
35 __thread_stack_pointer (void)
37 register void *__sp__;
38 __asm__ ("mr %0, 1" : "=r" (__sp__));
39 return __sp__;
42 #endif /* machine-sp.h */