Thread (69 messages) 69 messages, 6 authors, 2026-08-11

Re: [PATCH v8 05/22] RISC-V: Define indirect CSR access helpers

From: Atish Patra <atish.patra@linux.dev>
Date: 2026-08-08 07:33:23
Also in: linux-devicetree, linux-perf-users, linux-riscv, lkml

On 8/7/26 6:04 PM, Paul Walmsley wrote:
On Wed, 5 Aug 2026, Atish Patra wrote:
quoted
On 8/4/26 5:39 PM, Paul Walmsley wrote:
quoted
On Wed, 1 Jul 2026, Atish Patra wrote:
quoted
From: Atish Patra <redacted>

The indirect CSR requires multiple instructions to read/write CSR.
Add a few helper functions for ease of usage.

Signed-off-by: Atish Patra <redacted>
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.
Oops. Ha ha. LLM agent was parsing the lore and preparing a draft response.
It produced so much garbage that I replied manually. I have no idea what prompted
it to send it after I sent the response! Sorry for the spam.
- Paul
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help