[coreboot] Inconsistent low-level arch functions between ARM and x86

mrnuke mr.nuke.me at gmail.com
Mon Dec 30 02:16:29 CET 2013


So, I found this:

ARM: static inline void write32(uint32_t val, void *addr)
x86: static inline void write32(unsigned long addr, uint32_t value)

Now, isn't a 4-byte memory write a 4-byte memory write independent of 
architecture? Forget about the fact that the x86 version takes an unsigned 
long instead of a void * for the address; the ARM and x86 variants have their 
arguments mixed up.

I actually came across this when trying to use our 8250 memmapped UART code on 
an ARM chip. The original code was written for x86, and hence, it can't work 
on ARM (yet).

I propose that these simple memory accessors be unified. Since they refer to a 
memory address, I propose void * for the address parameter. I don't care what 
order the parameters come in as long it's consistent between arches. Any 
takers?


Alex



More information about the coreboot mailing list