2 * relocate_kernel.S - put the kernel image in place to boot
3 * 2005.9.17 kogiidena@eggplant.ddo.jp
5 * LANDISK/sh4 is supported. Maybe, SH archtecture works well.
7 * This source code is licensed under the GNU General Public License,
8 * Version 2. See the file COPYING for more details.
10 #include <linux/linkage.h>
11 #include <asm/addrspace.h>
14 .globl relocate_new_kernel
16 /* r4 = indirection_page */
17 /* r5 = reboot_code_buffer */
18 /* r6 = start_address */
21 mov.l 10f,r8 /* PAGE_SIZE */
22 mov.l 11f,r9 /* P2SEG */
29 mov r4,r0 /* cmd = indirection_page */
31 mov.l @r4+,r0 /* cmd = *ind++ */
33 1: /* addr = (cmd | P2SEG) & 0xfffffff0 */
39 /* if(cmd & IND_DESTINATION) dst = addr */
45 2: /* else if(cmd & IND_INDIRECTION) ind = addr */
51 3: /* else if(cmd & IND_DONE) goto 6 */
57 4: /* else if(cmd & IND_SOURCE) memcpy(dst,addr,PAGE_SIZE) */
66 mov.l @r2+,r1 /* 16n+0 */
69 mov.l @r2+,r1 /* 16n+4 */
72 mov.l @r2+,r1 /* 16n+8 */
75 mov.l @r2+,r1 /* 16n+12 */
83 #ifdef CONFIG_SH_STANDARD_BIOS
95 relocate_new_kernel_end:
97 .globl relocate_new_kernel_size
98 relocate_new_kernel_size:
99 .long relocate_new_kernel_end - relocate_new_kernel