From ffa869113ad109af59b5fd05f07d13d346badb23 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 29 Jun 2000 07:36:16 +0000 Subject: [PATCH] Get 060 CacheCopyBack support in line with the amiga (and working ;-) --- sys/arch/atari/atari/atari_init.c | 15 +++++++++++---- sys/arch/atari/atari/pmap.c | 7 ++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/sys/arch/atari/atari/atari_init.c b/sys/arch/atari/atari/atari_init.c index ff4924a83c60..e4e04fd74fbd 100644 --- a/sys/arch/atari/atari/atari_init.c +++ b/sys/arch/atari/atari/atari_init.c @@ -1,4 +1,4 @@ -/* $NetBSD: atari_init.c,v 1.49 2000/06/27 04:18:53 mrg Exp $ */ +/* $NetBSD: atari_init.c,v 1.50 2000/06/29 07:36:16 leo Exp $ */ /* * Copyright (c) 1995 Leo Weppelman @@ -173,6 +173,7 @@ int reloc_kernel = RELOC_KERNEL; /* Patchable */ * * Very crude 68040 support by Michael L. Hitch. */ +int kernel_copyback = 1; void start_c(id, ttphystart, ttphysize, stphysize, esym_addr) @@ -366,13 +367,19 @@ char *esym_addr; /* Address of kernel '_esym' symbol */ * recommended by Motorola; for the 68060 mandatory) */ if (mmutype == MMU_68040) { + + if (kernel_copyback) + pg_proto |= PG_CCB; + for (; i < (u_int)Sysseg; i += NBPG, pg_proto += NBPG) *pg++ = pg_proto; + pg_proto = (pg_proto & ~PG_CCB) | PG_CI; - for (; i < (u_int)&Sysseg[kstsize * NPTEPG]; i += NBPG, - pg_proto += NBPG) + for (; i < pstart; i += NBPG, pg_proto += NBPG) *pg++ = pg_proto; - pg_proto = (pg_proto & ~PG_CI) | PG_CCB; + pg_proto = (pg_proto & ~PG_CI); + if (kernel_copyback) + pg_proto |= PG_CCB; } #endif /* defined(M68040) || defined(M68060) */ diff --git a/sys/arch/atari/atari/pmap.c b/sys/arch/atari/atari/pmap.c index 8d8027fb3cd1..18756c25d4db 100644 --- a/sys/arch/atari/atari/pmap.c +++ b/sys/arch/atari/atari/pmap.c @@ -1,4 +1,3 @@ -/* $NetBSD: pmap.c,v 1.56 2000/06/26 14:20:39 mrg Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -1081,6 +1080,8 @@ pmap_protect(pmap, sva, eva, prot) * or lose information. That is, this routine must actually * insert this page into the given map NOW. */ +extern int kernel_copyback; + int pmap_enter(pmap, va, pa, prot, flags) register pmap_t pmap; @@ -1306,10 +1307,10 @@ validate: if (wired) npte |= PG_W; if (!checkpv && !cacheable) - npte |= PG_CI; + npte |= (cputype == CPU_68060 ? PG_CIN : PG_CI); #if defined(M68040) || defined(M68060) else if (mmutype == MMU_68040 && (npte & PG_PROT) == PG_RW && - pmap != pmap_kernel()) + (kernel_copyback || pmap != pmap_kernel())) npte |= PG_CCB; /* cache copyback */ #endif /*