summaryrefslogtreecommitdiffstats
path: root/utils/imxtools
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-08-06 15:47:35 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-08-06 21:24:38 +0200
commit97459def3c34d338d3ced9bd2b55f8902573aa19 (patch)
tree08cd8ee128334c4ae40e7adfc382662ae8d4a32b /utils/imxtools
parent8b13d2f5f100d088746a1f8dd94f8ab82acc9b5b (diff)
downloadrockbox-97459def3c34d338d3ced9bd2b55f8902573aa19.tar.gz
rockbox-97459def3c34d338d3ced9bd2b55f8902573aa19.tar.bz2
rockbox-97459def3c34d338d3ced9bd2b55f8902573aa19.zip
sbtools: fix handling of NOP instructions
Change-Id: I05ab8176f368a6e2d075dfb2059692871e0c00b3
Diffstat (limited to 'utils/imxtools')
-rw-r--r--utils/imxtools/sbtools/sb.c9
-rw-r--r--utils/imxtools/sbtools/sb.h8
2 files changed, 16 insertions, 1 deletions
diff --git a/utils/imxtools/sbtools/sb.c b/utils/imxtools/sbtools/sb.c
index 05f9836b46..df3622940f 100644
--- a/utils/imxtools/sbtools/sb.c
+++ b/utils/imxtools/sbtools/sb.c
@@ -122,6 +122,13 @@ static void compute_sb_offsets(struct sb_file_t *sb)
sb->image_size += ROUND_UP(inst->size, BLOCK_SIZE) / BLOCK_SIZE;
sec->sec_size += ROUND_UP(inst->size, BLOCK_SIZE) / BLOCK_SIZE;
}
+ else if(inst->inst == SB_INST_NOP)
+ {
+ if(g_debug)
+ printf(" NOOP\n");
+ sb->image_size += sizeof(struct sb_instruction_nop_t) / BLOCK_SIZE;
+ sec->sec_size += sizeof(struct sb_instruction_nop_t) / BLOCK_SIZE;
+ }
else
{
if(g_debug)
@@ -445,7 +452,7 @@ enum sb_error_t sb_write_file(struct sb_file_t *sb, const char *filename)
if(buf_p - buf != sb_hdr.image_size * BLOCK_SIZE)
{
if(g_debug)
- printf("SB image buffer was not entirely filled !");
+ printf("SB image buffer was not entirely filled !\n");
return SB_ERROR;
}
diff --git a/utils/imxtools/sbtools/sb.h b/utils/imxtools/sbtools/sb.h
index 02150aa2fb..6f2eecbf4b 100644
--- a/utils/imxtools/sbtools/sb.h
+++ b/utils/imxtools/sbtools/sb.h
@@ -137,6 +137,14 @@ struct sb_instruction_mode_t
uint32_t mode;
} __attribute__((packed));
+struct sb_instruction_nop_t
+{
+ struct sb_instruction_header_t hdr;
+ uint32_t zero1;
+ uint32_t zero2;
+ uint32_t zero3;
+} __attribute__((packed));
+
struct sb_instruction_call_t
{
struct sb_instruction_header_t hdr;