From 335d97ed29d0b1c7a5c835edfded9558ab3bdf66 Mon Sep 17 00:00:00 2001 From: nls Date: Sat, 16 Oct 2010 12:30:06 +0000 Subject: [PATCH] Remove some inconsistent guarding around cpucache_* functions to fix a test_codec crash on coldfire, breaks plugin api compatibility so sorted and bumped version numbers. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28287 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugin.c | 18 ++++++++---------- apps/plugin.h | 24 +++++++++++------------- apps/plugins/test_codec.c | 2 -- 3 files changed, 19 insertions(+), 25 deletions(-) diff --git a/apps/plugin.c b/apps/plugin.c index 6c402f646..316c7c6b5 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -344,6 +344,7 @@ static const struct plugin_api rockbox_api = { mkdir, rmdir, dir_exists, + dir_get_info, /* kernel/ system */ #if defined(CPU_ARM) && CONFIG_PLATFORM & PLATFORM_NATIVE @@ -384,12 +385,15 @@ static const struct plugin_api rockbox_api = { trigger_cpu_boost, cancel_cpu_boost, #endif -#ifdef HAVE_CPUCACHE_FLUSH + cpucache_flush, -#endif -#ifdef HAVE_CPUCACHE_INVALIDATE cpucache_invalidate, -#endif + + lc_open, + lc_open_from_mem, + lc_get_header, + lc_close, + timer_register, timer_unregister, timer_set_period, @@ -722,12 +726,6 @@ static const struct plugin_api rockbox_api = { /* new stuff at the end, sort into place next time the API gets incompatible */ - dir_get_info, - - lc_open, - lc_open_from_mem, - lc_get_header, - lc_close, }; int plugin_load(const char* plugin, const void* parameter) diff --git a/apps/plugin.h b/apps/plugin.h index cbfc48bd0..faea8470f 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -147,12 +147,12 @@ void* plugin_get_buffer(size_t *buffer_size); #define PLUGIN_MAGIC 0x526F634B /* RocK */ /* increase this every time the api struct changes */ -#define PLUGIN_API_VERSION 193 +#define PLUGIN_API_VERSION 194 /* update this to latest version if a change to the api struct breaks backwards compatibility (and please take the opportunity to sort in any new function which are "waiting" at the end of the function table) */ -#define PLUGIN_MIN_API_VERSION 192 +#define PLUGIN_MIN_API_VERSION 194 /* plugin return codes */ /* internal returns start at 0x100 to make exit(1..255) work */ @@ -454,6 +454,7 @@ struct plugin_api { int (*mkdir)(const char *name); int (*rmdir)(const char *name); bool (*dir_exists)(const char *path); + struct dirinfo (*dir_get_info)(DIR* parent, struct dirent *entry); /* kernel/ system */ #if defined(CPU_ARM) && CONFIG_PLATFORM & PLATFORM_NATIVE @@ -498,12 +499,16 @@ struct plugin_api { void (*trigger_cpu_boost)(void); void (*cancel_cpu_boost)(void); #endif -#ifdef HAVE_CPUCACHE_FLUSH + void (*cpucache_flush)(void); -#endif -#ifdef HAVE_CPUCACHE_INVALIDATE void (*cpucache_invalidate)(void); -#endif + + /* load code api for overlay */ + void* (*lc_open)(const char *filename, unsigned char *buf, size_t buf_size); + void* (*lc_open_from_mem)(void* addr, size_t blob_size); + void* (*lc_get_header)(void *handle); + void (*lc_close)(void *handle); + bool (*timer_register)(int reg_prio, void (*unregister_callback)(void), long cycles, void (*timer_callback)(void) IF_COP(, int core)); @@ -894,13 +899,6 @@ struct plugin_api { /* new stuff at the end, sort into place next time the API gets incompatible */ - struct dirinfo (*dir_get_info)(DIR* parent, struct dirent *entry); - - /* load code api for overlay */ - void* (*lc_open)(const char *filename, unsigned char *buf, size_t buf_size); - void* (*lc_open_from_mem)(void* addr, size_t blob_size); - void* (*lc_get_header)(void *handle); - void (*lc_close)(void *handle); }; /* plugin header */ diff --git a/apps/plugins/test_codec.c b/apps/plugins/test_codec.c index 09274133b..d581d74f8 100644 --- a/apps/plugins/test_codec.c +++ b/apps/plugins/test_codec.c @@ -601,10 +601,8 @@ static void init_ci(void) ci.profile_func_exit = rb->profile_func_exit; #endif -#if NUM_CORES > 1 ci.cpucache_invalidate = rb->cpucache_invalidate; ci.cpucache_flush = rb->cpucache_flush; -#endif #if NUM_CORES > 1 ci.create_thread = rb->create_thread; -- 2.11.4.GIT