From patchwork Fri Feb 26 13:15:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 63044 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp712238lbc; Fri, 26 Feb 2016 05:16:53 -0800 (PST) X-Received: by 10.55.79.134 with SMTP id d128mr1716128qkb.73.1456492613681; Fri, 26 Feb 2016 05:16:53 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id n125si13115407qhn.6.2016.02.26.05.16.53 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 26 Feb 2016 05:16:53 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dkim=fail header.i=@linaro.org Received: from localhost ([::1]:49686 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZIGL-0000wY-29 for patch@linaro.org; Fri, 26 Feb 2016 08:16:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZIFK-0008IN-1l for qemu-devel@nongnu.org; Fri, 26 Feb 2016 08:15:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZIFG-0004E7-PD for qemu-devel@nongnu.org; Fri, 26 Feb 2016 08:15:49 -0500 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:38481) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZIFG-0004E3-IX for qemu-devel@nongnu.org; Fri, 26 Feb 2016 08:15:46 -0500 Received: by mail-wm0-x235.google.com with SMTP id a4so69524868wme.1 for ; Fri, 26 Feb 2016 05:15:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HLCLICJxUuiAOJYn+CHLrtHnqJTbyuU4nh3k8qGA+zQ=; b=ZLH2XpA7/XaYAPV3oaeakzz7ZT4enM1M5BrRd2kkHmWTxlt1IkxqwzJkriXPqvM2Dn qkFOeewLcP0BRwIiWQbdOT2Pt6xfd/eDFNcO15h9BMYJJLk8HS7OdcKrhbm8TbEy80GI Upb8dZWYAMJj3gLoO/lYi3YNTUqgarOgKyMCg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HLCLICJxUuiAOJYn+CHLrtHnqJTbyuU4nh3k8qGA+zQ=; b=cfiPJlaT9tk18B/yzJD17u5sRiLQ1mqT25++LWCf2MsAQDKaRFFet0bb2OFQuhaKn/ S6xKGyPCPGU4DqKHwbMhKhDfOtrkU1lRy12BGtaCWtVLOBKOZqTwvLjA9jk6ahTFbnr7 l2qRaXXsqBAinMNKH9cDkwGyMOIuEhPdw9jPvskwet/J2S4tYDrYrhuz8KB6kKLf1hB3 Ip/DXYBtDac/xnmqp9pFTi1hSs6r2g2+jPjK6BThu7yMIu35yGqCN+O8RGEXRBFBE/qU YSkCr4uXX3Ddf9f9QPDvcFEEr+Z7HPdC1O7qy9nXFdWnRm4rsQBudEdwQ7xHRVJLQtq7 CQeA== X-Gm-Message-State: AD7BkJKBDW2lHkq2i5NW8cIVUH3R5eK8Vx57lXAuOsYayE+FSuZhrfd/iBaulW5UxALjtGJh X-Received: by 10.194.78.83 with SMTP id z19mr1654289wjw.5.1456492545982; Fri, 26 Feb 2016 05:15:45 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id ka7sm12420425wjb.8.2016.02.26.05.15.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Feb 2016 05:15:41 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 39C3D3E01EB; Fri, 26 Feb 2016 13:15:41 +0000 (GMT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: mttcg@listserver.greensocs.com, mark.burton@greensocs.com, fred.konrad@greensocs.com, a.rigo@virtualopensystems.com Date: Fri, 26 Feb 2016 13:15:24 +0000 Message-Id: <1456492533-17171-3-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.7.1 In-Reply-To: <1456492533-17171-1-git-send-email-alex.bennee@linaro.org> References: <1456492533-17171-1-git-send-email-alex.bennee@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::235 Cc: peter.maydell@linaro.org, drjones@redhat.com, a.spyridakis@virtualopensystems.com, claudio.fontana@huawei.com, qemu-devel@nongnu.org, will.deacon@arm.com, crosthwaitepeter@gmail.com, pbonzini@redhat.com, aurelien@aurel32.net, rth@twiddle.net Subject: [Qemu-devel] [RFC 02/11] arm/arm64: irq enable/disable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Andrew Jones Signed-off-by: Andrew Jones --- lib/arm/asm/processor.h | 10 ++++++++++ lib/arm64/asm/processor.h | 10 ++++++++++ 2 files changed, 20 insertions(+) -- 2.7.1 diff --git a/lib/arm/asm/processor.h b/lib/arm/asm/processor.h index f25e7ee..a3a4e0b 100644 --- a/lib/arm/asm/processor.h +++ b/lib/arm/asm/processor.h @@ -33,6 +33,16 @@ static inline unsigned long current_cpsr(void) #define current_mode() (current_cpsr() & MODE_MASK) +static inline void local_irq_enable(void) +{ + asm volatile("cpsie i" : : : "memory", "cc"); +} + +static inline void local_irq_disable(void) +{ + asm volatile("cpsid i" : : : "memory", "cc"); +} + static inline unsigned int get_mpidr(void) { unsigned int mpidr; diff --git a/lib/arm64/asm/processor.h b/lib/arm64/asm/processor.h index 84d5c7c..18fa2a2 100644 --- a/lib/arm64/asm/processor.h +++ b/lib/arm64/asm/processor.h @@ -66,6 +66,16 @@ static inline unsigned long current_level(void) return el & 0xc; } +static inline void local_irq_enable(void) +{ + asm volatile("msr daifclr, #2" : : : "memory"); +} + +static inline void local_irq_disable(void) +{ + asm volatile("msr daifset, #2" : : : "memory"); +} + #define DEFINE_GET_SYSREG32(reg) \ static inline unsigned int get_##reg(void) \ { \