summaryrefslogtreecommitdiffstats
path: root/utils/sbtools/sb.h
diff options
context:
space:
mode:
authorAmaury Pouly <pamaury@rockbox.org>2011-11-01 11:23:43 +0000
committerAmaury Pouly <pamaury@rockbox.org>2011-11-01 11:23:43 +0000
commite36471df9cfb3fa7aaa2216d9b5c79cb775bf9da (patch)
treed8c03ad24a339928a379dd864d235a3f1a02aaad /utils/sbtools/sb.h
parent591ec0349b424e94eaaaa1c9bf486f769ff34732 (diff)
downloadrockbox-e36471df9cfb3fa7aaa2216d9b5c79cb775bf9da.tar.gz
rockbox-e36471df9cfb3fa7aaa2216d9b5c79cb775bf9da.tar.bz2
rockbox-e36471df9cfb3fa7aaa2216d9b5c79cb775bf9da.zip
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
Diffstat (limited to 'utils/sbtools/sb.h')
-rw-r--r--utils/sbtools/sb.h18
1 files changed, 15 insertions, 3 deletions
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 <stdint.h>
#include <stdbool.h>
+#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;
// <union>
void *data;
uint32_t pattern;
- uint32_t addr;
// </union>
- 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__ */