From 86a2448d10f1984c0a34c2a1a7777c8875cc1cd1 Mon Sep 17 00:00:00 2001 From: garbled Date: Thu, 14 Feb 2008 19:41:54 +0000 Subject: [PATCH] Some powerpc cleanup. Remove unneeded/bad usage of extern oeacpufeat. Convert asm code to use %r register format. Done by comparison to disassembled output, double checked with diff of dissasembled output before and after, and test booted on my 7044. --- sys/arch/powerpc/oea/cpu_subr.c | 6 +- sys/arch/powerpc/oea/oea_machdep.c | 5 +- sys/arch/powerpc/oea/ofw_subr.S | 228 ++--- sys/arch/powerpc/oea/ofwoea_machdep.c | 5 +- .../powerpc/powerpc/darwin_commpage_machdep.S | 224 ++--- sys/arch/powerpc/powerpc/lock_stubs.S | 35 +- sys/arch/powerpc/powerpc/locore_subr.S | 10 +- sys/arch/powerpc/powerpc/pio_subr.S | 936 +++++++++--------- 8 files changed, 723 insertions(+), 726 deletions(-) diff --git a/sys/arch/powerpc/oea/cpu_subr.c b/sys/arch/powerpc/oea/cpu_subr.c index c0cf6b2eaa4a..d42c60c5e9ef 100644 --- a/sys/arch/powerpc/oea/cpu_subr.c +++ b/sys/arch/powerpc/oea/cpu_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: cpu_subr.c,v 1.43 2008/02/05 18:52:56 garbled Exp $ */ +/* $NetBSD: cpu_subr.c,v 1.44 2008/02/14 19:41:54 garbled Exp $ */ /*- * Copyright (c) 2001 Matt Thomas. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.43 2008/02/05 18:52:56 garbled Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.44 2008/02/14 19:41:54 garbled Exp $"); #include "opt_ppcparam.h" #include "opt_multiprocessor.h" @@ -236,8 +236,6 @@ char cpu_model[80]; /* This is to be called from locore.S, and nowhere else. */ -extern unsigned long oeacpufeat; - void cpu_model_init(void) { diff --git a/sys/arch/powerpc/oea/oea_machdep.c b/sys/arch/powerpc/oea/oea_machdep.c index 85588f6b51a1..645cbca7dfae 100644 --- a/sys/arch/powerpc/oea/oea_machdep.c +++ b/sys/arch/powerpc/oea/oea_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: oea_machdep.c,v 1.43 2008/02/07 03:20:16 garbled Exp $ */ +/* $NetBSD: oea_machdep.c,v 1.44 2008/02/14 19:41:54 garbled Exp $ */ /* * Copyright (C) 2002 Matt Thomas @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: oea_machdep.c,v 1.43 2008/02/07 03:20:16 garbled Exp $"); +__KERNEL_RCSID(0, "$NetBSD: oea_machdep.c,v 1.44 2008/02/14 19:41:54 garbled Exp $"); #include "opt_ppcarch.h" #include "opt_compat_netbsd.h" @@ -97,7 +97,6 @@ struct vm_map *phys_map = NULL; * Global variables used here and there */ extern struct user *proc0paddr; -extern unsigned long oeacpufeat; static void trap0(void *); diff --git a/sys/arch/powerpc/oea/ofw_subr.S b/sys/arch/powerpc/oea/ofw_subr.S index 638f4169197c..d4096d7bd57c 100644 --- a/sys/arch/powerpc/oea/ofw_subr.S +++ b/sys/arch/powerpc/oea/ofw_subr.S @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_subr.S,v 1.6 2008/01/28 21:06:29 garbled Exp $ */ +/* $NetBSD: ofw_subr.S,v 1.7 2008/02/14 19:41:54 garbled Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -58,39 +58,39 @@ GLOBAL(ofwreal_incharge) */ ENTRY_NOPROFILE(ofwinit) #ifdef FIRMWORKSBUGS - mfmsr 0 - andi. 0,0,PSL_IR|PSL_DR + mfmsr %r0 + andi. %r0,%r0,PSL_IR|PSL_DR beq 1f - li 8,1 - lis 9,ofwreal_incharge@ha - stw 8,ofwreal_incharge@l(9) + li %r8,1 + lis %r9,ofwreal_incharge@ha + stw %r8,ofwreal_incharge@l(9) - mflr 30 + mflr %r30 bl _C_LABEL(ofwr_init) - mtlr 30 + mtlr %r30 1: #endif - lis 8,openfirmware_entry@ha - stw 5,openfirmware_entry@l(8) /* save client interface handler*/ + lis %r8,openfirmware_entry@ha + stw %r5,openfirmware_entry@l(%r8) /* save client interface handler*/ - mfmsr 0 - lis 9,ofmsr@ha - stwu 0,ofmsr@l(9) /* save initial MSR value */ + mfmsr %r0 + lis %r9,ofmsr@ha + stwu %r0,ofmsr@l(%r9) /* save initial MSR value */ - mfsprg 0,0 /* save SPRGs */ - stwu 0,4(9) - mfsprg 0,1 - stwu 0,4(9) - mfsprg 0,2 - stwu 0,4(9) - mfsprg 0,3 - stw 0,4(9) + mfsprg %r0,0 /* save SPRGs */ + stwu %r0,4(%r9) + mfsprg %r0,1 + stwu %r0,4(%r9) + mfsprg %r0,2 + stwu %r0,4(%r9) + mfsprg %r0,3 + stw %r0,4(%r9) - lis 8,OF_buffer@ha - addi 8,8,OF_buffer@l - lis 9,_C_LABEL(OF_buf)@ha - stw 8,_C_LABEL(OF_buf)@l(9) + lis %r8,OF_buffer@ha + addi %r8,%r8,OF_buffer@l + lis %r9,_C_LABEL(OF_buf)@ha + stw %r8,_C_LABEL(OF_buf)@l(%r9) blr @@ -99,99 +99,99 @@ ENTRY_NOPROFILE(ofwinit) */ .text ENTRY(openfirmware) - mflr 0 /* save return address */ - stw 0,4(1) - stwu 1,-16(1) /* setup stack frame */ + mflr %r0 /* save return address */ + stw %r0,4(%r1) + stwu %r1,-16(%r1) /* setup stack frame */ - lis 4,openfirmware_entry@ha /* get firmware entry point */ - lwz 4,openfirmware_entry@l(4) - mtlr 4 + lis %r4,openfirmware_entry@ha /* get firmware entry point */ + lwz %r4,openfirmware_entry@l(%r4) + mtlr %r4 - mfsprg 5,0 /* save current sprg0 (curcpu) */ - lis 4,ofwsprg0save@ha - addi 4,4,ofwsprg0save@l - stw 5,0(4) + mfsprg %r5,0 /* save current sprg0 (curcpu) */ + lis %r4,ofwsprg0save@ha + addi %r4,%r4,ofwsprg0save@l + stw %r5,0(%r4) #ifdef FIRMWORKSBUGS - lis 4,ofwreal_incharge@ha - lwz 4,ofwreal_incharge@l(4) - cmpwi 4,1 + lis %r4,ofwreal_incharge@ha + lwz %r4,ofwreal_incharge@l(%r4) + cmpwi %r4,1 bne 1f blrl b 4f 1: #endif - mfmsr 4 /* save msr */ - stw 4,8(1) + mfmsr %r4 /* save msr */ + stw %r4,8(%r1) - li 0,0 /* clear battable translations */ + li %r0,0 /* clear battable translations */ #if defined (PPC_OEA) || defined (PPC_OEA64_BRIDGE) - mtdbatu 2,0 - mtdbatu 3,0 - mtibatu 2,0 - mtibatu 3,0 + mtdbatu 2,%r0 + mtdbatu 3,%r0 + mtibatu 2,%r0 + mtibatu 3,%r0 #endif /* PPC_OEA */ - lis 4,ofwsrsave@ha /* save current SRs */ - addi 4,4,ofwsrsave@l - li 5,0 -1: mfsrin 0,5 - stw 0,0(4) - addi 4,4,4 - addis 5,5,0x10000000@h - cmpwi 5,0 + lis %r4,ofwsrsave@ha /* save current SRs */ + addi %r4,%r4,ofwsrsave@l + li %r5,0 +1: mfsrin %r0,%r5 + stw %r0,0(%r4) + addi %r4,%r4,4 + addis %r5,%r5,0x10000000@h + cmpwi %r5,0 bne 1b - lis 4,_C_LABEL(ofw_pmap)@ha /* load OFW SR */ - addi 4,4,_C_LABEL(ofw_pmap)@l - lwz 0,PM_KERNELSR(4) - cmpwi 0,0 /* pm_sr[KERNEL_SR] == 0? */ + lis %r4,_C_LABEL(ofw_pmap)@ha /* load OFW SR */ + addi %r4,%r4,_C_LABEL(ofw_pmap)@l + lwz %r0,PM_KERNELSR(%r4) + cmpwi %r0,0 /* pm_sr[KERNEL_SR] == 0? */ beq 2f /* then skip (not initialized yet) */ - li 5,0 -1: lwz 0,0(4) - mtsrin 0,5 - addi 4,4,4 - addis 5,5,0x10000000@h - cmpwi 5,0 + li %r5,0 +1: lwz %r0,0(%r4) + mtsrin %r0,%r5 + addi %r4,%r4,4 + addis %r5,%r5,0x10000000@h + cmpwi %r5,0 bne 1b 2: - lis 4,ofmsr@ha /* Open Firmware msr + sprg[0-3] */ - lwzu 5,ofmsr+16@l(4) - mtsprg 3,5 - lwzu 5,-4(4) - mtsprg 2,5 - lwzu 5,-4(4) - mtsprg 1,5 - lwzu 5,-4(4) - mtsprg 0,5 - lwz 5,-4(4) - mtmsr 5 + lis %r4,ofmsr@ha /* Open Firmware msr + sprg[0-3] */ + lwzu %r5,ofmsr+16@l(%r4) + mtsprg 3,%r5 + lwzu %r5,-4(%r4) + mtsprg 2,%r5 + lwzu %r5,-4(%r4) + mtsprg 1,%r5 + lwzu %r5,-4(%r4) + mtsprg 0,%r5 + lwz %r5,-4(%r4) + mtmsr %r5 isync blrl /* call Open Firmware */ - lis 4,ofwsrsave@ha /* restore saved SRs */ - addi 4,4,ofwsrsave@l - li 5,0 -1: lwz 0,0(4) - mtsrin 0,5 - addi 4,4,4 - addis 5,5,0x10000000@h - cmpwi 5,0 + lis %r4,ofwsrsave@ha /* restore saved SRs */ + addi %r4,%r4,ofwsrsave@l + li %r5,0 +1: lwz %r0,0(%r4) + mtsrin %r0,%r5 + addi %r4,%r4,4 + addis %r5,%r5,0x10000000@h + cmpwi %r5,0 bne 1b - lwz 4,8(1) /* restore msr */ - mtmsr 4 + lwz %r4,8(%r1) /* restore msr */ + mtmsr %r4 isync 4: - lis 4,ofwsprg0save@ha /* restore saved sprg0 (curcpu) */ - addi 4,4,ofwsprg0save@l - lwz 5,0(4) - mtsprg 0,5 + lis %r4,ofwsprg0save@ha /* restore saved sprg0 (curcpu) */ + addi %r4,%r4,ofwsprg0save@l + lwz %r5,0(%r4) + mtsprg 0,%r5 - lwz 1,0(1) /* and return */ - lwz 0,4(1) - mtlr 0 + lwz %r1,0(%r1) /* and return */ + lwz %r0,4(%r1) + mtlr %r0 blr /* @@ -228,38 +228,38 @@ ENTRY(openfirmware) */ ENTRY(ofw_stack) - mfmsr 8 /* turn off interrupts */ - andi. 0,8,~(PSL_EE|PSL_RI)@l - mtmsr 0 - stw 8,4(1) /* abuse return address slot */ + mfmsr %r8 /* turn off interrupts */ + andi. %r0,%r8,~(PSL_EE|PSL_RI)@l + mtmsr %r0 + stw %r8,4(%r1) /* abuse return address slot */ - lwz 5,0(1) /* get length of stack frame */ - subf 5,1,5 + lwz %r5,0(%r1) /* get length of stack frame */ + subf %r5,%r1,%r5 - lis 7,firmstk+NBPG-8@ha - addi 7,7,firmstk+NBPG-8@l - lis 6,ofw_back@ha - addi 6,6,ofw_back@l - subf 4,5,7 /* make room for stack frame on + lis %r7,firmstk+NBPG-8@ha + addi %r7,%r7,firmstk+NBPG-8@l + lis %r6,ofw_back@ha + addi %r6,%r6,ofw_back@l + subf %r4,%r5,%r7 /* make room for stack frame on new stack */ - stw 6,-4(7) /* setup return pointer */ - stwu 1,-8(7) + stw %r6,-4(%r7) /* setup return pointer */ + stwu %r1,-8(%r7) - stw 7,-8(4) + stw %r7,-8(%r4) - addi 3,1,8 - addi 1,4,-8 - subi 5,5,8 + addi %r3,%r1,8 + addi %r1,%r4,-8 + subi %r5,%r5,8 b _C_LABEL(ofbcopy) /* and copy it */ ofw_back: - lwz 1,0(1) /* get callers original stack pointer */ + lwz %r1,0(%r1) /* get callers original stack pointer */ - lwz 0,4(1) /* get saved msr from abused slot */ - mtmsr 0 + lwz %r0,4(%r1) /* get saved msr from abused slot */ + mtmsr %r0 - lwz 1,0(1) /* return */ - lwz 0,4(1) - mtlr 0 + lwz %r1,0(%r1) /* return */ + lwz %r0,4(%r1) + mtlr %r0 blr diff --git a/sys/arch/powerpc/oea/ofwoea_machdep.c b/sys/arch/powerpc/oea/ofwoea_machdep.c index b1522828e769..3c8de47f5eb9 100644 --- a/sys/arch/powerpc/oea/ofwoea_machdep.c +++ b/sys/arch/powerpc/oea/ofwoea_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofwoea_machdep.c,v 1.11 2008/02/11 17:32:18 garbled Exp $ */ +/* $NetBSD: ofwoea_machdep.c,v 1.12 2008/02/14 19:41:54 garbled Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.11 2008/02/11 17:32:18 garbled Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.12 2008/02/14 19:41:54 garbled Exp $"); #include "opt_ppcarch.h" #include "opt_compat_netbsd.h" @@ -131,7 +131,6 @@ extern int chosen; extern uint32_t ticks_per_sec; extern uint32_t ns_per_tick; extern uint32_t ticks_per_intr; -extern unsigned long oeacpufeat; static int save_ofmap(struct ofw_translations *, int); static void restore_ofmap(struct ofw_translations *, int); diff --git a/sys/arch/powerpc/powerpc/darwin_commpage_machdep.S b/sys/arch/powerpc/powerpc/darwin_commpage_machdep.S index 833e22125885..207d46d14601 100644 --- a/sys/arch/powerpc/powerpc/darwin_commpage_machdep.S +++ b/sys/arch/powerpc/powerpc/darwin_commpage_machdep.S @@ -1,4 +1,4 @@ -/* $NetBSD: darwin_commpage_machdep.S,v 1.6 2005/12/11 12:18:46 christos Exp $ */ +/* $NetBSD: darwin_commpage_machdep.S,v 1.7 2008/02/14 19:41:54 garbled Exp $ */ /* * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -49,45 +49,45 @@ */ .globl _C_LABEL(darwin_commpage_bzero) _C_LABEL(darwin_commpage_bzero): - cmplwi r4,0 + cmplwi %r4,0 beqlr - li r0,0 - cmplwi r4,6 + li %r0,0 + cmplwi %r4,6 bgt- bzero1 - addi r3,r3,-1 + addi %r3,%r3,-1 bzero8: - mtctr r4 + mtctr %r4 bzero2: - stbu r0,1(r3) + stbu %r0,1(%r3) bdnz+ bzero2 blr bzero1: - andi. r5,r3,3 + andi. %r5,%r3,3 beq+ bzero3 - andi. r5,r3,1 + andi. %r5,%r3,1 beq- bzero5 - stb r0,0(r3) - addi r3,r3,1 - addi r4,r4,-1 - andi. r5,r3,2 + stb %r0,0(%r3) + addi %r3,%r3,1 + addi %r4,%r4,-1 + andi. %r5,%r3,2 beq- bzero3 bzero5: - sth r0,0(r3) - addi r3,r3,2 - addi r4,r4,-2 + sth %r0,0(%r3) + addi %r3,%r3,2 + addi %r4,%r4,-2 bzero3: - cmplwi r4,4 + cmplwi %r4,4 blt- bzero6 - rlwinm r5,r4,30,2,31 - mtctr r5 - addi r3,r3,-4 + rlwinm %r5,%r4,30,2,31 + mtctr %r5 + addi %r3,%r3,-4 bzero7: - stwu r0,4(r3) + stwu %r0,4(%r3) bdnz+ bzero7 bzero6: - andi. r4,r4,3 + andi. %r4,%r4,3 beqlr+ - addi r3,r3,3 + addi %r3,%r3,3 b bzero8 .globl _C_LABEL(darwin_commpage_bzero_size) _C_LABEL(darwin_commpage_bzero_size) = .-_C_LABEL(darwin_commpage_bzero) @@ -98,7 +98,7 @@ _C_LABEL(darwin_commpage_bzero_size) = .-_C_LABEL(darwin_commpage_bzero) */ .globl _C_LABEL(darwin_commpage_pthread_self) _C_LABEL(darwin_commpage_pthread_self): - li r0,MACH_FASTTRAPS_SYS_cthread_self+MACH_FASTTRAPS + li %r0,MACH_FASTTRAPS_SYS_cthread_self+MACH_FASTTRAPS sc blr .globl _C_LABEL(darwin_commpage_pthread_self_size) @@ -109,7 +109,7 @@ _C_LABEL(darwin_commpage_pthread_self_size) = .-_C_LABEL(darwin_commpage_pthread */ .globl _C_LABEL(darwin_commpage_gettimeofday) _C_LABEL(darwin_commpage_gettimeofday): - li r0,DARWIN_SYS_gettimeofday + li %r0,DARWIN_SYS_gettimeofday sc blr /* Skipped on success */ blr @@ -126,14 +126,14 @@ _C_LABEL(darwin_commpage_gettimeofday_size) = .-_C_LABEL(darwin_commpage_gettime */ .globl _C_LABEL(darwin_commpage_bigcopy) _C_LABEL(darwin_commpage_bigcopy): - stwu r1,-16(r1) - stw r31,0(r1) -1: lwz r31,0(r12) - stw r31,0(r4) - addi r5,r5,-4 - cmplwi r5,0 + stwu %r1,-16(%r1) + stw %r31,0(%r1) +1: lwz %r31,0(%r12) + stw %r31,0(%r4) + addi %r5,%r5,-4 + cmplwi %r5,0 bgt 1b - lwz r31,0(r1) + lwz %r31,0(%r1) blr .globl _C_LABEL(darwin_commpage_bigcopy_size) _C_LABEL(darwin_commpage_bigcopy_size) = .-_C_LABEL(darwin_commpage_bigcopy) @@ -143,9 +143,9 @@ _C_LABEL(darwin_commpage_bigcopy_size) = .-_C_LABEL(darwin_commpage_bigcopy) */ .globl _C_LABEL(darwin_commpage_bcopy) _C_LABEL(darwin_commpage_bcopy): - mr r6,r3 /* swap $1 and $2 */ - mr r3,r4 - mr r4,r6 + mr %r6,%r3 /* swap $1 and $2 */ + mr %r3,%r4 + mr %r4,%r6 ba 0xffff87a0 /* Absolute branch to memcpy */ .globl _C_LABEL(darwin_commpage_bcopy_size) _C_LABEL(darwin_commpage_bcopy_size) = .-_C_LABEL(darwin_commpage_bcopy) @@ -155,61 +155,61 @@ _C_LABEL(darwin_commpage_bcopy_size) = .-_C_LABEL(darwin_commpage_bcopy) */ .globl _C_LABEL(darwin_commpage_memcpy) _C_LABEL(darwin_commpage_memcpy): - subfic r0,r5,0 - adde r9,r0,r5 - stwu r1,-16(r1) - xor r0,r3,r4 - subfic r8,r0,0 - adde r0,r8,r0 - or. r11,r9,r0 - mr r11,r3 + subfic %r0,%r5,0 + adde %r9,%r0,%r5 + stwu %r1,-16(%r1) + xor %r0,%r3,%r4 + subfic %r8,%r0,0 + adde %r0,%r8,%r0 + or. %r11,%r9,%r0 + mr %r11,%r3 bne- memcpy1 - or r0,r4,r3 - andi. r8,r0,3 + or %r0,%r4,%r3 + andi. %r8,%r0,3 beq- memcpy2 - xor r0,r4,r3 - subfic r9,r5,3 - li r9,0 - adde r9,r9,r9 - clrlwi r0,r0,30 - mr r10,r5 - neg r0,r0 - rlwinm r0,r0,1,31,31 - or. r8,r0,r9 + xor %r0,%r4,%r3 + subfic %r9,%r5,3 + li %r9,0 + adde %r9,%r9,%r9 + clrlwi %r0,%r0,30 + mr %r10,%r5 + neg %r0,%r0 + rlwinm %r0,%r0,1,31,31 + or. %r8,%r0,%r9 bne- memcpy3 - clrlwi r0,r4,30 - subfic r10,r0,4 + clrlwi %r0,%r4,30 + subfic %r10,%r0,4 memcpy3: - mtctr r10 - subf r5,r10,r5 + mtctr %r10 + subf %r5,%r10,%r5 memcpy4: - lbz r0,0(r4) - addi r4,r4,1 - stb r0,0(r11) - addi r11,r11,1 + lbz %r0,0(%r4) + addi %r4,%r4,1 + stb %r0,0(%r11) + addi %r11,%r11,1 bdnz+ memcpy4 memcpy2: - rlwinm. r10,r5,30,2,31 + rlwinm. %r10,%r5,30,2,31 beq- memcpy5 - mtctr r10 + mtctr %r10 memcpy6: - lwz r0,0(r4) - addi r4,r4,4 - stw r0,0(r11) - addi r11,r11,4 + lwz %r0,0(%r4) + addi %r4,%r4,4 + stw %r0,0(%r11) + addi %r11,%r11,4 bdnz+ memcpy6 memcpy5: - andi. r10,r5,3 + andi. %r10,%r5,3 beq- memcpy1 - mtctr r10 + mtctr %r10 memcpy7: - lbz r0,0(r4) - addi r4,r4,1 - stb r0,0(r11) - addi r11,r11,1 + lbz %r0,0(%r4) + addi %r4,%r4,1 + stb %r0,0(%r11) + addi %r11,%r11,1 bdnz+ memcpy7 memcpy1: - addi r1,r1,16 + addi %r1,%r1,16 blr .globl _C_LABEL(darwin_commpage_memcpy_size) _C_LABEL(darwin_commpage_memcpy_size) = .-_C_LABEL(darwin_commpage_memcpy) @@ -220,11 +220,11 @@ _C_LABEL(darwin_commpage_memcpy_size) = .-_C_LABEL(darwin_commpage_memcpy) */ .globl _C_LABEL(darwin_commpage_pthread_getspecific) _C_LABEL(darwin_commpage_pthread_getspecific): - rlwinm r5,r3,2,0,29 - li r0,MACH_FASTTRAPS_SYS_cthread_self+MACH_FASTTRAPS + rlwinm %r5,%r3,2,0,29 + li %r0,MACH_FASTTRAPS_SYS_cthread_self+MACH_FASTTRAPS sc - add r5,r5,r4 - lwzx r3,r3,r5 + add %r5,%r5,%r4 + lwzx %r3,%r3,%r5 blr .globl _C_LABEL(darwin_commpage_pthread_getspecific_size) _C_LABEL(darwin_commpage_pthread_getspecific_size) = .-_C_LABEL(darwin_commpage_pthread_getspecific) @@ -234,10 +234,10 @@ _C_LABEL(darwin_commpage_pthread_getspecific_size) = .-_C_LABEL(darwin_commpage_ */ .globl _C_LABEL(darwin_commpage_mach_absolute_time) _C_LABEL(darwin_commpage_mach_absolute_time): -1: mftbu r3 - mftb r4 - mftbu r5 - cmpw r3,r5 +1: mftbu %r3 + mftb %r4 + mftbu %r5 + cmpw %r3,%r5 bne- 1b blr .globl _C_LABEL(darwin_commpage_mach_absolute_time_size) @@ -251,9 +251,9 @@ _C_LABEL(darwin_commpage_mach_absolute_time_size) = .-_C_LABEL(darwin_commpage_m */ .globl _C_LABEL(darwin_commpage_sys_dcache_flush) _C_LABEL(darwin_commpage_sys_dcache_flush): -1: dcbf 0,r3 - addi r3,r3,32 /* CACHELINESIZE */ - addic. r4,r4,-32 /* len -= CACHELINESIZE */ +1: dcbf 0,%r3 + addi %r3,%r3,32 /* CACHELINESIZE */ + addic. %r4,%r4,-32 /* len -= CACHELINESIZE */ bgt 1b sync blr @@ -265,14 +265,14 @@ _C_LABEL(darwin_commpage_sys_dcache_flush_size) = .-_C_LABEL(darwin_commpage_sys */ .globl _C_LABEL(darwin_commpage_sys_icache_invalidate) _C_LABEL(darwin_commpage_sys_icache_invalidate): - mr r5,r3 - mr r6,r4 - mflr r7 + mr %r5,%r3 + mr %r6,%r4 + mflr %r7 bla 0xffff84e0 /* Absolute branch to dcache_flush */ - mtlr r7 -1: icbi 0,r5 - addi r5,r5,32 /* CACHELINESIZE */ - addic. r6,r6,-32 /* len -= CACHELINESIZE */ + mtlr %r7 +1: icbi 0,%r5 + addi %r5,%r5,32 /* CACHELINESIZE */ + addic. %r6,%r6,-32 /* len -= CACHELINESIZE */ bgt 1b isync blr @@ -284,20 +284,20 @@ _C_LABEL(darwin_commpage_sys_icache_invalidate_size) = .-_C_LABEL(darwin_commpag */ .globl _C_LABEL(darwin_commpage_spinlock_try) _C_LABEL(darwin_commpage_spinlock_try): - li r4,1 - lwarx r5,0,r3 - cmpwi r5,0 + li %r4,1 + lwarx %r5,0,%r3 + cmpwi %r5,0 bne- 2f /* * OSX seems to store the address of the lock here. i.e. the equivalent of * stwcx. r3,0,r3 !!! */ - stwcx. r4,0,r3 + stwcx. %r4,0,%r3 bne- 2f - mr r3,r4 + mr %r3,%r4 isync blr -2: li r3,0 +2: li %r3,0 blr .globl _C_LABEL(darwin_commpage_spinlock_try_size) _C_LABEL(darwin_commpage_spinlock_try_size) = .-_C_LABEL(darwin_commpage_spinlock_try) @@ -307,16 +307,16 @@ _C_LABEL(darwin_commpage_spinlock_try_size) = .-_C_LABEL(darwin_commpage_spinloc */ .globl _C_LABEL(darwin_commpage_spinlock_lock) _C_LABEL(darwin_commpage_spinlock_lock): - mr r6,r3 /* copy *p - r6/r7/r8 used for temps */ - li r7,1 -1: lwarx r8,0,r6 - cmpwi r8,0 + mr %r6,%r3 /* copy *p - r6/r7/r8 used for temps */ + li %r7,1 +1: lwarx %r8,0,%r6 + cmpwi %r8,0 bnea- 0xffff85c0 /* Absolute branch to spinlock_relinquish */ /* * OSX seems to store the address of the lock here. i.e. the equivalent of * stwcx. r6,0,r3 !!! */ - stwcx. r7,0,r6 + stwcx. %r7,0,%r6 bnea- 0xffff85c0 /* Absolute branch to spinlock_relinquish */ isync blr @@ -329,8 +329,8 @@ _C_LABEL(darwin_commpage_spinlock_lock_size) = .-_C_LABEL(darwin_commpage_spinlo .globl _C_LABEL(darwin_commpage_spinlock_unlock) _C_LABEL(darwin_commpage_spinlock_unlock): sync - li r4,0 - stw r4,0(r3) + li %r4,0 + stw %r4,0(%r3) blr .globl _C_LABEL(darwin_commpage_spinlock_unlock_size) _C_LABEL(darwin_commpage_spinlock_unlock_size) = .-_C_LABEL(darwin_commpage_spinlock_unlock) @@ -340,13 +340,13 @@ _C_LABEL(darwin_commpage_spinlock_unlock_size) = .-_C_LABEL(darwin_commpage_spin */ .globl _C_LABEL(darwin_commpage_spinlock_relinquish) _C_LABEL(darwin_commpage_spinlock_relinquish): - mr r6,r3 - li r3,0 /* THREAD_NULL */ - li r4,1 /* MACH_SWITCH_OPTION_DEPRESS */ - li r5,1 /* 1ms */ - li r0,-MACH_SYS_syscall_thread_switch + mr %r6,%r3 + li %r3,0 /* THREAD_NULL */ + li %r4,1 /* MACH_SWITCH_OPTION_DEPRESS */ + li %r5,1 /* 1ms */ + li %r0,-MACH_SYS_syscall_thread_switch sc - mr r3,r6 + mr %r3,%r6 ba 0xffff8260 /* Absolute branch to spin_lock */ .globl _C_LABEL(darwin_commpage_spinlock_relinquish_size) _C_LABEL(darwin_commpage_spinlock_relinquish_size) = .-_C_LABEL(darwin_commpage_spinlock_relinquish) diff --git a/sys/arch/powerpc/powerpc/lock_stubs.S b/sys/arch/powerpc/powerpc/lock_stubs.S index f6b1b3b84dcd..98cbb4186fd2 100644 --- a/sys/arch/powerpc/powerpc/lock_stubs.S +++ b/sys/arch/powerpc/powerpc/lock_stubs.S @@ -1,4 +1,4 @@ -/* $NetBSD: lock_stubs.S,v 1.2 2007/02/09 21:55:11 ad Exp $ */ +/* $NetBSD: lock_stubs.S,v 1.3 2008/02/14 19:41:54 garbled Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -39,6 +39,7 @@ #include "opt_multiprocessor.h" #include "opt_lockdebug.h" +#define _NOREGNAMES #include #include "assym.h" @@ -58,17 +59,17 @@ */ ENTRY_NOPROFILE(_lock_cas) 1: - lwarx r10,0,r3 - cmpw r10,r4 + lwarx %r10,0,%r3 + cmpw %r10,%r4 bne- 2f - stwcx. r5,0,r3 + stwcx. %r5,0,%r3 bne- 1b SYNC - li r3,1 + li %r3,1 blr 2: SYNC - li r3,0 + li %r3,0 blr #if !defined(LOCKDEBUG) @@ -76,13 +77,13 @@ ENTRY_NOPROFILE(_lock_cas) * void mutex_enter(kmutex_t *); */ ENTRY_NOPROFILE(mutex_enter) - GET_CPUINFO(r8) - ldptr r9,CI_CURLWP(r8) + GET_CPUINFO(%r8) + ldptr %r9,CI_CURLWP(%r8) 1: - lwarx r10,0,r3 - cmpwi r10,0 + lwarx %r10,0,%r3 + cmpwi %r10,0 bne- 2f - stwcx. r9,0,r3 + stwcx. %r9,0,%r3 bne- 1b ISYNC blr @@ -93,15 +94,15 @@ ENTRY_NOPROFILE(mutex_enter) * void mutex_exit(kmutex_t *); */ ENTRY_NOPROFILE(mutex_exit) - GET_CPUINFO(r8) - ldptr r9,CI_CURLWP(r8) + GET_CPUINFO(%r8) + ldptr %r9,CI_CURLWP(%r8) SYNC - li r7,0 + li %r7,0 1: - lwarx r10,0,r3 - cmpw r10,r9 + lwarx %r10,0,%r3 + cmpw %r10,%r9 bne- 2f - stwcx. r7,0,r3 + stwcx. %r7,0,%r3 bne- 1b blr 2: diff --git a/sys/arch/powerpc/powerpc/locore_subr.S b/sys/arch/powerpc/powerpc/locore_subr.S index 5dcb71d5dc6e..e61d397d5d85 100644 --- a/sys/arch/powerpc/powerpc/locore_subr.S +++ b/sys/arch/powerpc/powerpc/locore_subr.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore_subr.S,v 1.34 2008/02/05 18:10:48 garbled Exp $ */ +/* $NetBSD: locore_subr.S,v 1.35 2008/02/14 19:41:54 garbled Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -292,12 +292,12 @@ _C_LABEL(cpu_lwp_bootstrap): #if defined(MULTIPROCESSOR) && !defined(PPC_OEA64) && !defined (PPC_IBM4XX) ENTRY(cpu_spinup_trampoline) - li 0,0 - mtmsr 0 + li %r0,0 + mtmsr %r0 isync - lis 3,_C_LABEL(cpu_hatch_stack)@ha - lwz 1,_C_LABEL(cpu_hatch_stack)@l(3) + lis %r3,_C_LABEL(cpu_hatch_stack)@ha + lwz %r1,_C_LABEL(cpu_hatch_stack)@l(%r3) bl _C_LABEL(cpu_hatch) b _C_LABEL(idle_loop) diff --git a/sys/arch/powerpc/powerpc/pio_subr.S b/sys/arch/powerpc/powerpc/pio_subr.S index da6c18c8ebbc..9961597174cb 100644 --- a/sys/arch/powerpc/powerpc/pio_subr.S +++ b/sys/arch/powerpc/powerpc/pio_subr.S @@ -1,4 +1,4 @@ -/* $NetBSD: pio_subr.S,v 1.10 2005/12/11 12:18:46 christos Exp $ */ +/* $NetBSD: pio_subr.S,v 1.11 2008/02/14 19:41:54 garbled Exp $ */ /* * Copyright (c) 2003 Matt Thomas @@ -46,7 +46,7 @@ /* LINTSTUB: Func: void out8(volatile u_int8_t *a, u_int8_t v) */ ENTRY_NOPROFILE(out8) - stbx 4,0,3 + stbx %r4,0,%r3 eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ blr /* return */ @@ -55,10 +55,10 @@ ENTRY_NOPROFILE(out8) /* LINTSTUB: Func: void bsw1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int8_t v) */ ENTRY_NOPROFILE(bsw1_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bsw1) - stbx 6,4,5 /* store value */ + stbx %r6,%r4,%r5 /* store value */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ blr /* return */ @@ -66,7 +66,7 @@ ENTRY_NOPROFILE(bsw1) /* LINTSTUB: Func: void out16(volatile u_int16_t *a, u_int16_t v) */ ENTRY_NOPROFILE(out16) - sth 4,0(3) + sth %r4,0(%r3) eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ blr /* return */ @@ -75,10 +75,10 @@ ENTRY_NOPROFILE(out16) /* LINTSTUB: Func: void bsw2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int16_t v) */ ENTRY_NOPROFILE(bsw2_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bsw2) - sthx 6,4,5 /* store value */ + sthx %r6,%r4,%r5 /* store value */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ blr /* return */ @@ -86,7 +86,7 @@ ENTRY_NOPROFILE(bsw2) /* LINTSTUB: Func: void out32(volatile u_int32_t *a, u_int32_t v) */ ENTRY_NOPROFILE(out32) - stw 4,0(3) + stw %r4,0(%r3) eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ blr /* return */ @@ -95,10 +95,10 @@ ENTRY_NOPROFILE(out32) /* LINTSTUB: Func: void bsw4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int32_t v) */ ENTRY_NOPROFILE(bsw4_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bsw4) - stwx 6,4,5 /* store value */ + stwx %r6,%r4,%r5 /* store value */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ blr /* return */ @@ -106,11 +106,11 @@ ENTRY_NOPROFILE(bsw4) /* LINTSTUB: Func: void bsw8_s(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int64_t v) */ /* LINTSTUB: Func: void bsw8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int64_t v) */ ENTRY_NOPROFILE(bsw8_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bsw8) #ifdef __ARCH64__ - stdx 6,4,5 /* store value */ + stdx %r6,%r4,%r5 /* store value */ #else trap /* die */ #endif @@ -121,7 +121,7 @@ ENTRY_NOPROFILE(bsw8) /* LINTSTUB: Func: void out16rb(volatile u_int16_t *a, u_int16_t v) */ ENTRY_NOPROFILE(out16rb) - sthbrx 4,0,3 + sthbrx %r4,0,%r3 eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ blr /* return */ @@ -131,10 +131,10 @@ ENTRY_NOPROFILE(out16rb) ENTRY_NOPROFILE(bsw2rb_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bsw2rb) - sthbrx 6,4,5 /* store value */ + sthbrx %r6,%r4,%r5 /* store value */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ blr /* return */ @@ -142,7 +142,7 @@ ENTRY_NOPROFILE(bsw2rb) /* LINTSTUB: Func: void out32rb(volatile u_int32_t *a, u_int32_t v) */ ENTRY_NOPROFILE(out32rb) - stwbrx 4,0,3 + stwbrx %r4,0,%r3 eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ blr /* return */ @@ -151,10 +151,10 @@ ENTRY_NOPROFILE(out32rb) /* LINTSTUB: Func: void bsw4rb(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int32_t v) */ ENTRY_NOPROFILE(bsw4rb_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bsw4rb) - stwbrx 6,4,5 /* store value */ + stwbrx %r6,%r4,%r5 /* store value */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ blr /* return */ @@ -163,11 +163,11 @@ ENTRY_NOPROFILE(bsw4rb) /* LINTSTUB: Func: void bsw8rb(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int64_t v) */ ENTRY_NOPROFILE(bsw8rb_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bsw8rb) #ifdef __ARCH64__ - stdbrx 6,4,5 /* store value */ + stdbrx %r6,%r4,%r5 /* store value */ #else trap /* die */ #endif @@ -178,7 +178,7 @@ ENTRY_NOPROFILE(bsw8rb) /* LINTSTUB: Func: int in8(const volatile u_int8_t *a) */ ENTRY_NOPROFILE(in8) - lbz 3,0(3) + lbz %r3,0(%r3) eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ blr /* return */ @@ -187,10 +187,10 @@ ENTRY_NOPROFILE(in8) /* LINTSTUB: Func: int bsr1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o) */ ENTRY_NOPROFILE(bsr1_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bsr1) - lbzx 3,4,5 /* load value */ + lbzx %r3,%r4,%r5 /* load value */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ blr /* return */ @@ -198,7 +198,7 @@ ENTRY_NOPROFILE(bsr1) /* LINTSTUB: Func: int in16(const volatile u_int16_t *a) */ ENTRY_NOPROFILE(in16) - lhz 3,0(3) + lhz %r3,0(%r3) eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ blr /* return */ @@ -207,10 +207,10 @@ ENTRY_NOPROFILE(in16) /* LINTSTUB: Func: int bsr2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o) */ ENTRY_NOPROFILE(bsr2_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bsr2) - lhzx 3,4,5 /* load value */ + lhzx %r3,%r4,%r5 /* load value */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ blr /* return */ @@ -218,7 +218,7 @@ ENTRY_NOPROFILE(bsr2) /* LINTSTUB: Func: int in32(const volatile u_int32_t *a) */ ENTRY_NOPROFILE(in32) - lwz 3,0(3) + lwz %r3,0(%r3) eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ blr /* return */ @@ -227,10 +227,10 @@ ENTRY_NOPROFILE(in32) /* LINTSTUB: Func: int bsr4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o) */ ENTRY_NOPROFILE(bsr4_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bsr4) - lwzx 3,4,5 /* load value */ + lwzx %r3,%r4,%r5 /* load value */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ blr /* return */ @@ -239,11 +239,11 @@ ENTRY_NOPROFILE(bsr4) /* LINTSTUB: Func: u_int64_t bsr8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o) */ ENTRY_NOPROFILE(bsr8_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bsr8) #ifdef __ARCH64__ - lwdx 3,4,5 /* load value */ + lwdx %r3,%r4,%r5 /* load value */ #else trap #endif @@ -254,7 +254,7 @@ ENTRY_NOPROFILE(bsr8) /* LINTSTUB: Func: int in16rb(const volatile u_int16_t *a) */ ENTRY_NOPROFILE(in16rb) - lhbrx 3,0,3 + lhbrx %r3,0,%r3 eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ blr /* return */ @@ -263,10 +263,10 @@ ENTRY_NOPROFILE(in16rb) /* LINTSTUB: Func: int bsr2rb(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o) */ ENTRY_NOPROFILE(bsr2rb_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bsr2rb) - lhbrx 3,4,5 /* load value */ + lhbrx %r3,%r4,%r5 /* load value */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ blr /* return */ @@ -274,7 +274,7 @@ ENTRY_NOPROFILE(bsr2rb) /* LINTSTUB: Func: int in32rb(const volatile u_int32_t *a) */ ENTRY_NOPROFILE(in32rb) - lwbrx 3,0,3 + lwbrx %r3,0,%r3 eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ blr /* return */ @@ -283,10 +283,10 @@ ENTRY_NOPROFILE(in32rb) /* LINTSTUB: Func: int bsr4rb(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o) */ ENTRY_NOPROFILE(bsr4rb_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bsr4rb) - lwbrx 3,4,5 /* load value */ + lwbrx %r3,%r4,%r5 /* load value */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ blr /* return */ @@ -295,11 +295,11 @@ ENTRY_NOPROFILE(bsr4rb) /* LINTSTUB: Func: u_int64_t bsr8rb(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o) */ ENTRY_NOPROFILE(bsr8rb_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bsr8rb) #ifdef __ARCH64__ - ldbrx 3,4,5 /* load value */ + ldbrx %r3,%r4,%r5 /* load value */ #else trap #endif @@ -312,21 +312,21 @@ ENTRY_NOPROFILE(bsr8rb) /* LINTSTUB: Func: void outs8(volatile u_int8_t *dst, const u_int8_t *src, size_t len) */ ENTRY_NOPROFILE(bswm1_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bswm1) - add 3,4,5 /* add offset to handle & place in argument 0 */ - mr 4,6 /* move addr to argument 1 register */ - mr 5,7 /* move count to argument 2 register */ + add %r3,%r4,%r5 /* add offset to handle & place in argument 0 */ + mr %r4,%r6 /* move addr to argument 1 register */ + mr %r5,%r7 /* move count to argument 2 register */ ENTRY_NOPROFILE(outs8) - cmpwi 5,0 /* len == 0? */ + cmpwi %r5,0 /* len == 0? */ beqlr- /* return if len == 0 */ - addi 5,5,-1 /* len -= 1 */ - add 5,5,4 /* len += src */ - addi 4,4,-1 /* pre-decrement */ -1: lbzu 0,1(4) /* load and increment */ - stb 0,0(3) /* store */ - cmpl 0,4,5 /* at the end? */ + addi %r5,%r5,-1 /* len -= 1 */ + add %r5,%r5,%r4 /* len += src */ + addi %r4,%r4,-1 /* pre-decrement */ +1: lbzu %r0,1(%r4) /* load and increment */ + stb %r0,0(%r3) /* store */ + cmpl 0,%r4,%r5 /* at the end? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -337,22 +337,22 @@ ENTRY_NOPROFILE(outs8) /* LINTSTUB: Func: void outs16(volatile u_int16_t *dst, const u_int16_t *src, size_t len) */ ENTRY_NOPROFILE(bswm2_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bswm2) - add 3,4,5 /* add offset to handle & place in argument 0 */ - mr 4,6 /* move addr to argument 1 register */ - mr 5,7 /* move count to argument 2 register */ + add %r3,%r4,%r5 /* add offset to handle & place in argument 0 */ + mr %r4,%r6 /* move addr to argument 1 register */ + mr %r5,%r7 /* move count to argument 2 register */ ENTRY_NOPROFILE(outs16) - cmpwi 5,0 /* len == 0? */ + cmpwi %r5,0 /* len == 0? */ beqlr- /* return if len == 0 */ - addi 5,5,-1 /* len -= 1 */ - slwi 5,5,1 /* len *= 2 */ - add 5,5,4 /* len += src */ - addi 4,4,-2 /* pre-decrement */ -1: lhzu 0,2(4) /* load and increment */ - sth 0,0(3) /* store */ - cmpl 0,4,5 /* at the end? */ + addi %r5,%r5,-1 /* len -= 1 */ + slwi %r5,%r5,1 /* len *= 2 */ + add %r5,%r5,%r4 /* len += src */ + addi %r4,%r4,-2 /* pre-decrement */ +1: lhzu %r0,2(%r4) /* load and increment */ + sth %r0,0(%r3) /* store */ + cmpl 0,%r4,%r5 /* at the end? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -363,22 +363,22 @@ ENTRY_NOPROFILE(outs16) /* LINTSTUB: Func: void outs32(volatile u_int32_t *dst, const u_int32_t *src, size_t len) */ ENTRY_NOPROFILE(bswm4_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bswm4) - add 3,4,5 /* add offset to handle & place in argument 0 */ - mr 4,6 /* move addr to argument 1 register */ - mr 5,7 /* move count to argument 2 register */ + add %r3,%r4,%r5 /* add offset to handle & place in argument 0 */ + mr %r4,%r6 /* move addr to argument 1 register */ + mr %r5,%r7 /* move count to argument 2 register */ ENTRY_NOPROFILE(outs32) - cmpwi 5,0 /* len == 0? */ + cmpwi %r5,0 /* len == 0? */ beqlr- /* return if len == 0 */ - addi 5,5,-1 /* len -= 1 */ - slwi 5,5,2 /* len *= 4 */ - add 5,5,4 /* len += src */ - addi 4,4,-4 /* pre-decrement */ -1: lwzu 0,4(4) /* load and increment */ - stw 0,0(3) /* store */ - cmpl 0,4,5 /* at the end? */ + addi %r5,%r5,-1 /* len -= 1 */ + slwi %r5,%r5,2 /* len *= 4 */ + add %r5,%r5,%r4 /* len += src */ + addi %r4,%r4,-4 /* pre-decrement */ +1: lwzu %r0,4(%r4) /* load and increment */ + stw %r0,0(%r3) /* store */ + cmpl 0,%r4,%r5 /* at the end? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -389,22 +389,22 @@ ENTRY_NOPROFILE(outs32) #ifdef _LP64 ENTRY_NOPROFILE(bswm8_s) - ld 0,0(3) /* get log2(stride) */ - rotld 5,5,0 /* shift offset */ + ld %r0,0(%r3) /* get log2(stride) */ + rotld %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bswm8) - add 3,4,5 /* add offset to handle & place in argument 0 */ - mr 4,6 /* move addr to argument 1 register */ - mr 5,7 /* move count to argument 2 register */ + add %r3,%r4,%r5 /* add offset to handle & place in argument 0 */ + mr %r4,%r6 /* move addr to argument 1 register */ + mr %r5,%r7 /* move count to argument 2 register */ ENTRY_NOPROFILE(outs32) - cmpdi 5,0 /* len == 0? */ + cmpdi %r5,0 /* len == 0? */ beqlr- /* return if len == 0 */ - addi 5,5,-1 /* len -= 1 */ - sldi 5,5,2 /* len *= 4 */ - add 5,5,4 /* len += src */ - addi 4,4,-4 /* pre-decrement */ -1: ldzu 0,4(4) /* load and increment */ - std 0,0(3) /* store */ - cmpl 0,4,5 /* at the end? */ + addi %r5,%r5,-1 /* len -= 1 */ + sldi %r5,%r5,2 /* len *= 4 */ + add %r5,%r5,%r4 /* len += src */ + addi %r4,%r4,-4 /* pre-decrement */ +1: ldzu %r0,4(%r4) /* load and increment */ + std %r0,0(%r3) /* store */ + cmpl 0,%r4,%r5 /* at the end? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -420,22 +420,22 @@ ENTRY_NOPROFILE(bswm8) /* LINTSTUB: Func: void outs16rb(volatile u_int16_t *dst, const u_int16_t *src, size_t len) */ ENTRY_NOPROFILE(bswm2rb_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bswm2rb) - add 3,4,5 /* add offset to handle & place in argument 0 */ - mr 4,6 /* move addr to argument 1 register */ - mr 5,7 /* move count to argument 2 register */ + add %r3,%r4,%r5 /* add offset to handle & place in argument 0 */ + mr %r4,%r6 /* move addr to argument 1 register */ + mr %r5,%r7 /* move count to argument 2 register */ ENTRY_NOPROFILE(outs16rb) - cmpwi 5,0 /* len == 0? */ + cmpwi %r5,0 /* len == 0? */ beqlr- /* return if len == 0 */ - addi 5,5,-1 /* len -= 1 */ - slwi 5,5,1 /* len *= 2 */ - add 5,5,4 /* len += src */ - addi 4,4,-2 /* pre-decrement */ -1: lwzu 0,2(4) /* load and increment */ - sthbrx 0,0,3 /* store (byte-reversed) */ - cmpl 0,4,5 /* at the end? */ + addi %r5,%r5,-1 /* len -= 1 */ + slwi %r5,%r5,1 /* len *= 2 */ + add %r5,%r5,%r4 /* len += src */ + addi %r4,%r4,-2 /* pre-decrement */ +1: lwzu %r0,2(%r4) /* load and increment */ + sthbrx %r0,0,%r3 /* store (byte-reversed) */ + cmpl 0,%r4,%r5 /* at the end? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -446,22 +446,22 @@ ENTRY_NOPROFILE(outs16rb) /* LINTSTUB: Func: void outs32rb(volatile u_int32_t *dst, const u_int32_t *src, size_t len) */ ENTRY_NOPROFILE(bswm4rb_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bswm4rb) - add 3,4,5 /* add offset to handle & place in argument 0 */ - mr 4,6 /* move addr to argument 1 register */ - mr 5,7 /* move count to argument 2 register */ + add %r3,%r4,%r5 /* add offset to handle & place in argument 0 */ + mr %r4,%r6 /* move addr to argument 1 register */ + mr %r5,%r7 /* move count to argument 2 register */ ENTRY_NOPROFILE(outs32rb) - cmpwi 5,0 /* len == 0? */ + cmpwi %r5,0 /* len == 0? */ beqlr- /* return if len == 0 */ - addi 5,5,-1 /* len -= 1 */ - slwi 5,5,2 /* len *= 4 */ - add 5,5,4 /* len += src */ - addi 4,4,-4 /* pre-decrement */ -1: lwzu 0,4(4) /* load and increment */ - stwbrx 0,0,3 /* store (byte-reversed) */ - cmpl 0,4,5 /* at the end? */ + addi %r5,%r5,-1 /* len -= 1 */ + slwi %r5,%r5,2 /* len *= 4 */ + add %r5,%r5,%r4 /* len += src */ + addi %r4,%r4,-4 /* pre-decrement */ +1: lwzu %r0,4(%r4) /* load and increment */ + stwbrx %r0,0,%r3 /* store (byte-reversed) */ + cmpl 0,%r4,%r5 /* at the end? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -478,21 +478,21 @@ ENTRY_NOPROFILE(bswm8rb) /* LINTSTUB: Func: void ins8(const volatile u_int8_t *src, u_int8_t *dst, size_t len) */ ENTRY_NOPROFILE(bsrm1_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bsrm1) - add 3,4,5 /* add offset to handle & place in argument 0 */ - mr 4,6 /* move addr to argument 1 register */ - mr 5,7 /* move count to argument 2 register */ + add %r3,%r4,%r5 /* add offset to handle & place in argument 0 */ + mr %r4,%r6 /* move addr to argument 1 register */ + mr %r5,%r7 /* move count to argument 2 register */ ENTRY_NOPROFILE(ins8) - cmpwi 5,0 /* len == 0? */ + cmpwi %r5,0 /* len == 0? */ beqlr- /* return if len == 0 */ - addi 5,5,-1 /* len -= 1 */ - add 5,5,4 /* len += src */ - addi 4,4,-1 /* pre-decrement */ -1: lbz 0,0(3) /* load value */ - stbu 0,1(4) /* store and increment */ - cmpl 0,4,5 /* at the end? */ + addi %r5,%r5,-1 /* len -= 1 */ + add %r5,%r5,%r4 /* len += src */ + addi %r4,%r4,-1 /* pre-decrement */ +1: lbz %r0,0(%r3) /* load value */ + stbu %r0,1(%r4) /* store and increment */ + cmpl 0,%r4,%r5 /* at the end? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -503,22 +503,22 @@ ENTRY_NOPROFILE(ins8) /* LINTSTUB: Func: void ins16(const volatile u_int16_t *src, u_int16_t *dst, size_t len) */ ENTRY_NOPROFILE(bsrm2_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bsrm2) - add 3,4,5 /* add offset to handle & place in argument 0 */ - mr 4,6 /* move addr to argument 1 register */ - mr 5,7 /* move count to argument 2 register */ + add %r3,%r4,%r5 /* add offset to handle & place in argument 0 */ + mr %r4,%r6 /* move addr to argument 1 register */ + mr %r5,%r7 /* move count to argument 2 register */ ENTRY_NOPROFILE(ins16) - cmpwi 5,0 /* len == 0? */ + cmpwi %r5,0 /* len == 0? */ beqlr- /* return if len == 0 */ - addi 5,5,-1 /* len -= 1 */ - slwi 5,5,1 /* len *= 2 */ - add 5,5,4 /* len += src */ - addi 4,4,-2 /* pre-decrement */ -1: lhz 0,0(3) /* load value */ - sthu 0,2(4) /* store and increment */ - cmpl 0,4,5 /* at the end? */ + addi %r5,%r5,-1 /* len -= 1 */ + slwi %r5,%r5,1 /* len *= 2 */ + add %r5,%r5,%r4 /* len += src */ + addi %r4,%r4,-2 /* pre-decrement */ +1: lhz %r0,0(%r3) /* load value */ + sthu %r0,2(%r4) /* store and increment */ + cmpl 0,%r4,%r5 /* at the end? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -529,22 +529,22 @@ ENTRY_NOPROFILE(ins16) /* LINTSTUB: Func: void ins32(const volatile u_int32_t *src, u_int32_t *dst, size_t len) */ ENTRY_NOPROFILE(bsrm4_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bsrm4) - add 3,4,5 /* add offset to handle & place in argument 0 */ - mr 4,6 /* move addr to argument 1 register */ - mr 5,7 /* move count to argument 2 register */ + add %r3,%r4,%r5 /* add offset to handle & place in argument 0 */ + mr %r4,%r6 /* move addr to argument 1 register */ + mr %r5,%r7 /* move count to argument 2 register */ ENTRY_NOPROFILE(ins32) - cmpwi 5,0 /* len == 0? */ + cmpwi %r5,0 /* len == 0? */ beqlr- /* return if len == 0 */ - addi 5,5,-1 /* len -= 1 */ - slwi 5,5,2 /* len *= 4 */ - add 5,5,4 /* len += src */ - addi 4,4,-4 /* pre-decrement */ -1: lwz 0,0(3) /* load value */ - stwu 0,4(4) /* store and increment */ - cmpl 0,4,5 /* at the end? */ + addi %r5,%r5,-1 /* len -= 1 */ + slwi %r5,%r5,2 /* len *= 4 */ + add %r5,%r5,%r4 /* len += src */ + addi %r4,%r4,-4 /* pre-decrement */ +1: lwz %r0,0(%r3) /* load value */ + stwu %r0,4(%r4) /* store and increment */ + cmpl 0,%r4,%r5 /* at the end? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -560,22 +560,22 @@ ENTRY_NOPROFILE(bsrm8) /* LINTSTUB: Func: void ins16rb(const volatile u_int16_t *src, u_int16_t *dst, size_t len) */ ENTRY_NOPROFILE(bsrm2rb_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bsrm2rb) - add 3,4,5 /* add offset to handle & place in argument 0 */ - mr 4,6 /* move addr to argument 1 register */ - mr 5,7 /* move count to argument 2 register */ + add %r3,%r4,%r5 /* add offset to handle & place in argument 0 */ + mr %r4,%r6 /* move addr to argument 1 register */ + mr %r5,%r7 /* move count to argument 2 register */ ENTRY_NOPROFILE(ins16rb) - cmpwi 5,0 /* len == 0? */ + cmpwi %r5,0 /* len == 0? */ beqlr- /* return if len == 0 */ - addi 5,5,-1 /* len -= 1 */ - slwi 5,5,1 /* len *= 2 */ - add 5,5,4 /* len += src */ - addi 4,4,-2 /* pre-decrement */ -1: lhbrx 0,0,3 /* load value (byte reversed) */ - sthu 0,2(4) /* store and increment */ - cmpl 0,4,5 /* at the end? */ + addi %r5,%r5,-1 /* len -= 1 */ + slwi %r5,%r5,1 /* len *= 2 */ + add %r5,%r5,%r4 /* len += src */ + addi %r4,%r4,-2 /* pre-decrement */ +1: lhbrx %r0,0,%r3 /* load value (byte reversed) */ + sthu %r0,2(%r4) /* store and increment */ + cmpl 0,%r4,%r5 /* at the end? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -585,22 +585,22 @@ ENTRY_NOPROFILE(ins16rb) /* LINTSTUB: Func: void bsrm4rb(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int32_t *addr, bus_size_t len) */ /* LINTSTUB: Func: void ins32rb(const volatile u_int32_t *src, u_int32_t *dst, size_t len) */ ENTRY_NOPROFILE(bsrm4rb_s) - lwz 0,0(3) /* get log2(stride) */ - rotlw 5,5,0 /* shift offset */ + lwz %r0,0(%r3) /* get log2(stride) */ + rotlw %r5,%r5,%r0 /* shift offset */ ENTRY_NOPROFILE(bsrm4rb) - add 3,4,5 /* add offset to handle & place in argument 0 */ - mr 4,6 /* move addr to argument 1 register */ - mr 5,7 /* move count to argument 2 register */ + add %r3,%r4,%r5 /* add offset to handle & place in argument 0 */ + mr %r4,%r6 /* move addr to argument 1 register */ + mr %r5,%r7 /* move count to argument 2 register */ ENTRY_NOPROFILE(ins32rb) - cmpwi 5,0 /* len == 0? */ + cmpwi %r5,0 /* len == 0? */ beqlr- /* return if len == 0 */ - addi 5,5,-1 /* len -= 1 */ - slwi 5,5,2 /* len *= 4 */ - add 5,5,4 /* len += src */ - addi 4,4,-4 /* pre-decrement */ -1: lwbrx 0,0,3 /* load value (byte reversed) */ - stwu 0,4(4) /* store and increment */ - cmpl 0,4,5 /* at the end? */ + addi %r5,%r5,-1 /* len -= 1 */ + slwi %r5,%r5,2 /* len *= 4 */ + add %r5,%r5,%r4 /* len += src */ + addi %r4,%r4,-4 /* pre-decrement */ +1: lwbrx %r0,0,%r3 /* load value (byte reversed) */ + stwu %r0,4(%r4) /* store and increment */ + cmpl 0,%r4,%r5 /* at the end? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -615,24 +615,24 @@ ENTRY_NOPROFILE(bsrm8rb) /* LINTSTUB: Func: void bswr1_s(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int8_t *a, bus_size_t c); */ /* LINTSTUB: Func: void bswr1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int8_t *a, bus_size_t c); */ ENTRY_NOPROFILE(bswr1_s) - lwz 0,0(3) /* get log2(stride) */ - li 8,1 /* distance between dst bytes */ - rotlw 5,5,0 /* shift offset */ - rotlw 8,8,0 /* shift distance */ + lwz %r0,0(%r3) /* get log2(stride) */ + li %r8,1 /* distance between dst bytes */ + rotlw %r5,%r5,%r0 /* shift offset */ + rotlw %r8,%r8,%r0 /* shift distance */ b .Lbswr1_enter ENTRY_NOPROFILE(bswr1) - li 8,1 /* distance between dst bytes */ + li %r8,1 /* distance between dst bytes */ .Lbswr1_enter: - add 3,4,5 /* add offset to handle & place in argument 0 */ - cmpwi 7,0 /* len == 0? */ + add %r3,%r4,%r5 /* add offset to handle & place in argument 0 */ + cmpwi %r7,0 /* len == 0? */ beqlr- /* return if len == 0 */ - addi 7,7,-1 /* len -= 1 */ - add 7,7,6 /* len += src */ - addi 6,6,-1 /* pre-decrement */ - sub 3,3,8 -1: lbzu 0,1(6) /* load and increment */ - stbux 0,3,8 /* store and add distance */ - cmpl 0,6,7 /* at the end? */ + addi %r7,%r7,-1 /* len -= 1 */ + add %r7,%r7,%r6 /* len += src */ + addi %r6,%r6,-1 /* pre-decrement */ + sub %r3,%r3,%r8 +1: lbzu %r0,1(%r6) /* load and increment */ + stbux %r0,%r3,%r8 /* store and add distance */ + cmpl 0,%r6,%r7 /* at the end? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -641,25 +641,25 @@ ENTRY_NOPROFILE(bswr1) /* LINTSTUB: Func: void bswr2_s(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int16_t *a, bus_size_t c); */ /* LINTSTUB: Func: void bswr2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int16_t *a, bus_size_t c); */ ENTRY_NOPROFILE(bswr2_s) - lwz 0,0(3) /* get log2(stride) */ - li 8,2 /* distance between dst halfwords */ - rotlw 5,5,0 /* shift offset */ - rotlw 8,8,0 /* shift distance */ + lwz %r0,0(%r3) /* get log2(stride) */ + li %r8,2 /* distance between dst halfwords */ + rotlw %r5,%r5,%r0 /* shift offset */ + rotlw %r8,%r8,%r0 /* shift distance */ b .Lbswr2_enter ENTRY_NOPROFILE(bswr2) - li 8,2 /* distance between dst halfwords */ + li %r8,2 /* distance between dst halfwords */ .Lbswr2_enter: - add 3,4,5 /* add offset to handle & place in argument 0 */ - cmpwi 7,0 /* len == 0? */ + add %r3,%r4,%r5 /* add offset to handle & place in argument 0 */ + cmpwi %r7,0 /* len == 0? */ beqlr- /* return if len == 0 */ - addi 7,7,-1 /* len -= 1 */ - slwi 7,7,1 /* len *= 2 */ - add 7,7,6 /* len += src */ - addi 6,6,-2 /* pre-decrement */ - sub 3,3,8 -1: lhzu 0,2(6) /* load and increment */ - sthux 0,3,8 /* store and add distance */ - cmpl 0,6,7 /* at the end? */ + addi %r7,%r7,-1 /* len -= 1 */ + slwi %r7,%r7,1 /* len *= 2 */ + add %r7,%r7,%r6 /* len += src */ + addi %r6,%r6,-2 /* pre-decrement */ + sub %r3,%r3,%r8 +1: lhzu %r0,2(%r6) /* load and increment */ + sthux %r0,%r3,%r8 /* store and add distance */ + cmpl 0,%r6,%r7 /* at the end? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -668,25 +668,25 @@ ENTRY_NOPROFILE(bswr2) /* LINTSTUB: Func: void bswr2rb_s(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int16_t *a, bus_size_t c); */ /* LINTSTUB: Func: void bswr2rb(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int16_t *a, bus_size_t c); */ ENTRY_NOPROFILE(bswr2rb_s) - lwz 0,0(3) /* get log2(stride) */ - li 8,2 /* distance between dst halfwords */ - rotlw 5,5,0 /* shift offset */ - rotlw 8,8,0 /* shift distance */ + lwz %r0,0(%r3) /* get log2(stride) */ + li %r8,2 /* distance between dst halfwords */ + rotlw %r5,%r5,%r0 /* shift offset */ + rotlw %r8,%r8,%r0 /* shift distance */ b .Lbswr2rb_enter ENTRY_NOPROFILE(bswr2rb) - li 8,2 /* distance between dst halfwords */ + li %r8,2 /* distance between dst halfwords */ .Lbswr2rb_enter: - add 3,4,5 /* add offset to handle & place in argument 0 */ - cmpwi 7,0 /* len == 0? */ + add %r3,%r4,%r5 /* add offset to handle & place in argument 0 */ + cmpwi %r7,0 /* len == 0? */ beqlr- /* return if len == 0 */ - addi 7,7,-1 /* len -= 1 */ - slwi 7,7,1 /* len *= 2 */ - add 7,7,6 /* len += src */ - addi 6,6,-2 /* pre-decrement */ -1: lhzu 0,2(6) /* load and increment */ - sthbrx 0,0,3 /* store (reversed) */ - add 3,3,8 /* dst += distance */ - cmpl 0,6,7 /* at the end? */ + addi %r7,%r7,-1 /* len -= 1 */ + slwi %r7,%r7,1 /* len *= 2 */ + add %r7,%r7,%r6 /* len += src */ + addi %r6,%r6,-2 /* pre-decrement */ +1: lhzu %r0,2(%r6) /* load and increment */ + sthbrx %r0,0,%r3 /* store (reversed) */ + add %r3,%r3,%r8 /* dst += distance */ + cmpl 0,%r6,%r7 /* at the end? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -695,25 +695,25 @@ ENTRY_NOPROFILE(bswr2rb) /* LINTSTUB: Func: void bswr4_s(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int32_t *a, bus_size_t c); */ /* LINTSTUB: Func: void bswr4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int32_t *a, bus_size_t c); */ ENTRY_NOPROFILE(bswr4_s) - lwz 0,0(3) /* get log2(stride) */ - li 8,4 /* distance between dst halfwords */ - rotlw 5,5,0 /* shift offset */ - rotlw 8,8,0 /* shift distance */ + lwz %r0,0(%r3) /* get log2(stride) */ + li %r8,4 /* distance between dst halfwords */ + rotlw %r5,%r5,%r0 /* shift offset */ + rotlw %r8,%r8,%r0 /* shift distance */ b .Lbswr4_enter ENTRY_NOPROFILE(bswr4) - li 8,4 /* distance between dst halfwords */ + li %r8,4 /* distance between dst halfwords */ .Lbswr4_enter: - add 3,4,5 /* add offset to handle & place in argument 0 */ - cmpwi 7,0 /* len == 0? */ + add %r3,%r4,%r5 /* add offset to handle & place in argument 0 */ + cmpwi %r7,0 /* len == 0? */ beqlr- /* return if len == 0 */ - addi 7,7,-1 /* len -= 1 */ - slwi 7,7,2 /* len *= 4 */ - add 7,7,6 /* len += src */ - addi 6,6,-4 /* pre-decrement */ - sub 3,3,8 -1: lwzu 0,4(6) /* load and increment */ - stwux 0,3,8 /* store and add distance */ - cmpl 0,6,7 /* at the end? */ + addi %r7,%r7,-1 /* len -= 1 */ + slwi %r7,%r7,2 /* len *= 4 */ + add %r7,%r7,%r6 /* len += src */ + addi %r6,%r6,-4 /* pre-decrement */ + sub %r3,%r3,%r8 +1: lwzu %r0,4(%r6) /* load and increment */ + stwux %r0,%r3,%r8 /* store and add distance */ + cmpl 0,%r6,%r7 /* at the end? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -722,25 +722,25 @@ ENTRY_NOPROFILE(bswr4) /* LINTSTUB: Func: void bswr4rb_s(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int32_t *a, bus_size_t c); */ /* LINTSTUB: Func: void bswr4rb(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int32_t *a, bus_size_t c); */ ENTRY_NOPROFILE(bswr4rb_s) - lwz 0,0(3) /* get log2(stride) */ - li 8,4 /* distance between dst halfwords */ - rotlw 5,5,0 /* shift offset */ - rotlw 8,8,0 /* shift distance */ + lwz %r0,0(%r3) /* get log2(stride) */ + li %r8,4 /* distance between dst halfwords */ + rotlw %r5,%r5,%r0 /* shift offset */ + rotlw %r8,%r8,%r0 /* shift distance */ b .Lbswr4rb_enter ENTRY_NOPROFILE(bswr4rb) - li 8,4 /* distance between dst halfwords */ + li %r8,4 /* distance between dst halfwords */ .Lbswr4rb_enter: - add 3,4,5 /* add offset to handle & place in argument 0 */ - cmpwi 7,0 /* len == 0? */ + add %r3,%r4,%r5 /* add offset to handle & place in argument 0 */ + cmpwi %r7,0 /* len == 0? */ beqlr- /* return if len == 0 */ - addi 7,7,-1 /* len -= 1 */ - slwi 7,7,2 /* len *= 4 */ - add 7,7,6 /* len += src */ - addi 6,6,-4 /* pre-decrement */ -1: lwzu 0,4(6) /* load and increment */ - stwbrx 0,0,3 /* store (reversed) */ - add 3,3,8 /* dst += distance */ - cmpl 0,6,7 /* at the end? */ + addi %r7,%r7,-1 /* len -= 1 */ + slwi %r7,%r7,2 /* len *= 4 */ + add %r7,%r7,%r6 /* len += src */ + addi %r6,%r6,-4 /* pre-decrement */ +1: lwzu %r0,4(%r6) /* load and increment */ + stwbrx %r0,0,%r3 /* store (reversed) */ + add %r3,%r3,%r8 /* dst += distance */ + cmpl 0,%r6,%r7 /* at the end? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -752,8 +752,8 @@ ENTRY_NOPROFILE(bswr4rb) /* LINTSTUB: Func: void bswr8rb(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int64_t *a, bus_size_t c); */ ENTRY_NOPROFILE(bswr8_s) ENTRY_NOPROFILE(bswr8rb_s) - lwz 0,0(3) - rotlw 5,5,0 + lwz %r0,0(%r3) + rotlw %r5,%r5,%r0 ENTRY_NOPROFILE(bswr8) ENTRY_NOPROFILE(bswr8rb) trap @@ -761,24 +761,24 @@ ENTRY_NOPROFILE(bswr8rb) /* LINTSTUB: Func: void bsrr1_s(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int8_t *a, bus_size_t c); */ /* LINTSTUB: Func: void bsrr1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int8_t *a, bus_size_t c); */ ENTRY_NOPROFILE(bsrr1_s) - lwz 0,0(3) /* get log2(stride) */ - li 8,1 /* distance between src bytes */ - rotlw 5,5,0 /* shift offset */ - rotlw 8,8,0 /* shift distance */ + lwz %r0,0(%r3) /* get log2(stride) */ + li %r8,1 /* distance between src bytes */ + rotlw %r5,%r5,%r0 /* shift offset */ + rotlw %r8,%r8,%r0 /* shift distance */ b .Lbsrr1_enter ENTRY_NOPROFILE(bsrr1) - li 8,1 /* distance between src bytes */ + li %r8,1 /* distance between src bytes */ .Lbsrr1_enter: - add 3,4,5 /* add offset to handle & place in argument 0 */ - cmpwi 7,0 /* len == 0? */ + add %r3,%r4,%r5 /* add offset to handle & place in argument 0 */ + cmpwi %r7,0 /* len == 0? */ beqlr- /* return if len == 0 */ - addi 7,7,-1 /* len -= 1 */ - add 7,7,6 /* len += src */ - addi 6,6,-1 /* pre-decrement */ - sub 3,3,8 -1: lbzux 0,3,8 /* load value and add distance */ - stbu 0,1(6) /* store and increment */ - cmpl 0,6,7 /* at the end? */ + addi %r7,%r7,-1 /* len -= 1 */ + add %r7,%r7,%r6 /* len += src */ + addi %r6,%r6,-1 /* pre-decrement */ + sub %r3,%r3,%r8 +1: lbzux %r0,%r3,%r8 /* load value and add distance */ + stbu %r0,1(%r6) /* store and increment */ + cmpl 0,%r6,%r7 /* at the end? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -787,25 +787,25 @@ ENTRY_NOPROFILE(bsrr1) /* LINTSTUB: Func: void bsrr2_s(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int16_t *a, bus_size_t c); */ /* LINTSTUB: Func: void bsrr2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int16_t *a, bus_size_t c); */ ENTRY_NOPROFILE(bsrr2_s) - lwz 0,0(3) /* get log2(stride) */ - li 8,2 /* distance between src halfwords */ - rotlw 5,5,0 /* shift offset */ - rotlw 8,8,0 /* shift distance */ + lwz %r0,0(%r3) /* get log2(stride) */ + li %r8,2 /* distance between src halfwords */ + rotlw %r5,%r5,%r0 /* shift offset */ + rotlw %r8,%r8,%r0 /* shift distance */ b .Lbsrr2_enter ENTRY_NOPROFILE(bsrr2) - li 8,2 /* distance between src halfwords */ + li %r8,2 /* distance between src halfwords */ .Lbsrr2_enter: - add 3,4,5 /* add offset to handle & place in argument 0 */ - cmpwi 7,0 /* len == 0? */ + add %r3,%r4,%r5 /* add offset to handle & place in argument 0 */ + cmpwi %r7,0 /* len == 0? */ beqlr- /* return if len == 0 */ - addi 7,7,-1 /* len -= 1 */ - slwi 7,7,1 /* len *= 2 */ - add 7,7,6 /* len += src */ - addi 6,6,-2 /* pre-decrement */ - sub 3,3,8 -1: lhzux 0,3,8 /* load value and add distance */ - sthu 0,2(6) /* store and increment */ - cmpl 0,6,7 /* at the end? */ + addi %r7,%r7,-1 /* len -= 1 */ + slwi %r7,%r7,1 /* len *= 2 */ + add %r7,%r7,%r6 /* len += src */ + addi %r6,%r6,-2 /* pre-decrement */ + sub %r3,%r3,%r8 +1: lhzux %r0,%r3,%r8 /* load value and add distance */ + sthu %r0,2(%r6) /* store and increment */ + cmpl 0,%r6,%r7 /* at the end? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -814,25 +814,25 @@ ENTRY_NOPROFILE(bsrr2) /* LINTSTUB: Func: void bsrr2rb_s(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int16_t *a, bus_size_t c); */ /* LINTSTUB: Func: void bsrr2rb(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int16_t *a, bus_size_t c); */ ENTRY_NOPROFILE(bsrr2rb_s) - lwz 0,0(3) /* get log2(stride) */ - li 8,2 /* distance between source halfwords */ - rotlw 5,5,0 /* shift offset */ - rotlw 8,8,0 /* shift distance */ + lwz %r0,0(%r3) /* get log2(stride) */ + li %r8,2 /* distance between source halfwords */ + rotlw %r5,%r5,%r0 /* shift offset */ + rotlw %r8,%r8,%r0 /* shift distance */ b .Lbsrr2rb_enter ENTRY_NOPROFILE(bsrr2rb) - li 8,2 /* distance between source halfwords */ + li %r8,2 /* distance between source halfwords */ .Lbsrr2rb_enter: - add 3,4,5 /* add offset to handle & place in argument 0 */ - cmpwi 7,0 /* len == 0? */ + add %r3,%r4,%r5 /* add offset to handle & place in argument 0 */ + cmpwi %r7,0 /* len == 0? */ beqlr- /* return if len == 0 */ - addi 7,7,-1 /* len -= 1 */ - slwi 7,7,1 /* len *= 2 */ - add 7,7,6 /* len += src */ - addi 6,6,-2 /* pre-decrement */ -1: lhbrx 0,0,3 /* load value (reversed) */ - add 3,3,8 /* src += distance */ - sthu 0,2(6) /* store and increment */ - cmpl 0,6,7 /* at the end? */ + addi %r7,%r7,-1 /* len -= 1 */ + slwi %r7,%r7,1 /* len *= 2 */ + add %r7,%r7,%r6 /* len += src */ + addi %r6,%r6,-2 /* pre-decrement */ +1: lhbrx %r0,0,%r3 /* load value (reversed) */ + add %r3,%r3,%r8 /* src += distance */ + sthu %r0,2(%r6) /* store and increment */ + cmpl 0,%r6,%r7 /* at the end? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -841,25 +841,25 @@ ENTRY_NOPROFILE(bsrr2rb) /* LINTSTUB: Func: void bsrr4_s(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int32_t *a, bus_size_t c); */ /* LINTSTUB: Func: void bsrr4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int32_t *a, bus_size_t c); */ ENTRY_NOPROFILE(bsrr4_s) - lwz 0,0(3) /* get log2(stride) */ - li 8,4 /* distance between src words */ - rotlw 5,5,0 /* shift offset */ - rotlw 8,8,0 /* shift distance */ + lwz %r0,0(%r3) /* get log2(stride) */ + li %r8,4 /* distance between src words */ + rotlw %r5,%r5,%r0 /* shift offset */ + rotlw %r8,%r8,%r0 /* shift distance */ b .Lbsrr4_enter ENTRY_NOPROFILE(bsrr4) - li 8,4 /* distance between src words */ + li %r8,4 /* distance between src words */ .Lbsrr4_enter: - add 3,4,5 /* add offset to handle & place in argument 0 */ - cmpwi 7,0 /* len == 0? */ + add %r3,%r4,%r5 /* add offset to handle & place in argument 0 */ + cmpwi %r7,0 /* len == 0? */ beqlr- /* return if len == 0 */ - addi 7,7,-1 /* len -= 1 */ - slwi 7,7,2 /* len *= 4 */ - add 7,7,6 /* len += src */ - addi 6,6,-4 /* pre-decrement */ - sub 3,3,8 -1: lwzux 0,3,8 /* load value and add distance */ - stwu 0,4(6) /* store and increment */ - cmpl 0,6,7 /* at the end? */ + addi %r7,%r7,-1 /* len -= 1 */ + slwi %r7,%r7,2 /* len *= 4 */ + add %r7,%r7,%r6 /* len += src */ + addi %r6,%r6,-4 /* pre-decrement */ + sub %r3,%r3,%r8 +1: lwzux %r0,%r3,%r8 /* load value and add distance */ + stwu %r0,4(%r6) /* store and increment */ + cmpl 0,%r6,%r7 /* at the end? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -868,26 +868,26 @@ ENTRY_NOPROFILE(bsrr4) /* LINTSTUB: Func: void bsrr4rb_s(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int32_t *a, bus_size_t c); */ /* LINTSTUB: Func: void bsrr4rb(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int32_t *a, bus_size_t c); */ ENTRY_NOPROFILE(bsrr4rb_s) - lwz 0,0(3) /* get log2(stride) */ - li 8,4 /* distance between src words */ - rotlw 5,5,0 /* shift offset */ - rotlw 8,8,0 /* shift distance */ + lwz %r0,0(%r3) /* get log2(stride) */ + li %r8,4 /* distance between src words */ + rotlw %r5,%r5,%r0 /* shift offset */ + rotlw %r8,%r8,%r0 /* shift distance */ b .Lbsrr4rb_enter ENTRY_NOPROFILE(bsrr4rb) - li 8,4 /* distance between src words */ + li %r8,4 /* distance between src words */ .Lbsrr4rb_enter: - add 3,4,5 /* add offset to handle & place in argument 0 */ - mr 4,6 /* move addr to argument 1 register */ - cmpwi 7,0 /* len == 0? */ + add %r3,%r4,%r5 /* add offset to handle & place in argument 0 */ + mr %r4,%r6 /* move addr to argument 1 register */ + cmpwi %r7,0 /* len == 0? */ beqlr- /* return if len == 0 */ - addi 7,7,-1 /* len -= 1 */ - slwi 7,7,2 /* len *= 4 */ - add 7,7,6 /* len += src */ - addi 6,6,-4 /* pre-decrement */ -1: lwbrx 0,0,3 /* load value (reversed) */ - add 3,3,8 /* src += distance */ - sthu 0,4(6) /* store and increment */ - cmpl 0,6,7 /* at the end? */ + addi %r7,%r7,-1 /* len -= 1 */ + slwi %r7,%r7,2 /* len *= 4 */ + add %r7,%r7,%r6 /* len += src */ + addi %r6,%r6,-4 /* pre-decrement */ +1: lwbrx %r0,0,%r3 /* load value (reversed) */ + add %r3,%r3,%r8 /* src += distance */ + sthu %r0,4(%r6) /* store and increment */ + cmpl 0,%r6,%r7 /* at the end? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -899,8 +899,8 @@ ENTRY_NOPROFILE(bsrr4rb) /* LINTSTUB: Func: void bsrr8rb(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int64_t *a, bus_size_t c); */ ENTRY_NOPROFILE(bsrr8_s) ENTRY_NOPROFILE(bsrr8rb_s) - lwz 0,0(3) - rotlw 5,5,0 + lwz %r0,0(%r3) + rotlw %r5,%r5,%r0 ENTRY_NOPROFILE(bsrr8) ENTRY_NOPROFILE(bsrr8rb) trap @@ -908,20 +908,20 @@ ENTRY_NOPROFILE(bsrr8rb) /* LINTSTUB: Func: void bssr1_s(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int8_t v, bus_size_t c); */ /* LINTSTUB: Func: void bssr1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, u_int8_t v, bus_size_t c); */ ENTRY_NOPROFILE(bssr1_s) - lwz 0,0(3) /* get log2(stride) */ - li 8,1 /* distance between src bytes */ - rotlw 5,5,0 /* shift offset */ - rotlw 8,8,0 /* shift distance */ + lwz %r0,0(%r3) /* get log2(stride) */ + li %r8,1 /* distance between src bytes */ + rotlw %r5,%r5,%r0 /* shift offset */ + rotlw %r8,%r8,%r0 /* shift distance */ b .Lbssr1_enter ENTRY_NOPROFILE(bssr1) - li 8,1 /* distance between src bytes */ + li %r8,1 /* distance between src bytes */ .Lbssr1_enter: - cmpwi 7,0 /* len == 0? */ + cmpwi %r7,0 /* len == 0? */ beqlr- /* return if len == 0 */ -1: addi 7,7,-1 /* len -= 1 */ - stbx 6,4,5 /* store value */ - add 5,5,8 /* add offset */ - cmpwi 7,0 /* len == 0? */ +1: addi %r7,%r7,-1 /* len -= 1 */ + stbx %r6,%r4,%r5 /* store value */ + add %r5,%r5,%r8 /* add offset */ + cmpwi %r7,0 /* len == 0? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -930,20 +930,20 @@ ENTRY_NOPROFILE(bssr1) /* LINTSTUB: Func: void bssr2_s(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int16_t v, bus_size_t c); */ /* LINTSTUB: Func: void bssr2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int16_t v, bus_size_t c); */ ENTRY_NOPROFILE(bssr2_s) - lwz 0,0(3) /* get log2(stride) */ - li 8,2 /* distance between src halfwords */ - rotlw 5,5,0 /* shift offset */ - rotlw 8,8,0 /* shift distance */ + lwz %r0,0(%r3) /* get log2(stride) */ + li %r8,2 /* distance between src halfwords */ + rotlw %r5,%r5,%r0 /* shift offset */ + rotlw %r8,%r8,%r0 /* shift distance */ b .Lbssr2_enter ENTRY_NOPROFILE(bssr2) - li 8,2 /* distance between src halfwords */ + li %r8,2 /* distance between src halfwords */ .Lbssr2_enter: - cmpwi 7,0 /* len == 0? */ + cmpwi %r7,0 /* len == 0? */ beqlr- /* return if len == 0 */ -1: addi 7,7,-1 /* len -= 1 */ - sthx 6,4,5 /* store value */ - add 5,5,8 /* add offset */ - cmpwi 7,0 /* len == 0? */ +1: addi %r7,%r7,-1 /* len -= 1 */ + sthx %r6,%r4,%r5 /* store value */ + add %r5,%r5,%r8 /* add offset */ + cmpwi %r7,0 /* len == 0? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -952,20 +952,20 @@ ENTRY_NOPROFILE(bssr2) /* LINTSTUB: Func: void bssr2rb_s(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int16_t v, bus_size_t c); */ /* LINTSTUB: Func: void bssr2rb(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int16_t v, bus_size_t c); */ ENTRY_NOPROFILE(bssr2rb_s) - lwz 0,0(3) /* get log2(stride) */ - li 8,2 /* distance between src halfwords */ - rotlw 5,5,0 /* shift offset */ - rotlw 8,8,0 /* shift distance */ + lwz %r0,0(%r3) /* get log2(stride) */ + li %r8,2 /* distance between src halfwords */ + rotlw %r5,%r5,%r0 /* shift offset */ + rotlw %r8,%r8,%r0 /* shift distance */ b .Lbssr2rb_enter ENTRY_NOPROFILE(bssr2rb) - li 8,2 /* distance between src halfwords */ + li %r8,2 /* distance between src halfwords */ .Lbssr2rb_enter: - cmpwi 7,0 /* len == 0? */ + cmpwi %r7,0 /* len == 0? */ beqlr- /* return if len == 0 */ -1: addi 7,7,-1 /* len -= 1 */ - sthbrx 6,4,5 /* store value */ - add 5,5,8 /* add offset */ - cmpwi 7,0 /* len == 0? */ +1: addi %r7,%r7,-1 /* len -= 1 */ + sthbrx %r6,%r4,%r5 /* store value */ + add %r5,%r5,%r8 /* add offset */ + cmpwi %r7,0 /* len == 0? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -974,20 +974,20 @@ ENTRY_NOPROFILE(bssr2rb) /* LINTSTUB: Func: void bssr4_s(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int32_t v, bus_size_t c); */ /* LINTSTUB: Func: void bssr4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int32_t v, bus_size_t c); */ ENTRY_NOPROFILE(bssr4_s) - lwz 0,0(3) /* get log2(stride) */ - li 8,4 /* distance between src words */ - rotlw 5,5,0 /* shift offset */ - rotlw 8,8,0 /* shift distance */ + lwz %r0,0(%r3) /* get log2(stride) */ + li %r8,4 /* distance between src words */ + rotlw %r5,%r5,%r0 /* shift offset */ + rotlw %r8,%r8,%r0 /* shift distance */ b .Lbssr4_enter ENTRY_NOPROFILE(bssr4) - li 8,4 /* distance between src words */ + li %r8,4 /* distance between src words */ .Lbssr4_enter: - cmpwi 7,0 /* len == 0? */ + cmpwi %r7,0 /* len == 0? */ beqlr- /* return if len == 0 */ -1: addi 7,7,-1 /* len -= 1 */ - stwx 6,4,5 /* store value */ - add 5,5,8 /* add offset */ - cmpwi 7,0 /* len == 0? */ +1: addi %r7,%r7,-1 /* len -= 1 */ + stwx %r6,%r4,%r5 /* store value */ + add %r5,%r5,%r8 /* add offset */ + cmpwi %r7,0 /* len == 0? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -996,20 +996,20 @@ ENTRY_NOPROFILE(bssr4) /* LINTSTUB: Func: void bssr4rb_s(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int32_t v, bus_size_t c); */ /* LINTSTUB: Func: void bssr4rb(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int32_t v, bus_size_t c); */ ENTRY_NOPROFILE(bssr4rb_s) - lwz 0,0(3) /* get log2(stride) */ - li 8,4 /* distance between src words */ - rotlw 5,5,0 /* shift offset */ - rotlw 8,8,0 /* shift distance */ + lwz %r0,0(%r3) /* get log2(stride) */ + li %r8,4 /* distance between src words */ + rotlw %r5,%r5,%r0 /* shift offset */ + rotlw %r8,%r8,%r0 /* shift distance */ b .Lbssr4rb_enter ENTRY_NOPROFILE(bssr4rb) - li 8,4 /* distance between src words */ + li %r8,4 /* distance between src words */ .Lbssr4rb_enter: - cmpwi 7,0 /* len == 0? */ + cmpwi %r7,0 /* len == 0? */ beqlr- /* return if len == 0 */ -1: addi 7,7,-1 /* len -= 1 */ - stwbrx 6,4,5 /* store value */ - add 5,5,8 /* add offset */ - cmpwi 7,0 /* len == 0? */ +1: addi %r7,%r7,-1 /* len -= 1 */ + stwbrx %r6,%r4,%r5 /* store value */ + add %r5,%r5,%r8 /* add offset */ + cmpwi %r7,0 /* len == 0? */ bne+ 1b /* nope, do another pass */ eieio /* memory barrier (reorder protection) */ DBGSYNC /* force exceptions */ @@ -1021,8 +1021,8 @@ ENTRY_NOPROFILE(bssr4rb) /* LINTSTUB: Func: void bssr8rb(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, const u_int64_t v, bus_size_t c); */ ENTRY_NOPROFILE(bssr8_s) ENTRY_NOPROFILE(bssr8rb_s) - lwz 0,0(3) - rotlw 5,5,0 + lwz %r0,0(%r3) + rotlw %r5,%r5,%r0 ENTRY_NOPROFILE(bssr8) ENTRY_NOPROFILE(bssr8rb) trap @@ -1030,40 +1030,40 @@ ENTRY_NOPROFILE(bssr8rb) /* LINTSTUB: Func: void bscr1_s(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, bus_space_handle_t h2, bus_size_t o2, bus_size_t len); */ /* LINTSTUB: Func: void bscr1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, bus_space_handle_t h2, bus_size_t o2, bus_size_t len); */ ENTRY_NOPROFILE(bscr1_s) - lwz 0,0(3) /* get log2(stride) */ + lwz %r0,0(%r3) /* get log2(stride) */ b .Lbscr1_enter ENTRY_NOPROFILE(bscr1) - li 0,0 /* non stride */ + li %r0,0 /* non stride */ .Lbscr1_enter: - li 9,1 /* distance between src bytes */ - rotlw 9,9,0 /* shift distance */ - cmpwi 8,0 /* len == 0? */ + li %r9,1 /* distance between src bytes */ + rotlw %r9,%r9,%r0 /* shift distance */ + cmpwi %r8,0 /* len == 0? */ beqlr- /* return if len == 0 */ - rotlw 5,5,0 /* shift src offset */ - rotlw 7,7,0 /* shift dest offset */ - add 10,4,5 /* calculate src end address */ - add 11,6,7 /* calculate dest end address */ - mtctr 8 - cmpw 10,11 /* compare end address */ + rotlw %r5,%r5,%r0 /* shift src offset */ + rotlw %r7,%r7,%r0 /* shift dest offset */ + add %r10,%r4,%r5 /* calculate src end address */ + add %r11,%r6,%r7 /* calculate dest end address */ + mtctr %r8 + cmpw %r10,%r11 /* compare end address */ blt 2f /* jump if h + o < h2 + o2 */ /* h + o >= h2 + o2 */ -1: lbzx 12,4,5 /* load value */ - stbx 12,6,7 /* store value */ - add 5,5,9 /* src offset += 1 */ - add 7,7,9 /* dest offset += 1 */ +1: lbzx %r12,%r4,%r5 /* load value */ + stbx %r12,%r6,%r7 /* store value */ + add %r5,%r5,%r9 /* src offset += 1 */ + add %r7,%r7,%r9 /* dest offset += 1 */ bdnz+ 1b /* jump if len != 0 */ b .Lbscr1_end /* end */ /* h + o < h2 + o2 */ -2: addi 8,8,-1 /* len -= 1 */ - rotlw 8,8,0 /* shift len */ - add 5,10,8 /* src offset = o + len - 1 */ - add 7,11,8 /* dest offset = o2 + len - 1 */ -3: lbzx 12,4,5 /* load value */ - stbx 12,6,7 /* store value */ - sub 5,5,9 /* src offset -= 1 */ - sub 7,7,9 /* dest offset -= 1 */ +2: addi %r8,%r8,-1 /* len -= 1 */ + rotlw %r8,%r8,%r0 /* shift len */ + add %r5,%r10,%r8 /* src offset = o + len - 1 */ + add %r7,%r11,%r8 /* dest offset = o2 + len - 1 */ +3: lbzx %r12,%r4,%r5 /* load value */ + stbx %r12,%r6,%r7 /* store value */ + sub %r5,%r5,%r9 /* src offset -= 1 */ + sub %r7,%r7,%r9 /* dest offset -= 1 */ bdnz+ 3b /* jump if len != 0 */ .Lbscr1_end: eieio /* memory barrier (reorder protection) */ @@ -1073,40 +1073,40 @@ ENTRY_NOPROFILE(bscr1) /* LINTSTUB: Func: void bscr2_s(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, bus_space_handle_t h2, bus_size_t o2, bus_size_t len); */ /* LINTSTUB: Func: void bscr2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, bus_space_handle_t h2, bus_size_t o2, bus_size_t len); */ ENTRY_NOPROFILE(bscr2_s) - lwz 0,0(3) /* get log2(stride) */ + lwz %r0,0(%r3) /* get log2(stride) */ b .Lbscr2_enter ENTRY_NOPROFILE(bscr2) - li 0,0 /* non stride */ + li %r0,0 /* non stride */ .Lbscr2_enter: - li 9,2 /* distance between src halfwords */ - rotlw 9,9,0 /* shift distance */ - cmpwi 8,0 /* len == 0? */ + li %r9,2 /* distance between src halfwords */ + rotlw %r9,%r9,%r0 /* shift distance */ + cmpwi %r8,0 /* len == 0? */ beqlr- /* return if len == 0 */ - rotlw 5,5,0 /* shift src offset */ - rotlw 7,7,0 /* shift dest offset */ - add 10,4,5 /* calculate src end address */ - add 11,6,7 /* calculate dest end address */ - mtctr 8 - cmpw 10,11 /* compare end address */ + rotlw %r5,%r5,%r0 /* shift src offset */ + rotlw %r7,%r7,%r0 /* shift dest offset */ + add %r10,%r4,%r5 /* calculate src end address */ + add %r11,%r6,%r7 /* calculate dest end address */ + mtctr %r8 + cmpw %r10,%r11 /* compare end address */ blt 2f /* jump if h + o < h2 + o2 */ /* h + o >= h2 + o2 */ -1: lhzx 12,4,5 /* load value */ - sthx 12,6,7 /* store value */ - add 5,5,9 /* src offset += 2 */ - add 7,7,9 /* dest offset += 2 */ +1: lhzx %r12,%r4,%r5 /* load value */ + sthx %r12,%r6,%r7 /* store value */ + add %r5,%r5,%r9 /* src offset += 2 */ + add %r7,%r7,%r9 /* dest offset += 2 */ bdnz+ 1b /* jump if len != 0 */ b .Lbscr2_end /* end */ /* h + o < h2 + o2 */ -2: addi 8,8,-1 /* len -= 1 */ - rotlw 8,8,0 /* shift len */ - add 5,10,8 /* src offset = o + len - 1 */ - add 7,11,8 /* dest offset = o2 + len - 1 */ -3: lhzx 12,4,5 /* load value */ - sthx 12,6,7 /* store value */ - sub 5,5,9 /* src offset -= 2 */ - sub 7,7,9 /* dest offset -= 2 */ +2: addi %r8,%r8,-1 /* len -= 1 */ + rotlw %r8,%r8,%r0 /* shift len */ + add %r5,%r10,%r8 /* src offset = o + len - 1 */ + add %r7,%r11,%r8 /* dest offset = o2 + len - 1 */ +3: lhzx %r12,%r4,%r5 /* load value */ + sthx %r12,%r6,%r7 /* store value */ + sub %r5,%r5,%r9 /* src offset -= 2 */ + sub %r7,%r7,%r9 /* dest offset -= 2 */ bdnz+ 3b /* jump if len != 0 */ .Lbscr2_end: eieio /* memory barrier (reorder protection) */ @@ -1116,40 +1116,40 @@ ENTRY_NOPROFILE(bscr2) /* LINTSTUB: Func: void bscr4_s(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, bus_space_handle_t h2, bus_size_t o2, bus_size_t len); */ /* LINTSTUB: Func: void bscr4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, bus_space_handle_t h2, bus_size_t o2, bus_size_t len); */ ENTRY_NOPROFILE(bscr4_s) - lwz 0,0(3) /* get log2(stride) */ + lwz %r0,0(%r3) /* get log2(stride) */ b .Lbscr4_enter ENTRY_NOPROFILE(bscr4) - li 0,0 /* non stride */ + li %r0,0 /* non stride */ .Lbscr4_enter: - li 9,4 /* distance between src words */ - rotlw 9,9,0 /* shift distance */ - cmpwi 8,0 /* len == 0? */ + li %r9,4 /* distance between src words */ + rotlw %r9,%r9,%r0 /* shift distance */ + cmpwi %r8,0 /* len == 0? */ beqlr- /* return if len == 0 */ - rotlw 5,5,0 /* shift src offset */ - rotlw 7,7,0 /* shift dest offset */ - add 10,4,5 /* calculate src end address */ - add 11,6,7 /* calculate dest end address */ - mtctr 8 - cmpw 10,11 /* compare end address */ + rotlw %r5,%r5,%r0 /* shift src offset */ + rotlw %r7,%r7,%r0 /* shift dest offset */ + add %r10,%r4,%r5 /* calculate src end address */ + add %r11,%r6,%r7 /* calculate dest end address */ + mtctr %r8 + cmpw %r10,%r11 /* compare end address */ blt 2f /* jump if h + o < h2 + o2 */ /* h + o >= h2 + o2 */ -1: lwzx 12,4,5 /* load value */ - stwx 12,6,7 /* store value */ - add 5,5,9 /* src offset += 4 */ - add 7,7,9 /* dest offset += 4 */ +1: lwzx %r12,%r4,%r5 /* load value */ + stwx %r12,%r6,%r7 /* store value */ + add %r5,%r5,%r9 /* src offset += 4 */ + add %r7,%r7,%r9 /* dest offset += 4 */ bdnz+ 1b /* jump if len != 0 */ b .Lbscr4_end /* end */ /* h + o < h2 + o2 */ -2: addi 8,8,-1 /* len -= 1 */ - rotlw 8,8,0 /* shift len */ - add 5,10,8 /* src offset = o + len - 1 */ - add 7,11,8 /* dest offset = o2 + len - 1 */ -3: lwzx 12,4,5 /* load value */ - stwx 12,6,7 /* store value */ - sub 5,5,9 /* src offset -= 4 */ - sub 7,7,9 /* dest offset -= 4 */ +2: addi %r8,%r8,-1 /* len -= 1 */ + rotlw %r8,%r8,%r0 /* shift len */ + add %r5,%r10,%r8 /* src offset = o + len - 1 */ + add %r7,%r11,%r8 /* dest offset = o2 + len - 1 */ +3: lwzx %r12,%r4,%r5 /* load value */ + stwx %r12,%r6,%r7 /* store value */ + sub %r5,%r5,%r9 /* src offset -= 4 */ + sub %r7,%r7,%r9 /* dest offset -= 4 */ bdnz+ 3b /* jump if len != 0 */ .Lbscr4_end: eieio /* memory barrier (reorder protection) */