2 * arch/s390/kernel/machine_kexec.c
4 * Copyright IBM Corp. 2005,2006
6 * Author(s): Rolf Adelsberger,
7 * Heiko Carstens <heiko.carstens@de.ibm.com>
10 #include <linux/device.h>
12 #include <linux/kexec.h>
13 #include <linux/delay.h>
15 #include <asm/setup.h>
16 #include <asm/pgtable.h>
17 #include <asm/pgalloc.h>
18 #include <asm/system.h>
20 #include <asm/reset.h>
22 typedef void (*relocate_kernel_t)(kimage_entry_t *, unsigned long);
24 extern const unsigned char relocate_kernel[];
25 extern const unsigned long long relocate_kernel_len;
27 int machine_kexec_prepare(struct kimage *image)
29 void *reboot_code_buffer;
31 /* We don't support anything but the default image type for now. */
32 if (image->type != KEXEC_TYPE_DEFAULT)
35 /* Get the destination where the assembler code should be copied to.*/
36 reboot_code_buffer = (void *) page_to_phys(image->control_code_page);
39 memcpy(reboot_code_buffer, relocate_kernel, relocate_kernel_len);
43 void machine_kexec_cleanup(struct kimage *image)
47 void machine_shutdown(void)
49 printk(KERN_INFO "kexec: machine_shutdown called\n");
52 void machine_kexec(struct kimage *image)
54 relocate_kernel_t data_mover;
60 data_mover = (relocate_kernel_t) page_to_phys(image->control_code_page);
62 /* Call the moving routine */
63 (*data_mover)(&image->head, image->start);