summaryrefslogtreecommitdiff
path: root/apps/plugin.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugin.h')
-rw-r--r--apps/plugin.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/apps/plugin.h b/apps/plugin.h
index bafd4070f6..a69b85bbfd 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -53,6 +53,7 @@ void* plugin_get_buffer(size_t *buffer_size);
53#include "thread.h" 53#include "thread.h"
54#include "button.h" 54#include "button.h"
55#include "action.h" 55#include "action.h"
56#include "load_code.h"
56#include "usb.h" 57#include "usb.h"
57#include "font.h" 58#include "font.h"
58#include "lcd.h" 59#include "lcd.h"
@@ -895,15 +896,17 @@ struct plugin_api {
895 /* new stuff at the end, sort into place next time 896 /* new stuff at the end, sort into place next time
896 the API gets incompatible */ 897 the API gets incompatible */
897 struct dirinfo (*dir_get_info)(DIR* parent, struct dirent *entry); 898 struct dirinfo (*dir_get_info)(DIR* parent, struct dirent *entry);
899
900 /* load code api for overlay */
901 void* (*lc_open)(const char *filename, unsigned char *buf, size_t buf_size);
902 void* (*lc_open_from_mem)(void* addr, size_t blob_size);
903 void* (*lc_get_header)(void *handle);
904 void (*lc_close)(void *handle);
898}; 905};
899 906
900/* plugin header */ 907/* plugin header */
901struct plugin_header { 908struct plugin_header {
902 unsigned long magic; 909 struct lc_header lc_hdr; /* must be the first */
903 unsigned short target_id;
904 unsigned short api_version;
905 unsigned char *load_addr;
906 unsigned char *end_addr;
907 enum plugin_status(*entry_point)(const void*); 910 enum plugin_status(*entry_point)(const void*);
908 const struct plugin_api **api; 911 const struct plugin_api **api;
909}; 912};
@@ -916,15 +919,15 @@ extern unsigned char plugin_end_addr[];
916 const struct plugin_api *rb DATA_ATTR; \ 919 const struct plugin_api *rb DATA_ATTR; \
917 const struct plugin_header __header \ 920 const struct plugin_header __header \
918 __attribute__ ((section (".header")))= { \ 921 __attribute__ ((section (".header")))= { \
919 PLUGIN_MAGIC, TARGET_ID, PLUGIN_API_VERSION, \ 922 { PLUGIN_MAGIC, TARGET_ID, PLUGIN_API_VERSION, \
920 plugin_start_addr, plugin_end_addr, plugin__start, &rb }; 923 plugin_start_addr, plugin_end_addr }, plugin__start, &rb };
921#else /* PLATFORM_HOSTED */ 924#else /* PLATFORM_HOSTED */
922#define PLUGIN_HEADER \ 925#define PLUGIN_HEADER \
923 const struct plugin_api *rb DATA_ATTR; \ 926 const struct plugin_api *rb DATA_ATTR; \
924 const struct plugin_header __header \ 927 const struct plugin_header __header \
925 __attribute__((visibility("default"))) = { \ 928 __attribute__((visibility("default"))) = { \
926 PLUGIN_MAGIC, TARGET_ID, PLUGIN_API_VERSION, \ 929 { PLUGIN_MAGIC, TARGET_ID, PLUGIN_API_VERSION, NULL, NULL },
927 NULL, NULL, plugin__start, &rb }; 930 plugin__start, &rb };
928#endif /* CONFIG_PLATFORM */ 931#endif /* CONFIG_PLATFORM */
929#endif /* PLUGIN */ 932#endif /* PLUGIN */
930 933