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: 8436821 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7C80FC0553 for ; Fri, 26 Feb 2016 13:16:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D0958203A4 for ; Fri, 26 Feb 2016 13:16:06 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 314DC20394 for ; Fri, 26 Feb 2016 13:16:06 +0000 (UTC) Received: from localhost ([::1]:49682 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZIFZ-0008Ih-8z for patchwork-qemu-devel@patchwork.kernel.org; Fri, 26 Feb 2016 08:16:05 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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) \ { \