diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2005-11-11 08:06:06 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-11-14 00:34:06 -0500 |
commit | 593e537b93193d1696809817533ce5ad510445b1 (patch) | |
tree | b2045132486c3d39950899e3a9b574188df55ce6 /arch/ppc64/kernel/machine_kexec.c | |
parent | c5e24354efae9f962e0e369d875d45f47e0bb9aa (diff) |
[PATCH] powerpc: Export htab start/end via device tree
The userspace kexec-tools need to know the location of the htab on non-lpar
machines, as well as the end of the kernel. Export via the device tree.
NB. This patch has been updated to use "linux,x" property names. You may
need to update your kexec-tools to match.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc64/kernel/machine_kexec.c')
-rw-r--r-- | arch/ppc64/kernel/machine_kexec.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/arch/ppc64/kernel/machine_kexec.c b/arch/ppc64/kernel/machine_kexec.c index 203f1d5e6f10..97c51e452be7 100644 --- a/arch/ppc64/kernel/machine_kexec.c +++ b/arch/ppc64/kernel/machine_kexec.c | |||
@@ -305,3 +305,54 @@ void machine_kexec(struct kimage *image) | |||
305 | ppc_md.hpte_clear_all); | 305 | ppc_md.hpte_clear_all); |
306 | /* NOTREACHED */ | 306 | /* NOTREACHED */ |
307 | } | 307 | } |
308 | |||
309 | /* Values we need to export to the second kernel via the device tree. */ | ||
310 | static unsigned long htab_base, htab_size, kernel_end; | ||
311 | |||
312 | static struct property htab_base_prop = { | ||
313 | .name = "linux,htab-base", | ||
314 | .length = sizeof(unsigned long), | ||
315 | .value = (unsigned char *)&htab_base, | ||
316 | }; | ||
317 | |||
318 | static struct property htab_size_prop = { | ||
319 | .name = "linux,htab-size", | ||
320 | .length = sizeof(unsigned long), | ||
321 | .value = (unsigned char *)&htab_size, | ||
322 | }; | ||
323 | |||
324 | static struct property kernel_end_prop = { | ||
325 | .name = "linux,kernel-end", | ||
326 | .length = sizeof(unsigned long), | ||
327 | .value = (unsigned char *)&kernel_end, | ||
328 | }; | ||
329 | |||
330 | static void __init export_htab_values(void) | ||
331 | { | ||
332 | struct device_node *node; | ||
333 | |||
334 | node = of_find_node_by_path("/chosen"); | ||
335 | if (!node) | ||
336 | return; | ||
337 | |||
338 | kernel_end = __pa(_end); | ||
339 | prom_add_property(node, &kernel_end_prop); | ||
340 | |||
341 | /* On machines with no htab htab_address is NULL */ | ||
342 | if (NULL == htab_address) | ||
343 | goto out; | ||
344 | |||
345 | htab_base = __pa(htab_address); | ||
346 | prom_add_property(node, &htab_base_prop); | ||
347 | |||
348 | htab_size = 1UL << ppc64_pft_size; | ||
349 | prom_add_property(node, &htab_size_prop); | ||
350 | |||
351 | out: | ||
352 | of_node_put(node); | ||
353 | } | ||
354 | |||
355 | void __init kexec_setup(void) | ||
356 | { | ||
357 | export_htab_values(); | ||
358 | } | ||