diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2006-11-18 02:18:29 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2006-11-18 02:18:29 +0000 |
commit | acc29d95be85c9cfd0d8f74dda813d7d1082e2ec (patch) | |
tree | 81fdd154d122b393d6254968cba5bc90b63e4741 /apps/plugin.c | |
parent | e2a262ee258769136eadc58c2bc8e3aa53db1a71 (diff) | |
download | rockbox-acc29d95be85c9cfd0d8f74dda813d7d1082e2ec.tar.gz rockbox-acc29d95be85c9cfd0d8f74dda813d7d1082e2ec.zip |
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.c | 16 |
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 = { | |||
471 | lcd_set_backdrop, | 471 | lcd_set_backdrop, |
472 | #endif | 472 | #endif |
473 | 473 | ||
474 | #ifdef IRAM_STEAL | ||
475 | plugin_iram_init, | ||
476 | #endif | ||
474 | }; | 477 | }; |
475 | 478 | ||
476 | int plugin_load(const char* plugin, void* parameter) | 479 | int plugin_load(const char* plugin, void* parameter) |
@@ -683,9 +686,20 @@ void* plugin_get_audio_buffer(int* buffer_size) | |||
683 | audio_stop(); | 686 | audio_stop(); |
684 | talk_buffer_steal(); /* we use the mp3 buffer, need to tell */ | 687 | talk_buffer_steal(); /* we use the mp3 buffer, need to tell */ |
685 | *buffer_size = audiobufend - audiobuf; | 688 | *buffer_size = audiobufend - audiobuf; |
686 | #endif | ||
687 | return audiobuf; | 689 | return audiobuf; |
690 | #endif | ||
691 | } | ||
692 | |||
693 | #ifdef IRAM_STEAL | ||
694 | /* Initializes plugin IRAM */ | ||
695 | void plugin_iram_init(char *iramstart, char *iramcopy, size_t iram_size, | ||
696 | char *iedata, size_t iedata_size) | ||
697 | { | ||
698 | audio_iram_steal(); | ||
699 | memcpy(iramstart, iramcopy, iram_size); | ||
700 | memset(iedata, 0, iedata_size); | ||
688 | } | 701 | } |
702 | #endif /* IRAM_STEAL */ | ||
689 | 703 | ||
690 | /* The plugin wants to stay resident after leaving its main function, e.g. | 704 | /* The plugin wants to stay resident after leaving its main function, e.g. |
691 | runs from timer or own thread. The callback is registered to later | 705 | runs from timer or own thread. The callback is registered to later |