Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp627884pxb; Thu, 21 Apr 2022 07:09:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHm3HFMgFM1XdGSqKTDpsRDmE2H06xjd8FpcWTOPmFtZHkHzethgbuFN0czK3M4NOzgngR X-Received: by 2002:a05:6a00:130e:b0:4cc:3c7d:4dec with SMTP id j14-20020a056a00130e00b004cc3c7d4decmr29048465pfu.32.1650550184643; Thu, 21 Apr 2022 07:09:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650550184; cv=none; d=google.com; s=arc-20160816; b=g9NMSaZCERGVeurtbmlpN4QglJb/FoDBXwkEi86jFkWcIA4IhwmsqLg5bVekc8pupr yYLuFNQtZ+Rm/y9U6xiFDor1PfXZLSspr5N+o+FuhCM7Aq9rz4wFNAqCoT1kTgJLNeMJ jUqLUdyEZzIkZvjqmnk8EH7tlC+/0aP0Jm60snpyZvabozBuaTDbbZNWV9AUvj2R7sKY gGzKhqPl/ODKGz3wWAQ0pk03wwVFIKgWtOf65h3XSFLENT32G6eTxU4S/JLru93rX+zI k6+TNzS6ekDU3XNneza5WzERQQn6idKe73NIjNbWal0eqSR4eOt5oWMsJ5u4iObn75dB eEFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/ncZocJ5Upo0Tlz4v6e6Y6+ABw2qemtuw7eXleVpkeo=; b=wznbO3fFi8faiTGblQ3aYJ/sFDaJnfATc4ERFIYzavOYjt6ptcRzUaWkY+EziBxCy9 gRUpCQJJ+B+VKTR1KPKtv/fGkHOBXWRPT7LiJCWBgk5fXxGAEy9NNRR9KfPQVzDveHnL pkuk18QtIfcJKNNLJEbC6p5+UuHY/a1k/AIr1nZixYRuvt0b7wI/RGLj2ap9vIxrKMZZ hJqTLfeMfctMfoiEhBY41HPhXmyaZSLwmDgsnchHwkenc6gByhbl0j4LfNCblS6Oy6P/ iTSUGpQJ7+UQcepPLr6n2sgBKU3ycvY0tclOVPamoD0jP9qWQumQbAWuOYtWjl89vgxw bSlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GxeC1J4v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i16-20020a17090332d000b001569d19531fsi1249555plr.588.2022.04.21.07.09.23; Thu, 21 Apr 2022 07:09:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GxeC1J4v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1388169AbiDUKOd (ORCPT + 99 others); Thu, 21 Apr 2022 06:14:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1388132AbiDUKNx (ORCPT ); Thu, 21 Apr 2022 06:13:53 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29B111A5 for ; Thu, 21 Apr 2022 03:11:05 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id h12so728838plf.12 for ; Thu, 21 Apr 2022 03:11:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/ncZocJ5Upo0Tlz4v6e6Y6+ABw2qemtuw7eXleVpkeo=; b=GxeC1J4vIS2+nci1FssatJn2cr0PL2yiEEkCFTAXrc6vp/Hdak0blA8sEU7aaUiQZO iY0df4KkxlBC2WdN751BCw+N2+eyltOv4WK0jnbD39oL2OpbAEu6KxN69JZahH7VmJdN k/bg8N2AmEbhcHMv//taWra5dbJC5yHokEa13D0vHBuFbH2KVWyzazzaWPWf75R6hm+q UfWHYxZWC5aNG6WFkhWSgUIlHxeIvBU0OJo3SR5LBeQtjlR/MYTcWnHOajkiCqH4naiR oBC4iVbVs44xhsxoY3b86g3jJUXgsgl6o/ybA0aIIvelm5smPoDF/g2guC5M1h5k3GU7 IN2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/ncZocJ5Upo0Tlz4v6e6Y6+ABw2qemtuw7eXleVpkeo=; b=G18XFqvCTUKG7wsujZPCUhHKQvXuKXvTPoH8+04sppPCzd1ATTC/hysRpY9AzJvqZn JZD8sFoJ1pBLHkb639NjgQ+QKv4orAMAbyUWlYt2RngLncdm94n8da+le0tV4YKqTYGa nOcGsrTEip0S3bSiq+1LFeH3cYIYuAKGiYiSCplA38i39G65t8eG+eibGiOGfAbZNDkZ RXif8ZLUBb2hfjHg6WjjbWLsMP2Xt1hZoTfvZHgK9OFe3S47C6hmYnKwjKKDrRUl684S 2Dnvd5/nRZMerVBUcVAWkCuNSMEzFM+enbomeA18Ps/QhVxFAT8Nu0zMb6cVb9+pbBtM 8m8Q== X-Gm-Message-State: AOAM531Zd4ucLLsb++0weaT7Q++JiCQiWzCXWWvYtIULABHgpralzn2R TenfTl2D2q4NBWyKTZjLEVoqX9jluikOMfl9 X-Received: by 2002:a17:902:ab96:b0:159:1ff:4ea0 with SMTP id f22-20020a170902ab9600b0015901ff4ea0mr18414042plr.60.1650535864712; Thu, 21 Apr 2022 03:11:04 -0700 (PDT) Received: from octofox.hsd1.ca.comcast.net ([2601:641:401:1d20:df13:3d47:8c92:6576]) by smtp.gmail.com with ESMTPSA id w196-20020a6282cd000000b0050ada022940sm2407806pfd.183.2022.04.21.03.11.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 03:11:04 -0700 (PDT) From: Max Filippov To: linux-xtensa@linux-xtensa.org Cc: Chris Zankel , linux-kernel@vger.kernel.org, Max Filippov Subject: [PATCH v2 07/10] xtensa: add xtensa_xsr macro Date: Thu, 21 Apr 2022 03:10:30 -0700 Message-Id: <20220421101033.216394-8-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220421101033.216394-1-jcmvbkbc@gmail.com> References: <20220421101033.216394-1-jcmvbkbc@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, FROM_LOCAL_NOVOWEL,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org xtensa_xsr does the XSR instruction for the specified special register. Signed-off-by: Max Filippov --- arch/xtensa/include/asm/processor.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h index 4489a27d527a..76bc63127c66 100644 --- a/arch/xtensa/include/asm/processor.h +++ b/arch/xtensa/include/asm/processor.h @@ -246,6 +246,13 @@ extern unsigned long __get_wchan(struct task_struct *p); v; \ }) +#define xtensa_xsr(x, sr) \ + ({ \ + unsigned int __v__ = (unsigned int)(x); \ + __asm__ __volatile__ ("xsr %0, " __stringify(sr) : "+a"(__v__)); \ + __v__; \ + }) + #if XCHAL_HAVE_EXTERN_REGS static inline void set_er(unsigned long value, unsigned long addr) -- 2.30.2