Received: from mail.onstor.com (66.201.51.107) by exch1.onstor.net
 (10.0.0.225) with Microsoft SMTP Server id 8.1.311.2; Wed, 10 Dec 2008
 08:39:12 -0800
Received: from chiesmta2-2.messageone.com ([216.203.30.55]) by mail.onstor.com
 with Microsoft SMTPSVC(6.0.3790.3959);	 Wed, 10 Dec 2008 08:39:11 -0800
Received: from ftp.linux-mips.org (ftp.linux-mips.org [213.58.128.207])	by
 chiesmta2-2.messageone.com (8.13.8/8.13.8) with ESMTP id mBAGdB60032405	for
 <andy.sharp@onstor.com>; Wed, 10 Dec 2008 10:39:11 -0600
Received: from localhost.localdomain ([127.0.0.1]:62395 "EHLO
	ftp.linux-mips.org") by ftp.linux-mips.org with ESMTP	id S24207709AbYLJQih
 (ORCPT <rfc822;andy.sharp@onstor.com>);	Wed, 10 Dec 2008 16:38:37 +0000
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 10 Dec 2008 16:38:21
 +0000 (GMT)
Received: from mail3.caviumnetworks.com ([12.108.191.235]:18987 "EHLO
	mail3.caviumnetworks.com") by ftp.linux-mips.org with ESMTP	id
 S24207708AbYLJQiN (ORCPT <rfc822;linux-mips@linux-mips.org>);	Wed, 10 Dec
 2008 16:38:13 +0000
Received: from exch4.caveonetworks.com (Not Verified[192.168.16.23]) by
 mail3.caviumnetworks.com with MailMarshal (v6,2,2,3503)	id <B493ff0460000>;
 Wed, 10 Dec 2008 11:37:27 -0500
Received: from exch4.caveonetworks.com ([192.168.16.23]) by
 exch4.caveonetworks.com with Microsoft SMTPSVC(6.0.3790.3959);	 Wed, 10 Dec
 2008 08:37:25 -0800
Received: from dd1.caveonetworks.com ([64.169.86.201]) by
 exch4.caveonetworks.com with Microsoft SMTPSVC(6.0.3790.3959);	 Wed, 10 Dec
 2008 08:37:25 -0800
From: David Daney <ddaney@caviumnetworks.com>
To: linux-mips <linux-mips@linux-mips.org>
Sender: "linux-mips-bounce@linux-mips.org" <linux-mips-bounce@linux-mips.org>
Date: Wed, 10 Dec 2008 08:37:25 -0800
Subject: [PATCH] MIPS: Use ei/di for mipsr2.
Thread-Topic: [PATCH] MIPS: Use ei/di for mipsr2.
Thread-Index: Acla5dUGQWVe/LI4RhicUP4yK2shpg==
Message-ID: <493FF045.1020803@caviumnetworks.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Internal
X-MS-Exchange-Organization-AuthMechanism: 0b
X-MS-Exchange-Organization-AuthSource: exch1.onstor.net
X-MS-Has-Attach:
X-Auto-Response-Suppress: All
X-MS-TNEF-Correlator:
x-originalarrivaltime: 10 Dec 2008 16:37:25.0190 (UTC)
 FILETIME=[95140E60:01C95AE5]
user-agent: Thunderbird 2.0.0.18 (X11/20081119)
errors-to: linux-mips-bounce@linux-mips.org
x-ems-proccessed: 2K3Xl1OQTInXD6xxuA8z3Q==
x-ems-stamp: o7qgL/SEej4o8jCwa/nWhw==
x-messageone-virus-version: vendor=fsecure
 engine=4.65.7400:2.4.4,1.2.40,4.0.164
 definitions=2008-12-10_06:2008-12-08,2008-12-10,2008-12-10 signatures=0
x-messageone-virus-scanned: Clean
x-messageone-envelope-sender: linux-mips-bounce@linux-mips.org
x-messageone-spam-details: rule=m773emszm_notspam policy=m773emszm score=0
 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam
 adjust=0 reason=mlx engine=3.1.0-0810130000 definitions=main-0812100084
x-messageone-spam-score: 0
x-messageone-spam-bar:
x-list: linux-mips
x-archive-position: 21565
x-ecartis-version: Ecartis v1.0.0
x-original-sender: ddaney@caviumnetworks.com
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0


For mipsr2, use the ei and di instructions to enable and disable
interrupts.

Signed-off-by: Tomaso Paoletti <tpaoletti@caviumnetworks.com>
Signed-off-by: David Daney <ddaney@caviumnetworks.com>
---
 arch/mips/include/asm/asmmacro.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/mips/include/asm/asmmacro.h b/arch/mips/include/asm/asmma=
cro.h
index 7a88175..6c8342a 100644
--- a/arch/mips/include/asm/asmmacro.h
+++ b/arch/mips/include/asm/asmmacro.h
@@ -35,6 +35,16 @@
 	mtc0	\reg, CP0_TCSTATUS
 	_ehb
 	.endm
+#elif defined(CONFIG_CPU_MIPSR2)
+	.macro	local_irq_enable reg=3Dt0
+	ei
+	irq_enable_hazard
+	.endm
+
+	.macro	local_irq_disable reg=3Dt0
+	di
+	irq_disable_hazard
+	.endm
 #else
 	.macro	local_irq_enable reg=3Dt0
 	mfc0	\reg, CP0_STATUS

