public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ben Dooks <ben.dooks@codethink.co.uk>
To: Leo Liang <ycliang@andestech.com>
Cc: Ben Dooks <ben.dooks@sifive.com>,
	u-boot@lists.denx.de, Rick Chen <rick@andestech.com>
Subject: Re: [PATCH 2/3] riscv: implement local_irq_{save,restore} macros
Date: Fri, 23 Jun 2023 10:57:14 +0100	[thread overview]
Message-ID: <505ddf8d1155b2a2df5273ae3ef97635@codethink.co.uk> (raw)
In-Reply-To: <ZIbNqAKvF5x7mP1Y@ubuntu01>



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
>> <asm/atomic.h> can be used with riscv.
>> 
>> Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
>> ---
>>  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 <asm/csr.h>
>> +
>>  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

  reply	other threads:[~2023-06-23  9:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-05  8:02 riscv: asm update for building ubifs Ben Dooks
2023-05-05  8:02 ` [PATCH 1/3] riscv: add generic link for <asm/atomic.h> Ben Dooks
2023-06-12  7:31   ` Leo Liang
2023-05-05  8:02 ` [PATCH 2/3] riscv: implement local_irq_{save,restore} macros Ben Dooks
2023-06-12  7:47   ` Leo Liang
2023-06-23  9:57     ` Ben Dooks [this message]
2023-05-05  8:02 ` [PATCH 3/3] riscv: define test_and_{set,clear}_bit in asm/bitops.h Ben Dooks
2023-06-12  7:48   ` Leo Liang
2023-05-11 11:56 ` riscv: asm update for building ubifs Conor Dooley
2023-05-25 11:01 ` Ben Dooks

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=505ddf8d1155b2a2df5273ae3ef97635@codethink.co.uk \
    --to=ben.dooks@codethink.co.uk \
    --cc=ben.dooks@sifive.com \
    --cc=rick@andestech.com \
    --cc=u-boot@lists.denx.de \
    --cc=ycliang@andestech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox