diff options
author | Andreas Schwab <schwab@linux-m68k.org> | 2011-11-01 16:03:29 +0100 |
---|---|---|
committer | Andreas Schwab <schwab@linux-m68k.org> | 2011-11-01 18:35:32 +0100 |
commit | f335e01fe1240ea3e4a3759e68f6585c51ffcda3 (patch) | |
tree | 952eea514755ade632e20e08ada1d999f3a6f7d8 /sysdeps | |
parent | 6dcecc64865ece5109260fd89d876c83b173e6d8 (diff) | |
download | glibc-f335e01fe1240ea3e4a3759e68f6585c51ffcda3.tar.gz glibc-f335e01fe1240ea3e4a3759e68f6585c51ffcda3.tar.xz glibc-f335e01fe1240ea3e4a3759e68f6585c51ffcda3.zip |
m68k: define stackinfo_get_sp, stackinfo_sub_sp
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/m68k/stackinfo.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sysdeps/m68k/stackinfo.h b/sysdeps/m68k/stackinfo.h index b44d4d0ee9..bcfdb12857 100644 --- a/sysdeps/m68k/stackinfo.h +++ b/sysdeps/m68k/stackinfo.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2010 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2010, 2011 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 @@ -31,4 +31,12 @@ is present, but it is presumed absent. */ #define DEFAULT_STACK_PERMS (PF_R|PF_W|PF_X) +/* Access to the stack pointer. */ +#define stackinfo_get_sp() \ + ({ void *p__; asm volatile ("move.l %%sp, %0" : "=r" (p__)); p__; }) +#define stackinfo_sub_sp(ptr) \ + ({ ptrdiff_t d__; \ + asm volatile ("sub.l %%sp, %0" : "=r" (d__) : "0" (ptr)); \ + d__; }) + #endif /* stackinfo.h */ |