summaryrefslogtreecommitdiff
path: root/apps/plugin.h
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2006-11-18 02:18:29 +0000
committerMichael Sevakis <jethead71@rockbox.org>2006-11-18 02:18:29 +0000
commitacc29d95be85c9cfd0d8f74dda813d7d1082e2ec (patch)
tree81fdd154d122b393d6254968cba5bc90b63e4741 /apps/plugin.h
parente2a262ee258769136eadc58c2bc8e3aa53db1a71 (diff)
downloadrockbox-acc29d95be85c9cfd0d8f74dda813d7d1082e2ec.zip
rockbox-acc29d95be85c9cfd0d8f74dda813d7d1082e2ec.tar.gz
rockbox-acc29d95be85c9cfd0d8f74dda813d7d1082e2ec.tar.bz2
rockbox-acc29d95be85c9cfd0d8f74dda813d7d1082e2ec.tar.xz
SWCODEC/IRAM: Save voice IRAM when a plugin initializes its IRAM. Defines two macros for declaring and initializing IRAM. Plugins should use these instead. See mp3_encoder, doom, etc. for details. Further tweaks in buffer restoration after other use. Hiding of some interfaces that should only be used by buffer management.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11544 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugin.h')
-rw-r--r--apps/plugin.h33
1 files changed, 30 insertions, 3 deletions
diff --git a/apps/plugin.h b/apps/plugin.h
index e9a6cfd..608009d 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -107,7 +107,7 @@
#define PLUGIN_MAGIC 0x526F634B /* RocK */
/* increase this every time the api struct changes */
-#define PLUGIN_API_VERSION 35
+#define PLUGIN_API_VERSION 36
/* update this to latest version if a change to the api struct breaks
backwards compatibility (and please take the opportunity to sort in any
@@ -582,6 +582,11 @@ struct plugin_api {
#if LCD_DEPTH > 1
void (*lcd_set_backdrop)(fb_data* backdrop);
#endif
+
+#ifdef IRAM_STEAL
+ void (*plugin_iram_init)(char *iramstart, char *iramcopy, size_t iram_size,
+ char *iedata, size_t iedata_size);
+#endif
};
/* plugin header */
@@ -593,6 +598,7 @@ struct plugin_header {
unsigned char *end_addr;
enum plugin_status(*entry_point)(struct plugin_api*, void*);
};
+
#ifdef PLUGIN
#ifndef SIMULATOR
extern unsigned char plugin_start_addr[];
@@ -607,12 +613,33 @@ extern unsigned char plugin_end_addr[];
const struct plugin_header __header = { \
PLUGIN_MAGIC, TARGET_ID, PLUGIN_API_VERSION, \
NULL, NULL, plugin_start };
-#endif
-#endif
+#endif /* SIMULATOR */
+
+#ifdef USE_IRAM
+/* Declare IRAM variables */
+#define PLUGIN_IRAM_DECLARE \
+ extern char iramcopy[]; \
+ extern char iramstart[]; \
+ extern char iramend[]; \
+ extern char iedata[]; \
+ extern char iend[];
+/* Initialize IRAM */
+#define PLUGIN_IRAM_INIT(api) \
+ (api)->plugin_iram_init(iramstart, iramcopy, iramend-iramstart, \
+ iedata, iend-iedata);
+#else
+#define PLUGIN_IRAM_DECLARE
+#define PLUGIN_IRAM_INIT(api)
+#endif /* USE_IRAM */
+#endif /* PLUGIN */
int plugin_load(const char* plugin, void* parameter);
void* plugin_get_buffer(int *buffer_size);
void* plugin_get_audio_buffer(int *buffer_size);
+#ifdef IRAM_STEAL
+void plugin_iram_init(char *iramstart, char *iramcopy, size_t iram_size,
+ char *iedata, size_t iedata_size);
+#endif
/* plugin_tsr,
callback returns true to allow the new plugin to load,