From patchwork Tue Mar 15 06:25:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Crystal Wood X-Patchwork-Id: 597364 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 AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qPPm21ywpz9sD3 for ; Tue, 15 Mar 2016 17:26:58 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3qPPm21BCQzDr6G for ; Tue, 15 Mar 2016 17:26:58 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from host.buserror.net (host.buserror.net [209.198.135.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3qPPkx6bh7zDq7K for ; Tue, 15 Mar 2016 17:26:01 +1100 (AEDT) Received: from c-75-72-173-242.hsd1.mn.comcast.net ([75.72.173.242] helo=snotra.buserror.net) by host.buserror.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA256:128) (Exim 4.84) (envelope-from ) id 1afiQT-0006Rx-I3; Tue, 15 Mar 2016 01:25:55 -0500 From: Scott Wood To: Michael Ellerman Date: Tue, 15 Mar 2016 01:25:51 -0500 Message-Id: <1458023151-32066-1-git-send-email-oss@buserror.net> X-Mailer: git-send-email 2.5.0 X-SA-Exim-Connect-IP: 75.72.173.242 X-SA-Exim-Mail-From: oss@buserror.net X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on host.buserror.net X-Spam-Level: X-Spam-Status: No, score=-16.0 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * -15 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Subject: [PATCH] powerpc/8xx: Fix do_mtspr_cpu6 build on older compilers X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:57:07 +0000) X-SA-Exim-Scanned: Yes (on host.buserror.net) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Scott Wood , linuxppc-dev@lists.ozlabs.org MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Some versions of GCC, reportedly before 4.9, fail with arch/powerpc/mm/8xx_mmu.c:139:2: error: memory input 1 is not directly addressable Use a register constraint instead of a memory constraint to avoid this. Also change the one-element array into a simple variable. Signed-off-by: Scott Wood Cc: Christophe Leroy --- Christope, could you test? And was there any particular reason for the [1]? arch/powerpc/include/asm/reg_8xx.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/include/asm/reg_8xx.h b/arch/powerpc/include/asm/reg_8xx.h index d41412c..cb7dfb9 100644 --- a/arch/powerpc/include/asm/reg_8xx.h +++ b/arch/powerpc/include/asm/reg_8xx.h @@ -53,11 +53,11 @@ #ifdef CONFIG_8xx_CPU6 #define do_mtspr_cpu6(rn, rn_addr, v) \ do { \ - int _reg_cpu6 = rn_addr, _tmp_cpu6[1]; \ - asm volatile("stw %0, %1;" \ - "lwz %0, %1;" \ + int _reg_cpu6 = rn_addr, _tmp_cpu6; \ + asm volatile("stwx %0, 0, %1;" \ + "lwzx %0, 0, %1;" \ "mtspr " __stringify(rn) ",%2" : \ - : "r" (_reg_cpu6), "m"(_tmp_cpu6), \ + : "r" (_reg_cpu6), "r" (&_tmp_cpu6), \ "r" ((unsigned long)(v)) \ : "memory"); \ } while (0)