start.S revision 296183
1296183Ssgalabov/*- 2296183Ssgalabov * Copyright (c) 2016 Stanislav Galabov 3296183Ssgalabov * All rights reserved. 4296183Ssgalabov * 5296183Ssgalabov * Redistribution and use in source and binary forms, with or without 6296183Ssgalabov * modification, are permitted provided that the following conditions 7296183Ssgalabov * are met: 8296183Ssgalabov * 1. Redistributions of source code must retain the above copyright 9296183Ssgalabov * notice, this list of conditions and the following disclaimer. 10296183Ssgalabov * 2. Redistributions in binary form must reproduce the above copyright 11296183Ssgalabov * notice, this list of conditions and the following disclaimer in the 12296183Ssgalabov * documentation and/or other materials provided with the distribution. 13296183Ssgalabov * 14296183Ssgalabov * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15296183Ssgalabov * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16296183Ssgalabov * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17296183Ssgalabov * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18296183Ssgalabov * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19296183Ssgalabov * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20296183Ssgalabov * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21296183Ssgalabov * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22296183Ssgalabov * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23296183Ssgalabov * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24296183Ssgalabov * SUCH DAMAGE. 25296183Ssgalabov * 26296183Ssgalabov * $FreeBSD: head/sys/boot/mips/uboot/start.S 296183 2016-02-29 07:47:04Z sgalabov $ 27296183Ssgalabov */ 28296183Ssgalabov 29296183Ssgalabov#include <machine/asm.h> 30296183Ssgalabov 31296183Ssgalabov .text 32296183Ssgalabov .extern _C_LABEL(main) 33296183Ssgalabov .weak _DYNAMIC 34296183Ssgalabov 35296183Ssgalabov/* 36296183Ssgalabov * Entry point to the loader that U-Boot passes control to. 37296183Ssgalabov */ 38296183SsgalabovENTRY(_start) 39296183Ssgalabov PTR_S sp, uboot_address 40296183Ssgalabov j main 41296183Ssgalabov nop 42296183SsgalabovEND(_start) 43296183Ssgalabov 44296183Ssgalabov/* 45296183Ssgalabov * syscall() 46296183Ssgalabov */ 47296183SsgalabovENTRY(syscall) 48296183Ssgalabov PTR_S ra, ret_address 49296183Ssgalabov PTR_L t9, syscall_ptr 50296183Ssgalabov jalr t9 51296183Ssgalabov nop 52296183Ssgalabov PTR_L ra, ret_address 53296183Ssgalabov jr ra 54296183Ssgalabov nop 55296183SsgalabovEND(syscall) 56296183Ssgalabov 57296183Ssgalabov/* 58296183Ssgalabov * Data section 59296183Ssgalabov */ 60296183Ssgalabov .data 61296183Ssgalabov .align 8 62296183Ssgalabov .globl syscall_ptr 63296183Ssgalabovsyscall_ptr: 64296183Ssgalabov .dword 0 65296183Ssgalabov 66296183Ssgalabov .globl uboot_address 67296183Ssgalabovuboot_address: 68296183Ssgalabov .dword 0 69296183Ssgalabov 70296183Ssgalabovret_address: 71296183Ssgalabov .dword 0 72