Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64/include add some sun4/sun4c/sun4m compat co...
details: https://anonhg.NetBSD.org/src/rev/33a04bc3ab01
branches: trunk
changeset: 514343:33a04bc3ab01
user: mrg <mrg%NetBSD.org@localhost>
date: Thu Aug 30 09:32:23 2001 +0000
description:
add some sun4/sun4c/sun4m compat code so we can build 32 bit kvm. (these files are not even vaguely syncable.)
diffstat:
sys/arch/sparc64/include/pmap.h | 9 ++++++++-
sys/arch/sparc64/include/pte.h | 40 +++++++++++++++++++++++++++++++++++++++-
2 files changed, 47 insertions(+), 2 deletions(-)
diffs (82 lines):
diff -r e48a507479ea -r 33a04bc3ab01 sys/arch/sparc64/include/pmap.h
--- a/sys/arch/sparc64/include/pmap.h Thu Aug 30 09:30:40 2001 +0000
+++ b/sys/arch/sparc64/include/pmap.h Thu Aug 30 09:32:23 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.16 2001/04/22 23:19:30 thorpej Exp $ */
+/* $NetBSD: pmap.h,v 1.17 2001/08/30 09:32:23 mrg Exp $ */
/*-
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -185,4 +185,11 @@
#endif /* _KERNEL */
#endif /* _LOCORE */
+
+/* This is only for compatibility with the SPARC */
+struct segmap {
+ int *sg_pte; /* points to NPTESG PTEs */
+ pmeg_t sg_pmeg; /* the MMU segment number (4c) */
+ u_char sg_npte; /* number of valid PTEs per seg */
+};
#endif /* _MACHINE_PMAP_H_ */
diff -r e48a507479ea -r 33a04bc3ab01 sys/arch/sparc64/include/pte.h
--- a/sys/arch/sparc64/include/pte.h Thu Aug 30 09:30:40 2001 +0000
+++ b/sys/arch/sparc64/include/pte.h Thu Aug 30 09:32:23 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pte.h,v 1.7 2001/07/31 06:55:46 eeh Exp $ */
+/* $NetBSD: pte.h,v 1.8 2001/08/30 09:32:23 mrg Exp $ */
/*
* Copyright (c) 1996-1999 Eduardo Horvath
@@ -54,9 +54,13 @@
*/
/* virtual address to virtual page number */
+#define VA_SUN4_VPG(va) (((int)(va) >> 13) & 31)
+#define VA_SUN4C_VPG(va) (((int)(va) >> 12) & 63)
#define VA_SUN4U_VPG(va) (((int)(va) >> 13) & 31)
/* virtual address to offset within page */
+#define VA_SUN4_OFF(va) (((int)(va)) & 0x1FFF)
+#define VA_SUN4C_OFF(va) (((int)(va)) & 0xFFF)
#define VA_SUN4U_OFF(va) (((int)(va)) & 0x1FFF)
/* When we go to 64-bit VAs we need to handle the hole */
@@ -234,3 +238,37 @@
#define IOPTE_RSVD 0x000000f1
#define IOPTE_WRITE 0x00000004
#define IOPTE_VALID 0x00000002
+
+/*
+ * This is purely for compatibility with the old SPARC machines.
+ */
+#define NBPRG (1 << 24) /* bytes per region */
+#define RGSHIFT 24 /* log2(NBPRG) */
+#define NSEGRG (NBPRG / NBPSG) /* segments per region */
+
+#define NBPSG (1 << 18) /* bytes per segment */
+#define SGSHIFT 18 /* log2(NBPSG) */
+
+/* there is no `struct pte'; we just use `int'; this is for non-4M only */
+#define PG_V 0x80000000
+#define PG_PFNUM 0x0007ffff /* n.b.: only 16 bits on sun4c */
+
+/* virtual address to virtual region number */
+#define VA_VREG(va) (((unsigned int)(va) >> RGSHIFT) & 255)
+
+/* virtual address to virtual segment number */
+#define VA_VSEG(va) (((unsigned int)(va) >> SGSHIFT) & 63)
+
+#ifndef _LOCORE
+typedef u_short pmeg_t; /* 10 bits needed per Sun-4 segmap entry */
+#endif
+
+/*
+ * Here are the bit definitions for 4M/SRMMU pte's
+ */
+ /* MMU TABLE ENTRIES */
+#define SRMMU_TETYPE 0x3 /* mask for table entry type */
+#define SRMMU_TEPTE 0x2 /* Page Table Entry */
+ /* PTE FIELDS */
+#define SRMMU_PPNMASK 0xFFFFFF00
+#define SRMMU_PPNPASHIFT 0x4 /* shift to put ppn into PAddr */
Home |
Main Index |
Thread Index |
Old Index