Module Name: src Committed By: rin Date: Tue Oct 4 13:58:54 UTC 2022
Modified Files: src/sys/arch/powerpc/ibm4xx: copyinstr.c copyoutstr.c Log Message: copy{in,out}str: Style sync with copy{in,out}. No binary changes. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/arch/powerpc/ibm4xx/copyinstr.c \ src/sys/arch/powerpc/ibm4xx/copyoutstr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/powerpc/ibm4xx/copyinstr.c diff -u src/sys/arch/powerpc/ibm4xx/copyinstr.c:1.19 src/sys/arch/powerpc/ibm4xx/copyinstr.c:1.20 --- src/sys/arch/powerpc/ibm4xx/copyinstr.c:1.19 Tue Oct 4 13:45:50 2022 +++ src/sys/arch/powerpc/ibm4xx/copyinstr.c Tue Oct 4 13:58:54 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: copyinstr.c,v 1.19 2022/10/04 13:45:50 rin Exp $ */ +/* $NetBSD: copyinstr.c,v 1.20 2022/10/04 13:58:54 rin Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: copyinstr.c,v 1.19 2022/10/04 13:45:50 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: copyinstr.c,v 1.20 2022/10/04 13:58:54 rin Exp $"); #include <sys/param.h> #include <uvm/uvm_extern.h> @@ -73,14 +73,11 @@ copyinstr(const void *uaddr, void *kaddr resid = len; __asm volatile( "mtctr %[resid];" /* Set up counter */ - "mfmsr %[msr];" /* Save MSR */ - "li %[pid],0x20;" /* Disable IMMU */ "andc %[pid],%[msr],%[pid];" "mtmsr %[pid];" "isync;" - MFPID(%[pid]) /* Save old PID */ "1:" MTPID(%[ctx]) /* Load user ctx */ @@ -95,13 +92,11 @@ copyinstr(const void *uaddr, void *kaddr "addi %[kaddr],%[kaddr],1;" "or. %[data],%[data],%[data];" "sync;" - "bdnzf eq,1b;" /* while(ctr-- && !zero) */ MTPID(%[pid]) /* Restore PID, MSR */ "mtmsr %[msr];" "isync;" - "mfctr %[resid];" /* Restore resid */ : [msr] "=&r" (msr), [pid] "=&r" (pid), [data] "=&r" (data), Index: src/sys/arch/powerpc/ibm4xx/copyoutstr.c diff -u src/sys/arch/powerpc/ibm4xx/copyoutstr.c:1.19 src/sys/arch/powerpc/ibm4xx/copyoutstr.c:1.20 --- src/sys/arch/powerpc/ibm4xx/copyoutstr.c:1.19 Tue Oct 4 13:45:50 2022 +++ src/sys/arch/powerpc/ibm4xx/copyoutstr.c Tue Oct 4 13:58:54 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: copyoutstr.c,v 1.19 2022/10/04 13:45:50 rin Exp $ */ +/* $NetBSD: copyoutstr.c,v 1.20 2022/10/04 13:58:54 rin Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: copyoutstr.c,v 1.19 2022/10/04 13:45:50 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: copyoutstr.c,v 1.20 2022/10/04 13:58:54 rin Exp $"); #include <sys/param.h> #include <uvm/uvm_extern.h> @@ -73,29 +73,23 @@ copyoutstr(const void *kaddr, void *uadd resid = len; __asm volatile( "mtctr %[resid];" /* Set up counter */ - "mfmsr %[msr];" /* Save MSR */ - "li %[pid],0x20;" /* Disable IMMU */ "andc %[pid],%[msr],%[pid];" "mtmsr %[pid];" "isync;" - MFPID(%[pid]) /* Save old PID */ "1:" MTPID(%[pid]) "isync;" - "lbz %[data],0(%[kaddr]);" /* Load kernel byte */ "addi %[kaddr],%[kaddr],1;" "sync;" MTPID(%[ctx]) /* Load user ctx */ "isync;" - "stb %[data],0(%[uaddr]);" /* Store byte */ "addi %[uaddr],%[uaddr],1;" - "or. %[data],%[data],%[data];" "sync;" "bdnzf eq,1b;" /* while(ctr-- && !zero) */ @@ -103,7 +97,6 @@ copyoutstr(const void *kaddr, void *uadd MTPID(%[pid]) /* Restore PID, MSR */ "mtmsr %[msr];" "isync;" - "mfctr %[resid];" /* Restore resid */ : [msr] "=&r" (msr), [pid] "=&r" (pid), [data] "=&r" (data),