diff options
author | Karl Kurbjun <kkurbjun@gmail.com> | 2008-05-10 18:30:46 +0000 |
---|---|---|
committer | Karl Kurbjun <kkurbjun@gmail.com> | 2008-05-10 18:30:46 +0000 |
commit | 0220a5fbc31f3443f2d165e395881d3bd213a698 (patch) | |
tree | 12d4eee2c7256ca1598991e2a6a777dfffc6c369 /firmware/target/arm/mmu-arm.c | |
parent | 80278e45aa79cee66596c257c5d3870765233e00 (diff) |
Fix the ARM assembly to ensure that the stack is not used.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17443 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/mmu-arm.c')
-rw-r--r-- | firmware/target/arm/mmu-arm.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/firmware/target/arm/mmu-arm.c b/firmware/target/arm/mmu-arm.c index c4b63cf805..7a5303d54d 100644 --- a/firmware/target/arm/mmu-arm.c +++ b/firmware/target/arm/mmu-arm.c @@ -33,7 +33,6 @@ void __attribute__((naked)) ttb_init(void) { } void __attribute__((naked)) map_section(unsigned int pa, unsigned int va, int mb, int flags) { -#if 0 /* This code needs to be fixed and the C needs to be replaced to ensure that stack is not used */ asm volatile ( /* pa &= (-1 << 20); // align to 1MB */ @@ -78,11 +77,13 @@ void __attribute__((naked)) map_section(unsigned int pa, unsigned int va, int mb */ "cmp r2, #0 \n" - "bxle lr \n" + "bxle lr \n" + "mov r3, #0x0 \n" "loop: \n" "str r0, [r1], #4 \n" "add r0, r0, #0x100000 \n" - "sub r2, r2, #0x01 \n" + "add r3, r3, #0x1 \n" + "cmp r2, r3 \n" "bne loop \n" "bx lr \n" : @@ -92,18 +93,6 @@ void __attribute__((naked)) map_section(unsigned int pa, unsigned int va, int mb (void) va; (void) mb; (void) flags; -#else - pa &= (-1 << 20); - pa |= (flags | 0x412); - unsigned int* ttbPtr = TTB_BASE + (va >> 20); - -#define MB (1 << 20) - for( ; mb>0; mb--, pa += MB) - { - *(ttbPtr++) = pa; - } -#undef MB -#endif } void __attribute__((naked)) enable_mmu(void) { |