1 /* start.S - AsbestOS stage1 startup code
3 Copyright (C) 2010-2011 Hector Martin "marcan" <hector@marcansoft.com>
5 This code is licensed to you under the terms of the GNU GPL, version 2;
6 see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
9 #include "../common/assembly.h"
12 .section .start,"ax",@progbits
22 /* calculate address of _start */
23 addi r4, r4, (_start - 1b)
25 /* relocate to our real address */
28 oris r5, r3, __self_start@h
29 ori r5, r5, __self_start@l
30 oris r6, r3, __self_end@h
31 ori r6, r6, __self_end@l
50 /* continue running at the relocated location */
51 oris r4, r3, reloced_start@h
52 ori r4, r4, reloced_start@l
60 /* register the USB device driver */
61 oris r3, r3, usb_driver@h
62 ori r3, r3, usb_driver@l
65 /* return from exploit */