Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Feb 2006 07:27:46 GMT
From:      Kip Macy <kmacy@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 91734 for review
Message-ID:  <200602140727.k1E7RkdR068633@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=91734

Change 91734 by kmacy@kmacy_storage:sun4v_work on 2006/02/14 07:27:21

	remove invalid pstate bits
	add new tte bits
	remove invalid use of pstate bits in locore.S
	add 

Affected files ...

.. //depot/projects/kmacy_sun4v/src/sys/sun4v/include/pstate.h#2 edit
.. //depot/projects/kmacy_sun4v/src/sys/sun4v/include/tte.h#2 edit
.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/locore.S#2 edit

Differences ...

==== //depot/projects/kmacy_sun4v/src/sys/sun4v/include/pstate.h#2 (text+ko) ====

@@ -29,7 +29,6 @@
 #ifndef	_MACHINE_PSTATE_H_
 #define	_MACHINE_PSTATE_H_
 
-#define	PSTATE_AG		(1<<0)
 #define	PSTATE_IE		(1<<1)
 #define	PSTATE_PRIV		(1<<2)
 #define	PSTATE_AM		(1<<3)
@@ -45,16 +44,11 @@
 
 #define	PSTATE_TLE		(1<<8)
 #define	PSTATE_CLE		(1<<9)
-#define	PSTATE_MG		(1<<10)
-#define	PSTATE_IG		(1<<11)
+
 
 #define	PSTATE_MM		PSTATE_MM_TSO
 
 #define	PSTATE_NORMAL		(PSTATE_MM | PSTATE_PEF | PSTATE_PRIV)
-#define	PSTATE_ALT		(PSTATE_NORMAL | PSTATE_AG)
-#define	PSTATE_INTR		(PSTATE_NORMAL | PSTATE_IG)
-#define	PSTATE_MMU		(PSTATE_NORMAL | PSTATE_MG)
-
 #define	PSTATE_KERNEL		(PSTATE_NORMAL | PSTATE_IE)
 
 #define	PSTATE_SECURE(pstate) \

==== //depot/projects/kmacy_sun4v/src/sys/sun4v/include/tte.h#2 (text+ko) ====

@@ -56,6 +56,10 @@
 #define	TS_64K		(1UL)
 #define	TS_512K		(2UL)
 #define	TS_4M		(3UL)
+#define	TS_32M		(4UL)
+#define	TS_256M		(5UL)
+#define	TS_2G		(6UL)
+#define	TS_16G		(7UL)
 
 #define	TS_MIN		TS_8K
 #define	TS_MAX		TS_4M
@@ -114,11 +118,11 @@
 
 struct pmap;
 
-struct tte {
+typedef struct tte {
 	u_long	tte_vpn;
 	u_long	tte_data;
 	TAILQ_ENTRY(tte) tte_link;
-};
+} *tte_t;
 
 static __inline int
 tte_match(struct tte *tp, vm_offset_t va)
@@ -127,4 +131,29 @@
 	    (tp->tte_vpn == TV_VPN(va, TTE_GET_SIZE(tp))));
 }
 
+#define	VTD_SOFT_SHIFT	(56)
+
+#define	VTD_V		(1UL << 63)
+#define	VTD_NFO		(1UL << 62)
+#define	VTD_PA(pa)	((pa) & (TD_PA_MASK << TD_PA_SHIFT))
+#define	VTD_IE		(1UL << 12)
+#define	VTD_E		(1UL << 11)
+#define	VTD_CP		(1UL << 10)
+#define	VTD_CV		(1UL << 9)
+#define	VTD_P		(1UL << 8)
+#define	VTD_X		(1UL << 7)
+#define	VTD_W		(1UL << 6)
+
+#define	VTD_REF		((1UL << 3) << VTD_SOFT_SHIFT)
+#define	VTD_SW		((1UL << 1) << VTD_SOFT_SHIFT)
+
+
+#define	VTD_8K		TS_8K 
+#define	VTD_64K		TS_64K 
+#define	VTD_512K	TS_512K 
+#define	VTD_4M		TS_4M 
+#define	VTD_32M		TS_32M 
+#define	VTD_256M	TS_256M 
+
+
 #endif /* !_MACHINE_TTE_H_ */

==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/locore.S#2 (text+ko) ====

@@ -54,7 +54,6 @@
 	wrpr	%g0, 0, %cleanwin
 	wrpr	%g0, 0, %pil
 	wr	%g0, 0, %fprs
-	wrpr	%g0, 0, %tick
 
 	/*
 	 * Get onto our per-cpu panic stack, which precedes the struct pcpu in
@@ -106,45 +105,7 @@
 	mov	%o1, PCB_REG
 	mov	%o0, PCPU_REG
 
-	/*
-	 * Alternate globals.
-	 */
-	wrpr	%g0, PSTATE_ALT, %pstate
-
-	/*
-	 * Alternate %g5 points to a per-cpu panic stack, %g6 points to the
-	 * current thread's pcb, and %g7 points to the per-cpu data structure.
-	 */
-	mov	%o0, ASP_REG
-	mov	%o1, PCB_REG
-	mov	%o0, PCPU_REG
-
-	/*
-	 * Interrupt globals.
-	 */
-	wrpr	%g0, PSTATE_INTR, %pstate
-
-	/*
-	 * Interrupt %g7 points to the per-cpu data structure.
-	 */
-	mov	%o0, PCPU_REG
-
-	/*
-	 * Normal globals again.
-	 */
-	wrpr	%g0, PSTATE_NORMAL, %pstate
-
-	/*
-	 * Force trap level 1 and take over the trap table.
-	 */
-	SET(tl0_base, %o2, %o1)
-	wrpr	%g0, 1, %tl
-	wrpr	%o1, 0, %tba
-
-	/*
-	 * Re-enable interrupts.
-	 */
-	wrpr	%g0, PSTATE_KERNEL, %pstate
+	/* XXX SUN4V_FIXME need to set the scratchpad registers */
 
 	retl
 	 nop



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602140727.k1E7RkdR068633>