start.S revision 199767f8919635c4928607450d9e0abb932109ce
/*-
* Copyright (c) 2008 Semihalf, Rafal Czubak
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
.text
/*
* Entry point to the loader that U-Boot passes control to.
*/
#ifdef _ARM_ARCH_6
#endif
/*
* Do self-relocation when the weak external symbol _DYNAMIC is non-NULL.
* When linked as a dynamic relocatable file, the linker automatically
* defines _DYNAMIC with a value that is the offset of the dynamic
* relocation info section.
* Note that we're still on u-boot's stack here, but the self_reloc
* code uses only a couple dozen bytes of stack space.
*/
/* Hint where to look for the API signature */
/* Save U-Boot's r8 and r9 */
/*
* Start loader. This is basically a tail-recursion call; if main()
* returns, it returns to u-boot (which reports the value returned r0).
*/
b main
/*
* Data for self-relocation, in the text segment for pc-rel access.
*/
.here_off:
.word .
/*
* syscall()
*/
/* Save caller's lr, r8 and r9 */
/* Restore U-Boot's r8 and r9 */
/* Call into U-Boot */
/* Restore loader's r8, r9 and lr */
/* Return to caller */
/*
* Data section
*/
.data
.align 4
.long 0
.long 0
.long 0 /* U-Boot's r8 */
.long 0 /* U-Boot's r9 */
.long 0 /* Loader's r8 */
.long 0 /* Loader's r9 */
.long 0 /* Loader's lr */