#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 */
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");
* 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);
}
#include <asm/module.h>
#include <asm/uaccess.h>
#include <asm/firmware.h>
+#include <asm/code-patching.h>
#include <linux/sort.h>
#include "setup.h"
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;
#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);