From patchwork Wed Jun 10 11:24:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 6578681 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4CCEBC0020 for ; Wed, 10 Jun 2015 11:27:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5AB74205F9 for ; Wed, 10 Jun 2015 11:27:08 +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 6E9B2205F5 for ; Wed, 10 Jun 2015 11:27:07 +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 1Z2e7v-0004rz-Bl; Wed, 10 Jun 2015 11:24:59 +0000 Received: from mail-wi0-f174.google.com ([209.85.212.174]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z2e7p-0004lh-E4 for linux-arm-kernel@lists.infradead.org; Wed, 10 Jun 2015 11:24:54 +0000 Received: by wiwd19 with SMTP id d19so45046201wiw.0 for ; Wed, 10 Jun 2015 04:24:31 -0700 (PDT) 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; bh=lLgPMMaqWVkV4kzdGA6tIr2QARLm3rHNqukZ/3BkLJs=; b=XdOHR/UhUdEnIBzogWoKT+Cqf8bjWb2UEicd8cdHuO/Kd+XyNgr5YWQkN1jxZcwbUX LnjUafkHadgsjtNX6y7RBZ3yKg/GfbYYltxD9uqfvCrNbLCmRo5IqGDRWnHctzGME68Y y2PIjFYl9hhBfir73j3A2YCYjwPScGDiwx0lzqnFv5ZLwx+1N8TCZcrdoYCNr2ygK9uD OFfRYkriMHo9+OzX1HlbqdKXnit0UZ8382RW7kZEm2rVdvS+7JUCoIW1zv2BWUfWH4Do CRN03Tay3mqkZrPLd4MPGA5Oy2cwzw+glXp4FJ1/GBIR+XgWXhhaoIQnn+yvm9+g7KAX 7PiA== X-Gm-Message-State: ALoCoQnhZZsTdq5Q/EPmfoHPZ7MZhhmowrGEei5k5HN786pb49jOT17w8KN2NkmCUY450g3APcu0 X-Received: by 10.194.240.8 with SMTP id vw8mr980787wjc.114.1433935471126; Wed, 10 Jun 2015 04:24:31 -0700 (PDT) Received: from wychelm.lan (cpc4-aztw19-0-0-cust71.18-1.cable.virginm.net. [82.33.25.72]) by mx.google.com with ESMTPSA id fi6sm7451617wib.6.2015.06.10.04.24.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jun 2015 04:24:30 -0700 (PDT) From: Daniel Thompson To: Russell King Subject: [PATCH] ARM: irqflags: Get arch_irqs_disabled from asm-generic Date: Wed, 10 Jun 2015 12:24:13 +0100 Message-Id: <1433935453-22381-1-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 2.4.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150610_042453_656985_88FE79D9 X-CRM114-Status: UNSURE ( 9.05 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: Daniel Thompson , linaro-kernel@lists.linaro.org, Arnd Bergmann , patches@linaro.org, linux-kernel@vger.kernel.org, Maxime Coquelin , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , linux-arm-kernel@lists.infradead.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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 Commit cb1293e2f594 ("ARM: 8375/1: disable some options on ARMv7-M") causes the build to on ARMv7-M machines: CC arch/arm/kernel/asm-offsets.s In file included from include/linux/sem.h:5:0, from include/linux/sched.h:35, from arch/arm/kernel/asm-offsets.c:14: include/linux/rcupdate.h: In function 'rcu_read_lock_sched_held': include/linux/rcupdate.h:539:2: error: implicit declaration of function 'arch_irqs_disabled' [-Werror=implicit-function-declaration] return preempt_count() != 0 || irqs_disabled(); asm-generic/irqflags.h provides an implementation of arch_irqs_disabled(). Lets grab an implementation from there! Suggested-by: Russell King Signed-off-by: Daniel Thompson Acked-by: Maxime Coquelin --- Notes: Compile tested on v4.1-rc6 using all arch/arm/configs. Boot tested on v4.1-rc6 with versatile_defconfig and multi_v7_defconfig. Boot tested on linux-next-20150608 using stm32_defconfig (out-of-tree). arch/arm/include/asm/irqflags.h | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.4.2 diff --git a/arch/arm/include/asm/irqflags.h b/arch/arm/include/asm/irqflags.h index 3b763d6652a0..43908146a5cf 100644 --- a/arch/arm/include/asm/irqflags.h +++ b/arch/arm/include/asm/irqflags.h @@ -20,6 +20,7 @@ #if __LINUX_ARM_ARCH__ >= 6 +#define arch_local_irq_save arch_local_irq_save static inline unsigned long arch_local_irq_save(void) { unsigned long flags; @@ -31,6 +32,7 @@ static inline unsigned long arch_local_irq_save(void) return flags; } +#define arch_local_irq_enable arch_local_irq_enable static inline void arch_local_irq_enable(void) { asm volatile( @@ -40,6 +42,7 @@ static inline void arch_local_irq_enable(void) : "memory", "cc"); } +#define arch_local_irq_disable arch_local_irq_disable static inline void arch_local_irq_disable(void) { asm volatile( @@ -56,6 +59,7 @@ static inline void arch_local_irq_disable(void) /* * Save the current interrupt enable state & disable IRQs */ +#define arch_local_irq_save arch_local_irq_save static inline unsigned long arch_local_irq_save(void) { unsigned long flags, temp; @@ -73,6 +77,7 @@ static inline unsigned long arch_local_irq_save(void) /* * Enable IRQs */ +#define arch_local_irq_enable arch_local_irq_enable static inline void arch_local_irq_enable(void) { unsigned long temp; @@ -88,6 +93,7 @@ static inline void arch_local_irq_enable(void) /* * Disable IRQs */ +#define arch_local_irq_disable arch_local_irq_disable static inline void arch_local_irq_disable(void) { unsigned long temp; @@ -135,6 +141,7 @@ static inline void arch_local_irq_disable(void) /* * Save the current interrupt enable state. */ +#define arch_local_save_flags arch_local_save_flags static inline unsigned long arch_local_save_flags(void) { unsigned long flags; @@ -147,6 +154,7 @@ static inline unsigned long arch_local_save_flags(void) /* * restore saved IRQ & FIQ state */ +#define arch_local_irq_restore arch_local_irq_restore static inline void arch_local_irq_restore(unsigned long flags) { asm volatile( @@ -156,10 +164,13 @@ static inline void arch_local_irq_restore(unsigned long flags) : "memory", "cc"); } +#define arch_irqs_disabled_flags arch_irqs_disabled_flags static inline int arch_irqs_disabled_flags(unsigned long flags) { return flags & IRQMASK_I_BIT; } +#include + #endif /* ifdef __KERNEL__ */ #endif /* ifndef __ASM_ARM_IRQFLAGS_H */