Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64/sparc64 convert dcache_flush_page() into a ...
details: https://anonhg.NetBSD.org/src/rev/04ae2f68e52e
branches: trunk
changeset: 765784:04ae2f68e52e
user: mrg <mrg%NetBSD.org@localhost>
date: Mon Jun 06 02:49:39 2011 +0000
description:
convert dcache_flush_page() into a function pointer. introduce a
sp_dcache_flush_page() to help the smp version.
XXX: probably best to have usI/II and usIII (and nop) of this and
XXX: avoid the need for sp_dcache_flush_page at all.
diffstat:
sys/arch/sparc64/sparc64/cache.c | 21 +++++++++++----------
sys/arch/sparc64/sparc64/cache.h | 21 +++++----------------
sys/arch/sparc64/sparc64/ipifuncs.c | 14 +++-----------
3 files changed, 19 insertions(+), 37 deletions(-)
diffs (184 lines):
diff -r d086d4d7c2b2 -r 04ae2f68e52e sys/arch/sparc64/sparc64/cache.c
--- a/sys/arch/sparc64/sparc64/cache.c Mon Jun 06 01:23:31 2011 +0000
+++ b/sys/arch/sparc64/sparc64/cache.c Mon Jun 06 02:49:39 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cache.c,v 1.7 2011/06/06 01:16:48 mrg Exp $ */
+/* $NetBSD: cache.c,v 1.8 2011/06/06 02:49:39 mrg Exp $ */
/*
* Copyright (c) 2011 Matthew R. Green
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cache.c,v 1.7 2011/06/06 01:16:48 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cache.c,v 1.8 2011/06/06 02:49:39 mrg Exp $");
#include "opt_multiprocessor.h"
@@ -58,7 +58,6 @@
sp_blast_dcache(dcache_size, dcache_line_size);
}
-#if 0
static void
sp_dcache_flush_page_cpuset(paddr_t pa, sparc64_cpuset_t cs)
{
@@ -69,35 +68,37 @@
void (*dcache_flush_page)(paddr_t) = dcache_flush_page_us;
void (*dcache_flush_page_cpuset)(paddr_t, sparc64_cpuset_t) =
sp_dcache_flush_page_cpuset;
-#endif
void (*blast_dcache)(void) = blast_dcache_real;
void (*blast_icache)(void) = blast_icache_us;
+#ifdef MULTIPROCESSOR
+void (*sp_dcache_flush_page)(paddr_t) = dcache_flush_page_us;
+#endif
+
void
cache_setup_funcs(void)
{
if (CPU_ISSUN4US || CPU_ISSUN4V) {
-#if 0
dcache_flush_page = (void (*)(paddr_t)) cache_nop;
+#ifdef MULTIPROCESSOR
+ /* XXXMRG shouldn't be necessary -- only caller is nop'ed out */
+ sp_dcache_flush_page = (void (*)(paddr_t)) cache_nop;
#endif
blast_dcache = cache_nop;
blast_icache = cache_nop;
} else {
if (CPU_IS_USIII_UP()) {
-#if 0
dcache_flush_page = dcache_flush_page_usiii;
+#ifdef MULTIPROCESSOR
+ sp_dcache_flush_page = dcache_flush_page_usiii;
#endif
blast_icache = blast_icache_usiii;
-printf("set usIII dcache/icache funcs\n");
}
#ifdef MULTIPROCESSOR
if (sparc_ncpus > 1 && (boothowto & RB_MD1) == 0) {
-printf("set MP dcache funcs\n");
-#if 0
dcache_flush_page = smp_dcache_flush_page_allcpu;
dcache_flush_page_cpuset = smp_dcache_flush_page_cpuset;
-#endif
blast_dcache = smp_blast_dcache;
}
#endif
diff -r d086d4d7c2b2 -r 04ae2f68e52e sys/arch/sparc64/sparc64/cache.h
--- a/sys/arch/sparc64/sparc64/cache.h Mon Jun 06 01:23:31 2011 +0000
+++ b/sys/arch/sparc64/sparc64/cache.h Mon Jun 06 02:49:39 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cache.h,v 1.21 2011/06/06 01:16:48 mrg Exp $ */
+/* $NetBSD: cache.h,v 1.22 2011/06/06 02:49:39 mrg Exp $ */
/*
* Copyright (c) 2011 Matthew R. Green
@@ -102,17 +102,6 @@
void cache_flush_phys_usiii(paddr_t, psize_t, int);
static __inline__ void
-dcache_flush_page(paddr_t pa)
-{
- if (CPU_ISSUN4US || CPU_ISSUN4V)
- return;
- if (CPU_IS_USIII_UP())
- dcache_flush_page_usiii(pa);
- else
- dcache_flush_page_us(pa);
-}
-
-static __inline__ void
cache_flush_phys(paddr_t pa, psize_t size, int ecache)
{
if (CPU_IS_USIII_UP() || CPU_IS_SPARC64_V_UP())
@@ -146,25 +135,25 @@
sp_tlb_flush_all_us();
}
-#if 0
extern void (*dcache_flush_page)(paddr_t);
extern void (*dcache_flush_page_cpuset)(paddr_t, sparc64_cpuset_t);
-#endif
extern void (*blast_dcache)(void);
extern void (*blast_icache)(void);
void cache_setup_funcs(void);
#ifdef MULTIPROCESSOR
+extern void (*sp_dcache_flush_page)(paddr_t);
+
void smp_tlb_flush_pte(vaddr_t, struct pmap *);
void smp_dcache_flush_page_cpuset(paddr_t pa, sparc64_cpuset_t);
+void smp_dcache_flush_page_allcpu(paddr_t pa);
void smp_blast_dcache(void);
-#define tlb_flush_pte(va,pm ) smp_tlb_flush_pte(va, pm)
+#define tlb_flush_pte(va,pm) smp_tlb_flush_pte(va, pm)
#define dcache_flush_page_all(pa) smp_dcache_flush_page_cpuset(pa, cpus_active)
#define dcache_flush_page_cpuset(pa,cs) smp_dcache_flush_page_cpuset(pa, cs)
#else
#define tlb_flush_pte(va,pm) sp_tlb_flush_pte(va, (pm)->pm_ctx[0])
#define dcache_flush_page_all(pa) dcache_flush_page(pa)
#define dcache_flush_page_cpuset(pa,cs) dcache_flush_page(pa)
-
#endif
diff -r d086d4d7c2b2 -r 04ae2f68e52e sys/arch/sparc64/sparc64/ipifuncs.c
--- a/sys/arch/sparc64/sparc64/ipifuncs.c Mon Jun 06 01:23:31 2011 +0000
+++ b/sys/arch/sparc64/sparc64/ipifuncs.c Mon Jun 06 02:49:39 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ipifuncs.c,v 1.41 2011/06/06 01:16:48 mrg Exp $ */
+/* $NetBSD: ipifuncs.c,v 1.42 2011/06/06 02:49:39 mrg Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipifuncs.c,v 1.41 2011/06/06 01:16:48 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipifuncs.c,v 1.42 2011/06/06 02:49:39 mrg Exp $");
#include "opt_ddb.h"
@@ -422,26 +422,21 @@
{
ipifunc_t func;
- if (CPU_ISSUN4US || CPU_ISSUN4V)
- return;
-
if (CPU_IS_USIII_UP())
func = sparc64_ipi_dcache_flush_page_usiii;
else
func = sparc64_ipi_dcache_flush_page_us;
sparc64_multicast_ipi(activecpus, func, pa, dcache_line_size);
- dcache_flush_page(pa);
+ sp_dcache_flush_page(pa);
}
-#if 0
void
smp_dcache_flush_page_allcpu(paddr_t pa)
{
smp_dcache_flush_page_cpuset(pa, cpus_active);
}
-#endif
/*
* Flush the D$ on all CPUs.
@@ -450,9 +445,6 @@
smp_blast_dcache(void)
{
- if (CPU_ISSUN4US || CPU_ISSUN4V)
- return;
-
sparc64_multicast_ipi(cpus_active, sparc64_ipi_blast_dcache,
dcache_size, dcache_line_size);
sp_blast_dcache(dcache_size, dcache_line_size);
Home |
Main Index |
Thread Index |
Old Index