From patchwork Mon Dec 19 08:07:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: maddy X-Patchwork-Id: 706986 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3thtwC45Txz9ryT for ; Mon, 19 Dec 2016 19:13:31 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3thtwC3LZ7zDt0g for ; Mon, 19 Dec 2016 19:13:31 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 3thtnQ60FfzDwKv for ; Mon, 19 Dec 2016 19:07:38 +1100 (AEDT) Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uBJ83iD0048816 for ; Mon, 19 Dec 2016 03:07:37 -0500 Received: from e23smtp02.au.ibm.com (e23smtp02.au.ibm.com [202.81.31.144]) by mx0a-001b2d01.pphosted.com with ESMTP id 27dwxc7wvc-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 19 Dec 2016 03:07:34 -0500 Received: from localhost by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 19 Dec 2016 18:07:32 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp02.au.ibm.com (202.81.31.208) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 19 Dec 2016 18:07:31 +1000 Received: from d23relay10.au.ibm.com (d23relay10.au.ibm.com [9.190.26.77]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id AD4032CE8046 for ; Mon, 19 Dec 2016 19:07:30 +1100 (EST) Received: from d23av05.au.ibm.com (d23av05.au.ibm.com [9.190.234.119]) by d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uBJ87UDs46137522 for ; Mon, 19 Dec 2016 19:07:30 +1100 Received: from d23av05.au.ibm.com (localhost [127.0.0.1]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id uBJ87TcS027738 for ; Mon, 19 Dec 2016 19:07:30 +1100 Received: from SrihariSrinidhi.in.ibm.com (sriharisrinidhi.in.ibm.com [9.121.0.136]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id uBJ87F96027242; Mon, 19 Dec 2016 19:07:27 +1100 From: Madhavan Srinivasan To: benh@kernel.crashing.org, mpe@ellerman.id.au Subject: [PATCH v4 04/12] powerpc: Add soft_enabled manipulation functions Date: Mon, 19 Dec 2016 13:37:00 +0530 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482134828-18811-1-git-send-email-maddy@linux.vnet.ibm.com> References: <1482134828-18811-1-git-send-email-maddy@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16121908-0004-0000-0000-000001CA130A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16121908-0005-0000-0000-00000956DCBD Message-Id: <1482134828-18811-5-git-send-email-maddy@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-12-19_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1612190130 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@lists.ozlabs.org, Madhavan Srinivasan , paulus@samba.org, anton@samba.org, npiggin@gmail.com Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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)