diff options
author | Frank Gevaerts <frank@gevaerts.be> | 2010-10-10 20:49:21 +0000 |
---|---|---|
committer | Frank Gevaerts <frank@gevaerts.be> | 2010-10-10 20:49:21 +0000 |
commit | e94eea95389567047dbbfd064f456ab8028b2852 (patch) | |
tree | 85d2735f9af77e677d64252053304c297c867858 | |
parent | bf301fdbb6cc7858d3b53a31d08c06b83c7f10c8 (diff) | |
download | rockbox-e94eea95389567047dbbfd064f456ab8028b2852.tar.gz rockbox-e94eea95389567047dbbfd064f456ab8028b2852.zip |
Invalidate the CPU cache after clearing bss, to make sure that bss variables that are used via non-cached aliases don't read garbage.
This fixes FS#11653 for me
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28236 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/codecs/codec_crt0.c | 4 | ||||
-rw-r--r-- | apps/plugins/plugin_crt0.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/apps/codecs/codec_crt0.c b/apps/codecs/codec_crt0.c index 184da74c8f..cf14e460ec 100644 --- a/apps/codecs/codec_crt0.c +++ b/apps/codecs/codec_crt0.c | |||
@@ -53,6 +53,10 @@ enum codec_status codec_start(void) | |||
53 | } | 53 | } |
54 | #endif /* PLUGIN_USE_IRAM */ | 54 | #endif /* PLUGIN_USE_IRAM */ |
55 | ci->memset(plugin_bss_start, 0, plugin_end_addr - plugin_bss_start); | 55 | ci->memset(plugin_bss_start, 0, plugin_end_addr - plugin_bss_start); |
56 | /* Some parts of bss may be used via a no-cache alias (at least | ||
57 | * portalplayer has this). If we don't clear the cache, those aliases | ||
58 | * may read garbage */ | ||
59 | ci->cpucache_invalidate(); | ||
56 | #endif | 60 | #endif |
57 | 61 | ||
58 | return codec_main(); | 62 | return codec_main(); |
diff --git a/apps/plugins/plugin_crt0.c b/apps/plugins/plugin_crt0.c index 1db9d6a81a..d86c5c367c 100644 --- a/apps/plugins/plugin_crt0.c +++ b/apps/plugins/plugin_crt0.c | |||
@@ -90,6 +90,10 @@ enum plugin_status plugin__start(const void *param) | |||
90 | 90 | ||
91 | /* zero out the bss section */ | 91 | /* zero out the bss section */ |
92 | rb->memset(plugin_bss_start, 0, plugin_end_addr - plugin_bss_start); | 92 | rb->memset(plugin_bss_start, 0, plugin_end_addr - plugin_bss_start); |
93 | /* Some parts of bss may be used via a no-cache alias (at least | ||
94 | * portalplayer has this). If we don't clear the cache, those aliases | ||
95 | * may read garbage */ | ||
96 | rb->cpucache_invalidate(); | ||
93 | #endif | 97 | #endif |
94 | 98 | ||
95 | /* we come back here if exit() was called or the plugin returned normally */ | 99 | /* we come back here if exit() was called or the plugin returned normally */ |