From owner-svn-src-all@FreeBSD.ORG Mon Jul 12 07:42:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44840106566B; Mon, 12 Jul 2010 07:42:43 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3457C8FC20; Mon, 12 Jul 2010 07:42:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6C7ghKp031050; Mon, 12 Jul 2010 07:42:43 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6C7ghOS031048; Mon, 12 Jul 2010 07:42:43 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201007120742.o6C7ghOS031048@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 12 Jul 2010 07:42:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209929 - head/sys/mips/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jul 2010 07:42:43 -0000 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: