1
0
Fork 0
forked from len0rd/rockbox

sbtools: fix handling of NOP instructions

Change-Id: I05ab8176f368a6e2d075dfb2059692871e0c00b3
This commit is contained in:
Amaury Pouly 2013-08-06 15:47:35 +02:00
parent 8b13d2f5f1
commit 97459def3c
2 changed files with 16 additions and 1 deletions

View file

@ -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;
}

View file

@ -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;