Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc Allow for CPU specific page clear and page co...
details: https://anonhg.NetBSD.org/src/rev/1443ea7cc376
branches: trunk
changeset: 485543:1443ea7cc376
user: pk <pk%NetBSD.org@localhost>
date: Sun Apr 30 21:09:43 2000 +0000
description:
Allow for CPU specific page clear and page copy functions.
diffstat:
sys/arch/sparc/include/pmap.h | 16 +++++-------
sys/arch/sparc/sparc/cpu.c | 52 ++++++++++++++++++++++++++++++------------
sys/arch/sparc/sparc/cpuvar.h | 10 ++++++-
3 files changed, 52 insertions(+), 26 deletions(-)
diffs (293 lines):
diff -r e57c585e9fba -r 1443ea7cc376 sys/arch/sparc/include/pmap.h
--- a/sys/arch/sparc/include/pmap.h Sun Apr 30 19:08:19 2000 +0000
+++ b/sys/arch/sparc/include/pmap.h Sun Apr 30 21:09:43 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.44 2000/03/13 23:52:33 soren Exp $ */
+/* $NetBSD: pmap.h,v 1.45 2000/04/30 21:09:43 pk Exp $ */
/*
* Copyright (c) 1996
@@ -300,6 +300,7 @@
boolean_t pmap_clear_modify4m __P((struct vm_page *));
boolean_t pmap_clear_reference4m __P((struct vm_page *));
void pmap_copy_page4m __P((paddr_t, paddr_t));
+void pmap_copy_page_viking_mxcc(paddr_t, paddr_t);
int pmap_enter4m __P((pmap_t, vaddr_t, paddr_t, vm_prot_t,
int));
boolean_t pmap_extract4m __P((pmap_t, vaddr_t, paddr_t *));
@@ -311,6 +312,7 @@
void pmap_page_protect4m __P((struct vm_page *, vm_prot_t));
void pmap_protect4m __P((pmap_t, vaddr_t, vaddr_t, vm_prot_t));
void pmap_zero_page4m __P((paddr_t));
+void pmap_zero_page_viking_mxcc(paddr_t);
void pmap_changeprot4m __P((pmap_t, vaddr_t, vm_prot_t, int));
#endif /* defined SUN4M */
@@ -319,7 +321,6 @@
#define pmap_clear_modify pmap_clear_modify4_4c
#define pmap_clear_reference pmap_clear_reference4_4c
-#define pmap_copy_page pmap_copy_page4_4c
#define pmap_enter pmap_enter4_4c
#define pmap_extract pmap_extract4_4c
#define pmap_is_modified pmap_is_modified4_4c
@@ -329,14 +330,12 @@
#define pmap_kremove pmap_kremove4_4c
#define pmap_page_protect pmap_page_protect4_4c
#define pmap_protect pmap_protect4_4c
-#define pmap_zero_page pmap_zero_page4_4c
#define pmap_changeprot pmap_changeprot4_4c
#elif defined(SUN4M) && !(defined(SUN4) || defined(SUN4C))
#define pmap_clear_modify pmap_clear_modify4m
#define pmap_clear_reference pmap_clear_reference4m
-#define pmap_copy_page pmap_copy_page4m
#define pmap_enter pmap_enter4m
#define pmap_extract pmap_extract4m
#define pmap_is_modified pmap_is_modified4m
@@ -346,14 +345,12 @@
#define pmap_kremove pmap_kremove4m
#define pmap_page_protect pmap_page_protect4m
#define pmap_protect pmap_protect4m
-#define pmap_zero_page pmap_zero_page4m
#define pmap_changeprot pmap_changeprot4m
#else /* must use function pointers */
extern boolean_t(*pmap_clear_modify_p) __P((struct vm_page *));
extern boolean_t(*pmap_clear_reference_p) __P((struct vm_page *));
-extern void (*pmap_copy_page_p) __P((paddr_t, paddr_t));
extern int (*pmap_enter_p) __P((pmap_t, vaddr_t, paddr_t, vm_prot_t,
int));
extern boolean_t (*pmap_extract_p) __P((pmap_t, vaddr_t, paddr_t *));
@@ -364,12 +361,10 @@
extern void (*pmap_kremove_p) __P((vaddr_t, vsize_t));
extern void (*pmap_page_protect_p) __P((struct vm_page *, vm_prot_t));
extern void (*pmap_protect_p) __P((pmap_t, vaddr_t, vaddr_t, vm_prot_t));
-extern void (*pmap_zero_page_p) __P((paddr_t));
extern void (*pmap_changeprot_p) __P((pmap_t, vaddr_t, vm_prot_t, int));
#define pmap_clear_modify (*pmap_clear_modify_p)
#define pmap_clear_reference (*pmap_clear_reference_p)
-#define pmap_copy_page (*pmap_copy_page_p)
#define pmap_enter (*pmap_enter_p)
#define pmap_extract (*pmap_extract_p)
#define pmap_is_modified (*pmap_is_modified_p)
@@ -379,11 +374,14 @@
#define pmap_kremove (*pmap_kremove_p)
#define pmap_page_protect (*pmap_page_protect_p)
#define pmap_protect (*pmap_protect_p)
-#define pmap_zero_page (*pmap_zero_page_p)
#define pmap_changeprot (*pmap_changeprot_p)
#endif
+/* pmap_{zero,copy}_page() may be assisted by specialized hardware */
+#define pmap_zero_page (*cpuinfo.zero_page)
+#define pmap_copy_page (*cpuinfo.copy_page)
+
#endif /* _KERNEL */
#endif /* _SPARC_PMAP_H_ */
diff -r e57c585e9fba -r 1443ea7cc376 sys/arch/sparc/sparc/cpu.c
--- a/sys/arch/sparc/sparc/cpu.c Sun Apr 30 19:08:19 2000 +0000
+++ b/sys/arch/sparc/sparc/cpu.c Sun Apr 30 21:09:43 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.97 1999/12/16 20:24:58 thorpej Exp $ */
+/* $NetBSD: cpu.c,v 1.98 2000/04/30 21:09:46 pk Exp $ */
/*
* Copyright (c) 1996
@@ -632,7 +632,9 @@
noop_pcache_flush_line,
noop_pure_vcache_flush,
noop_cache_flush_all,
- 0
+ 0,
+ pmap_zero_page4_4c,
+ pmap_copy_page4_4c
};
void
@@ -758,7 +760,9 @@
noop_pcache_flush_line,
noop_pure_vcache_flush,
noop_cache_flush_all,
- 0
+ 0,
+ pmap_zero_page4_4c,
+ pmap_copy_page4_4c
};
void
@@ -956,7 +960,9 @@
noop_pcache_flush_line,
noop_pure_vcache_flush,
ms1_cache_flush_all,
- memerr4m
+ memerr4m,
+ pmap_zero_page4m,
+ pmap_copy_page4m
};
void
@@ -984,11 +990,13 @@
noop_pcache_flush_line,
noop_pure_vcache_flush,
srmmu_cache_flush_all,
- memerr4m
+ memerr4m,
+ pmap_zero_page4m,
+ pmap_copy_page4m
};
-struct module_info module_swift = { /* UNTESTED */
+struct module_info module_swift = {
CPUTYP_MS2,
VAC_WRITETHROUGH,
0,
@@ -1007,7 +1015,9 @@
srmmu_pcache_flush_line,
noop_pure_vcache_flush,
srmmu_cache_flush_all,
- memerr4m
+ memerr4m,
+ pmap_zero_page4m,
+ pmap_copy_page4m
};
void
@@ -1026,7 +1036,7 @@
{
}
-struct module_info module_viking = { /* UNTESTED */
+struct module_info module_viking = {
CPUTYP_UNKNOWN, /* set in cpumatch() */
VAC_NONE,
cpumatch_viking,
@@ -1046,7 +1056,9 @@
viking_pcache_flush_line,
noop_pure_vcache_flush,
noop_cache_flush_all,
- viking_memerr
+ viking_memerr,
+ pmap_zero_page4m,
+ pmap_copy_page4m
};
void
@@ -1069,6 +1081,8 @@
if ((pcr & VIKING_PCR_MB) == 0) {
sc->mxcc = 1;
sc->flags |= CPUFLG_CACHE_MANDATORY;
+ sc->zero_page = pmap_zero_page_viking_mxcc;
+ sc->copy_page = pmap_copy_page_viking_mxcc;
/*
* Ok to cache PTEs; set the flag here, so we don't
* uncache in pmap_bootstrap().
@@ -1108,7 +1122,7 @@
/* ROSS Hypersparc */
-struct module_info module_hypersparc = { /* UNTESTED */
+struct module_info module_hypersparc = {
CPUTYP_UNKNOWN,
VAC_WRITEBACK,
cpumatch_hypersparc,
@@ -1127,7 +1141,9 @@
srmmu_pcache_flush_line,
hypersparc_pure_vcache_flush,
hypersparc_cache_flush_all,
- hypersparc_memerr
+ hypersparc_memerr,
+ pmap_zero_page4m,
+ pmap_copy_page4m
};
void
@@ -1156,7 +1172,7 @@
}
/* Cypress 605 */
-struct module_info module_cypress = { /* UNTESTED */
+struct module_info module_cypress = {
CPUTYP_CYPRESS,
VAC_WRITEBACK,
0,
@@ -1175,11 +1191,13 @@
srmmu_pcache_flush_line,
noop_pure_vcache_flush,
cypress_cache_flush_all,
- memerr4m
+ memerr4m,
+ pmap_zero_page4m,
+ pmap_copy_page4m
};
/* Fujitsu Turbosparc */
-struct module_info module_turbosparc = { /* UNTESTED */
+struct module_info module_turbosparc = {
CPUTYP_MS2,
VAC_WRITEBACK,
cpumatch_turbosparc,
@@ -1198,7 +1216,9 @@
srmmu_pcache_flush_line,
noop_pure_vcache_flush,
srmmu_cache_flush_all,
- memerr4m
+ memerr4m,
+ pmap_zero_page4m,
+ pmap_copy_page4m
};
void
@@ -1422,6 +1442,8 @@
MPCOPY(pure_vcache_flush);
MPCOPY(cache_flush_all);
MPCOPY(memerr);
+ MPCOPY(zero_page);
+ MPCOPY(copy_page);
#undef MPCOPY
/*
* On the boot cpu we use the single-processor cache flush
diff -r e57c585e9fba -r 1443ea7cc376 sys/arch/sparc/sparc/cpuvar.h
--- a/sys/arch/sparc/sparc/cpuvar.h Sun Apr 30 19:08:19 2000 +0000
+++ b/sys/arch/sparc/sparc/cpuvar.h Sun Apr 30 21:09:43 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpuvar.h,v 1.22 1999/10/04 19:23:49 pk Exp $ */
+/* $NetBSD: cpuvar.h,v 1.23 2000/04/30 21:09:46 pk Exp $ */
/*
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
void (*hotfix) __P((struct cpu_info *));
void (*mmu_enable)__P((void));
void (*cache_enable)__P((void));
- int ncontext; /* max. # of contexts (we use) */
+ int ncontext; /* max. # of contexts (that we use) */
void (*get_syncflt)__P((void));
int (*get_asyncflt)__P((u_int *, u_int *));
@@ -74,6 +74,8 @@
void (*pure_vcache_flush)__P((void));
void (*cache_flush_all)__P((void));
void (*memerr)__P((unsigned, u_int, u_int, struct trapframe *));
+ void (*zero_page)__P((paddr_t));
+ void (*copy_page)__P((paddr_t, paddr_t));
};
struct xpmsg {
@@ -258,6 +260,10 @@
void (*pure_vcache_flush)__P((void));
void (*cache_flush_all)__P((void));
+ /* Support for hardware-assisted page clear/copy */
+ void (*zero_page)__P((paddr_t));
+ void (*copy_page)__P((paddr_t, paddr_t));
+
#ifdef SUN4M
/* hardware-assisted block operation routines */
void (*hwbcopy)
Home |
Main Index |
Thread Index |
Old Index