Hi,
src/northbridge/amdht/ht_wrapper.c miscompiles on recent compilers (gcc-4.4.1 in crossgcc for example). The compiler is correct in what it does, our code isn't.
The issue is that with recent compilers swaplist is generated on the stack, and then a pointer to that structure on stack is passed around. The data is nearly immediately destroyed by subsequent calls.
The "const" modifier only makes the compiler ensure that no write operations are made to the data, but says nothing about the life cycle. To force the compiler to keep the array in read-only memory, it must be global const or static const.
Thanks go to Myles for isolating the problem.
Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de