diff options
Diffstat (limited to 'utils/sbtools/sb.h')
-rw-r--r-- | utils/sbtools/sb.h | 18 |
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 @@ | |||
24 | #include <stdint.h> | 24 | #include <stdint.h> |
25 | #include <stdbool.h> | 25 | #include <stdbool.h> |
26 | 26 | ||
27 | #include "misc.h" | ||
28 | |||
27 | #define BLOCK_SIZE 16 | 29 | #define BLOCK_SIZE 16 |
28 | 30 | ||
29 | /* All fields are in big-endian BCD */ | 31 | /* All fields are in big-endian BCD */ |
@@ -161,12 +163,12 @@ struct sb_inst_t | |||
161 | { | 163 | { |
162 | uint8_t inst; /* SB_INST_* */ | 164 | uint8_t inst; /* SB_INST_* */ |
163 | uint32_t size; | 165 | uint32_t size; |
166 | uint32_t addr; | ||
164 | // <union> | 167 | // <union> |
165 | void *data; | 168 | void *data; |
166 | uint32_t pattern; | 169 | uint32_t pattern; |
167 | uint32_t addr; | ||
168 | // </union> | 170 | // </union> |
169 | uint32_t argument; // for call and jump | 171 | uint32_t argument; // for call, jump and mode |
170 | /* for production use */ | 172 | /* for production use */ |
171 | uint32_t padding_size; | 173 | uint32_t padding_size; |
172 | uint8_t *padding; | 174 | uint8_t *padding; |
@@ -194,6 +196,10 @@ struct sb_file_t | |||
194 | uint8_t (*crypto_iv)[16]; | 196 | uint8_t (*crypto_iv)[16]; |
195 | 197 | ||
196 | int nr_sections; | 198 | int nr_sections; |
199 | uint16_t drive_tag; | ||
200 | uint32_t first_boot_sec_id; | ||
201 | uint16_t flags; | ||
202 | uint8_t minor_version; | ||
197 | struct sb_section_t *sections; | 203 | struct sb_section_t *sections; |
198 | struct sb_version_t product_ver; | 204 | struct sb_version_t product_ver; |
199 | struct sb_version_t component_ver; | 205 | struct sb_version_t component_ver; |
@@ -201,6 +207,12 @@ struct sb_file_t | |||
201 | uint32_t image_size; /* in blocks */ | 207 | uint32_t image_size; /* in blocks */ |
202 | }; | 208 | }; |
203 | 209 | ||
204 | void sb_produce_file(struct sb_file_t *sb, const char *filename); | 210 | void sb_write_file(struct sb_file_t *sb, const char *filename); |
211 | |||
212 | typedef void (*sb_color_printf)(void *u, bool err, color_t c, const char *f, ...); | ||
213 | struct sb_file_t *sb_read_file(const char *filename, bool raw_mode, void *u, | ||
214 | sb_color_printf printf); | ||
215 | |||
216 | void sb_dump(struct sb_file_t *file, void *u, sb_color_printf printf); | ||
205 | 217 | ||
206 | #endif /* __SB_H__ */ | 218 | #endif /* __SB_H__ */ |