Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jul 2010 07:42:43 +0000 (UTC)
From:      "Jayachandran C." <jchandra@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r209929 - head/sys/mips/include
Message-ID:  <201007120742.o6C7ghOS031048@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jchandra
Date: Mon Jul 12 07:42:42 2010
New Revision: 209929
URL: http://svn.freebsd.org/changeset/base/209929

Log:
  Merge jmallett@'s n64 work into HEAD
  
  64 bit TLB definitions in pte.h
  
  Reviewed by:	imp
  Obtained from:	jmallett (http://svn.freebsd.org/base/user/jmallett/octeon)

Modified:
  head/sys/mips/include/pte.h

Modified: head/sys/mips/include/pte.h
==============================================================================
--- head/sys/mips/include/pte.h	Mon Jul 12 07:24:40 2010	(r209928)
+++ head/sys/mips/include/pte.h	Mon Jul 12 07:42:42 2010	(r209929)
@@ -82,8 +82,24 @@ typedef	pt_entry_t *pd_entry_t;
  * Note that in FreeBSD, we map 2 TLB pages is equal to 1 VM page.
  */
 #define	TLBHI_ASID_MASK		(0xff)
+#if defined(__mips_n64)
+#define	TLBHI_R_SHIFT		62
+#define	TLBHI_R_USER		(0x00UL << TLBHI_R_SHIFT)
+#define	TLBHI_R_SUPERVISOR	(0x01UL << TLBHI_R_SHIFT)
+#define	TLBHI_R_KERNEL		(0x03UL << TLBHI_R_SHIFT)
+#define	TLBHI_R_MASK		(0x03UL << TLBHI_R_SHIFT)
+#define	TLBHI_VA_R(va)		((va) & TLBHI_R_MASK)
+#define	TLBHI_FILL_SHIFT	40
+#define	TLBHI_VPN2_SHIFT	(TLB_PAGE_SHIFT + 1)
+#define	TLBHI_VPN2_MASK		(((~((1UL << TLBHI_VPN2_SHIFT) - 1)) << (63 - TLBHI_FILL_SHIFT)) >> (63 - TLBHI_FILL_SHIFT))
+#define	TLBHI_VA_TO_VPN2(va)	((va) & TLBHI_VPN2_MASK)
+#define	TLBHI_ENTRY(va, asid)	((TLBHI_VA_R((va))) /* Region. */ | \
+				 (TLBHI_VA_TO_VPN2((va))) /* VPN2. */ | \
+				 ((asid) & TLBHI_ASID_MASK))
+#else
 #define	TLBHI_PAGE_MASK		(2 * PAGE_SIZE - 1)
 #define	TLBHI_ENTRY(va, asid)	(((va) & ~TLBHI_PAGE_MASK) | ((asid) & TLBHI_ASID_MASK))
+#endif
 
 /*
  * TLB flags managed in hardware:



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