This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH, AArch64] Associate 'stack_ptr' with wsp register in ILP32
- From: Yufeng Zhang <Yufeng dot Zhang at arm dot com>
- To: newlib at sourceware dot org
- Cc: Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>
- Date: Thu, 04 Jul 2013 08:12:14 +0100
- Subject: [PATCH, AArch64] Associate 'stack_ptr' with wsp register in ILP32
Hi,
This patch changes the global register variable 'stack_ptr' in the
AArch64 port to be declared with asm ("wsp") in ILP32.
OK for the trunk?
Thanks,
Yufeng
libgloss/
* aarch64/syscalls.c (stack_ptr): Defined with asm ("wsp")
if __ILP32__ is defined.
diff --git a/libgloss/aarch64/syscalls.c b/libgloss/aarch64/syscalls.c
index 51c39c5..35567ad 100644
--- a/libgloss/aarch64/syscalls.c
+++ b/libgloss/aarch64/syscalls.c
@@ -105,7 +105,11 @@ static struct fdent *findslot _PARAMS ((int));
static int newslot _PARAMS ((void));
/* Register name faking - works in collusion with the linker. */
+#ifdef __ILP32__
+register char * stack_ptr asm ("wsp");
+#else
register char * stack_ptr asm ("sp");
+#endif
/* following is copied from libc/stdio/local.h to check std streams */