pussuw commented on a change in pull request #5917:
URL: https://github.com/apache/incubator-nuttx/pull/5917#discussion_r839325862



##########
File path: arch/risc-v/src/common/riscv_internal.h
##########
@@ -121,6 +150,37 @@
 #define getreg64(a)         (*(volatile uint64_t *)(a))
 #define putreg64(v,a)       (*(volatile uint64_t *)(a) = (v))
 
+#define READ_CSR(reg) \
+  ({ \
+     uintptr_t reg##_val; \

Review comment:
       Yes this should produce an unique enough tmp variable. I have no idea 
why the compiler has not complained about this before. Seems like enough 
obfuscation in pre-processing will silence it (I have seen similar behavior 
before).
   
   Using uintptr_t here is fine, as all actual CSRs are XLEN




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to