Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/matt-nb6-plus]: src/lib/libc/arch/arm/sys Don't push/pop r1 around SYSTR...



details:   https://anonhg.NetBSD.org/src/rev/337b4c9ee155
branches:  matt-nb6-plus
changeset: 774495:337b4c9ee155
user:      matt <matt%NetBSD.org@localhost>
date:      Tue Nov 20 23:25:41 2012 +0000

description:
Don't push/pop r1 around SYSTRAP, save it in ip instead.

diffstat:

 lib/libc/arch/arm/sys/__aeabi_read_tp.S |  15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r 23c18ead0878 -r 337b4c9ee155 lib/libc/arch/arm/sys/__aeabi_read_tp.S
--- a/lib/libc/arch/arm/sys/__aeabi_read_tp.S   Tue Nov 20 23:24:55 2012 +0000
+++ b/lib/libc/arch/arm/sys/__aeabi_read_tp.S   Tue Nov 20 23:25:41 2012 +0000
@@ -1,13 +1,20 @@
+/* $NetBSD: __aeabi_read_tp.S,v 1.2.6.1 2012/11/20 23:25:41 matt Exp $ */
+
 #include "SYS.h"
 
+/*
+ * Implementations of this function should corrupt only the result register
+ * (r0) and the non-parameter integer core registers allowed to be corrupted
+ * by the [AAPCS] (ip, lr, and CPSR).
+ */
 ENTRY(__aeabi_read_tp)
-       mrc p15, 0, r0, c13, c0, 3
+       mrc     p15, 0, r0, c13, c0, 3
 #ifndef _ARM_ARCH_6
-       cmp r0, #0                      /* was it zero? */
+       cmp     r0, #0                  /* was it zero? */
        RETc(ne)                        /* return it's not zero */
-       push {r1}                       /* syscall zeroes r1 */
+       mov     ip, r1                  /* syscall zeroes r1 */
        SYSTRAP(_lwp_getprivate)        /* can't fail */
-       pop {r1}                        /* restore r1 */
+       mov     r1, ip                  /* restore r1 */
 #endif
        RET
 _END(__aeabi_read_tp)



Home | Main Index | Thread Index | Old Index