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
This commit is contained in:
Frank Gevaerts 2010-10-10 20:49:21 +00:00
parent bf301fdbb6
commit e94eea9538
2 changed files with 8 additions and 0 deletions

View file

@ -53,6 +53,10 @@ enum codec_status codec_start(void)
}
#endif /* PLUGIN_USE_IRAM */
ci->memset(plugin_bss_start, 0, plugin_end_addr - plugin_bss_start);
/* Some parts of bss may be used via a no-cache alias (at least
* portalplayer has this). If we don't clear the cache, those aliases
* may read garbage */
ci->cpucache_invalidate();
#endif
return codec_main();

View file

@ -90,6 +90,10 @@ enum plugin_status plugin__start(const void *param)
/* zero out the bss section */
rb->memset(plugin_bss_start, 0, plugin_end_addr - plugin_bss_start);
/* Some parts of bss may be used via a no-cache alias (at least
* portalplayer has this). If we don't clear the cache, those aliases
* may read garbage */
rb->cpucache_invalidate();
#endif
/* we come back here if exit() was called or the plugin returned normally */