Blame | Last modification | View Log | RSS feed
@@@ Copyright 2010 TheSeven@@@ This file is part of emBIOS.@@ emBIOS is free software: you can redistribute it and/or@ modify it under the terms of the GNU General Public License as@ published by the Free Software Foundation, either version 2 of the@ License, or (at your option) any later version.@@ emBIOS is distributed in the hope that it will be useful,@ but WITHOUT ANY WARRANTY; without even the implied warranty of@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.@ See the GNU General Public License for more details.@@ You should have received a copy of the GNU General Public License@ along with emBIOS. If not, see <http://www.gnu.org/licenses/>.@@.section .intvect,"ax",%progbitsldr pc, =reset_handlerldr pc, =undef_instr_handlerldr pc, =syscall_handlerldr pc, =prefetch_abort_handlerldr pc, =data_abort_handlerldr pc, =reserved_handlerldr pc, =irq_handlerldr pc, =fiq_handler.ltorg.section .initcode,"ax",%progbits.global _start_start:ldr r0, =_sramsourceldr r1, =_sramstartldr r2, =_sramend.copysram:cmp r2, r1ldrhi r3, [r0], #4strhi r3, [r1], #4bhi .copysramldr r0, =_sdramsourceldr r1, =_sdramstartldr r2, =_sdramend.copysdram:cmp r2, r1ldrhi r3, [r0], #4strhi r3, [r1], #4bhi .copysdramldr r0, =_initbssstartldr r1, =_initbssendmov r2, #0.clearinitbss:cmp r1, r0strhi r2, [r0], #4bhi .clearinitbssldr r0, =_ibssstartldr r1, =_ibssend.clearibss:cmp r1, r0strhi r2, [r0], #4bhi .clearibssldr r0, =_bssstartldr r1, =_bssend.clearbss:cmp r1, r0strhi r2, [r0], #4bhi .clearbssldr r1, =0x38200000ldr r0, [r1]orr r0, r0, #1bic r0, r0, #0x10000str r0, [r1]mov r0, #0mcr p15, 0, r0,c7,c5,0msr cpsr_c, #0xd2ldr sp, =_irqstackendmsr cpsr_c, #0xd7ldr sp, =_abortstackendmsr cpsr_c, #0xdbldr sp, =_abortstackendmsr cpsr_c, #0xd3ldr sp, =_initstackendbl initb main.ltorg.section .icode, "ax", %progbits.align 2.global reset.global hang.type reset, %function.type hang, %functionreset:msr cpsr_c, #0xd3mov r0, #0x110000add r0, r0, #0xffadd r1, r0, #0xa00mov r2, #0x3c800000str r1, [r2]mov r1, #0xff0str r1, [r2,#4]str r0, [r2]hang:b hang.size reset, .-reset.size hang, .-hang.type reset_handler, %functionreset_handler:adr r0, reset_textb panicreset_text:.ascii "Hit reset vector!\0".size reset_handler, .-reset_handler.type undef_instr_handler, %functionundef_instr_handler:adr r0, undef_instr_textsub r0, lr, #4b panicf.size undef_instr_handler, .-undef_instr_handler.type prefetch_abort_handler, %functionprefetch_abort_handler:adr r0, prefetch_abort_textsub r0, lr, #4b panicf.size prefetch_abort_handler, .-prefetch_abort_handler.type data_abort_handler, %functiondata_abort_handler:adr r0, data_abort_textsub r0, lr, #4b panicf.size data_abort_handler, .-data_abort_handler.type reserved_handler, %functionreserved_handler:adr r0, reserved_textb panic.size reserved_handler, .-reserved_handler.type fiq_handler, %functionfiq_handler:adr r0, fiq_textb panic.size fiq_handler, .-fiq_handler.type irq_handler, %functionirq_handler:adr r0, irq_textb panic.size irq_handler, .-irq_handler.type syscall_handler, %functionsyscall_handler:adr r0, syscall_textb panic.size syscall_handler, .-syscall_handlerundef_instr_text:.ascii "Undefined instruction at %08X!\0"prefetch_abort_text:.ascii "Prefetch abort at %08X!\0"data_abort_text:.ascii "Data abort at %08X!\0"reserved_text:.ascii "Hit reserved exception handler!\0"fiq_text:.ascii "Unhandled FIQ!\0"irq_text:.ascii "Unhandled IRQ!\0"syscall_text:.ascii "Unhandled syscall!\0"