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.
11 #include <linux/config.h>
12 #include <linux/linkage.h>
14 #define PAGE_SIZE 4096 /* must be same value as in <asm/page.h> */
17 .globl relocate_new_kernel
19 /* r4 = indirection_page */
20 /* r5 = reboot_code_buffer */
21 /* r6 = start_address */
24 mov.l 10f,r8 /* 4096 */
25 mov.l 11f,r9 /* 0xa0000000 */
32 mov r4,r0 /* cmd = indirection_page */
34 mov.l @r4+,r0 /* cmd = *ind++ */
36 1: /* addr = (cmd | 0xa0000000) & 0xfffffff0 */
42 /* if(cmd & IND_DESTINATION) dst = addr */
48 2: /* else if(cmd & IND_INDIRECTION) ind = addr */
54 3: /* else if(cmd & IND_DONE) goto 6 */
60 4: /* else if(cmd & IND_SOURCE) memcpy(dst,addr,PAGE_SIZE) */
69 mov.l @r2+,r1 /* 16n+0 */
72 mov.l @r2+,r1 /* 16n+4 */
75 mov.l @r2+,r1 /* 16n+8 */
78 mov.l @r2+,r1 /* 16n+12 */
86 #ifdef CONFIG_SH_STANDARD_BIOS
98 relocate_new_kernel_end:
100 .globl relocate_new_kernel_size
101 relocate_new_kernel_size:
102 .long relocate_new_kernel_end - relocate_new_kernel