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/linkage.h>
13 #define PAGE_SIZE 4096 /* must be same value as in <asm/page.h> */
16 .globl relocate_new_kernel
18 /* r4 = indirection_page */
19 /* r5 = reboot_code_buffer */
20 /* r6 = start_address */
23 mov.l 10f,r8 /* 4096 */
24 mov.l 11f,r9 /* 0xa0000000 */
31 mov r4,r0 /* cmd = indirection_page */
33 mov.l @r4+,r0 /* cmd = *ind++ */
35 1: /* addr = (cmd | 0xa0000000) & 0xfffffff0 */
41 /* if(cmd & IND_DESTINATION) dst = addr */
47 2: /* else if(cmd & IND_INDIRECTION) ind = addr */
53 3: /* else if(cmd & IND_DONE) goto 6 */
59 4: /* else if(cmd & IND_SOURCE) memcpy(dst,addr,PAGE_SIZE) */
68 mov.l @r2+,r1 /* 16n+0 */
71 mov.l @r2+,r1 /* 16n+4 */
74 mov.l @r2+,r1 /* 16n+8 */
77 mov.l @r2+,r1 /* 16n+12 */
85 #ifdef CONFIG_SH_STANDARD_BIOS
97 relocate_new_kernel_end:
99 .globl relocate_new_kernel_size
100 relocate_new_kernel_size:
101 .long relocate_new_kernel_end - relocate_new_kernel