Module Name: src
Committed By: thorpej
Date: Wed Dec 27 19:22:11 UTC 2023
Modified Files:
src/distrib/sets/lists/comp: ad.m68k
src/sys/arch/m68k/include: Makefile
Added Files:
src/sys/arch/m68k/include: mmu_30.h
Log Message:
Add a header file for 68030-specific MMU definitions, specifically the
Transparent Translation registers, that do not exist on the 68851. A
big comment at the top of the file describes the differences between
the 68851 and the 68030's MMU.
To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/distrib/sets/lists/comp/ad.m68k
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/m68k/include/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/arch/m68k/include/mmu_30.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/sets/lists/comp/ad.m68k
diff -u src/distrib/sets/lists/comp/ad.m68k:1.69 src/distrib/sets/lists/comp/ad.m68k:1.70
--- src/distrib/sets/lists/comp/ad.m68k:1.69 Wed Dec 27 02:40:31 2023
+++ src/distrib/sets/lists/comp/ad.m68k Wed Dec 27 19:22:11 2023
@@ -1,4 +1,4 @@
-# $NetBSD: ad.m68k,v 1.69 2023/12/27 02:40:31 thorpej Exp $
+# $NetBSD: ad.m68k,v 1.70 2023/12/27 19:22:11 thorpej Exp $
./usr/bin/elf2aout comp-sysutil-bin
./usr/include/gcc-4.5/math-68881.h comp-obsolete obsolete
./usr/include/gcc-4.5/tgmath.h comp-obsolete obsolete
@@ -54,6 +54,7 @@
./usr/include/m68k/m68k.h comp-c-include
./usr/include/m68k/math.h comp-c-include
./usr/include/m68k/mcontext.h comp-c-include
+./usr/include/m68k/mmu_30.h comp-c-include
./usr/include/m68k/mmu_40.h comp-c-include
./usr/include/m68k/mmu_51.h comp-c-include
./usr/include/m68k/mutex.h comp-c-include
Index: src/sys/arch/m68k/include/Makefile
diff -u src/sys/arch/m68k/include/Makefile:1.33 src/sys/arch/m68k/include/Makefile:1.34
--- src/sys/arch/m68k/include/Makefile:1.33 Wed Dec 27 02:40:31 2023
+++ src/sys/arch/m68k/include/Makefile Wed Dec 27 19:22:10 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.33 2023/12/27 02:40:31 thorpej Exp $
+# $NetBSD: Makefile,v 1.34 2023/12/27 19:22:10 thorpej Exp $
INCSDIR= /usr/include/m68k
@@ -12,7 +12,7 @@ INCS= ansi.h aout_machdep.h asm.h asm_si
int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \
kcore.h \
limits.h lock.h \
- m68k.h math.h mcontext.h mmu_40.h mmu_51.h mutex.h \
+ m68k.h math.h mcontext.h mmu_30.h mmu_40.h mmu_51.h mutex.h \
param.h pmap_motorola.h pcb.h proc.h profile.h \
psl.h pte_motorola.h ptrace.h \
reg.h rwlock.h setjmp.h signal.h sync_icache.h \
Added files:
Index: src/sys/arch/m68k/include/mmu_30.h
diff -u /dev/null src/sys/arch/m68k/include/mmu_30.h:1.1
--- /dev/null Wed Dec 27 19:22:11 2023
+++ src/sys/arch/m68k/include/mmu_30.h Wed Dec 27 19:22:10 2023
@@ -0,0 +1,91 @@
+/* $NetBSD: mmu_30.h,v 1.1 2023/12/27 19:22:10 thorpej Exp $ */
+
+/*-
+ * Copyright (c) 2023 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _M68K_MMU_30_H_
+#define _M68K_MMU_30_H_
+
+#include <machine/fcode.h>
+
+/*
+ * The built-in MMU in the 68030 is a subset of the 68851. Section 9.6
+ * of the 68030 User's Manual describes the differences:
+ *
+ * The following 68851 functions are not present on the 68030:
+ * - Access levels
+ * - Breakpoint registers
+ * - DMA Root Pointer
+ * - Task aliases
+ * - Lockable ATC entries
+ * - ATC entries defined as Shared Globally
+ *
+ * Futhermore, the 68030 has some functional differences:
+ * - Only 22 ATC entries
+ * - Reduced instruction set for MMU operations
+ * - Reduced addressing modes for MMU instructions.
+ *
+ * Instructions removed: PVALID, PFLUSHR, PFLUSHS, PBcc, PDBcc, PScc,
+ * PTRAPcc, PSAVE, PRESTORE.
+ *
+ * Registers removed: CAL, VAL, BAD, BACx, DRP, AC.
+ *
+ * The 68030 does, however, add a pair of Transparent Translation
+ * registers
+ */
+
+/*
+ * 9.7.3 -- Transparent Translation registers
+ *
+ * These registers define blocks of logical address space that are
+ * transparently translated VA==PA. The minimum block size is 16MB,
+ * and the blocks may overlap. The mode in which the transparent
+ * translation is applied is specified by the Function Code base and
+ * mask fields.
+ *
+ * The Logical Address Base specifies the address of the block and
+ * the Logical Address Mask field specifies the address bits to *ignore*.
+ *
+ */
+#define TT30_LAB __BITS(31,24) /* Logical Address Base */
+#define TT30_LAM __BITS(16,23) /* Logical Address Mask */
+#define TT30_E __BIT(15) /* Enable transparent translation */
+#define TT30_CI __BIT(10) /* Cache Inhibit */
+#define TT30_RW __BIT(9) /* Read(1) or Write(0) translated */
+#define TT30_RWM __BIT(8) /* RW field used(0) or ignored(1) */
+#define TT30_FCBASE __BITS(4,6) /* Function Code base */
+#define TT30_FCMASK __BITS(0,2) /* Function Code bits to ignore */
+
+/* Convenience definitions for address space selection. */
+#define TT30_USERD __SHIFTIN(FC_USERD,TT30_FCBASE)
+#define TT30_USERP __SHIFTIN(FC_USERP,TT30_FCBASE)
+#define TT30_SUPERD __SHIFTIN(FC_SUPERD,TT30_FCBASE)
+#define TT30_SUPERP __SHIFTIN(FC_SUPERP,TT30_FCBASE)
+
+#endif /* _M68K_MMU_30_H_ */