Get 060 CacheCopyBack support in line with the amiga (and working ;-)

This commit is contained in:
leo 2000-06-29 07:36:16 +00:00
parent 9c11d316b4
commit ffa869113a
2 changed files with 15 additions and 7 deletions

View File

@ -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 * Copyright (c) 1995 Leo Weppelman
@ -173,6 +173,7 @@ int reloc_kernel = RELOC_KERNEL; /* Patchable */
* *
* Very crude 68040 support by Michael L. Hitch. * Very crude 68040 support by Michael L. Hitch.
*/ */
int kernel_copyback = 1;
void void
start_c(id, ttphystart, ttphysize, stphysize, esym_addr) 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) * recommended by Motorola; for the 68060 mandatory)
*/ */
if (mmutype == MMU_68040) { if (mmutype == MMU_68040) {
if (kernel_copyback)
pg_proto |= PG_CCB;
for (; i < (u_int)Sysseg; i += NBPG, pg_proto += NBPG) for (; i < (u_int)Sysseg; i += NBPG, pg_proto += NBPG)
*pg++ = pg_proto; *pg++ = pg_proto;
pg_proto = (pg_proto & ~PG_CCB) | PG_CI; pg_proto = (pg_proto & ~PG_CCB) | PG_CI;
for (; i < (u_int)&Sysseg[kstsize * NPTEPG]; i += NBPG, for (; i < pstart; i += NBPG, pg_proto += NBPG)
pg_proto += NBPG)
*pg++ = pg_proto; *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) */ #endif /* defined(M68040) || defined(M68060) */

View File

@ -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. * 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 * or lose information. That is, this routine must actually
* insert this page into the given map NOW. * insert this page into the given map NOW.
*/ */
extern int kernel_copyback;
int int
pmap_enter(pmap, va, pa, prot, flags) pmap_enter(pmap, va, pa, prot, flags)
register pmap_t pmap; register pmap_t pmap;
@ -1306,10 +1307,10 @@ validate:
if (wired) if (wired)
npte |= PG_W; npte |= PG_W;
if (!checkpv && !cacheable) if (!checkpv && !cacheable)
npte |= PG_CI; npte |= (cputype == CPU_68060 ? PG_CIN : PG_CI);
#if defined(M68040) || defined(M68060) #if defined(M68040) || defined(M68060)
else if (mmutype == MMU_68040 && (npte & PG_PROT) == PG_RW && else if (mmutype == MMU_68040 && (npte & PG_PROT) == PG_RW &&
pmap != pmap_kernel()) (kernel_copyback || pmap != pmap_kernel()))
npte |= PG_CCB; /* cache copyback */ npte |= PG_CCB; /* cache copyback */
#endif #endif
/* /*