diff options
author | Jason Wright <jason@cvs.openbsd.org> | 1999-03-03 21:58:29 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 1999-03-03 21:58:29 +0000 |
commit | d2509d58c7194c5570872ccd1a4d759fd4c3bb9a (patch) | |
tree | 4af4ba654fd0776138b29efd0115dcd79c635273 | |
parent | c8665bea2834f43661929e10c3c0c68ed7a37ed0 (diff) |
pull in some viking stuff from NetBSD; delay use of CPUFLG_CACHEPAGETABLES
if VIKING_PCR_TC isn't set.
-rw-r--r-- | sys/arch/sparc/sparc/cpu.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/sys/arch/sparc/sparc/cpu.c b/sys/arch/sparc/sparc/cpu.c index dca23ed5eef..ae45a93ded0 100644 --- a/sys/arch/sparc/sparc/cpu.c +++ b/sys/arch/sparc/sparc/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.16 1998/10/09 13:12:43 deraadt Exp $ */ +/* $OpenBSD: cpu.c,v 1.17 1999/03/03 21:58:28 jason Exp $ */ /* $NetBSD: cpu.c,v 1.56 1997/09/15 20:52:36 pk Exp $ */ /* @@ -785,7 +785,7 @@ struct module_info module_viking = { /* UNTESTED */ noop_vcache_flush_segment, noop_vcache_flush_region, noop_vcache_flush_context, - noop_pcache_flush_line + viking_pcache_flush_line }; void @@ -802,15 +802,20 @@ void viking_hotfix(sc) struct cpu_softc *sc; { + int pcr = lda(SRMMU_PCR, ASI_SRMMU); + /* Test if we're directly on the MBus */ - if (!(lda(SRMMU_PCR, ASI_SRMMU) & VIKING_PCR_MB)) { + if ((pcr & VIKING_PCR_MB) == 0) { sc->mxcc = 1; sc->flags |= CPUFLG_CACHE_MANDATORY; /* * Ok to cache PTEs; set the flag here, so we don't * uncache in pmap_bootstrap(). */ - sc->flags |= CPUFLG_CACHEPAGETABLES; + if ((pcr & VIKING_PCR_TC) == 0) + printf("[viking: PCR_TC is off]"); + else + sc->flags |= CPUFLG_CACHEPAGETABLES; } else { sc->cache_flush = viking_cache_flush; sc->pcache_flush_line = viking_pcache_flush_line; @@ -830,9 +835,12 @@ viking_mmu_enable() pcr = lda(SRMMU_PCR, ASI_SRMMU); - if (cpuinfo.mxcc) + if (cpuinfo.mxcc) { + if ((pcr & VIKING_PCR_TC) == 0) { + printf("[viking: turn on PCR_TC]"); + } pcr |= VIKING_PCR_TC; - else + } else pcr &= ~VIKING_PCR_TC; sta(SRMMU_PCR, ASI_SRMMU, pcr); } |