From f79bfcf1d7624c233222cc18d2aa35e297a80d85 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sun, 6 Apr 2008 13:26:39 +0000 Subject: [PATCH] PP targets: Make sure the COP cache is invalidated before loading a plugin. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16984 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugin.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/plugin.c b/apps/plugin.c index 66e3d634df..7a8e0e04be 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -585,10 +585,13 @@ int plugin_load(const char* plugin, void* parameter) struct plugin_header *hdr; #ifdef SIMULATOR void *pd; -#else +#else /* !SIMULATOR */ int fd; ssize_t readsize; +#if NUM_CORES > 1 + unsigned my_core; #endif +#endif /* !SIMULATOR */ int xm, ym; #ifdef HAVE_REMOTE_LCD int rxm, rym; @@ -637,6 +640,12 @@ int plugin_load(const char* plugin, void* parameter) gui_syncsplash(HZ*2, str(LANG_PLUGIN_CANT_OPEN), plugin); return fd; } +#if NUM_CORES > 1 + /* Make sure COP cache is flushed and invalidated before loading */ + my_core = switch_core(CURRENT_CORE ^ 1); + invalidate_icache(); + switch_core(my_core); +#endif readsize = read(fd, pluginbuf, PLUGIN_BUFFER_SIZE); close(fd);