You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
912 B
ArmAsm
34 lines
912 B
ArmAsm
/* Re-copy kernel image from given offset in a0 (length a1), and then
|
|
* jump to entry point contained in a2. Copies data to location pointed
|
|
* to in a3
|
|
* Very naive.
|
|
* ------------------------------------------------------------------
|
|
* (c) 2008 Philippe Vachon <philippe@cowpig.ca>
|
|
* Licensed under the GNU General Public License v3. See COPYING in the
|
|
* source distribution for more details.
|
|
*/
|
|
|
|
#include <asm/regdef.h>
|
|
#include <asm/asm.h>
|
|
|
|
EXPORT(_start)
|
|
|
|
LEAF(_start)
|
|
.set noreorder
|
|
|
|
1: lw s0, 0(a0) # load byte from address pointed to in a0
|
|
sw s0, 0(a3) # copy byte to address pointed to in a3
|
|
|
|
addiu a0, 4 # next location to read from
|
|
addiu a3, 4 # next location to write to
|
|
|
|
bnez a1, 1b # continue copying
|
|
addi a1, -4 # subtract from remaining bytes to copy
|
|
|
|
nop
|
|
|
|
jr a2 # jump to kernel entry point
|
|
nop
|
|
|
|
END(_start)
|