diff options
Diffstat (limited to 'include/asm-ppc')
-rw-r--r-- | include/asm-ppc/kexec.h | 38 | ||||
-rw-r--r-- | include/asm-ppc/machdep.h | 31 |
2 files changed, 69 insertions, 0 deletions
diff --git a/include/asm-ppc/kexec.h b/include/asm-ppc/kexec.h new file mode 100644 index 000000000000..73191310d8db --- /dev/null +++ b/include/asm-ppc/kexec.h | |||
@@ -0,0 +1,38 @@ | |||
1 | #ifndef _PPC_KEXEC_H | ||
2 | #define _PPC_KEXEC_H | ||
3 | |||
4 | #ifdef CONFIG_KEXEC | ||
5 | |||
6 | /* | ||
7 | * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return. | ||
8 | * I.e. Maximum page that is mapped directly into kernel memory, | ||
9 | * and kmap is not required. | ||
10 | * | ||
11 | * Someone correct me if FIXADDR_START - PAGEOFFSET is not the correct | ||
12 | * calculation for the amount of memory directly mappable into the | ||
13 | * kernel memory space. | ||
14 | */ | ||
15 | |||
16 | /* Maximum physical address we can use pages from */ | ||
17 | #define KEXEC_SOURCE_MEMORY_LIMIT (-1UL) | ||
18 | /* Maximum address we can reach in physical address mode */ | ||
19 | #define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL) | ||
20 | /* Maximum address we can use for the control code buffer */ | ||
21 | #define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE | ||
22 | |||
23 | #define KEXEC_CONTROL_CODE_SIZE 4096 | ||
24 | |||
25 | /* The native architecture */ | ||
26 | #define KEXEC_ARCH KEXEC_ARCH_PPC | ||
27 | |||
28 | #ifndef __ASSEMBLY__ | ||
29 | |||
30 | struct kimage; | ||
31 | |||
32 | extern void machine_kexec_simple(struct kimage *image); | ||
33 | |||
34 | #endif /* __ASSEMBLY__ */ | ||
35 | |||
36 | #endif /* CONFIG_KEXEC */ | ||
37 | |||
38 | #endif /* _PPC_KEXEC_H */ | ||
diff --git a/include/asm-ppc/machdep.h b/include/asm-ppc/machdep.h index b78d40870c95..1d4ab70a56f3 100644 --- a/include/asm-ppc/machdep.h +++ b/include/asm-ppc/machdep.h | |||
@@ -4,6 +4,7 @@ | |||
4 | 4 | ||
5 | #include <linux/config.h> | 5 | #include <linux/config.h> |
6 | #include <linux/init.h> | 6 | #include <linux/init.h> |
7 | #include <linux/kexec.h> | ||
7 | 8 | ||
8 | #include <asm/setup.h> | 9 | #include <asm/setup.h> |
9 | #include <asm/page.h> | 10 | #include <asm/page.h> |
@@ -114,6 +115,36 @@ struct machdep_calls { | |||
114 | /* functions for dealing with other cpus */ | 115 | /* functions for dealing with other cpus */ |
115 | struct smp_ops_t *smp_ops; | 116 | struct smp_ops_t *smp_ops; |
116 | #endif /* CONFIG_SMP */ | 117 | #endif /* CONFIG_SMP */ |
118 | |||
119 | #ifdef CONFIG_KEXEC | ||
120 | /* Called to shutdown machine specific hardware not already controlled | ||
121 | * by other drivers. | ||
122 | * XXX Should we move this one out of kexec scope? | ||
123 | */ | ||
124 | void (*machine_shutdown)(void); | ||
125 | |||
126 | /* Called to do the minimal shutdown needed to run a kexec'd kernel | ||
127 | * to run successfully. | ||
128 | * XXX Should we move this one out of kexec scope? | ||
129 | */ | ||
130 | void (*machine_crash_shutdown)(void); | ||
131 | |||
132 | /* Called to do what every setup is needed on image and the | ||
133 | * reboot code buffer. Returns 0 on success. | ||
134 | * Provide your own (maybe dummy) implementation if your platform | ||
135 | * claims to support kexec. | ||
136 | */ | ||
137 | int (*machine_kexec_prepare)(struct kimage *image); | ||
138 | |||
139 | /* Called to handle any machine specific cleanup on image */ | ||
140 | void (*machine_kexec_cleanup)(struct kimage *image); | ||
141 | |||
142 | /* Called to perform the _real_ kexec. | ||
143 | * Do NOT allocate memory or fail here. We are past the point of | ||
144 | * no return. | ||
145 | */ | ||
146 | void (*machine_kexec)(struct kimage *image); | ||
147 | #endif /* CONFIG_KEXEC */ | ||
117 | }; | 148 | }; |
118 | 149 | ||
119 | extern struct machdep_calls ppc_md; | 150 | extern struct machdep_calls ppc_md; |