
Wolfgang Denk wrote:
It also doesn't handle non-power-of-two sized memory -- don't rely on the value it returns.
Such configurations are usually set up of from several differently sized banks of memory, and get_ram_size() is always run per bank. So as long as chip manufacturers continue to make RAM chips with power-of-two sizes only, everything should be fine.
What if the board has two DIMM slots, one of which has a 1GB DIMM and the other has a 512MB DIMM?
[1] It's worse than machine checks, what if some I/O device is mapped directly after RAM? IIRC people have run into this sort of problem doing this type of memory sizing on PCs.
Well, let's call this a bug in setting up the memory map for the system ;-)
I thought get_ram_size() was supposed to safely determine how much RAM is actually in the system? Otherwise, it should be called verify_ram_size().