summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_jz47xx/crt0.S
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-02-09 10:02:38 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-02-09 10:02:38 +0000
commit04c7379ac585d1e79fd454cf860a8592db25c67f (patch)
tree0c42a1f0379d4282ab793f5f23ebde86d25e9e80 /firmware/target/mips/ingenic_jz47xx/crt0.S
parentf7a06dd6fc2022876c392e186bcf5037dd5a34bf (diff)
downloadrockbox-04c7379ac585d1e79fd454cf860a8592db25c67f.tar.gz
rockbox-04c7379ac585d1e79fd454cf860a8592db25c67f.tar.bz2
rockbox-04c7379ac585d1e79fd454cf860a8592db25c67f.zip
Onda VX747: commit some parts to get apps/ to compile (more will follow)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19954 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/crt0.S')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/crt0.S54
1 files changed, 35 insertions, 19 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/crt0.S b/firmware/target/mips/ingenic_jz47xx/crt0.S
index 5cfd49141a..e619022fc8 100644
--- a/firmware/target/mips/ingenic_jz47xx/crt0.S
+++ b/firmware/target/mips/ingenic_jz47xx/crt0.S
@@ -52,6 +52,17 @@
#ifdef BOOTLOADER
.word 0 /* Unknown */
.word 0 /* Filesize */
+
+ /* Relocate bootloader */
+ la t0, (_loadaddress-0x400000)
+ la t1, _loadaddress
+ la t2, _bootend
+_relocate_loop:
+ lw t3, 0(t0)
+ sw t3, 0(t1)
+ addiu t1, 4
+ bne t1, t2, _relocate_loop
+ addiu t0, 4
#endif
_start:
@@ -119,7 +130,6 @@ _init_bss_loop:
bne t0, t1, _init_bss_loop
addiu t0, 4
-#ifndef BOOTLOADER
/*
----------------------------------------------------
clear IBSS section
@@ -146,7 +156,6 @@ _init_iram_loop:
addiu t1, 4
bne t1, t2, _init_iram_loop
addiu t0, 4
-#endif
/*
----------------------------------------------------
@@ -167,23 +176,35 @@ _init_stack_loop:
nop
- .section .vectors, "ax", %progbits
- .extern real_exception_handler
- .global except_common_entry
- .type except_common_entry,@function
-except_common_entry:
+ /*
+ * 0x0 - Simple TLB refill handler
+ * 0x100 - Cache error handler
+ * 0x180 - Exception/Interrupt handler
+ * 0x200 - Special Exception Interrupt handler (when IV is set in CP0_CAUSE)
+ */
+
+
+ .section .vectors.1, "ax", %progbits
+ la k0, tlb_refill_handler
+ jr k0
+ nop
+
+ .section .vectors.2, "ax", %progbits
la k0, real_exception_handler
jr k0
nop
+
+ .section .vectors.3, "ax", %progbits
+ la k0, real_exception_handler
+ jr k0
nop
- nop
- .fill 0x20
- .extern _int
- .extern _exception
- .global real_exception_handler
- .type real_exception_handler,@function
- .set noreorder
+ .section .vectors.4, "ax", %progbits
+ la k0, real_exception_handler
+ jr k0
+ nop
+
+ .section .vectors, "ax", %progbits
real_exception_handler:
addiu sp, -0x80
sw ra, 0(sp)
@@ -241,8 +262,6 @@ real_exception_handler:
j _exception
nop
- .global _int
- .type _int,@function
_int:
jal intr_handler
nop
@@ -298,9 +317,6 @@ _int:
eret # Exception Return
nop
- .extern _exception_handler
- .global _exception
- .type _exception,@function
_exception:
add a0, sp, $0
mfc0 a1, C0_CAUSE # C0_CAUSE of last exception