Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 101719
b: refs/heads/master
c: b7bcda6
h: refs/heads/master
i:
  101717: 6086e0c
  101715: 49b8dd5
  101711: c6b9670
v: v3
  • Loading branch information
Michael Ellerman authored and Paul Mackerras committed Jul 1, 2008
1 parent 828d385 commit bae5839
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 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: ae0dc73625f9b0e636ccd130e394c9b654a062fb
refs/heads/master: b7bcda631e87eb3466d0baa9885650ba7d7ed89d
3 changes: 2 additions & 1 deletion trunk/arch/powerpc/kernel/cputable.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/module.h>

#include <asm/oprofile_impl.h>
#include <asm/code-patching.h>
#include <asm/cputable.h>
#include <asm/prom.h> /* for PTRRELOC on ARCH=ppc */

Expand Down Expand Up @@ -1663,7 +1664,7 @@ void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
pend = ((unsigned int *)fcur) + (fcur->end_off / 4);

for (p = pstart; p < pend; p++) {
*p = 0x60000000u;
*p = PPC_NOP_INSTR;
asm volatile ("dcbst 0, %0" : : "r" (p));
}
asm volatile ("sync" : : : "memory");
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/kernel/crash_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static void __init create_trampoline(unsigned long addr)
* branch to "addr" we jump to ("addr" + 32 MB). Although it requires
* two instructions it doesn't require any registers.
*/
patch_instruction(p, 0x60000000); /* nop */
patch_instruction(p, PPC_NOP_INSTR);
patch_branch(++p, addr + PHYSICAL_START, 0);
}

Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/powerpc/kernel/module_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <asm/module.h>
#include <asm/uaccess.h>
#include <asm/firmware.h>
#include <asm/code-patching.h>
#include <linux/sort.h>

#include "setup.h"
Expand Down Expand Up @@ -330,7 +331,7 @@ static unsigned long stub_for_addr(Elf64_Shdr *sechdrs,
restore r2. */
static int restore_r2(u32 *instruction, struct module *me)
{
if (*instruction != 0x60000000) {
if (*instruction != PPC_NOP_INSTR) {
printk("%s: Expect noop after relocate, got %08x\n",
me->name, *instruction);
return 0;
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/asm-powerpc/code-patching.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

#include <asm/types.h>

#define PPC_NOP_INSTR 0x60000000

/* Flags for create_branch:
* "b" == create_branch(addr, target, 0);
* "ba" == create_branch(addr, target, BRANCH_ABSOLUTE);
Expand Down

0 comments on commit bae5839

Please sign in to comment.