From patchwork Tue Sep 9 22:49:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 4873181 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 78497C0338 for ; Tue, 9 Sep 2014 22:52:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B32422017E for ; Tue, 9 Sep 2014 22:52:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BFE34201BA for ; Tue, 9 Sep 2014 22:52:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XRUEq-0006fs-Fe; Tue, 09 Sep 2014 22:50:16 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XRUDi-0004c4-2S; Tue, 09 Sep 2014 22:49:06 +0000 Received: from geoff by merlin.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1XRUDg-0007Rg-PO; Tue, 09 Sep 2014 22:49:04 +0000 Message-Id: <8db284c1443918ca692a5c2e30a0c7f13b37428f.1410302383.git.geoff@infradead.org> In-Reply-To: References: From: Geoff Levand Patch-Date: Tue, 9 Sep 2014 12:35:12 -0700 Subject: [PATCH 07/13] arm64: Add new routine local_disable To: Catalin Marinas , Will Deacon Date: Tue, 09 Sep 2014 22:49:04 +0000 Cc: marc.zyngier@arm.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, christoffer.dall@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Add the new arm64 routine local_disable() to allow the masking of several DAIF flags in one operation. Currently, we only have routines to mask individual flags, and to mask several flags multiple calls to daifset are required. Signed-off-by: Geoff Levand --- arch/arm64/include/asm/irqflags.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/arm64/include/asm/irqflags.h b/arch/arm64/include/asm/irqflags.h index 11cc941..28521d4 100644 --- a/arch/arm64/include/asm/irqflags.h +++ b/arch/arm64/include/asm/irqflags.h @@ -113,5 +113,18 @@ static inline int arch_irqs_disabled_flags(unsigned long flags) #define local_dbg_enable() asm("msr daifclr, #8" : : : "memory") #define local_dbg_disable() asm("msr daifset, #8" : : : "memory") +enum daif_flag { + DAIF_FIQ = (1UL << 6), + DAIF_IRQ = (1UL << 7), + DAIF_ASYNC = (1UL << 8), + DAIF_DBG = (1UL << 9), + DAIF_ALL = (0xffUL << 6), +}; + +static inline void local_disable(unsigned long daif_flags) +{ + arch_local_irq_restore(daif_flags | arch_local_save_flags()); +} + #endif #endif