summaryrefslogtreecommitdiff
path: root/apps/plugin.c
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.c
parente2a262ee258769136eadc58c2bc8e3aa53db1a71 (diff)
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.c')
-rw-r--r--apps/plugin.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index 90b3837cf8..a00a54e4ec 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -471,6 +471,9 @@ static const struct plugin_api rockbox_api = {
lcd_set_backdrop,
#endif
+#ifdef IRAM_STEAL
+ plugin_iram_init,
+#endif
};
int plugin_load(const char* plugin, void* parameter)
@@ -683,9 +686,20 @@ void* plugin_get_audio_buffer(int* buffer_size)
audio_stop();
talk_buffer_steal(); /* we use the mp3 buffer, need to tell */
*buffer_size = audiobufend - audiobuf;
-#endif
return audiobuf;
+#endif
+}
+
+#ifdef IRAM_STEAL
+/* Initializes plugin IRAM */
+void plugin_iram_init(char *iramstart, char *iramcopy, size_t iram_size,
+ char *iedata, size_t iedata_size)
+{
+ audio_iram_steal();
+ memcpy(iramstart, iramcopy, iram_size);
+ memset(iedata, 0, iedata_size);
}
+#endif /* IRAM_STEAL */
/* The plugin wants to stay resident after leaving its main function, e.g.
runs from timer or own thread. The callback is registered to later