Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292470
b: refs/heads/master
c: d34c5f2
h: refs/heads/master
v: v3
  • Loading branch information
Mahesh Salgaonkar authored and Benjamin Herrenschmidt committed Feb 22, 2012
1 parent 61ea496 commit 57d45b7
Show file tree
Hide file tree
Showing 2 changed files with 30 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: ebaeb5ae24379b5b635dc1d1fa6df904bc95b4d9
refs/heads/master: d34c5f26cf7de52a72ee064698817a5a39b91767
29 changes: 29 additions & 0 deletions trunk/arch/powerpc/kernel/fadump.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,19 @@ static void fadump_setup_crash_memory_ranges(void)
}
}

/*
* If the given physical address falls within the boot memory region then
* return the relocated address that points to the dump region reserved
* for saving initial boot memory contents.
*/
static inline unsigned long fadump_relocate(unsigned long paddr)
{
if (paddr > RMA_START && paddr < fw_dump.boot_memory_size)
return fdm.rmr_region.destination_address + paddr;
else
return paddr;
}

static int fadump_create_elfcore_headers(char *bufp)
{
struct elfhdr *elf;
Expand Down Expand Up @@ -845,6 +858,22 @@ static int fadump_create_elfcore_headers(char *bufp)

(elf->e_phnum)++;

/* setup ELF PT_NOTE for vmcoreinfo */
phdr = (struct elf_phdr *)bufp;
bufp += sizeof(struct elf_phdr);
phdr->p_type = PT_NOTE;
phdr->p_flags = 0;
phdr->p_vaddr = 0;
phdr->p_align = 0;

phdr->p_paddr = fadump_relocate(paddr_vmcoreinfo_note());
phdr->p_offset = phdr->p_paddr;
phdr->p_memsz = vmcoreinfo_max_size;
phdr->p_filesz = vmcoreinfo_max_size;

/* Increment number of program headers. */
(elf->e_phnum)++;

/* setup PT_LOAD sections. */

for (i = 0; i < crash_mem_ranges; i++) {
Expand Down

0 comments on commit 57d45b7

Please sign in to comment.