
Dear Simon Glass,
In message 1351813330-23741-1-git-send-email-sjg@chromium.org you wrote:
It is good to have these functions written in C instead of assembler, but with -O0 the cache_disable() function doesn't return. Rather than revert to assembler, this fix just forces this to be built with -O2.
NAK.
This is vodoo programming to fix a problem which is obviously not correctly understood (and fixed), so the real cause remains unfixed.
+/*
- Big hack warning!
- Devs like to compile with -O0 to get a nice debugging illusion. But this
We don't use -O0 normally, and actually there are more places in the code that are likely to cause problems or to actually break when using -O0.
- function does not survive that since -O0 causes the compiler to read the
- PC back from the stack after the dcache flush. Might it be possible to fix
- this by flushing the write buffer?
- */
"compiler to read the PC back from the stack after the dcache flush" - can you please explain what exactly this means, and which exact problem it causes?
+static void cache_disable(uint32_t cache_bit) __attribute__ ((optimize(2)));
Sorry, I will not accept this.
Best regards,
Wolfgang Denk