diff options
Diffstat (limited to 'apps/plugin.h')
-rw-r--r-- | apps/plugin.h | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/apps/plugin.h b/apps/plugin.h index e9a6cfdaed..608009d549 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -107,7 +107,7 @@ | |||
107 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ | 107 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ |
108 | 108 | ||
109 | /* increase this every time the api struct changes */ | 109 | /* increase this every time the api struct changes */ |
110 | #define PLUGIN_API_VERSION 35 | 110 | #define PLUGIN_API_VERSION 36 |
111 | 111 | ||
112 | /* update this to latest version if a change to the api struct breaks | 112 | /* update this to latest version if a change to the api struct breaks |
113 | backwards compatibility (and please take the opportunity to sort in any | 113 | backwards compatibility (and please take the opportunity to sort in any |
@@ -582,6 +582,11 @@ struct plugin_api { | |||
582 | #if LCD_DEPTH > 1 | 582 | #if LCD_DEPTH > 1 |
583 | void (*lcd_set_backdrop)(fb_data* backdrop); | 583 | void (*lcd_set_backdrop)(fb_data* backdrop); |
584 | #endif | 584 | #endif |
585 | |||
586 | #ifdef IRAM_STEAL | ||
587 | void (*plugin_iram_init)(char *iramstart, char *iramcopy, size_t iram_size, | ||
588 | char *iedata, size_t iedata_size); | ||
589 | #endif | ||
585 | }; | 590 | }; |
586 | 591 | ||
587 | /* plugin header */ | 592 | /* plugin header */ |
@@ -593,6 +598,7 @@ struct plugin_header { | |||
593 | unsigned char *end_addr; | 598 | unsigned char *end_addr; |
594 | enum plugin_status(*entry_point)(struct plugin_api*, void*); | 599 | enum plugin_status(*entry_point)(struct plugin_api*, void*); |
595 | }; | 600 | }; |
601 | |||
596 | #ifdef PLUGIN | 602 | #ifdef PLUGIN |
597 | #ifndef SIMULATOR | 603 | #ifndef SIMULATOR |
598 | extern unsigned char plugin_start_addr[]; | 604 | extern unsigned char plugin_start_addr[]; |
@@ -607,12 +613,33 @@ extern unsigned char plugin_end_addr[]; | |||
607 | const struct plugin_header __header = { \ | 613 | const struct plugin_header __header = { \ |
608 | PLUGIN_MAGIC, TARGET_ID, PLUGIN_API_VERSION, \ | 614 | PLUGIN_MAGIC, TARGET_ID, PLUGIN_API_VERSION, \ |
609 | NULL, NULL, plugin_start }; | 615 | NULL, NULL, plugin_start }; |
610 | #endif | 616 | #endif /* SIMULATOR */ |
611 | #endif | 617 | |
618 | #ifdef USE_IRAM | ||
619 | /* Declare IRAM variables */ | ||
620 | #define PLUGIN_IRAM_DECLARE \ | ||
621 | extern char iramcopy[]; \ | ||
622 | extern char iramstart[]; \ | ||
623 | extern char iramend[]; \ | ||
624 | extern char iedata[]; \ | ||
625 | extern char iend[]; | ||
626 | /* Initialize IRAM */ | ||
627 | #define PLUGIN_IRAM_INIT(api) \ | ||
628 | (api)->plugin_iram_init(iramstart, iramcopy, iramend-iramstart, \ | ||
629 | iedata, iend-iedata); | ||
630 | #else | ||
631 | #define PLUGIN_IRAM_DECLARE | ||
632 | #define PLUGIN_IRAM_INIT(api) | ||
633 | #endif /* USE_IRAM */ | ||
634 | #endif /* PLUGIN */ | ||
612 | 635 | ||
613 | int plugin_load(const char* plugin, void* parameter); | 636 | int plugin_load(const char* plugin, void* parameter); |
614 | void* plugin_get_buffer(int *buffer_size); | 637 | void* plugin_get_buffer(int *buffer_size); |
615 | void* plugin_get_audio_buffer(int *buffer_size); | 638 | void* plugin_get_audio_buffer(int *buffer_size); |
639 | #ifdef IRAM_STEAL | ||
640 | void plugin_iram_init(char *iramstart, char *iramcopy, size_t iram_size, | ||
641 | char *iedata, size_t iedata_size); | ||
642 | #endif | ||
616 | 643 | ||
617 | /* plugin_tsr, | 644 | /* plugin_tsr, |
618 | callback returns true to allow the new plugin to load, | 645 | callback returns true to allow the new plugin to load, |