arm_init.S revision 183651
1183651Sjhay/*- 2183651Sjhay * Copyright (c) 2008 John Hay. All rights reserved. 3183651Sjhay * 4183651Sjhay * Redistribution and use in source and binary forms, with or without 5183651Sjhay * modification, are permitted provided that the following conditions 6183651Sjhay * are met: 7183651Sjhay * 1. Redistributions of source code must retain the above copyright 8183651Sjhay * notice, this list of conditions and the following disclaimer. 9183651Sjhay * 2. Redistributions in binary form must reproduce the above copyright 10183651Sjhay * notice, this list of conditions and the following disclaimer in the 11183651Sjhay * documentation and/or other materials provided with the distribution. 12183651Sjhay * 13183651Sjhay * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14183651Sjhay * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15183651Sjhay * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16183651Sjhay * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17183651Sjhay * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18183651Sjhay * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19183651Sjhay * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20183651Sjhay * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21183651Sjhay * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22183651Sjhay * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23183651Sjhay * 24183651Sjhay * $FreeBSD: head/sys/boot/arm/ixp425/boot2/arm_init.S 183651 2008-10-06 19:38:10Z jhay $ 25183651Sjhay */ 26183651Sjhay 27183651Sjhaystart: 28183651Sjhay 29183651Sjhay/* Initialise bss and sp */ 30183651Sjhay nop 31183651Sjhay adr r1, .Lstart 32183651Sjhay ldmia r1, {r1, r2, sp} /* Set initial stack and */ 33183651Sjhay sub r2, r2, r1 /* get zero init data */ 34183651Sjhay mov r3, #0 35183651Sjhay.L1: 36183651Sjhay str r3, [r1], #0x0004 /* get zero init data */ 37183651Sjhay subs r2, r2, #4 38183651Sjhay bgt .L1 39183651Sjhay 40183651Sjhay .extern main 41183651Sjhay bl main 42183651Sjhay/* main should not return. If it does, spin forever */ 43183651SjhayinfiniteLoop: 44183651Sjhay b infiniteLoop 45183651Sjhay 46183651Sjhay.Lstart: 47183651Sjhay .word _edata 48183651Sjhay .word _end 49183651Sjhay .word BOOT_STACK 50183651Sjhay/* End */ 51