-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 17171 b: refs/heads/master c: 0cc4746 h: refs/heads/master i: 17169: 18bd7d4 17167: 056699c v: v3
- Loading branch information
Michael Ellerman
authored and
Paul Mackerras
committed
Jan 9, 2006
1 parent
51c2175
commit 4d39f1a
Showing
6 changed files
with
78 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 8c4f1f2958ff9d4a6760f3bdd0cfb7d2b9e12093 | ||
refs/heads/master: 0cc4746cadda16826a1b3214c042a2f75445b71c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Routines for doing kexec-based kdump. | ||
* | ||
* Copyright (C) 2005, IBM Corp. | ||
* | ||
* Created by: Michael Ellerman | ||
* | ||
* This source code is licensed under the GNU General Public License, | ||
* Version 2. See the file COPYING for more details. | ||
*/ | ||
|
||
#undef DEBUG | ||
|
||
#include <asm/kdump.h> | ||
#include <asm/lmb.h> | ||
#include <asm/firmware.h> | ||
|
||
#ifdef DEBUG | ||
#include <asm/udbg.h> | ||
#define DBG(fmt...) udbg_printf(fmt) | ||
#else | ||
#define DBG(fmt...) | ||
#endif | ||
|
||
static void __init create_trampoline(unsigned long addr) | ||
{ | ||
/* The maximum range of a single instruction branch, is the current | ||
* instruction's address + (32 MB - 4) bytes. For the trampoline we | ||
* need to branch to current address + 32 MB. So we insert a nop at | ||
* the trampoline address, then the next instruction (+ 4 bytes) | ||
* does a branch to (32 MB - 4). The net effect is that when we | ||
* branch to "addr" we jump to ("addr" + 32 MB). Although it requires | ||
* two instructions it doesn't require any registers. | ||
*/ | ||
create_instruction(addr, 0x60000000); /* nop */ | ||
create_branch(addr + 4, addr + PHYSICAL_START, 0); | ||
} | ||
|
||
void __init kdump_setup(void) | ||
{ | ||
unsigned long i; | ||
|
||
DBG(" -> kdump_setup()\n"); | ||
|
||
for (i = KDUMP_TRAMPOLINE_START; i < KDUMP_TRAMPOLINE_END; i += 8) { | ||
create_trampoline(i); | ||
} | ||
|
||
create_trampoline(__pa(system_reset_fwnmi) - PHYSICAL_START); | ||
create_trampoline(__pa(machine_check_fwnmi) - PHYSICAL_START); | ||
|
||
DBG(" <- kdump_setup()\n"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef _PPC64_KDUMP_H | ||
#define _PPC64_KDUMP_H | ||
|
||
/* How many bytes to reserve at zero for kdump. The reserve limit should | ||
* be greater or equal to the trampoline's end address. */ | ||
#define KDUMP_RESERVE_LIMIT 0x8000 | ||
|
||
#define KDUMP_TRAMPOLINE_START 0x0100 | ||
#define KDUMP_TRAMPOLINE_END 0x3000 | ||
|
||
extern void kdump_setup(void); | ||
|
||
#endif /* __PPC64_KDUMP_H */ |