RFC: CMSIS structs vs sys_readXX/sys_writeXX #76075
Replies: 1 comment 2 replies
-
Taking your comments from 75693:
Could you elaborate on these aspects, and how direct access is broken? |
Beta Was this translation helpful? Give feedback.
-
Hello,
I am starting this discussion as a continuation of our debate with @ithinuel regarding error #75693.
Currently, in Zephyr, for accessing hardware registers, both the CMSIS-based API using C structures and the more standard API based on sys_readXX/sys_writeXX and bitfield description macros are equally and simultaneously permitted.
As a supporter of the Linux way, I am more than convinced by the conclusions from the 2007 discussion* on banning
volatile
, and additionally, I want to highlight the impossibility of using C defined registers in assembly. However, someone might, in light of the past years, want to defends an opposing opinion.IMO which API is preferable for use should be voted and documented in the "Coding Guidelines"; otherwise, every new commit of code will spark similar debates repeatedly, as the machine code produced during compilation is not equivalent.
Beta Was this translation helpful? Give feedback.
All reactions