提交 7be5c55a 编写于 作者: M Magnus Damm 提交者: Paul Mundt

sh: simplify kexec vbr code

Setup the vbr register in machine_kexec(). This
instead of passing values to the assembly snippet.
Signed-off-by: NMagnus Damm <damm@igel.co.jp>
Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
上级 c2035184
...@@ -23,8 +23,7 @@ ...@@ -23,8 +23,7 @@
typedef NORET_TYPE void (*relocate_new_kernel_t)( typedef NORET_TYPE void (*relocate_new_kernel_t)(
unsigned long indirection_page, unsigned long indirection_page,
unsigned long reboot_code_buffer, unsigned long reboot_code_buffer,
unsigned long start_address, unsigned long start_address) ATTRIB_NORET;
unsigned long vbr_reg) ATTRIB_NORET;
extern const unsigned char relocate_new_kernel[]; extern const unsigned char relocate_new_kernel[];
extern const unsigned int relocate_new_kernel_size; extern const unsigned int relocate_new_kernel_size;
...@@ -76,14 +75,8 @@ void machine_kexec(struct kimage *image) ...@@ -76,14 +75,8 @@ void machine_kexec(struct kimage *image)
unsigned long page_list; unsigned long page_list;
unsigned long reboot_code_buffer; unsigned long reboot_code_buffer;
unsigned long vbr_reg;
relocate_new_kernel_t rnk; relocate_new_kernel_t rnk;
#if defined(CONFIG_SH_STANDARD_BIOS)
vbr_reg = ((unsigned long )gdb_vbr_vector) - 0x100;
#else
vbr_reg = 0x80000000; // dummy
#endif
/* Interrupts aren't acceptable while we reboot */ /* Interrupts aren't acceptable while we reboot */
local_irq_disable(); local_irq_disable();
...@@ -100,9 +93,15 @@ void machine_kexec(struct kimage *image) ...@@ -100,9 +93,15 @@ void machine_kexec(struct kimage *image)
kexec_info(image); kexec_info(image);
flush_cache_all(); flush_cache_all();
set_bl_bit();
#if defined(CONFIG_SH_STANDARD_BIOS)
asm volatile("ldc %0, vbr" :
: "r" (((unsigned long) gdb_vbr_vector) - 0x100)
: "memory");
#endif
/* now call it */ /* now call it */
rnk = (relocate_new_kernel_t) reboot_code_buffer; rnk = (relocate_new_kernel_t) reboot_code_buffer;
(*rnk)(page_list, reboot_code_buffer, P2SEGADDR(image->start), vbr_reg); (*rnk)(page_list, reboot_code_buffer, P2SEGADDR(image->start));
} }
void arch_crash_save_vmcoreinfo(void) void arch_crash_save_vmcoreinfo(void)
......
...@@ -16,7 +16,6 @@ relocate_new_kernel: ...@@ -16,7 +16,6 @@ relocate_new_kernel:
/* r4 = indirection_page */ /* r4 = indirection_page */
/* r5 = reboot_code_buffer */ /* r5 = reboot_code_buffer */
/* r6 = start_address */ /* r6 = start_address */
/* r7 = vbr_reg */
mov.l 10f,r8 /* PAGE_SIZE */ mov.l 10f,r8 /* PAGE_SIZE */
mov.l 11f,r9 /* P2SEG */ mov.l 11f,r9 /* P2SEG */
...@@ -80,9 +79,6 @@ relocate_new_kernel: ...@@ -80,9 +79,6 @@ relocate_new_kernel:
bra 0b bra 0b
nop nop
6: 6:
#ifdef CONFIG_SH_STANDARD_BIOS
ldc r7, vbr
#endif
jmp @r6 jmp @r6
nop nop
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册