Thu Mar 5 01:35:00 2020 UTC ()
pmap_procwr(): use dcbst instead of dcbf as a tiny optimization.


(rin)
diff -r1.82 -r1.83 src/sys/arch/powerpc/ibm4xx/pmap.c

cvs diff -r1.82 -r1.83 src/sys/arch/powerpc/ibm4xx/pmap.c (expand / switch to unified diff)

--- src/sys/arch/powerpc/ibm4xx/pmap.c 2020/03/05 01:33:36 1.82
+++ src/sys/arch/powerpc/ibm4xx/pmap.c 2020/03/05 01:35:00 1.83
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pmap.c,v 1.82 2020/03/05 01:33:36 rin Exp $ */ 1/* $NetBSD: pmap.c,v 1.83 2020/03/05 01:35:00 rin Exp $ */
2 2
3/* 3/*
4 * Copyright 2001 Wasabi Systems, Inc. 4 * Copyright 2001 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc. 7 * Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -57,27 +57,27 @@ @@ -57,27 +57,27 @@
57 * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR 57 * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
58 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 58 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
59 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 59 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
60 * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 60 * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
61 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 61 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
62 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 62 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
63 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 63 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
64 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 64 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
65 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 65 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
66 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 66 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
67 */ 67 */
68 68
69#include <sys/cdefs.h> 69#include <sys/cdefs.h>
70__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.82 2020/03/05 01:33:36 rin Exp $"); 70__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.83 2020/03/05 01:35:00 rin Exp $");
71 71
72#include <sys/param.h> 72#include <sys/param.h>
73#include <sys/cpu.h> 73#include <sys/cpu.h>
74#include <sys/device.h> 74#include <sys/device.h>
75#include <sys/kmem.h> 75#include <sys/kmem.h>
76#include <sys/pool.h> 76#include <sys/pool.h>
77#include <sys/proc.h> 77#include <sys/proc.h>
78#include <sys/queue.h> 78#include <sys/queue.h>
79#include <sys/systm.h> 79#include <sys/systm.h>
80 80
81#include <uvm/uvm.h> 81#include <uvm/uvm.h>
82 82
83#include <machine/powerpc.h> 83#include <machine/powerpc.h>
@@ -1173,27 +1173,27 @@ pmap_procwr(struct proc *p, vaddr_t va,  @@ -1173,27 +1173,27 @@ pmap_procwr(struct proc *p, vaddr_t va,
1173 ctx_alloc(pm); 1173 ctx_alloc(pm);
1174 ctx = pm->pm_ctx; 1174 ctx = pm->pm_ctx;
1175 } 1175 }
1176 __asm volatile( 1176 __asm volatile(
1177 "mfmsr %0;" 1177 "mfmsr %0;"
1178 "li %1, %7;" 1178 "li %1, %7;"
1179 "andc %1,%0,%1;" 1179 "andc %1,%0,%1;"
1180 "mtmsr %1;" 1180 "mtmsr %1;"
1181 "sync;isync;" 1181 "sync;isync;"
1182 "mfpid %1;" 1182 "mfpid %1;"
1183 "mtpid %2;" 1183 "mtpid %2;"
1184 "sync; isync;" 1184 "sync; isync;"
1185 "1:" 1185 "1:"
1186 "dcbf 0,%3;" 1186 "dcbst 0,%3;"
1187 "icbi 0,%3;" 1187 "icbi 0,%3;"
1188 "add %3,%3,%5;" 1188 "add %3,%3,%5;"
1189 "addc. %4,%4,%6;" 1189 "addc. %4,%4,%6;"
1190 "bge 1b;" 1190 "bge 1b;"
1191 "mtpid %1;" 1191 "mtpid %1;"
1192 "mtmsr %0;" 1192 "mtmsr %0;"
1193 "sync; isync" 1193 "sync; isync"
1194 : "=&r" (msr), "=&r" (opid) 1194 : "=&r" (msr), "=&r" (opid)
1195 : "r" (ctx), "r" (va), "r" (len), "r" (step), "r" (-step), 1195 : "r" (ctx), "r" (va), "r" (len), "r" (step), "r" (-step),
1196 "K" (PSL_IR | PSL_DR)); 1196 "K" (PSL_IR | PSL_DR));
1197} 1197}
1198 1198
1199 1199