Michael Ellerman | ac5f89c | 2011-06-29 19:16:59 +0000 | [diff] [blame] | 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 | |
Al Viro | 9c8b390 | 2011-11-08 19:56:05 -0500 | [diff] [blame] | 14 | #ifdef HAVE_JUMP_LABEL |
Michael Ellerman | ac5f89c | 2011-06-29 19:16:59 +0000 | [diff] [blame] | 15 | void arch_jump_label_transform(struct jump_entry *entry, |
| 16 | enum jump_label_type type) |
| 17 | { |
| 18 | u32 *addr = (u32 *)(unsigned long)entry->code; |
| 19 | |
| 20 | if (type == JUMP_LABEL_ENABLE) |
| 21 | patch_branch(addr, entry->target, 0); |
| 22 | else |
| 23 | patch_instruction(addr, PPC_INST_NOP); |
| 24 | } |
Al Viro | 9c8b390 | 2011-11-08 19:56:05 -0500 | [diff] [blame] | 25 | #endif |