From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3w2xGN3n09zDq8M for ; Wed, 12 Apr 2017 18:02:04 +1000 (AEST) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3C7rqja134081 for ; Wed, 12 Apr 2017 04:02:01 -0400 Received: from e23smtp02.au.ibm.com (e23smtp02.au.ibm.com [202.81.31.144]) by mx0b-001b2d01.pphosted.com with ESMTP id 29ru2u6dtj-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 12 Apr 2017 04:02:01 -0400 Received: from localhost by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 12 Apr 2017 18:01:58 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v3C81nCY51445790 for ; Wed, 12 Apr 2017 18:01:57 +1000 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v3C81KGg002711 for ; Wed, 12 Apr 2017 18:01:21 +1000 From: Madhavan Srinivasan To: benh@kernel.crashing.org, mpe@ellerman.id.au Cc: anton@samba.org, paulus@samba.org, npiggin@gmail.com, linuxppc-dev@lists.ozlabs.org, Madhavan Srinivasan Subject: [PATCH v7 03/11] powerpc: Add soft_enabled manipulation functions Date: Wed, 12 Apr 2017 13:30:32 +0530 In-Reply-To: <1491984040-28801-1-git-send-email-maddy@linux.vnet.ibm.com> References: <1491984040-28801-1-git-send-email-maddy@linux.vnet.ibm.com> Message-Id: <1491984040-28801-4-git-send-email-maddy@linux.vnet.ibm.com> List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Add new soft_enabled_* manipulation function and implement arch_local_* using the soft_enabled_* wrappers. Reviewed-by: Nicholas Piggin Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/hw_irq.h | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h index 88f6a8e2b5e3..c292ef4b4bc5 100644 --- a/arch/powerpc/include/asm/hw_irq.h +++ b/arch/powerpc/include/asm/hw_irq.h @@ -62,21 +62,7 @@ static inline notrace void soft_enabled_set(unsigned long enable) : "memory"); } -static inline notrace unsigned long soft_enabled_set_return(unsigned long enable) -{ - unsigned long flags; - - asm volatile( - "lbz %0,%1(13); stb %2,%1(13)" - : "=r" (flags) - : "i" (offsetof(struct paca_struct, soft_enabled)),\ - "r" (enable) - : "memory"); - - return flags; -} - -static inline unsigned long arch_local_save_flags(void) +static inline notrace unsigned long soft_enabled_return(void) { unsigned long flags; @@ -88,20 +74,30 @@ static inline unsigned long arch_local_save_flags(void) return flags; } -static inline unsigned long arch_local_irq_disable(void) +static inline notrace unsigned long soft_enabled_set_return(unsigned long enable) { unsigned long flags, zero; asm volatile( - "li %1,%3; lbz %0,%2(13); stb %1,%2(13)" + "mr %1,%3; lbz %0,%2(13); stb %1,%2(13)" : "=r" (flags), "=&r" (zero) : "i" (offsetof(struct paca_struct, soft_enabled)),\ - "i" (IRQ_DISABLE_MASK_LINUX) + "r" (enable) : "memory"); return flags; } +static inline unsigned long arch_local_save_flags(void) +{ + return soft_enabled_return(); +} + +static inline unsigned long arch_local_irq_disable(void) +{ + return soft_enabled_set_return(IRQ_DISABLE_MASK_LINUX); +} + extern void arch_local_irq_restore(unsigned long); static inline void arch_local_irq_enable(void) -- 2.7.4