This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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 */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]