Blame view
include/asm-powerpc/kexec.h
3.77 KB
e1df870d5
|
1 2 |
#ifndef _ASM_POWERPC_KEXEC_H #define _ASM_POWERPC_KEXEC_H |
88ced0314
|
3 |
#ifdef __KERNEL__ |
e1df870d5
|
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
/* * Maximum page that is mapped directly into kernel memory. * XXX: Since we copy virt we can use any page we allocate */ #define KEXEC_SOURCE_MEMORY_LIMIT (-1UL) /* * Maximum address we can reach in physical address mode. * XXX: I want to allow initrd in highmem. Otherwise set to rmo on LPAR. */ #define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL) /* Maximum address we can use for the control code buffer */ #ifdef __powerpc64__ #define KEXEC_CONTROL_MEMORY_LIMIT (-1UL) #else /* TASK_SIZE, probably left over from use_mm ?? */ #define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE #endif #define KEXEC_CONTROL_CODE_SIZE 4096 /* The native architecture */ #ifdef __powerpc64__ #define KEXEC_ARCH KEXEC_ARCH_PPC64 #else #define KEXEC_ARCH KEXEC_ARCH_PPC #endif |
2babf5c2e
|
33 |
#ifndef __ASSEMBLY__ |
b6f35b496
|
34 |
#include <linux/cpumask.h> |
2babf5c2e
|
35 |
|
cc5329152
|
36 |
#ifdef CONFIG_KEXEC |
8385a6a3a
|
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
#ifdef __powerpc64__ /* * This function is responsible for capturing register states if coming * via panic or invoking dump using sysrq-trigger. */ static inline void crash_setup_regs(struct pt_regs *newregs, struct pt_regs *oldregs) { if (oldregs) memcpy(newregs, oldregs, sizeof(*newregs)); else { /* FIXME Merge this with xmon_save_regs ?? */ unsigned long tmp1, tmp2; __asm__ __volatile__ ( "std 0,0(%2) " "std 1,8(%2) " "std 2,16(%2) " "std 3,24(%2) " "std 4,32(%2) " "std 5,40(%2) " "std 6,48(%2) " "std 7,56(%2) " "std 8,64(%2) " "std 9,72(%2) " "std 10,80(%2) " "std 11,88(%2) " "std 12,96(%2) " "std 13,104(%2) " "std 14,112(%2) " "std 15,120(%2) " "std 16,128(%2) " "std 17,136(%2) " "std 18,144(%2) " "std 19,152(%2) " "std 20,160(%2) " "std 21,168(%2) " "std 22,176(%2) " "std 23,184(%2) " "std 24,192(%2) " "std 25,200(%2) " "std 26,208(%2) " "std 27,216(%2) " "std 28,224(%2) " "std 29,232(%2) " "std 30,240(%2) " "std 31,248(%2) " "mfmsr %0 " "std %0, 264(%2) " "mfctr %0 " "std %0, 280(%2) " "mflr %0 " "std %0, 288(%2) " "bl 1f " "1: mflr %1 " "std %1, 256(%2) " "mtlr %0 " "mfxer %0 " "std %0, 296(%2) " : "=&r" (tmp1), "=&r" (tmp2) |
2ec5e3a86
|
140 141 |
: "b" (newregs) : "memory"); |
8385a6a3a
|
142 143 144 145 146 147 148 149 150 151 |
} } #else /* * Provide a dummy definition to avoid build failures. Will remain * empty till crash dump support is enabled. */ static inline void crash_setup_regs(struct pt_regs *newregs, struct pt_regs *oldregs) { } #endif /* !__powerpc64 __ */ |
e1df870d5
|
152 153 |
extern void kexec_smp_wait(void); /* get and clear naca physid, wait for master to copy new code to 0 */ |
cc5329152
|
154 155 |
extern int crashing_cpu; extern void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *)); |
c0ce7d088
|
156 157 158 159 160 |
extern cpumask_t cpus_in_sr; static inline int kexec_sr_activated(int cpu) { return cpu_isset(cpu,cpus_in_sr); } |
e1df870d5
|
161 |
|
3d1229d6a
|
162 |
struct kimage; |
cc5329152
|
163 |
struct pt_regs; |
3d1229d6a
|
164 165 |
extern void default_machine_kexec(struct kimage *image); extern int default_machine_kexec_prepare(struct kimage *image); |
cc5329152
|
166 |
extern void default_machine_crash_shutdown(struct pt_regs *regs); |
39931e41b
|
167 |
extern void machine_kexec_simple(struct kimage *image); |
c0ce7d088
|
168 |
extern void crash_kexec_secondary(struct pt_regs *regs); |
2babf5c2e
|
169 |
extern int overlaps_crashkernel(unsigned long start, unsigned long size); |
35dd54326
|
170 |
extern void reserve_crashkernel(void); |
2babf5c2e
|
171 172 |
#else /* !CONFIG_KEXEC */ |
c0ce7d088
|
173 174 |
static inline int kexec_sr_activated(int cpu) { return 0; } static inline void crash_kexec_secondary(struct pt_regs *regs) { } |
2babf5c2e
|
175 176 177 178 179 |
static inline int overlaps_crashkernel(unsigned long start, unsigned long size) { return 0; } |
39931e41b
|
180 |
|
35dd54326
|
181 |
static inline void reserve_crashkernel(void) { ; } |
8385a6a3a
|
182 |
#endif /* CONFIG_KEXEC */ |
2babf5c2e
|
183 |
#endif /* ! __ASSEMBLY__ */ |
88ced0314
|
184 |
#endif /* __KERNEL__ */ |
e1df870d5
|
185 |
#endif /* _ASM_POWERPC_KEXEC_H */ |