Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp787303imp; Thu, 21 Feb 2019 11:10:12 -0800 (PST) X-Google-Smtp-Source: AHgI3IYezpbISCA3wnEhVGC77Nw+qYBODQ+WJ8vYuo65VTzhgU2NokjYhOQ3DL8kfDwAGkChEXHH X-Received: by 2002:a17:902:6686:: with SMTP id e6mr82633plk.208.1550776212606; Thu, 21 Feb 2019 11:10:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550776212; cv=none; d=google.com; s=arc-20160816; b=lwciYPzA/xGdceJiOANApveV11k14AMJV0zJ0BI4zEhHCFs/Ne4a4aG+ZgYbzUHtvF 7kyASombla8X8jDkn2PgQuAkzt6mvNaqYBPi4gBvfSU4wGf8OZmeUlRTQfiEJFiONS4a iqNKIm+L7CIX7bj97erWUxN74UExbAsyBMgu4VOM32yQuDwZL7JFgPChvVmTalyWie0U Aywf0ZF1xd/qxeWHOS4V7oQV51CKuGZq9hH68DFv7qxXJIOmlctX2849yvWlNLdiWRYV f7vwkREOiVbKkrEddr0IITPIbvYwrnnl36FYNTx3PwZccNAk3hUTByNFGtQkSXfnoBsH LKkw== 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=vDZQEtXclTpMT6bSaqynofHzlcnIVYGKbxYOWhqSbrAz2wGdtZqW97c4EJVAMLNZI7 cjCPN1sZr6KWDWE9piYbolDyn2J3pnxACL1w9MK5yP7My5bjL0izsFQL5V1Kuiw/6I71 rps4lojLtxE6CMuwMb22i0w8g3xizFsuxaUw7dadcPi4hHrQ0s6jtCW4ZvgBt07NJv07 pMiftTJ+qvxEdqzai9qeTkbE0Jy94m7IATiUPDMKncd+CAI8YrewyaauQhJaxMutvjtJ NAyMHGs0i4mQcn5/DpXaWt0R96MrXTiOoNszJ/j1N8bHI8SOW6lFbmqoo5fnmKYbQ/V1 5nOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=XQW+54wH; 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 u20si1663275pgn.329.2019.02.21.11.09.57; Thu, 21 Feb 2019 11:10:12 -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=XQW+54wH; 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 S1726630AbfBUTIs (ORCPT + 99 others); Thu, 21 Feb 2019 14:08:48 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:10798 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726488AbfBUTIq (ORCPT ); Thu, 21 Feb 2019 14:08:46 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4453sn0Jmwz9v6l6; Thu, 21 Feb 2019 20:08:45 +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=XQW+54wH; 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 iX7qrrwEcELT; Thu, 21 Feb 2019 20:08:44 +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 4453sm6DlYz9v6l5; Thu, 21 Feb 2019 20:08:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1550776124; bh=ccf0q8MxveX5A/kD+EyhGHMgyOOsoAgRMM6RQCBw488=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=XQW+54wHmUiaRFKUF+D/fBbwmgxHedz3leUsTByMVqFevpJtMirejjPNwQaUv4KA8 +uEMhDPz85UgoLjBb8QkAvn4vD1HYVoKMeg0OU04/CWd+ALYzBJtVkoTXWNrXIbm8v 2B6cXPGoCwZjzM2yfmfoguApjS2UbJqqO0H5QWc4= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id D88078B852; Thu, 21 Feb 2019 20:08:44 +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 0AQ4MwL2JTi8; Thu, 21 Feb 2019 20:08:44 +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 AFF668B86B; Thu, 21 Feb 2019 20:08:44 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 88A5D6EF61; Thu, 21 Feb 2019 19:08:44 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v5 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 19:08:44 +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