diff options
author | Dave Chapman <dave@dchapman.com> | 2008-10-11 12:02:23 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2008-10-11 12:02:23 +0000 |
commit | 1a549d49f77da1fdf028bfe9b9669ece055069a4 (patch) | |
tree | 014425bef75f399469c3f29b9f5f8ff149fe65da /rbutil/mkamsboot | |
parent | 1c4bcfac691d4473cf513ba958c8edbdc8c97939 (diff) | |
download | rockbox-1a549d49f77da1fdf028bfe9b9669ece055069a4.tar.gz rockbox-1a549d49f77da1fdf028bfe9b9669ece055069a4.zip |
Fix some off-by-one errors, plus remove some unused variables
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18768 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/mkamsboot')
-rw-r--r-- | rbutil/mkamsboot/dualboot.S | 2 | ||||
-rw-r--r-- | rbutil/mkamsboot/mkamsboot.c | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/rbutil/mkamsboot/dualboot.S b/rbutil/mkamsboot/dualboot.S index 786f610aef..471158e9a8 100644 --- a/rbutil/mkamsboot/dualboot.S +++ b/rbutil/mkamsboot/dualboot.S @@ -39,7 +39,7 @@ start: ldr r1, uclunpack_size /* Source length */ sub r2, r0, r1 /* Source start - 1*/ - ldr r3, =DRAM_SIZE /* Destination end */ + ldr r3, =(DRAM_SIZE-1) /* Destination end */ uclcopy: ldrb r4, [r0], #-1 diff --git a/rbutil/mkamsboot/mkamsboot.c b/rbutil/mkamsboot/mkamsboot.c index e617b1204a..7e72d6cc3c 100644 --- a/rbutil/mkamsboot/mkamsboot.c +++ b/rbutil/mkamsboot/mkamsboot.c @@ -279,8 +279,6 @@ int main(int argc, char* argv[]) unsigned char* buf; int firmware_size; off_t bootloader_size; - uint32_t ucl_size; - uint32_t ucl_paddedsize; uint32_t sum,filesum; uint8_t model_id; int model; @@ -419,15 +417,15 @@ int main(int argc, char* argv[]) in each image, along with the size in bytes */ /* UCL unpack function */ - put_uint32le(&buf[0x420], firmware_size); + put_uint32le(&buf[0x420], firmware_size - 1); put_uint32le(&buf[0x424], sizeof(uclimg)); /* Compressed original firmware image */ - put_uint32le(&buf[0x428], firmware_size - sizeof(uclimg)); + put_uint32le(&buf[0x428], firmware_size - sizeof(uclimg) - 1); put_uint32le(&buf[0x42c], of_packedsize); /* Compressed Rockbox image */ - put_uint32le(&buf[0x430], firmware_size - sizeof(uclimg) - of_packedsize); + put_uint32le(&buf[0x430], firmware_size - sizeof(uclimg) - of_packedsize - 1); put_uint32le(&buf[0x434], rb_packedsize); |