Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp917793imu; Wed, 28 Nov 2018 01:29:09 -0800 (PST) X-Google-Smtp-Source: AFSGD/Ujhlixq5tdpQ8LF+ub5wmDB4Q8CtOXNXMNu4Ap4w2kGE/sB3jmU8R6kyHmpCWfe5K00njp X-Received: by 2002:a62:26c7:: with SMTP id m190mr14216280pfm.79.1543397349726; Wed, 28 Nov 2018 01:29:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543397349; cv=none; d=google.com; s=arc-20160816; b=o+UChlEHLMo5MoDkDOIrxcUfeJr1FYnuHzkcgDZxROcfUbyxcsyCY5u8DneIbaDqys 4piwr8tyyxtZtPYAQRNUZQBCe438DgeBEFUIdak8bxivuymFwMLW91GOTulMA0fhmfvJ 9ijY+GbXF2Lf3ZTgh8uIblWhTywnm0INezmGmmgyzH8A3A5LcgUdzOeywT0d0iNuTWXc +KyFOhe4/B9Mtz8L/bhI3gPVlovdlALaGsLRLyCOnk3oxbwSOPKPqxnYfPOTIYnLwoem rXHATR5MxFCrJ1xWIoSu+wJUc1SGKkIuNLygaIkbJF0Se6V8pCA7wuI6pcZU0i6PC2g/ GB/g== 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; bh=GDIWhMMs0gPxfKGCmYw2EV1Hbw9V4BjXIIeMmgCXj7E=; b=j6lkA1cbfrZULzp8oWksES7pHfP6JR1qEzH7/eMIVnq1E9sDJhbuJ9E2NhJl2/gdrR Kg9FNSMDZNeuJkZcRq22BshD0PLjfuiDG8FVlMhE3aiGynwvUce53SGDAWAwvyngGmbV zBH2cODHWcseqaJrbF6qLijXzwCk3cwrFuD81Q+XfD0uQuQPBH5AcWgQcaA4mTP8ksSr n+IoiXUQ/ArYiWq3ghc0LF5QVgUeIM39LuZMrL9enGgEGtfTi5mgn9wJ54XKYwTAILXA EECmpdDSIYQvSeUuIxYfg9qNm7m1NGymmly6snJeGsBxhLvlikKeooPp40aSpePvgV7Z f69A== ARC-Authentication-Results: i=1; mx.google.com; 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 a32si7906333pla.168.2018.11.28.01.28.55; Wed, 28 Nov 2018 01:29:09 -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; 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 S1728215AbeK1U2V (ORCPT + 99 others); Wed, 28 Nov 2018 15:28:21 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:4834 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728187AbeK1U2U (ORCPT ); Wed, 28 Nov 2018 15:28:20 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 434b080yTgz9vBKJ; Wed, 28 Nov 2018 10:27:20 +0100 (CET) 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 YjjvL2ikzmYX; Wed, 28 Nov 2018 10:27:20 +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 434b080TWjz9vBK9; Wed, 28 Nov 2018 10:27:20 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id F0ACF8B85D; Wed, 28 Nov 2018 10:27:20 +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 8bbXTsbtW2aF; Wed, 28 Nov 2018 10:27:20 +0100 (CET) Received: from po14163vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id D73F68B853; Wed, 28 Nov 2018 10:27:20 +0100 (CET) Received: by po14163vm.idsi0.si.c-s.fr (Postfix, from userid 0) id B14D169AFA; Wed, 28 Nov 2018 09:27:20 +0000 (UTC) Message-Id: <5b09cecccb64a577ee9c0cdef3b294ccd7f2ee70.1543356926.git.christophe.leroy@c-s.fr> In-Reply-To: <76d777b36e54e7b8d4c196405decc712fc5eaf45.1543356926.git.christophe.leroy@c-s.fr> References: <76d777b36e54e7b8d4c196405decc712fc5eaf45.1543356926.git.christophe.leroy@c-s.fr> From: Christophe Leroy Subject: [RFC PATCH v2 09/11] powerpc/32: add helper to write into segment registers To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , ruscur@russell.cc Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Wed, 28 Nov 2018 09:27:20 +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 d9598e6790d8..6b5d2a61af5a 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h @@ -1424,6 +1424,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