Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/macppc/stand Convert to register prefixes. Use ANS...



details:   https://anonhg.NetBSD.org/src/rev/e7e59e8d48d2
branches:  trunk
changeset: 538835:e7e59e8d48d2
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Oct 31 21:31:08 2002 +0000

description:
Convert to register prefixes.  Use ANSI string concatenation for
multiline asm strings.

diffstat:

 sys/arch/macppc/stand/bootxx/bootxx.c     |  71 ++++++++++++------------
 sys/arch/macppc/stand/ofwboot/Locore.c    |  89 +++++++++++++++---------------
 sys/arch/macppc/stand/ofwboot/Xcoffxtra.c |  14 ++--
 3 files changed, 86 insertions(+), 88 deletions(-)

diffs (219 lines):

diff -r fbb93b28e491 -r e7e59e8d48d2 sys/arch/macppc/stand/bootxx/bootxx.c
--- a/sys/arch/macppc/stand/bootxx/bootxx.c     Thu Oct 31 20:23:25 2002 +0000
+++ b/sys/arch/macppc/stand/bootxx/bootxx.c     Thu Oct 31 21:31:08 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bootxx.c,v 1.9 2002/05/18 04:24:22 lukem Exp $ */
+/*     $NetBSD: bootxx.c,v 1.10 2002/10/31 21:31:08 matt Exp $ */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -58,45 +58,44 @@
 void (*entry_point)(int, int, void *) = (void *)DEFAULT_ENTRY_POINT;
 
 
