diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2010-08-30 20:47:53 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2010-08-30 20:47:53 +0000 |
commit | da16248e47901c826a90291d2bb2a7aae78b209a (patch) | |
tree | fcc2a1944dd1b543e21346b46f50252ffc27fb7c /apps/plugin.h | |
parent | a1997c13c168beeb41bf2f5b814115cdd5cb574c (diff) | |
download | rockbox-da16248e47901c826a90291d2bb2a7aae78b209a.tar.gz rockbox-da16248e47901c826a90291d2bb2a7aae78b209a.zip |
Plugins: modify IRAM copying code
Move to plugin_crt0.c, plugins don't need PLUGIN_IRAM_* macros anymore
IRAM is no longered zeroed before copying (as it is at the same address
than BSS) -> Fix FS#11581
Use cpucache_invalidate() (and not cpucache_flush), needed for self-modifying code on cached IRAM
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27948 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugin.h')
-rw-r--r-- | apps/plugin.h | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/apps/plugin.h b/apps/plugin.h index 2f187f120b..422f58fc8a 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -147,12 +147,12 @@ void* plugin_get_buffer(size_t *buffer_size); | |||
147 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ | 147 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ |
148 | 148 | ||
149 | /* increase this every time the api struct changes */ | 149 | /* increase this every time the api struct changes */ |
150 | #define PLUGIN_API_VERSION 191 | 150 | #define PLUGIN_API_VERSION 192 |
151 | 151 | ||
152 | /* update this to latest version if a change to the api struct breaks | 152 | /* update this to latest version if a change to the api struct breaks |
153 | backwards compatibility (and please take the opportunity to sort in any | 153 | backwards compatibility (and please take the opportunity to sort in any |
154 | new function which are "waiting" at the end of the function table) */ | 154 | new function which are "waiting" at the end of the function table) */ |
155 | #define PLUGIN_MIN_API_VERSION 191 | 155 | #define PLUGIN_MIN_API_VERSION 192 |
156 | 156 | ||
157 | /* plugin return codes */ | 157 | /* plugin return codes */ |
158 | /* internal returns start at 0x100 to make exit(1..255) work */ | 158 | /* internal returns start at 0x100 to make exit(1..255) work */ |
@@ -183,7 +183,9 @@ struct plugin_api { | |||
183 | void (*lcd_clear_display)(void); | 183 | void (*lcd_clear_display)(void); |
184 | int (*lcd_getstringsize)(const unsigned char *str, int *w, int *h); | 184 | int (*lcd_getstringsize)(const unsigned char *str, int *w, int *h); |
185 | void (*lcd_putsxy)(int x, int y, const unsigned char *string); | 185 | void (*lcd_putsxy)(int x, int y, const unsigned char *string); |
186 | void (*lcd_putsxyf)(int x, int y, const unsigned char *fmt, ...); | ||
186 | void (*lcd_puts)(int x, int y, const unsigned char *string); | 187 | void (*lcd_puts)(int x, int y, const unsigned char *string); |
188 | void (*lcd_putsf)(int x, int y, const unsigned char *fmt, ...); | ||
187 | void (*lcd_puts_scroll)(int x, int y, const unsigned char* string); | 189 | void (*lcd_puts_scroll)(int x, int y, const unsigned char* string); |
188 | void (*lcd_stop_scroll)(void); | 190 | void (*lcd_stop_scroll)(void); |
189 | #ifdef HAVE_LCD_CHARCELLS | 191 | #ifdef HAVE_LCD_CHARCELLS |
@@ -496,8 +498,10 @@ struct plugin_api { | |||
496 | void (*trigger_cpu_boost)(void); | 498 | void (*trigger_cpu_boost)(void); |
497 | void (*cancel_cpu_boost)(void); | 499 | void (*cancel_cpu_boost)(void); |
498 | #endif | 500 | #endif |
499 | #if NUM_CORES > 1 | 501 | #ifdef HAVE_CPUCACHE_FLUSH |
500 | void (*cpucache_flush)(void); | 502 | void (*cpucache_flush)(void); |
503 | #endif | ||
504 | #ifdef HAVE_CPUCACHE_INVALIDATE | ||
501 | void (*cpucache_invalidate)(void); | 505 | void (*cpucache_invalidate)(void); |
502 | #endif | 506 | #endif |
503 | bool (*timer_register)(int reg_prio, void (*unregister_callback)(void), | 507 | bool (*timer_register)(int reg_prio, void (*unregister_callback)(void), |
@@ -769,10 +773,6 @@ struct plugin_api { | |||
769 | void* (*plugin_get_audio_buffer)(size_t *buffer_size); | 773 | void* (*plugin_get_audio_buffer)(size_t *buffer_size); |
770 | void (*plugin_tsr)(bool (*exit_callback)(bool reenter)); | 774 | void (*plugin_tsr)(bool (*exit_callback)(bool reenter)); |
771 | char* (*plugin_get_current_filename)(void); | 775 | char* (*plugin_get_current_filename)(void); |
772 | #ifdef PLUGIN_USE_IRAM | ||
773 | void (*plugin_iram_init)(char *iramstart, char *iramcopy, size_t iram_size, | ||
774 | char *iedata, size_t iedata_size); | ||
775 | #endif | ||
776 | #if defined(DEBUG) || defined(SIMULATOR) | 776 | #if defined(DEBUG) || defined(SIMULATOR) |
777 | void (*debugf)(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2); | 777 | void (*debugf)(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2); |
778 | #endif | 778 | #endif |
@@ -894,9 +894,6 @@ struct plugin_api { | |||
894 | 894 | ||
895 | /* new stuff at the end, sort into place next time | 895 | /* new stuff at the end, sort into place next time |
896 | the API gets incompatible */ | 896 | the API gets incompatible */ |
897 | |||
898 | void (*lcd_putsf)(int x, int y, const unsigned char *fmt, ...); | ||
899 | void (*lcd_putsxyf)(int x, int y, const unsigned char *fmt, ...); | ||
900 | }; | 897 | }; |
901 | 898 | ||
902 | /* plugin header */ | 899 | /* plugin header */ |
@@ -928,31 +925,10 @@ extern unsigned char plugin_end_addr[]; | |||
928 | PLUGIN_MAGIC, TARGET_ID, PLUGIN_API_VERSION, \ | 925 | PLUGIN_MAGIC, TARGET_ID, PLUGIN_API_VERSION, \ |
929 | NULL, NULL, plugin__start, &rb }; | 926 | NULL, NULL, plugin__start, &rb }; |
930 | #endif /* CONFIG_PLATFORM */ | 927 | #endif /* CONFIG_PLATFORM */ |
931 | |||
932 | #ifdef PLUGIN_USE_IRAM | ||
933 | /* Declare IRAM variables */ | ||
934 | #define PLUGIN_IRAM_DECLARE \ | ||
935 | extern char iramcopy[]; \ | ||
936 | extern char iramstart[]; \ | ||
937 | extern char iramend[]; \ | ||
938 | extern char iedata[]; \ | ||
939 | extern char iend[]; | ||
940 | /* Initialize IRAM */ | ||
941 | #define PLUGIN_IRAM_INIT(api) \ | ||
942 | (api)->plugin_iram_init(iramstart, iramcopy, iramend-iramstart, \ | ||
943 | iedata, iend-iedata); | ||
944 | #else | ||
945 | #define PLUGIN_IRAM_DECLARE | ||
946 | #define PLUGIN_IRAM_INIT(api) | ||
947 | #endif /* PLUGIN_USE_IRAM */ | ||
948 | #endif /* PLUGIN */ | 928 | #endif /* PLUGIN */ |
949 | 929 | ||
950 | int plugin_load(const char* plugin, const void* parameter); | 930 | int plugin_load(const char* plugin, const void* parameter); |
951 | void* plugin_get_audio_buffer(size_t *buffer_size); | 931 | void* plugin_get_audio_buffer(size_t *buffer_size); |
952 | #ifdef PLUGIN_USE_IRAM | ||
953 | void plugin_iram_init(char *iramstart, char *iramcopy, size_t iram_size, | ||
954 | char *iedata, size_t iedata_size); | ||
955 | #endif | ||
956 | 932 | ||
957 | /* plugin_tsr, | 933 | /* plugin_tsr, |
958 | callback returns true to allow the new plugin to load, | 934 | callback returns true to allow the new plugin to load, |