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: 49685 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AD9B620C81 for ; Wed, 10 Jun 2015 11:24:33 +0000 (UTC) Received: by laboh3 with SMTP id oh3sf12043956lab.0 for ; Wed, 10 Jun 2015 04:24:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=lLgPMMaqWVkV4kzdGA6tIr2QARLm3rHNqukZ/3BkLJs=; b=AtGwgBIWxvjgtyT0dBGdyuZkCtoXpgth0cTGKYpGbVMc99lvfhfcM8RnOqW5Uq7rGo XO2zW4JYCIcWA+k6bFu7JfkbhoruZzNXiszKrEqdj3qTSn9D3ttk5WJuZ5CGyZ2TbDoC 4e+Yqm3j8lIUdGNUDghWulGMisJmmemy3TEK3RMQ0Y2uVr/ahF9/lbCr1184QE3/njde e9qPx6YOE5G0CLGCb7aSCcyr787Ytt6Ytg6UXzOZ+qZSyzU38GJ69b10Tfw8JQwkRlU2 zg8oM1vwM1oeMcMSYZ/oa5kyHyBUTOO0T+Ik0BAmuAe10+iCGVk0fKhXK7ds44E5aEU+ 9FTQ== X-Gm-Message-State: ALoCoQnfKhcFvCmZlS+3bd9IPJA0EG1Th6+FOX9QKR+5aLkJRmZDFFokkixACkEW1v1TQLzqYMSG X-Received: by 10.112.166.137 with SMTP id zg9mr2520989lbb.11.1433935472574; Wed, 10 Jun 2015 04:24:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.41 with SMTP id bd9ls220286lab.109.gmail; Wed, 10 Jun 2015 04:24:32 -0700 (PDT) X-Received: by 10.152.19.162 with SMTP id g2mr3222082lae.46.1433935472431; Wed, 10 Jun 2015 04:24:32 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id j11si8691743lbg.95.2015.06.10.04.24.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jun 2015 04:24:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbbqq2 with SMTP id qq2so26756756lbb.3 for ; Wed, 10 Jun 2015 04:24:32 -0700 (PDT) X-Received: by 10.112.222.133 with SMTP id qm5mr3237150lbc.86.1433935472285; Wed, 10 Jun 2015 04:24:32 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp3267193lbb; Wed, 10 Jun 2015 04:24:31 -0700 (PDT) X-Received: by 10.194.222.137 with SMTP id qm9mr5396264wjc.43.1433935471581; Wed, 10 Jun 2015 04:24:31 -0700 (PDT) Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com. [209.85.212.169]) by mx.google.com with ESMTPS id dx2si9153965wib.2.2015.06.10.04.24.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jun 2015 04:24:31 -0700 (PDT) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.212.169 as permitted sender) client-ip=209.85.212.169; Received: by wiga1 with SMTP id a1so44915939wig.0 for ; Wed, 10 Jun 2015 04:24:31 -0700 (PDT) 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 Cc: Daniel Thompson , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, patches@linaro.org, linaro-kernel@lists.linaro.org, Maxime Coquelin , Arnd Bergmann , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.thompson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 */