From 0d4585b28ffcac1b62ed37cee2c34de0515df468 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Thu, 9 Sep 2010 16:17:21 +0000 Subject: Extend lc_open() to also being able to load overlay plugins. For this it needs to look at the plugin header. Since lc_open() doesn't know it's a plugin, the header needs to be changed slightly to include the new lc_header (which needs to be the first element in plugin_header so it can be casted savely). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28054 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs.h | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'apps/codecs.h') diff --git a/apps/codecs.h b/apps/codecs.h index f94c81ab20..1c0b9da6ba 100644 --- a/apps/codecs.h +++ b/apps/codecs.h @@ -51,6 +51,7 @@ #include "settings.h" #include "gcc_extensions.h" +#include "load_code.h" #ifdef CODEC #if defined(DEBUG) || defined(SIMULATOR) @@ -240,11 +241,7 @@ struct codec_api { /* codec header */ struct codec_header { - unsigned long magic; /* RCOD or RENC */ - unsigned short target_id; - unsigned short api_version; - unsigned char *load_addr; - unsigned char *end_addr; + struct lc_header lc_hdr; /* must be first */ enum codec_status(*entry_point)(void); struct codec_api **api; }; @@ -261,27 +258,27 @@ extern unsigned char plugin_end_addr[]; #define CODEC_HEADER \ const struct codec_header __header \ __attribute__ ((section (".header")))= { \ - CODEC_MAGIC, TARGET_ID, CODEC_API_VERSION, \ - plugin_start_addr, plugin_end_addr, codec_start, &ci }; + { CODEC_MAGIC, TARGET_ID, CODEC_API_VERSION, \ + plugin_start_addr, plugin_end_addr }, codec_start, &ci }; /* encoders */ #define CODEC_ENC_HEADER \ const struct codec_header __header \ __attribute__ ((section (".header")))= { \ - CODEC_ENC_MAGIC, TARGET_ID, CODEC_API_VERSION, \ - plugin_start_addr, plugin_end_addr, codec_start, &ci }; + { CODEC_ENC_MAGIC, TARGET_ID, CODEC_API_VERSION, \ + plugin_start_addr, plugin_end_addr }, codec_start, &ci }; #else /* def SIMULATOR */ /* decoders */ #define CODEC_HEADER \ const struct codec_header __header \ __attribute__((visibility("default"))) = { \ - CODEC_MAGIC, TARGET_ID, CODEC_API_VERSION, \ - NULL, NULL, codec_start, &ci }; + { CODEC_MAGIC, TARGET_ID, CODEC_API_VERSION, NULL, NULL }, \ + codec_start, &ci }; /* encoders */ #define CODEC_ENC_HEADER \ const struct codec_header __header = { \ - CODEC_ENC_MAGIC, TARGET_ID, CODEC_API_VERSION, \ - NULL, NULL, codec_start, &ci }; + { CODEC_ENC_MAGIC, TARGET_ID, CODEC_API_VERSION, NULL, NULL }, \ + codec_start, &ci }; #endif /* SIMULATOR */ #endif /* CODEC */ -- cgit v1.2.3