Module Name: src
Committed By: thorpej
Date: Wed Dec 27 19:26:30 UTC 2023
Modified Files:
src/sys/arch/mac68k/include: pmap.h
src/sys/arch/mac68k/mac68k: genassym.cf locore.s
src/sys/arch/news68k/include: pmap.h
src/sys/arch/news68k/news68k: genassym.cf locore.s
Log Message:
Define values for the 68030 TT registers in terms of the definitions
in <m68k/mmu_30.h> rather than using magic numbers.
To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/mac68k/include/pmap.h
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/mac68k/mac68k/genassym.cf
cvs rdiff -u -r1.177 -r1.178 src/sys/arch/mac68k/mac68k/locore.s
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/news68k/include/pmap.h
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/news68k/news68k/genassym.cf
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/news68k/news68k/locore.s
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/mac68k/include/pmap.h
diff -u src/sys/arch/mac68k/include/pmap.h:1.37 src/sys/arch/mac68k/include/pmap.h:1.38
--- src/sys/arch/mac68k/include/pmap.h:1.37 Sun Nov 3 19:56:30 2002
+++ src/sys/arch/mac68k/include/pmap.h Wed Dec 27 19:26:29 2023
@@ -1,3 +1,21 @@
-/* $NetBSD: pmap.h,v 1.37 2002/11/03 19:56:30 chs Exp $ */
+/* $NetBSD: pmap.h,v 1.38 2023/12/27 19:26:29 thorpej Exp $ */
+
+#ifndef _MAC68K_PMAP_H_
+#define _MAC68K_PMAP_H_
#include <m68k/pmap_motorola.h>
+#include <m68k/mmu_30.h>
+
+/*
+ * Tranparent translation register used in locore.s:get_pte().
+ * User Data set up for R/W access of the entire address space.
+ *
+ * (XXX TT30_RW isn't actually needed because of TT30_RWM, but
+ * this the value historically used.)
+ */
+#define MAC68K_TT_GET_PTE (0x00000000 | \
+ __SHIFTIN(0xff,TT30_LAM) | \
+ TT30_E | TT30_CI | TT30_RW | TT30_RWM |\
+ TT30_USERD)
+
+#endif /* _MAC68K_PMAP_H_ */
Index: src/sys/arch/mac68k/mac68k/genassym.cf
diff -u src/sys/arch/mac68k/mac68k/genassym.cf:1.43 src/sys/arch/mac68k/mac68k/genassym.cf:1.44
--- src/sys/arch/mac68k/mac68k/genassym.cf:1.43 Wed Dec 27 17:35:35 2023
+++ src/sys/arch/mac68k/mac68k/genassym.cf Wed Dec 27 19:26:29 2023
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.43 2023/12/27 17:35:35 thorpej Exp $
+# $NetBSD: genassym.cf,v 1.44 2023/12/27 19:26:29 thorpej Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
@@ -81,6 +81,9 @@ export MMU51_CRP_BITS
export MMU51_TCR_BITS
export MMU40_TCR_BITS
+# Transparent translation register values (from pmap.h)
+export MAC68K_TT_GET_PTE
+
# lwp & proc fields and values
define L_PCB offsetof(struct lwp, l_addr)
define L_PROC offsetof(struct lwp, l_proc)
Index: src/sys/arch/mac68k/mac68k/locore.s
diff -u src/sys/arch/mac68k/mac68k/locore.s:1.177 src/sys/arch/mac68k/mac68k/locore.s:1.178
--- src/sys/arch/mac68k/mac68k/locore.s:1.177 Wed Dec 27 03:03:41 2023
+++ src/sys/arch/mac68k/mac68k/locore.s Wed Dec 27 19:26:30 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.177 2023/12/27 03:03:41 thorpej Exp $ */
+/* $NetBSD: locore.s,v 1.178 2023/12/27 19:26:30 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -1143,7 +1143,7 @@ ENTRY_NOPROFILE(get_pte)
subql #4,%sp | make temporary space
lea _ASM_LABEL(longscratch),%a0
- movl #0x00ff8710,%a0@ | Set up FC 1 r/w access
+ movl #MAC68K_TT_GET_PTE,%a0@ | See pmap.h
.long 0xf0100800 | pmove %a0@,%tt0
movl %sp@(8),%a0 | logical address to look up
Index: src/sys/arch/news68k/include/pmap.h
diff -u src/sys/arch/news68k/include/pmap.h:1.14 src/sys/arch/news68k/include/pmap.h:1.15
--- src/sys/arch/news68k/include/pmap.h:1.14 Sun Nov 3 19:56:32 2002
+++ src/sys/arch/news68k/include/pmap.h Wed Dec 27 19:26:29 2023
@@ -1,3 +1,30 @@
-/* $NetBSD: pmap.h,v 1.14 2002/11/03 19:56:32 chs Exp $ */
+/* $NetBSD: pmap.h,v 1.15 2023/12/27 19:26:29 thorpej Exp $ */
+
+#ifndef _NEWS68K_PMAP_H_
+#define _NEWS68K_PMAP_H_
#include <m68k/pmap_motorola.h>
+#include <m68k/mmu_30.h>
+
+/*
+ * Transparent translation register values for:
+ *
+ * I/O space: 0xe0000000-0xffffffff
+ * RAM to use PROM calls: 0xc0000000-0xdfffffff
+ *
+ * Both use Function Codes 4-7 (to get SUPERD and SUPERP).
+ * XXX I/O space can probably just use SUPERD.
+ */
+#define NEWS68K_TT_IO (0xe0000000 | \
+ __SHIFTIN(0x1f,TT30_LAM) | \
+ TT30_E | TT30_CI | TT30_RWM | \
+ __SHIFTIN(4,TT30_FCBASE) | \
+ __SHIFTIN(3,TT30_FCMASK))
+
+#define NEWS68K_TT_PROM (0xc0000000 | \
+ __SHIFTIN(0x1f,TT30_LAM) | \
+ TT30_E | TT30_RWM | \
+ __SHIFTIN(4,TT30_FCBASE) | \
+ __SHIFTIN(3,TT30_FCMASK))
+
+#endif /* _NEWS68K_PMAP_H_ */
Index: src/sys/arch/news68k/news68k/genassym.cf
diff -u src/sys/arch/news68k/news68k/genassym.cf:1.32 src/sys/arch/news68k/news68k/genassym.cf:1.33
--- src/sys/arch/news68k/news68k/genassym.cf:1.32 Wed Dec 27 17:35:36 2023
+++ src/sys/arch/news68k/news68k/genassym.cf Wed Dec 27 19:26:29 2023
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.32 2023/12/27 17:35:36 thorpej Exp $
+# $NetBSD: genassym.cf,v 1.33 2023/12/27 19:26:29 thorpej Exp $
#
# Copyright (c) 1982, 1990, 1993
@@ -96,6 +96,10 @@ export MMU51_CRP_BITS
export MMU51_TCR_BITS
export MMU40_TCR_BITS
+# Transparent translation register values (from pmap.h)
+export NEWS68K_TT_IO
+export NEWS68K_TT_PROM
+
# lwp & proc fields and values
define L_PCB offsetof(struct lwp, l_addr)
define L_PROC offsetof(struct lwp, l_proc)
Index: src/sys/arch/news68k/news68k/locore.s
diff -u src/sys/arch/news68k/news68k/locore.s:1.74 src/sys/arch/news68k/news68k/locore.s:1.75
--- src/sys/arch/news68k/news68k/locore.s:1.74 Wed Dec 27 03:03:42 2023
+++ src/sys/arch/news68k/news68k/locore.s Wed Dec 27 19:26:29 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.74 2023/12/27 03:03:42 thorpej Exp $ */
+/* $NetBSD: locore.s,v 1.75 2023/12/27 19:26:29 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -379,16 +379,13 @@ Lstploaddone:
Lmotommu2:
/* Use %tt0 register to map I/O space */
RELOC(protott0, %a0)
- movl #0xe01f8543,%a0@ | use %tt0 (0xe0000000-0xffffffff)
.long 0xf0100800 | pmove %a0@,%tt0
- /* Use %tt1 register to map RAM to use PROM calls */
+ /* Use %tt1 register to map RAM to use PROM calls */
RELOC(protott1, %a0)
- movl #0xc01f8143,%a0@ | use %tt1 (0xc0000000-0xdfffffff)
.long 0xf0100c00 | pmove %a0@,%tt1
pflusha
RELOC(prototc, %a2)
- movl #MMU51_TCR_BITS,%a2@ | value to load TC with
pmove %a2@,%tc | load it
/*
@@ -1018,13 +1015,13 @@ GLOBAL(protorp)
.long 0,0 | prototype root pointer
GLOBAL(prototc)
- .long 0 | prototype translation control
+ .long MMU51_TCR_BITS | prototype translation control
GLOBAL(protott0)
- .long 0 | prototype transparent translation register 0
+ .long NEWS68K_TT_IO | prototype transparent translation register 0
GLOBAL(protott1)
- .long 0 | prototype transparent translation register 1
+ .long NEWS68K_TT_PROM | prototype transparent translation register 1
/*
* Information from first stage boot program