diff options
Diffstat (limited to 'arch/powerpc/kernel/jump_label.c')
-rw-r--r-- | arch/powerpc/kernel/jump_label.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/jump_label.c b/arch/powerpc/kernel/jump_label.c new file mode 100644 index 000000000000..368d158d665d --- /dev/null +++ b/arch/powerpc/kernel/jump_label.c | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * Copyright 2010 Michael Ellerman, IBM Corp. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | */ | ||
9 | |||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/jump_label.h> | ||
12 | #include <asm/code-patching.h> | ||
13 | |||
14 | void arch_jump_label_transform(struct jump_entry *entry, | ||
15 | enum jump_label_type type) | ||
16 | { | ||
17 | u32 *addr = (u32 *)(unsigned long)entry->code; | ||
18 | |||
19 | if (type == JUMP_LABEL_ENABLE) | ||
20 | patch_branch(addr, entry->target, 0); | ||
21 | else | ||
22 | patch_instruction(addr, PPC_INST_NOP); | ||
23 | } | ||