Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/sommerfeld_i386mp_1]: src/sys/arch/i386 Mirror a change made on the trunk:
details: https://anonhg.NetBSD.org/src/rev/cdd2817d54bf
branches: sommerfeld_i386mp_1
changeset: 482337:cdd2817d54bf
user: thorpej <thorpej%NetBSD.org@localhost>
date: Tue Jan 02 06:58:07 2001 +0000
description:
Mirror a change made on the trunk:
Don't equate pmap_update() with tlbflush(), but instead call
tlbflush() when that's what we mean (currently everywhere, except
in the one place in MI code where it is called).
The whole pmap_update() thing needs to be reexamined, but this helps
to clarify things a little with the currently-defined semantics of
that function.
diffstat:
sys/arch/i386/i386/db_memrw.c | 107 ++++++++++++++++++++++++++++++++++++++++
sys/arch/i386/i386/machdep.c | 4 +-
sys/arch/i386/i386/pmap.c | 18 +++---
sys/arch/i386/i386/vm_machdep.c | 4 +-
sys/arch/i386/include/pmap.h | 8 +-
5 files changed, 124 insertions(+), 17 deletions(-)
diffs (264 lines):
diff -r 0d4567dd6592 -r cdd2817d54bf sys/arch/i386/i386/db_memrw.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/i386/i386/db_memrw.c Tue Jan 02 06:58:07 2001 +0000
@@ -0,0 +1,107 @@
+/* $NetBSD: db_memrw.c,v 1.8.2.2 2001/01/02 06:58:07 thorpej Exp $ */
+
+/*
+ * Mach Operating System
+ * Copyright (c) 1991,1990 Carnegie Mellon University
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution%CS.CMU.EDU@localhost
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ *
+ * db_interface.c,v 2.4 1991/02/05 17:11:13 mrt (CMU)
+ */
+
+/*
+ * Routines to read and write memory on behalf of the debugger, used
+ * by DDB and KGDB.
+ */
+
+#include <sys/param.h>
+#include <sys/proc.h>
+#include <sys/systm.h>
+
+#include <uvm/uvm_extern.h>
+
+#include <machine/db_machdep.h>
+
+#include <ddb/db_access.h>
+
+/*
+ * Read bytes from kernel address space for debugger.
+ */
+void
+db_read_bytes(addr, size, data)
+ vaddr_t addr;
+ register size_t size;
+ register char *data;
+{
+ register char *src;
+
+ src = (char *)addr;
+ while (size-- > 0)
+ *data++ = *src++;
+}
+
+/*
+ * Write bytes to kernel address space for debugger.
+ */
+void
+db_write_bytes(addr, size, data)
+ vaddr_t addr;
+ register size_t size;
+ register char *data;
+{
+ register char *dst;
+
+ register pt_entry_t *ptep0 = 0;
+ pt_entry_t oldmap0 = { 0 };
+ vaddr_t addr1;
+ register pt_entry_t *ptep1 = 0;
+ pt_entry_t oldmap1 = { 0 };
+ extern char etext;
+
+ if (addr >= VM_MIN_KERNEL_ADDRESS &&
+ addr < (vaddr_t)&etext) {
+ ptep0 = PTE_BASE + i386_btop(addr);
+ oldmap0 = *ptep0;
+ *(int *)ptep0 |= /* INTEL_PTE_WRITE */ PG_RW;
+
+ addr1 = i386_trunc_page(addr + size - 1);
+ if (i386_trunc_page(addr) != addr1) {
+ /* data crosses a page boundary */
+ ptep1 = PTE_BASE + i386_btop(addr1);
+ oldmap1 = *ptep1;
+ *(int *)ptep1 |= /* INTEL_PTE_WRITE */ PG_RW;
+ }
+ tlbflush();
+ }
+
+ dst = (char *)addr;
+
+ while (size-- > 0)
+ *dst++ = *data++;
+
+ if (ptep0) {
+ *ptep0 = oldmap0;
+ if (ptep1)
+ *ptep1 = oldmap1;
+ tlbflush();
+ }
+}
diff -r 0d4567dd6592 -r cdd2817d54bf sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c Tue Jan 02 04:13:16 2001 +0000
+++ b/sys/arch/i386/i386/machdep.c Tue Jan 02 06:58:07 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.376.2.10 2000/12/29 21:25:47 sommerfeld Exp $ */
+/* $NetBSD: machdep.c,v 1.376.2.11 2001/01/02 06:58:08 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -1981,7 +1981,7 @@
* entire address space and doing a TLB flush.
*/
memset((caddr_t)PTD, 0, NBPG);
- pmap_update();
+ tlbflush();
#endif
for (;;);
diff -r 0d4567dd6592 -r cdd2817d54bf sys/arch/i386/i386/pmap.c
--- a/sys/arch/i386/i386/pmap.c Tue Jan 02 04:13:16 2001 +0000
+++ b/sys/arch/i386/i386/pmap.c Tue Jan 02 06:58:07 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.83.2.18 2001/01/02 04:13:16 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.83.2.19 2001/01/02 06:58:08 thorpej Exp $ */
/*
*
@@ -784,7 +784,7 @@
}
#if defined(I386_CPU)
if (cpu_class == CPUCLASS_386)
- pmap_update();
+ tlbflush();
#endif
}
@@ -827,7 +827,7 @@
}
#if defined(I386_CPU)
if (need_update && cpu_class == CPUCLASS_386)
- pmap_update();
+ tlbflush();
#endif
}
@@ -1092,7 +1092,7 @@
* ensure the TLB is sync'd with reality by flushing it...
*/
- pmap_update();
+ tlbflush();
}
/*
@@ -1854,7 +1854,7 @@
#endif
if (pmap_is_curpmap(pmaps_hand))
- pmap_update();
+ tlbflush();
else if (pmap_valid_entry(*APDP_PDE) &&
(*APDP_PDE & PG_FRAME) ==
pmaps_hand->pm_pdirpa) {
@@ -2429,7 +2429,7 @@
{
#if defined(I386_CPU)
if (cpu_class == CPUCLASS_386) {
- pmap_update();
+ tlbflush();
} else
#endif
pmap_tlb_shootnow();
@@ -2929,7 +2929,7 @@
PMAP_HEAD_TO_MAP_UNLOCK();
#if defined(I386_CPU)
if (needs_update)
- pmap_update();
+ tlbflush();
#endif
}
@@ -3076,7 +3076,7 @@
#if defined(I386_CPU)
if (needs_update)
- pmap_update();
+ tlbflush();
#endif
return(result != 0);
}
@@ -4252,7 +4252,7 @@
void pmap_do_tlbflush()
{
- pmap_update();
+ tlbflush();
}
#endif
diff -r 0d4567dd6592 -r cdd2817d54bf sys/arch/i386/i386/vm_machdep.c
--- a/sys/arch/i386/i386/vm_machdep.c Tue Jan 02 04:13:16 2001 +0000
+++ b/sys/arch/i386/i386/vm_machdep.c Tue Jan 02 06:58:07 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.86.2.9 2000/12/31 18:01:22 thorpej Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.86.2.10 2001/01/02 06:58:09 thorpej Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@@ -335,7 +335,7 @@
}
#if defined(I386_CPU)
if (cpu_class == CPUCLASS_386)
- pmap_update();
+ tlbflush();
#endif
}
diff -r 0d4567dd6592 -r cdd2817d54bf sys/arch/i386/include/pmap.h
--- a/sys/arch/i386/include/pmap.h Tue Jan 02 04:13:16 2001 +0000
+++ b/sys/arch/i386/include/pmap.h Tue Jan 02 06:58:07 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.43.2.7 2000/12/31 18:01:22 thorpej Exp $ */
+/* $NetBSD: pmap.h,v 1.43.2.8 2001/01/02 06:58:10 thorpej Exp $ */
/*
*
@@ -385,7 +385,7 @@
#define pmap_kernel() (&kernel_pmap_store)
#define pmap_resident_count(pmap) ((pmap)->pm_stats.resident_count)
-#define pmap_update() tlbflush()
+#define pmap_update() /* nothing (yet) */
#define pmap_clear_modify(pg) pmap_clear_attrs(pg, PG_M)
#define pmap_clear_reference(pg) pmap_clear_attrs(pg, PG_U)
@@ -449,7 +449,7 @@
{
#if defined(I386_CPU)
if (cpu_class == CPUCLASS_386)
- pmap_update();
+ tlbflush();
else
#endif
invlpg((u_int) va);
@@ -465,7 +465,7 @@
{
#if defined(I386_CPU)
if (cpu_class == CPUCLASS_386)
- pmap_update();
+ tlbflush();
else
#endif
{
Home |
Main Index |
Thread Index |
Old Index