[PATCH v8 05/22] RISC-V: Define indirect CSR access helpers
Paul Walmsley
pjw at kernel.org
Fri Aug 7 18:04:54 PDT 2026
On Wed, 5 Aug 2026, Atish Patra wrote:
> On 8/4/26 5:39 PM, Paul Walmsley wrote:
> > On Wed, 1 Jul 2026, Atish Patra wrote:
> >
> > > From: Atish Patra <atishp at rivosinc.com>
> > >
> > > The indirect CSR requires multiple instructions to read/write CSR.
> > > Add a few helper functions for ease of usage.
> > >
> > > Signed-off-by: Atish Patra <atishp at rivosinc.com>
> >
> > Thanks. These macros seem better implemented as static inline functions.
> > That also nicely aligns the code with what you write in the patch
> > description.
>
> I don't think inlining these macros in the following way will work because of
> the following reason. It won't build once anything calls it.
>
> csr_read()/csr_write() stringify the CSR argument straight into the inline asm
> template:
Yes, you're right; I should have caught that. Too bad, there are multiple
keyhole CSR index registers in use, otherwise it would have been a
reasonable thing to do.
What's up with the subsequent followup message? Looks like a
cut-and-paste from an LLM.
- Paul
More information about the linux-arm-kernel
mailing list