From e36471df9cfb3fa7aaa2216d9b5c79cb775bf9da Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Tue, 1 Nov 2011 11:23:43 +0000 Subject: sbtools: move sb reading from sbtoelf.c to sb.c with a proper interface, fix sb production bug, fix ugly code, add sb dump code and sbtoelf loopback facility git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30881 a1c6a512-1295-4272-9138-f99709370657 --- utils/sbtools/sb.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'utils/sbtools/sb.h') diff --git a/utils/sbtools/sb.h b/utils/sbtools/sb.h index 27f5668d2e..548b3ef55a 100644 --- a/utils/sbtools/sb.h +++ b/utils/sbtools/sb.h @@ -24,6 +24,8 @@ #include #include +#include "misc.h" + #define BLOCK_SIZE 16 /* All fields are in big-endian BCD */ @@ -161,12 +163,12 @@ struct sb_inst_t { uint8_t inst; /* SB_INST_* */ uint32_t size; + uint32_t addr; // void *data; uint32_t pattern; - uint32_t addr; // - uint32_t argument; // for call and jump + uint32_t argument; // for call, jump and mode /* for production use */ uint32_t padding_size; uint8_t *padding; @@ -194,6 +196,10 @@ struct sb_file_t uint8_t (*crypto_iv)[16]; int nr_sections; + uint16_t drive_tag; + uint32_t first_boot_sec_id; + uint16_t flags; + uint8_t minor_version; struct sb_section_t *sections; struct sb_version_t product_ver; struct sb_version_t component_ver; @@ -201,6 +207,12 @@ struct sb_file_t uint32_t image_size; /* in blocks */ }; -void sb_produce_file(struct sb_file_t *sb, const char *filename); +void sb_write_file(struct sb_file_t *sb, const char *filename); + +typedef void (*sb_color_printf)(void *u, bool err, color_t c, const char *f, ...); +struct sb_file_t *sb_read_file(const char *filename, bool raw_mode, void *u, + sb_color_printf printf); + +void sb_dump(struct sb_file_t *file, void *u, sb_color_printf printf); #endif /* __SB_H__ */ -- cgit v1.2.3