1 #ifndef _ASM_POWERPC_KEXEC_H
2 #define _ASM_POWERPC_KEXEC_H
5 #if defined(CONFIG_FSL_BOOKE) || defined(CONFIG_44x)
8 * On FSL-BookE we setup a 1:1 mapping which covers the first 2GiB of memory
9 * and therefore we can only deal with memory within this range
11 #define KEXEC_SOURCE_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL - 1)
12 #define KEXEC_DESTINATION_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL - 1)
13 #define KEXEC_CONTROL_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL - 1)
18 * Maximum page that is mapped directly into kernel memory.
19 * XXX: Since we copy virt we can use any page we allocate
21 #define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
24 * Maximum address we can reach in physical address mode.
25 * XXX: I want to allow initrd in highmem. Otherwise set to rmo on LPAR.
27 #define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
29 /* Maximum address we can use for the control code buffer */
31 #define KEXEC_CONTROL_MEMORY_LIMIT (-1UL)
33 /* TASK_SIZE, probably left over from use_mm ?? */
34 #define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE
38 #define KEXEC_CONTROL_PAGE_SIZE 4096
40 /* The native architecture */
42 #define KEXEC_ARCH KEXEC_ARCH_PPC64
44 #define KEXEC_ARCH KEXEC_ARCH_PPC
47 #define KEXEC_STATE_NONE 0
48 #define KEXEC_STATE_IRQS_OFF 1
49 #define KEXEC_STATE_REAL_MODE 2
54 typedef void (*crash_shutdown_t
)(void);
59 * This function is responsible for capturing register states if coming
60 * via panic or invoking dump using sysrq-trigger.
62 static inline void crash_setup_regs(struct pt_regs
*newregs
,
63 struct pt_regs
*oldregs
)
66 memcpy(newregs
, oldregs
, sizeof(*newregs
));
68 ppc_save_regs(newregs
);
71 extern void kexec_smp_wait(void); /* get and clear naca physid, wait for
72 master to copy new code to 0 */
73 extern int crashing_cpu
;
74 extern void crash_send_ipi(void (*crash_ipi_callback
)(struct pt_regs
*));
78 extern void default_machine_kexec(struct kimage
*image
);
79 extern int default_machine_kexec_prepare(struct kimage
*image
);
80 extern void default_machine_crash_shutdown(struct pt_regs
*regs
);
81 extern int crash_shutdown_register(crash_shutdown_t handler
);
82 extern int crash_shutdown_unregister(crash_shutdown_t handler
);
84 extern void machine_kexec_simple(struct kimage
*image
);
85 extern void crash_kexec_secondary(struct pt_regs
*regs
);
86 extern int overlaps_crashkernel(unsigned long start
, unsigned long size
);
87 extern void reserve_crashkernel(void);
88 extern void machine_kexec_mask_interrupts(void);
90 #else /* !CONFIG_KEXEC */
91 static inline void crash_kexec_secondary(struct pt_regs
*regs
) { }
93 static inline int overlaps_crashkernel(unsigned long start
, unsigned long size
)
98 static inline void reserve_crashkernel(void) { ; }
100 static inline int crash_shutdown_register(crash_shutdown_t handler
)
105 static inline int crash_shutdown_unregister(crash_shutdown_t handler
)
110 #endif /* CONFIG_KEXEC */
111 #endif /* ! __ASSEMBLY__ */
112 #endif /* __KERNEL__ */
113 #endif /* _ASM_POWERPC_KEXEC_H */