Received: from milmhbs1.lsil.com (147.145.21.209) by coscas01.lsi.com
 (172.21.36.60) with Microsoft SMTP Server id 8.1.393.1; Mon, 15 Feb 2010
 11:34:42 -0700
Received: from mail1.lsil.com (mail1.lsil.com [147.145.40.21])	by
 milmhbs1.lsil.com (8.12.11/8.12.11) with ESMTP id o1FIYfop014281	for
 <andy.sharp@lsi.com>; Mon, 15 Feb 2010 10:34:41 -0800
Received: from psmtp.com (na3sys009amx176.postini.com [74.125.149.157])	by
 mail1.lsil.com (8.12.11/8.12.11) with SMTP id o1FIYe83001178	for
 <andy.sharp@lsi.com>; Mon, 15 Feb 2010 10:34:40 -0800 (PST)
Received: from source ([78.24.191.182]) by na3sys009amx176.postini.com
 ([74.125.148.14]) with SMTP;	Mon, 15 Feb 2010 12:34:40 CST
Received: from localhost.localdomain ([127.0.0.1]:41844 "EHLO
        eddie.linux-mips.org" rhost-flags-OK-OK-OK-FAIL)        by
 eddie.linux-mips.org with ESMTP id S1492114Ab0BOSeZ (ORCPT
        <rfc822;andy.sharp@lsi.com>); Mon, 15 Feb 2010 19:34:25 +0100
Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 15 Feb 2010 19:34:07
 +0100 (CET)
Received: from mail3.caviumnetworks.com ([12.108.191.235]:18438 "EHLO
        mail3.caviumnetworks.com" rhost-flags-OK-OK-OK-OK)        by
 eddie.linux-mips.org with ESMTP id S1492112Ab0BOSeE (ORCPT
        <rfc822;linux-mips@linux-mips.org>); Mon, 15 Feb 2010 19:34:04 +0100
Received: from caexch01.caveonetworks.com (Not Verified[192.168.16.9]) by
 mail3.caviumnetworks.com with MailMarshal (v6,7,2,8378)        id
 <B4b7993a20000>; Mon, 15 Feb 2010 10:34:11 -0800
Received: from caexch01.caveonetworks.com ([192.168.16.9]) by
 caexch01.caveonetworks.com with Microsoft SMTPSVC(6.0.3790.3959);
         Mon, 15 Feb 2010 10:34:00 -0800
Received: from dd1.caveonetworks.com ([12.108.191.236]) by
 caexch01.caveonetworks.com over TLS secured channel with Microsoft
 SMTPSVC(6.0.3790.3959);         Mon, 15 Feb 2010 10:34:00 -0800
Received: from dd1.caveonetworks.com (localhost.localdomain [127.0.0.1])
        by dd1.caveonetworks.com (8.14.3/8.14.2) with ESMTP id o1FIXw90017879;
        Mon, 15 Feb 2010 10:33:58 -0800
Received: (from ddaney@localhost)        by dd1.caveonetworks.com
 (8.14.3/8.14.3/Submit) id o1FIXu0o017878;        Mon, 15 Feb 2010 10:33:56
 -0800
From: David Daney <ddaney@caviumnetworks.com>
To: "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
	"ralf@linux-mips.org" <ralf@linux-mips.org>
CC: David Daney <ddaney@caviumnetworks.com>
Sender: "linux-mips-bounce@linux-mips.org" <linux-mips-bounce@linux-mips.org>
Date: Mon, 15 Feb 2010 11:33:21 -0700
Subject: [PATCH] MIPS: Fix RIXI patch for au1000 processors.
Thread-Topic: [PATCH] MIPS: Fix RIXI patch for au1000 processors.
Thread-Index: AcqubYoPtCq1/XafQeqW0Mv7zCWeTA==
Message-ID: <1266258801-17841-1-git-send-email-ddaney@caviumnetworks.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-Exchange-Organization-AuthSource: coscas01.lsi.com
X-MS-Has-Attach:
X-Auto-Response-Suppress: All
X-MS-TNEF-Correlator:
x-scanned-by: MIMEDefang 2.39
errors-to: linux-mips-bounce@linux-mips.org
x-originalarrivaltime: 15 Feb 2010 18:34:00.0919 (UTC)
 FILETIME=[714F9670:01CAAE6D]
x-pstn-levels: (S:99.90000/99.90000 CV:99.9000 FC:95.5390 LC:95.5390
 R:95.9108 P:95.9108 M:97.0282 C:98.6951 )
x-pstn-settings: 3 (1.0000:1.0000) s cv gt3 gt2 gt1 r p m c 
x-pstn-addresses: from <ddaney@caviumnetworks.com> [22/1] 
x-pstn-neptune: 0/0/0.00/0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

Several macros need to be defined even though they are only used in
dead code paths.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
---
 arch/mips/include/asm/pgtable-bits.h |   25 ++++++++++++++++++++-----
 1 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/arch/mips/include/asm/pgtable-bits.h b/arch/mips/include/asm/p=
gtable-bits.h
index a2e646f..e9fe7e9 100644
--- a/arch/mips/include/asm/pgtable-bits.h
+++ b/arch/mips/include/asm/pgtable-bits.h
@@ -66,7 +66,6 @@
 #define _PAGE_SILENT_WRITE          (1<<10)
 #define _CACHE_UNCACHED             (1<<11)
 #define _CACHE_MASK                 (1<<11)
-#define _PFN_SHIFT                  PAGE_SHIFT
=20
 #else /* 'Normal' r4K case */
 /*
@@ -129,10 +128,26 @@
 #define _CACHE_MASK		(7 << _CACHE_SHIFT)
=20
 #define _PFN_SHIFT		(PAGE_SHIFT - 12 + _CACHE_SHIFT + 3)
-#define _PFN_MASK		(~((1 << (_PFN_SHIFT)) - 1))
=20
 #endif /* defined(CONFIG_64BIT_PHYS_ADDR && defined(CONFIG_CPU_MIPS32) */
=20
+#ifndef _PFN_SHIFT
+#define _PFN_SHIFT                  PAGE_SHIFT
+#endif
+#define _PFN_MASK		(~((1 << (_PFN_SHIFT)) - 1))
+
+#ifndef _PAGE_NO_READ
+#define _PAGE_NO_READ ({BUG(); 0; })
+#define _PAGE_NO_READ_SHIFT ({BUG(); 0; })
+#endif
+#ifndef _PAGE_NO_EXEC
+#define _PAGE_NO_EXEC ({BUG(); 0; })
+#endif
+#ifndef _PAGE_GLOBAL_SHIFT
+#define _PAGE_GLOBAL_SHIFT ilog2(_PAGE_GLOBAL)
+#endif
+
+
 #ifndef __ASSEMBLY__
 /*
  * pte_to_entrylo converts a page table entry (PTE) into a Mips
@@ -148,9 +163,9 @@ static inline uint64_t pte_to_entrylo(unsigned long pte=
_val)
 		sa =3D 63 - _PAGE_NO_READ_SHIFT;
 #endif
 		/*
-		 * C has no way to express that this is a DSRL 5
-		 * followed by a ROTR 2.  Luckily in the fast path
-		 * this is done in assembly
+		 * C has no way to express that this is a DSRL
+		 * _PAGE_NO_EXEC_SHIFT followed by a ROTR 2.  Luckily
+		 * in the fast path this is done in assembly
 		 */
 		return (pte_val >> _PAGE_GLOBAL_SHIFT) |
 			((pte_val & (_PAGE_NO_EXEC | _PAGE_NO_READ)) << sa);
--=20
1.6.6


