Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/m68k/m68k CADDR1 and CADDR2 should not be used here.



details:   https://anonhg.NetBSD.org/src/rev/7aa8238c15c2
branches:  trunk
changeset: 467946:7aa8238c15c2
user:      minoura <minoura%NetBSD.org@localhost>
date:      Wed Mar 31 14:18:49 1999 +0000

description:
CADDR1 and CADDR2 should not be used here.

diffstat:

 sys/arch/m68k/m68k/mappedcopy.c |  16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diffs (70 lines):

diff -r ec07e54cafbe -r 7aa8238c15c2 sys/arch/m68k/m68k/mappedcopy.c
--- a/sys/arch/m68k/m68k/mappedcopy.c   Wed Mar 31 14:16:20 1999 +0000
+++ b/sys/arch/m68k/m68k/mappedcopy.c   Wed Mar 31 14:18:49 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mappedcopy.c,v 1.3 1999/03/26 23:41:30 mycroft Exp $   */
+/*     $NetBSD: mappedcopy.c,v 1.4 1999/03/31 14:18:49 minoura Exp $   */
 
 /*
  * XXX This doesn't work yet.  Soon.  --thorpej%netbsd.org@localhost
@@ -70,6 +70,8 @@
  */
 u_int  mappedcopysize = -1;
 
+static caddr_t caddr1 = 0;
+
 /*
  * N.B. Both of these routines assume PAGE_SIZE == NBPG.
  */
@@ -84,7 +86,7 @@
        register size_t len;
        int off, alignable;
        pmap_t upmap;
-       extern caddr_t CADDR1;
+#define CADDR1 caddr1
 
 #ifdef DEBUG
        if (mappedcopydebug & MDB_COPYIN)
@@ -93,6 +95,9 @@
        mappedcopyincount++;
 #endif
 
+       if (CADDR1 == 0)
+               CADDR1 = (caddr_t) uvm_km_valloc(kernel_map, NBPG);
+
        kva = (vm_offset_t)CADDR1;
        off = (int)((u_long)fromp & PAGE_MASK);
        alignable = (off == ((u_long)top & PAGE_MASK));
@@ -124,6 +129,7 @@
        }
        pmap_remove(pmap_kernel(), kva, kva + PAGE_SIZE);
        return (0);
+#undef CADDR1
 }
 
 int
@@ -136,7 +142,7 @@
        register size_t len;
        int off, alignable;
        pmap_t upmap;
-       extern caddr_t CADDR2;
+#define CADDR2 caddr1
 
 #ifdef DEBUG
        if (mappedcopydebug & MDB_COPYOUT)
@@ -145,6 +151,9 @@
        mappedcopyoutcount++;
 #endif
 
+       if (CADDR2 == 0)
+               CADDR2 = (caddr_t) uvm_km_valloc(kernel_map, NBPG);
+
        kva = (vm_offset_t) CADDR2;
        off = (int)((u_long)top & PAGE_MASK);
        alignable = (off == ((u_long)fromp & PAGE_MASK));
@@ -176,4 +185,5 @@
        }
        pmap_remove(pmap_kernel(), kva, kva + PAGE_SIZE);
        return (0);
+#undef CADDR1
 }



Home | Main Index | Thread Index | Old Index