Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp1905365rwl; Thu, 5 Jan 2023 22:17:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXuQDdn9Cabx0JwFaVQDoKck0nN2uqkfnIPmDW7bpJ+SGXWnhF9YX2OSEn2CmbdqDKbJYhM7 X-Received: by 2002:a17:907:209c:b0:7c1:41bb:70ac with SMTP id pv28-20020a170907209c00b007c141bb70acmr46264927ejb.64.1672985848829; Thu, 05 Jan 2023 22:17:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672985848; cv=none; d=google.com; s=arc-20160816; b=m5ZPkiZSiPRwqAK5f7zWsC6o95gRcxgNvvHRj4eKp5LxsOh9+HUsJ9oYe9bTbJWx1T /fXvwL28La+Or1QQ6Oml0MOHEdDFAAwknOjWQWKYVPOqvM8828/wYZ6YUgZvD1tuTWv0 tIB5KVlo9jvm86DHJkS4kSpBoBOUjOAR/lzkhV19K3vlBkUJo8R8eRsU48XTwgz7goqA Fl3/ggcx7f2YKUF2+pDOdw6eRXV0ox/uAq2Tb8X/e3FB5Z3F+sc2LkicAiDBDKVDIlbk vyw9HvwABc91IQ/1mCOlZODt5kC9T8PCXg36Cah44bL71UaudlTAeI5zYiNveLy1vLw+ AZ3Q== 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; bh=8tD6XVBYIrdB1rXsVbv3PFTqO12NGsVNAj1/vrSNP78=; b=eKY1xYMEjzrcKSP5ozBEgA7+2UxcBDU3CHmz5/6EZrJHvEGsTma718MgJroy00Ykf9 PjsHOmP4jH8cCvTzg9XHVVx2/W1a8XaZDzPmdC8M6OD+73fXKRe9PapMuH+BSFl2s1Wu tomhBXZfbuq7twQ+8kfVn1b0xzhutdcgLQbHAXyXJYQdpzjY/BU8JVg6TN/B6sQwIrLd om+8eLjY+B3RJNBMme4JWQpbMiVMi4qIOkWzrvoPElnHudQLAkzrfo2IzPE8B3McESRt DmznZZ69h70CrCr3NUk9HRablHM4Cl6B75DzcJySA/WB5R+UT3dZITliE/8bS9F+9D1G e7gw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga38-20020a1709070c2600b0073d9f16e5b3si456330ejc.258.2023.01.05.22.17.16; Thu, 05 Jan 2023 22:17:28 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231315AbjAFGGA convert rfc822-to-8bit (ORCPT + 54 others); Fri, 6 Jan 2023 01:06:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbjAFGF4 (ORCPT ); Fri, 6 Jan 2023 01:05:56 -0500 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83C6B6147A for ; Thu, 5 Jan 2023 22:05:52 -0800 (PST) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 301AB24E02F; Fri, 6 Jan 2023 14:05:50 +0800 (CST) Received: from EXMBX066.cuchost.com (172.16.7.66) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 6 Jan 2023 14:05:50 +0800 Received: from jsia-virtual-machine.localdomain (202.188.176.82) by EXMBX066.cuchost.com (172.16.6.66) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 6 Jan 2023 14:05:46 +0800 From: Sia Jee Heng To: , , CC: , , , , Subject: [PATCH 1/3] RISC-V: Change suspend_save_csrs and suspend_restore_csrs to public function Date: Fri, 6 Jan 2023 14:05:33 +0800 Message-ID: <20230106060535.104321-2-jeeheng.sia@starfivetech.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230106060535.104321-1-jeeheng.sia@starfivetech.com> References: <20230106060535.104321-1-jeeheng.sia@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [202.188.176.82] X-ClientProxiedBy: EXCAS061.cuchost.com (172.16.6.21) To EXMBX066.cuchost.com (172.16.6.66) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS autolearn=ham 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 Currently suspend_save_csrs() and suspend_restore_csrs() functions are statically defined in the suspend.c. Change the function's attribute to public so that the functions can be used by hibernation as well. Signed-off-by: Sia Jee Heng Reviewed-by: Ley Foon Tan Reviewed-by: Mason Huo --- arch/riscv/include/asm/suspend.h | 3 +++ arch/riscv/kernel/suspend.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/riscv/include/asm/suspend.h b/arch/riscv/include/asm/suspend.h index 8be391c2aecb..75419c5ca272 100644 --- a/arch/riscv/include/asm/suspend.h +++ b/arch/riscv/include/asm/suspend.h @@ -33,4 +33,7 @@ int cpu_suspend(unsigned long arg, /* Low-level CPU resume entry function */ int __cpu_resume_enter(unsigned long hartid, unsigned long context); +/* Used to save and restore the csr */ +void suspend_save_csrs(struct suspend_context *context); +void suspend_restore_csrs(struct suspend_context *context); #endif diff --git a/arch/riscv/kernel/suspend.c b/arch/riscv/kernel/suspend.c index 9ba24fb8cc93..3c89b8ec69c4 100644 --- a/arch/riscv/kernel/suspend.c +++ b/arch/riscv/kernel/suspend.c @@ -8,7 +8,7 @@ #include #include -static void suspend_save_csrs(struct suspend_context *context) +void suspend_save_csrs(struct suspend_context *context) { context->scratch = csr_read(CSR_SCRATCH); context->tvec = csr_read(CSR_TVEC); @@ -29,7 +29,7 @@ static void suspend_save_csrs(struct suspend_context *context) #endif } -static void suspend_restore_csrs(struct suspend_context *context) +void suspend_restore_csrs(struct suspend_context *context) { csr_write(CSR_SCRATCH, context->scratch); csr_write(CSR_TVEC, context->tvec); -- 2.34.1