Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14161
b: refs/heads/master
c: 593e537
h: refs/heads/master
i:
  14159: bffc294
v: v3
  • Loading branch information
Michael Ellerman authored and Paul Mackerras committed Nov 14, 2005
1 parent ed7f3ab commit 93dd0ef
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c5e24354efae9f962e0e369d875d45f47e0bb9aa
refs/heads/master: 593e537b93193d1696809817533ce5ad510445b1
5 changes: 5 additions & 0 deletions trunk/arch/powerpc/kernel/setup_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
#include <asm/firmware.h>
#include <asm/xmon.h>
#include <asm/udbg.h>
#include <asm/kexec.h>

#include "setup.h"

Expand Down Expand Up @@ -415,6 +416,10 @@ void __init setup_system(void)
*/
unflatten_device_tree();

#ifdef CONFIG_KEXEC
kexec_setup(); /* requires unflattened device tree. */
#endif

/*
* Fill the ppc64_caches & systemcfg structures with informations
* retreived from the device-tree. Need to be called before
Expand Down
51 changes: 51 additions & 0 deletions trunk/arch/ppc64/kernel/machine_kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,3 +305,54 @@ void machine_kexec(struct kimage *image)
ppc_md.hpte_clear_all);
/* NOTREACHED */
}

/* Values we need to export to the second kernel via the device tree. */
static unsigned long htab_base, htab_size, kernel_end;

static struct property htab_base_prop = {
.name = "linux,htab-base",
.length = sizeof(unsigned long),
.value = (unsigned char *)&htab_base,
};

static struct property htab_size_prop = {
.name = "linux,htab-size",
.length = sizeof(unsigned long),
.value = (unsigned char *)&htab_size,
};

static struct property kernel_end_prop = {
.name = "linux,kernel-end",
.length = sizeof(unsigned long),
.value = (unsigned char *)&kernel_end,
};

static void __init export_htab_values(void)
{
struct device_node *node;

node = of_find_node_by_path("/chosen");
if (!node)
return;

kernel_end = __pa(_end);
prom_add_property(node, &kernel_end_prop);

/* On machines with no htab htab_address is NULL */
if (NULL == htab_address)
goto out;

htab_base = __pa(htab_address);
prom_add_property(node, &htab_base_prop);

htab_size = 1UL << ppc64_pft_size;
prom_add_property(node, &htab_size_prop);

out:
of_node_put(node);
}

void __init kexec_setup(void)
{
export_htab_values();
}
1 change: 1 addition & 0 deletions trunk/include/asm-powerpc/kexec.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ extern note_buf_t crash_notes[];
#ifdef __powerpc64__
extern void kexec_smp_wait(void); /* get and clear naca physid, wait for
master to copy new code to 0 */
extern void __init kexec_setup(void);
#else
struct kimage;
extern void machine_kexec_simple(struct kimage *image);
Expand Down

0 comments on commit 93dd0ef

Please sign in to comment.