-asm("
-       .text
-       .align 2
-       .globl  _start
-_start:
+asm(
+"      .text                   \n"
+"      .align 2                \n"
+"      .globl  _start          \n"
+"_start:                       \n"
 
-       lis     8,(_start)@ha
-       addi    8,8,(_start)@l
-       li      9,0x40          /* loop 64 times (for 2048 bytes of bootxx) */
-       mtctr   9
-1:
-       dcbf    0,8
-       icbi    0,8
-       addi    8,8,0x20
-       bdnz    1b
-       sync
+"      lis     %r8,(_start)@ha \n"
+"      addi    %r8,8,(_start)@l\n"
+"      li      %r9,0x40        \n"     /* loop 64 times (for 2048 bytes of bootxx) */
+"      mtctr   %r9             \n"
+"1:                            \n"
+"      dcbf    %r0,%r8         \n"
+"      icbi    %r0,%r8         \n"
+"      addi    %r8,%r8,0x20    \n"
+"      bdnz    1b              \n"
+"      sync                    \n"
 
-       li      0,0
-       mtdbatu 3,0
-       mtibatu 3,0
-       isync
-       li      8,0x1ffe        /* map the lowest 256MB */
-       li      9,0x22          /* BAT_I */
-       mtdbatl 3,9
-       mtdbatu 3,8
-       mtibatl 3,9
-       mtibatu 3,8
-       isync
+"      li      %r0,0           \n"
+"      mtdbatu 3,%r0           \n"
+"      mtibatu 3,%r0           \n"
+"      isync                   \n"
+"      li      %r8,0x1ffe      \n"     /* map the lowest 256MB */
+"      li      %r9,0x22        \n"     /* BAT_I */
+"      mtdbatl 3,%r9           \n"
+"      mtdbatu 3,%r8           \n"
+"      mtibatl 3,%r9           \n"
+"      mtibatu 3,%r8           \n"
+"      isync                   \n"
 
-                               /*
-                                * setup 32 KB of stack with 32 bytes overpad
-                                * (see above)
-                                */
-       lis     1,(stack  + 4 * 8192)@ha
-       addi    1,1,(stack+ 4 * 8192)@l
-       stw     0,0(1)          /* terminate the frame link chain */
+       /*
+        * setup 32 KB of stack with 32 bytes overpad (see above)
+        */
+"      lis     %r1,(stack+32768)@ha\n"
+"      addi    %r1,%r1,(stack+32768)@l\n"
+"      stw     %r0,0(%r1)      \n"     /* terminate the frame link chain */
 
-       b       startup
-");
+"      b       startup         \n"
+);
 
 
 static __inline int
diff -r fbb93b28e491 -r e7e59e8d48d2 sys/arch/macppc/stand/ofwboot/Locore.c
--- a/sys/arch/macppc/stand/ofwboot/Locore.c    Thu Oct 31 20:23:25 2002 +0000
+++ b/sys/arch/macppc/stand/ofwboot/Locore.c    Thu Oct 31 21:31:08 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: Locore.c,v 1.11 2002/09/27 00:32:17 wrstuden Exp $     */
+/*     $NetBSD: Locore.c,v 1.12 2002/10/31 21:31:09 matt Exp $ */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -46,52 +46,51 @@
 static int stack[8192/4 + 4];
 
 #ifdef XCOFF_GLUE
-asm("
-       .text
-       .globl  _entry
-_entry:
-       .long   _start,0,0
-");
+asm(
+"      .text                   \n"
+"      .globl  _entry          \n"
+"_entry:                       \n"
+"      .long   _start,0,0      \n"
+);
 #endif
 
-asm("
-       .text
-       .globl  _start
-_start:
-       sync
-       isync
-
-       lis     1,stack@ha
-       addi    1,1,stack@l
-       addi    1,1,8192
-
-       mfmsr   8
-       li      0,0
-       mtmsr   0
-       isync
-
-       mtibatu 0,0
-       mtibatu 1,0
-       mtibatu 2,0
-       mtibatu 3,0
-       mtdbatu 0,0
-       mtdbatu 1,0
-       mtdbatu 2,0
-       mtdbatu 3,0
-
-       li      9,0x12          /* BATL(0, BAT_M, BAT_PP_RW) */
-       mtibatl 0,9
-       mtdbatl 0,9
-       li      9,0x1ffe        /* BATU(0, BAT_BL_256M, BAT_Vs) */
-       mtibatu 0,9
-       mtdbatu 0,9
-       isync
-
-       mtmsr   8
-       isync
-
-       b       startup
-");
+asm(
+"      .text                   \n"
+"      .globl  _start          \n"
+"_start:                       \n"
+"      sync                    \n"
+"      isync                   \n"
+"      lis     %r1,stack@ha    \n"
+"      addi    %r1,%r1,stack@l \n"
+"      addi    %r1,%r1,8192    \n"
+"                              \n"
+"      mfmsr   %r8             \n"
+"      li      %r0,0           \n"
+"      mtmsr   %r0             \n"
+"      isync                   \n"
+"                              \n"
+"      mtibatu 0,%r0           \n"
+"      mtibatu 1,%r0           \n"
+"      mtibatu 2,%r0           \n"
+"      mtibatu 3,%r0           \n"
+"      mtdbatu 0,%r0           \n"
+"      mtdbatu 1,%r0           \n"
+"      mtdbatu 2,%r0           \n"
+"      mtdbatu 3,%r0           \n"
+"                              \n"
+"      li      %r9,0x12        \n"     /* BATL(0, BAT_M, BAT_PP_RW) */
+"      mtibatl 0,%r9           \n"
+"      mtdbatl 0,%r9           \n"
+"      li      %r9,0x1ffe      \n"     /* BATU(0, BAT_BL_256M, BAT_Vs) */
+"      mtibatu 0,%r9           \n"
+"      mtdbatu 0,%r9           \n"
+"      isync                   \n"
+"                              \n"
+"      mtmsr   %r8             \n"
+"      isync                   \n"
+"                              \n"
+"      b       startup         \n"
+);
 
 #if 0
 static int
diff -r fbb93b28e491 -r e7e59e8d48d2 sys/arch/macppc/stand/ofwboot/Xcoffxtra.c
--- a/sys/arch/macppc/stand/ofwboot/Xcoffxtra.c Thu Oct 31 20:23:25 2002 +0000
+++ b/sys/arch/macppc/stand/ofwboot/Xcoffxtra.c Thu Oct 31 21:31:08 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: Xcoffxtra.c,v 1.1 1999/11/23 01:35:37 wrstuden Exp $   */
+/*     $NetBSD: Xcoffxtra.c,v 1.2 2002/10/31 21:31:09 matt Exp $       */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -31,9 +31,9 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-asm("
-       .text
-       .globl  _entry
-_entry:
-       .long   _start,0,0
-");
+asm(
+"       .text                  \n"
+"      .globl  _entry          \n"
+"_entry:                       \n"
+"      .long   _start,0,0      \n"
+);



Home | Main Index | Thread Index | Old Index