Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/powerpc/ibm4xx copy{in,out}str: As a tiny optimizat...
details: https://anonhg.NetBSD.org/src/rev/5c15f2d131e6
branches: trunk
changeset: 371739:5c15f2d131e6
user: rin <rin%NetBSD.org@localhost>
date: Wed Oct 05 02:56:14 2022 +0000
description:
copy{in,out}str: As a tiny optimization, drop redundant mtpid.
No regression for ATF on 405. 403 seems to work fine.
diffstat:
sys/arch/powerpc/ibm4xx/copyinstr.c | 7 +++----
sys/arch/powerpc/ibm4xx/copyoutstr.c | 14 +++++++-------
2 files changed, 10 insertions(+), 11 deletions(-)
diffs (72 lines):
diff -r 41fe7790f32b -r 5c15f2d131e6 sys/arch/powerpc/ibm4xx/copyinstr.c
--- a/sys/arch/powerpc/ibm4xx/copyinstr.c Tue Oct 04 14:08:30 2022 +0000
+++ b/sys/arch/powerpc/ibm4xx/copyinstr.c Wed Oct 05 02:56:14 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: copyinstr.c,v 1.22 2022/10/04 14:08:30 rin Exp $ */
+/* $NetBSD: copyinstr.c,v 1.23 2022/10/05 02:56:14 rin Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: copyinstr.c,v 1.22 2022/10/04 14:08:30 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: copyinstr.c,v 1.23 2022/10/05 02:56:14 rin Exp $");
#include <sys/param.h>
#include <uvm/uvm_extern.h>
@@ -94,8 +94,7 @@
"sync;"
"bdnzf eq,1b;" /* while(ctr-- && !zero) */
- MTPID(%[pid]) /* Restore PID, MSR */
- "mtmsr %[msr];"
+ "mtmsr %[msr];" /* Restore MSR */
"isync;"
"mfctr %[resid];" /* Restore resid */
diff -r 41fe7790f32b -r 5c15f2d131e6 sys/arch/powerpc/ibm4xx/copyoutstr.c
--- a/sys/arch/powerpc/ibm4xx/copyoutstr.c Tue Oct 04 14:08:30 2022 +0000
+++ b/sys/arch/powerpc/ibm4xx/copyoutstr.c Wed Oct 05 02:56:14 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: copyoutstr.c,v 1.22 2022/10/04 14:08:30 rin Exp $ */
+/* $NetBSD: copyoutstr.c,v 1.23 2022/10/05 02:56:14 rin Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: copyoutstr.c,v 1.22 2022/10/04 14:08:30 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: copyoutstr.c,v 1.23 2022/10/05 02:56:14 rin Exp $");
#include <sys/param.h>
#include <uvm/uvm_extern.h>
@@ -80,9 +80,7 @@
"isync;"
MFPID(%[pid]) /* Save old PID */
- "1:" MTPID(%[pid])
- "isync;"
- "lbz %[tmp],0(%[kaddr]);" /* Load kernel byte */
+ "1:" "lbz %[tmp],0(%[kaddr]);" /* Load kernel byte */
"addi %[kaddr],%[kaddr],1;"
"sync;"
@@ -92,10 +90,12 @@
"addi %[uaddr],%[uaddr],1;"
"or. %[tmp],%[tmp],%[tmp];"
"sync;"
+
+ MTPID(%[pid])
+ "isync;"
"bdnzf eq,1b;" /* while(ctr-- && !zero) */
- MTPID(%[pid]) /* Restore PID, MSR */
- "mtmsr %[msr];"
+ "mtmsr %[msr];" /* Restore MSR */
"isync;"
"mfctr %[resid];" /* Restore resid */
Home |
Main Index |
Thread Index |
Old Index