From c2933cd46e7a84df24acf488249f62f9ec090759 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Thu, 2 Oct 2008 12:37:47 +0000 Subject: Remove the dependency on sufficient free space in the padding at the end of the firmware block by storing the ucl unpack function in the main firmware block, immediately before the compressed firmware image. Also simplify the memcpy function in test.S. This has been tested successfully on a Clip. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18682 a1c6a512-1295-4272-9138-f99709370657 --- utils/AMS/hacking/test.S | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'utils/AMS/hacking/test.S') diff --git a/utils/AMS/hacking/test.S b/utils/AMS/hacking/test.S index 79d23deb6a..a4757b44ce 100644 --- a/utils/AMS/hacking/test.S +++ b/utils/AMS/hacking/test.S @@ -16,10 +16,11 @@ .word 0 /* These values are filled in by mkamsboot - don't move them from offset 0x20 */ -ucl_unpack: .word 0 /* Entry point (plus 1 - for thumb) of ucl_unpack */ -ucl_start: .word 0 /* Start of the ucl-compressed OF image */ +ucl_unpack: .word 0 /* Entry point (plus 1 - for thumb) of ucl_unpack after copy*/ +ucl_start: .word 0 /* Start of the ucl-compressed OF image after copy */ ucl_size: .word 0 /* Length in bytes of the compressed OF image */ - +copy_start: .word 0 /* Start of the copy of the ucl_unpack function */ +copy_size: .word 0 /* uclunpack_size + ucl_paddedsize */ start: /* A delay loop - just to prove we're running */ @@ -29,25 +30,23 @@ loop: subs r1, r1, #1 /* First copy the compressed firmware to unused RAM */ - ldr r0, ucl_start /* Source */ - ldr r1, ucl_size /* Source length */ + ldr r0, copy_start /* Source */ + ldr r1, copy_size /* Source length */ mov r2, #0x40000 /* Destination end */ sub r2, r2, r1 memcpy: - ldrb r3, [r0] - strb r3, [r2] - adds r0, r0, #1 - adds r2, r2, #1 + ldrb r3, [r0], #1 + strb r3, [r2], #1 cmp r2, #0x40000 /* Stop when we reached dest_end */ bne memcpy - sub r0, r2, r1 /* Point to the compressed firmware */ - /* Call the ucl decompress function, which will branch to 0x0 */ /* on completion */ + ldr r0, ucl_start /* Address of compressed image */ + ldr r1, ucl_size /* Compressed size */ mov r2, #0 /* Destination */ ldr r3, ucl_unpack -- cgit v1.2.3