Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp240651imp; Thu, 21 Feb 2019 00:05:45 -0800 (PST) X-Google-Smtp-Source: AHgI3IZwBp7a2gB8bRKj1Q6hjPvhQmRAf3DPceGfGuEiYvRCLyXAWaV9GpEb5Iv6DrvwvQWRFEa8 X-Received: by 2002:a17:902:7d89:: with SMTP id a9mr24882512plm.33.1550736345634; Thu, 21 Feb 2019 00:05:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550736345; cv=none; d=google.com; s=arc-20160816; b=wNwRXcziQtx31BKV3ts5l2WCBuS5FQdgp65s+iP2/oUm6CLldCeqi0ZhTveXADnt+6 PHY/M7kRwWchPYoTR9eCeGpcOSF9DMnG6Ns4y8OL6aNrHJBMD4DMZctr+RiGBJqFSXw5 kxOkJyq7f0Ergw9kFYsvXBeAG79SUYaaOgHS13YQkz1nbl10NpbYPYKNh4O6MC/ZM4QT pwePkptGcuRwGQ/2WPT+E0/7iUM1cxoEqcJdl63qvZ6RoO1QsGRyZ+z5KBlu6KWocgch KHcx0BEDz3JV1dUBXjfEjEM17Y5mmzUvpCGMJcK6J0j0sfqI+XqKo7Ev4wQ3Z0O1LzML kNAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=ccf0q8MxveX5A/kD+EyhGHMgyOOsoAgRMM6RQCBw488=; b=uzTBYvGqTQpmYuvCaSN5Xi4NrMExlQKxlQ5d/gB/QH/XAMhnpQAk4svWjascTmcETi i1jEArlPuuD4yPaTIEKsvOPdTa4kez9JMiJCKWn9GidXhVEf2yiy13IefMdRoIMxuBsL aRuihTipL8TdHDBdVfu/Hm1I9cyP+SpUShmXW41bcbcD7jV82JTszU03Ioae0lNU6KEB 1Wb3S6jx4wgcqbbkgmRBKdEPYo/xuLateE9oF+YeMd8Cvp+602uW+MlXS6pBiB2DUpE6 i9fmYtqZvZKt+kfa9sv+717IqmKdvjNblCCKWw48cf/nKjoyasSW1GZJRJ8lbWdPhLXM e/1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=PrINp6EE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j73si1787174pge.263.2019.02.21.00.05.30; Thu, 21 Feb 2019 00:05:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=PrINp6EE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727430AbfBUIFA (ORCPT + 99 others); Thu, 21 Feb 2019 03:05:00 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:26284 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727382AbfBUIE6 (ORCPT ); Thu, 21 Feb 2019 03:04:58 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 444n7r0v0sz9vJgD; Thu, 21 Feb 2019 09:04:56 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=PrINp6EE; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id q_WF3tsxW9Rx; Thu, 21 Feb 2019 09:04:56 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 444n7q70TFz9vJg1; Thu, 21 Feb 2019 09:04:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1550736296; bh=ccf0q8MxveX5A/kD+EyhGHMgyOOsoAgRMM6RQCBw488=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=PrINp6EEIO4+UwJuNbTiC+MSFVDUL83HHSBVpguTx5Lq4MHnOFXjis4xYObAlqx2d +RnHMviifrNf/QRB5zRQ0xuiZHwyv/Rni2Zr9jA/IwVbOa7Fbf3MllR53ysoDVtHh0 1QZAZA8ZGhHmVz2yvYgrUMqfaakiqLwyczWciiO4= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id E3C198B78F; Thu, 21 Feb 2019 09:04:56 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id if7zJXHO8lFH; Thu, 21 Feb 2019 09:04:56 +0100 (CET) Received: from po16846vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id C0EE78B75B; Thu, 21 Feb 2019 09:04:56 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 9AE5E6E866; Thu, 21 Feb 2019 08:04:56 +0000 (UTC) Message-Id: <0c06496103452fc1a05fcfa68ae8b4b1ceb0f231.1550692943.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 08/16] powerpc/32: add helper to write into segment registers To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , j.neuschaefer@gmx.net Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Thu, 21 Feb 2019 08:04:56 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch add an helper which wraps 'mtsrin' instruction to write into segment registers. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/reg.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 1c98ef1f2d5b..a70cbaf5c26f 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h @@ -1425,6 +1425,11 @@ static inline void msr_check_and_clear(unsigned long bits) #define mfsrin(v) ({unsigned int rval; \ asm volatile("mfsrin %0,%1" : "=r" (rval) : "r" (v)); \ rval;}) + +static inline void mtsrin(u32 val, u32 idx) +{ + asm volatile("mtsrin %0, %1" : : "r" (val), "r" (idx)); +} #endif #define proc_trap() asm volatile("trap") -- 2.13.3