summaryrefslogtreecommitdiffstats
path: root/src/image.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/image.h')
-rw-r--r--src/image.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/image.h b/src/image.h
index 42111bf..824c8ad 100644
--- a/src/image.h
+++ b/src/image.h
@@ -37,9 +37,19 @@ enum image_type {
IMAGE_CMT_2ND,
IMAGE_CMT_ALGO,
IMAGE_CMT_MCUSW,
+ IMAGE_1ST,
+ IMAGE_CERT_SW,
+ IMAGE_APE_ALGO,
IMAGE_COUNT,
};
+struct image_part {
+ struct image_part * next;
+ uint32_t offset;
+ uint32_t size;
+ char * name;
+};
+
struct image {
enum image_type type;
struct device_list * devices;
@@ -47,6 +57,7 @@ struct image {
char * layout;
uint16_t hash;
uint32_t size;
+ struct image_part * parts;
int fd;
int is_shared_fd;
@@ -63,9 +74,9 @@ struct image_list {
struct image_list * next;
};
-struct image * image_alloc_from_file(const char * file, const char * type, const char * device, const char * hwrevs, const char * version, const char * layout);
-struct image * image_alloc_from_fd(int fd, const char * orig_filename, const char * type, const char * device, const char * hwrevs, const char * version, const char * layout);
-struct image * image_alloc_from_shared_fd(int fd, size_t size, size_t offset, uint16_t hash, const char * type, const char * device, const char * hwrevs, const char * version, const char * layout);
+struct image * image_alloc_from_file(const char * file, const char * type, const char * device, const char * hwrevs, const char * version, const char * layout, struct image_part * parts);
+struct image * image_alloc_from_fd(int fd, const char * orig_filename, const char * type, const char * device, const char * hwrevs, const char * version, const char * layout, struct image_part * parts);
+struct image * image_alloc_from_shared_fd(int fd, size_t size, size_t offset, uint16_t hash, const char * type, const char * device, const char * hwrevs, const char * version, const char * layout, struct image_part * parts);
void image_free(struct image * image);
void image_seek(struct image * image, size_t whence);
size_t image_read(struct image * image, void * buf, size_t count);
@@ -76,7 +87,7 @@ void image_list_unlink(struct image_list * list);
uint16_t image_hash_from_data(struct image * image);
enum image_type image_type_from_data(struct image * image);
-char * image_name_alloc_from_values(struct image * image);
+char * image_name_alloc_from_values(struct image * image, int part_num);
enum image_type image_type_from_string(const char * type);
const char * image_type_to_string(enum image_type type);
int image_hwrev_is_valid(struct image * image, int16_t hwrev);