net: ethernet: Fix memleak in ethoc_probe
[linux/fpc-iii.git] / arch / m68k / kernel / machine_kexec.c
blobd4affc917d9da11258c72e3c61470dd4a656faee
1 /*
2 * machine_kexec.c - handle transition of Linux booting another kernel
3 */
4 #include <linux/compiler.h>
5 #include <linux/kexec.h>
6 #include <linux/mm.h>
7 #include <linux/delay.h>
9 #include <asm/cacheflush.h>
10 #include <asm/page.h>
11 #include <asm/setup.h>
13 extern const unsigned char relocate_new_kernel[];
14 extern const size_t relocate_new_kernel_size;
16 int machine_kexec_prepare(struct kimage *kimage)
18 return 0;
21 void machine_kexec_cleanup(struct kimage *kimage)
25 void machine_shutdown(void)
29 void machine_crash_shutdown(struct pt_regs *regs)
33 typedef void (*relocate_kernel_t)(unsigned long ptr,
34 unsigned long start,
35 unsigned long cpu_mmu_flags) __noreturn;
37 void machine_kexec(struct kimage *image)
39 void *reboot_code_buffer;
40 unsigned long cpu_mmu_flags;
42 reboot_code_buffer = page_address(image->control_code_page);
44 memcpy(reboot_code_buffer, relocate_new_kernel,
45 relocate_new_kernel_size);
48 * we do not want to be bothered.
50 local_irq_disable();
52 pr_info("Will call new kernel at 0x%08lx. Bye...\n", image->start);
53 __flush_cache_all();
54 cpu_mmu_flags = m68k_cputype | m68k_mmutype << 8;
55 ((relocate_kernel_t) reboot_code_buffer)(image->head & PAGE_MASK,
56 image->start,
57 cpu_mmu_flags);