2 * relocate_kernel.S for kexec
3 * Created by <nschichan@corp.free.fr> on Thu Oct 12 17:49:57 2006
5 * This source code is licensed under the GNU General Public License,
6 * Version 2. See the file COPYING for more details.
10 #include <asm/asmmacro.h>
11 #include <asm/regdef.h>
13 #include <asm/mipsregs.h>
14 #include <asm/stackframe.h>
15 #include <asm/addrspace.h>
17 LEAF(relocate_new_kernel)
18 PTR_L s0, kexec_indirection_page
19 PTR_L s1, kexec_start_address
25 /* destination page */
28 and s4, s2, ~0x1 /* store destination addr in s4 */
33 /* indirection page, update s0 */
47 beq s3, zero, process_entry
49 li s6, (1 << PAGE_SHIFT) / SZREG
52 /* copy page word by word */
58 beq s6, zero, process_entry
63 /* jump to kexec_start_address */
65 END(relocate_new_kernel)
68 EXPORT(kexec_start_address)
70 .size kexec_start_address, PTRSIZE
72 kexec_indirection_page:
73 EXPORT(kexec_indirection_page)
75 .size kexec_indirection_page, PTRSIZE
77 relocate_new_kernel_end:
79 relocate_new_kernel_size:
80 EXPORT(relocate_new_kernel_size)
81 PTR relocate_new_kernel_end - relocate_new_kernel
82 .size relocate_new_kernel_size, PTRSIZE