Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/arcbios Avoid use of CALLFRAME_S0 on calling ARC BIO...



details:   https://anonhg.NetBSD.org/src/rev/6b3a48405ed2
branches:  trunk
changeset: 933744:6b3a48405ed2
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat May 30 03:16:31 2020 +0000

description:
Avoid use of CALLFRAME_S0 on calling ARC BIOS functions.

On O32 and O64, 0(sp) could be clobbered by callee functions
to save argument a0, so we can't use it to save caller registers.
Use CALLFRAME_SP instead because a frame pointer is not used here.
Maybe all other references of CALLFRAME_S0 might also be problematic
on O32.  Discussed with soda@.

diffstat:

 sys/dev/arcbios/arcbios_calls.S |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (56 lines):

diff -r 569a9977b967 -r 6b3a48405ed2 sys/dev/arcbios/arcbios_calls.S
--- a/sys/dev/arcbios/arcbios_calls.S   Sat May 30 03:12:52 2020 +0000
+++ b/sys/dev/arcbios/arcbios_calls.S   Sat May 30 03:16:31 2020 +0000
@@ -32,7 +32,7 @@
 
 #include "assym.h"
 
-RCSID("$NetBSD: arcbios_calls.S,v 1.3 2020/05/30 02:56:54 tsutsui Exp $")
+RCSID("$NetBSD: arcbios_calls.S,v 1.4 2020/05/30 03:16:31 tsutsui Exp $")
 
        .text
        .set noreorder
@@ -45,14 +45,14 @@
 
 #define        CALLFRAME2_SIZ  (CALLFRAME_SIZ + 16)
 #define        CALLFRAME2_RA   (CALLFRAME_RA + 16)
-#define        CALLFRAME2_S0   (CALLFRAME_S0 + 16)
+#define        CALLFRAME2_SP   (CALLFRAME_SP + 16)
 
 #ifndef _STANDALONE
 NESTED(arcbios_4orless_args, CALLFRAME_SIZ, ra)
        PTR_SUBU sp, CALLFRAME_SIZ
 
        REG_S   ra, CALLFRAME_RA(sp)
-       REG_S   s0, CALLFRAME_S0(sp)
+       REG_S   s0, CALLFRAME_SP(sp)
 
        PTR_L   t9, _C_LABEL(ARCBIOS)
        PTR_ADDU t9, t0
@@ -67,7 +67,7 @@
        move    MIPS_CURLWP, s0
 
        REG_L   ra, CALLFRAME_RA(sp)
-       REG_L   s0, CALLFRAME_S0(sp)
+       REG_L   s0, CALLFRAME_SP(sp)
 
        jr      ra
         PTR_ADDU sp, CALLFRAME_SIZ
@@ -77,7 +77,7 @@
        PTR_SUBU sp, CALLFRAME2_SIZ
 
        REG_S   ra, CALLFRAME2_RA(sp)
-       REG_S   s0, CALLFRAME2_S0(sp)
+       REG_S   s0, CALLFRAME2_SP(sp)
 
 #ifdef __mips_o32
        INT_L   ta0, CALLFRAME2_SIZ+16(sp)      # load 5th arg
@@ -108,7 +108,7 @@
        move    MIPS_CURLWP, s0
 
        REG_L   ra, CALLFRAME2_RA(sp)
-       REG_L   s0, CALLFRAME2_S0(sp)
+       REG_L   s0, CALLFRAME2_SP(sp)
 
        jr      ra
         PTR_ADDU sp, CALLFRAME2_SIZ



Home | Main Index | Thread Index | Old Index