Source-Changes-HG archive

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

[src/trunk]: src/sys/arch in the initial asm code, save the interesting calle...



details:   https://anonhg.NetBSD.org/src/rev/18ff0ab8f2dd
branches:  trunk
changeset: 803706:18ff0ab8f2dd
user:      chs <chs%NetBSD.org@localhost>
date:      Sun Nov 09 00:05:06 2014 +0000

description:
in the initial asm code, save the interesting caller-saved registers
(containing "arg" and "len") across function calls to C code.
fixes kernels built with gcc 4.8.

diffstat:

 sys/arch/macppc/macppc/locore.S |  8 ++++++--
 sys/arch/ofppc/ofppc/locore.S   |  6 +++++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diffs (57 lines):

diff -r a5960de6cd47 -r 18ff0ab8f2dd sys/arch/macppc/macppc/locore.S
--- a/sys/arch/macppc/macppc/locore.S   Sat Nov 08 23:47:15 2014 +0000
+++ b/sys/arch/macppc/macppc/locore.S   Sun Nov 09 00:05:06 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.S,v 1.71 2013/04/11 18:36:44 macallan Exp $     */
+/*     $NetBSD: locore.S,v 1.72 2014/11/09 00:05:06 chs Exp $  */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -82,8 +82,10 @@
        .text
        .globl  __start
 __start:
+       bl      _C_LABEL(ofwinit)               /* init OF */
+       mr      13,6
+       mr      14,7
        bl      _C_LABEL(cpu_model_init)        /* init oeacpufeat */
-       bl      _C_LABEL(ofwinit)               /* init OF */
 
        li      0,0
        mtmsr   0                       /* Disable FPU/MMU/exceptions */
@@ -99,6 +101,8 @@
        addi    4,4,_C_LABEL(end)@l
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        /* skip symbol table */
+       mr      6,13
+       mr      7,14
        cmpwi   6,0
        beq     1f
        add     9,6,7                   /* r9 = args + l */
diff -r a5960de6cd47 -r 18ff0ab8f2dd sys/arch/ofppc/ofppc/locore.S
--- a/sys/arch/ofppc/ofppc/locore.S     Sat Nov 08 23:47:15 2014 +0000
+++ b/sys/arch/ofppc/ofppc/locore.S     Sun Nov 09 00:05:06 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.S,v 1.48 2011/06/20 19:56:12 matt Exp $ */
+/*     $NetBSD: locore.S,v 1.49 2014/11/09 00:05:06 chs Exp $  */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -80,6 +80,8 @@
        .text
        .globl  __start
 __start:
+       mr      %r13,%r6
+       mr      %r14,%r7
        bl      _C_LABEL(ofwinit)       /* init our OF hooks */
 
        li      %r0,0
@@ -104,6 +106,8 @@
         addi   %r4,%r4,_C_LABEL(end)@l
 #if NKSYMS || defined(DDB) || defined(MODULAR)
        /* skip symbol table */
+       mr      %r6,%r13
+       mr      %r7,%r14
        cmpwi   %r6,0
        beq     1f
        add     %r9,%r6,%r7                     /* r9 = args + l */



Home | Main Index | Thread Index | Old Index