Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 331493
b: refs/heads/master
c: 4cabd1d
h: refs/heads/master
i:
  331491: e2cc891
v: v3
  • Loading branch information
Matthew Leach authored and Russell King committed Sep 26, 2012
1 parent d894644 commit 6b2bb5c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 559a593905e583fca23229b916c016e5211c6766
refs/heads/master: 4cabd1d9625c7d88acd143f4021fbef75394f154
23 changes: 22 additions & 1 deletion trunk/arch/arm/kernel/machine_kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <linux/io.h>
#include <linux/irq.h>
#include <asm/pgtable.h>
#include <linux/of_fdt.h>
#include <asm/pgalloc.h>
#include <asm/mmu_context.h>
#include <asm/cacheflush.h>
Expand All @@ -32,6 +33,24 @@ static atomic_t waiting_for_crash_ipi;

int machine_kexec_prepare(struct kimage *image)
{
struct kexec_segment *current_segment;
__be32 header;
int i, err;

/*
* No segment at default ATAGs address. try to locate
* a dtb using magic.
*/
for (i = 0; i < image->nr_segments; i++) {
current_segment = &image->segment[i];

err = get_user(header, (__be32*)current_segment->buf);
if (err)
return err;

if (be32_to_cpu(header) == OF_DT_HEADER)
kexec_boot_atags = current_segment->mem;
}
return 0;
}

Expand Down Expand Up @@ -122,7 +141,9 @@ void machine_kexec(struct kimage *image)
kexec_start_address = image->start;
kexec_indirection_page = page_list;
kexec_mach_type = machine_arch_type;
kexec_boot_atags = image->start - KEXEC_ARM_ZIMAGE_OFFSET + KEXEC_ARM_ATAGS_OFFSET;
if (!kexec_boot_atags)
kexec_boot_atags = image->start - KEXEC_ARM_ZIMAGE_OFFSET + KEXEC_ARM_ATAGS_OFFSET;


/* copy our kernel relocation code to the control code page */
memcpy(reboot_code_buffer,
Expand Down

0 comments on commit 6b2bb5c

Please sign in to comment.