Convert to register prefixes. Use ANSI string concatenation for

multiline asm strings.
This commit is contained in:
matt 2002-10-31 21:31:08 +00:00
parent 01ba93bc3c
commit 8b4993db5d
3 changed files with 86 additions and 88 deletions

View File

@ -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 @@ struct shared_bbinfo bbinfo = {
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

View File

@ -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 void setup __P((void));
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

View File

@ -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"
);