From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 400DCEB64D7 for ; Fri, 23 Jun 2023 09:57:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7F5B0863A0; Fri, 23 Jun 2023 11:57:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=reject dis=none) header.from=codethink.co.uk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id E2C9286374; Fri, 23 Jun 2023 11:57:22 +0200 (CEST) Received: from imap5.colo.codethink.co.uk (imap5.colo.codethink.co.uk [78.40.148.171]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C9DED801CE for ; Fri, 23 Jun 2023 11:57:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=codethink.co.uk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ben.dooks@codethink.co.uk Received: from [78.40.148.178] (helo=webmail.codethink.co.uk) by imap5.colo.codethink.co.uk with esmtpsa (Exim 4.94.2 #2 (Debian)) id 1qCdXV-00DcLk-Cv; Fri, 23 Jun 2023 10:57:14 +0100 MIME-Version: 1.0 Date: Fri, 23 Jun 2023 10:57:14 +0100 From: Ben Dooks To: Leo Liang Cc: Ben Dooks , u-boot@lists.denx.de, Rick Chen Subject: Re: [PATCH 2/3] riscv: implement local_irq_{save,restore} macros In-Reply-To: References: <20230505080207.11902-1-ben.dooks@sifive.com> <20230505080207.11902-3-ben.dooks@sifive.com> Message-ID: <505ddf8d1155b2a2df5273ae3ef97635@codethink.co.uk> X-Sender: ben.dooks@codethink.co.uk Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On 2023-06-12 08:47, Leo Liang wrote: > Hi Ben, > > On Fri, May 05, 2023 at 09:02:06AM +0100, Ben Dooks wrote: >> Add implementations of the local_irq_{save,restore} macros so that >> can be used with riscv. >> >> Signed-off-by: Ben Dooks >> --- >> arch/riscv/include/asm/system.h | 15 +++++++++++---- >> 1 file changed, 11 insertions(+), 4 deletions(-) >> >> diff --git a/arch/riscv/include/asm/system.h >> b/arch/riscv/include/asm/system.h >> index 9d8e43e394..78093681e5 100644 >> --- a/arch/riscv/include/asm/system.h >> +++ b/arch/riscv/include/asm/system.h >> @@ -7,15 +7,22 @@ >> #ifndef __ASM_RISCV_SYSTEM_H >> #define __ASM_RISCV_SYSTEM_H >> >> +#include >> + >> struct event; >> >> /* >> - * Interrupt configuring macros. >> - * >> - * TODO >> - * >> + * Interupt configuration macros >> */ >> >> +#define local_irq_save(__flags) do { \ > > Can we have this "do" in a new line just like what kernel does? > >> + __flags = csr_read_clear(CSR_SSTATUS, SR_SIE) & SR_SIE; \ >> + } while (0) >> + >> +#define local_irq_restore(__flags) do { \ >> + csr_set(CSR_SSTATUS, __flags & SR_SIE); \ >> + } while(0) > ^ > a space missing >> + >> /* Hook to set up the CPU (called from SPL too) */ >> int riscv_cpu_setup(void *ctx, struct event *event); >> > > If you don't mind, I could make these format modification on my side, > so you don't have to spin another patch set. > > Best regards, > Leo Yes that's fine, this got buried under a lot of other work. Thank you. -- Ben