jump_label.c 490 B

1234567891011121314151617181920
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * Copyright 2010 Michael Ellerman, IBM Corp.
  4. */
  5. #include <linux/kernel.h>
  6. #include <linux/jump_label.h>
  7. #include <asm/code-patching.h>
  8. #include <asm/inst.h>
  9. void arch_jump_label_transform(struct jump_entry *entry,
  10. enum jump_label_type type)
  11. {
  12. u32 *addr = (u32 *)jump_entry_code(entry);
  13. if (type == JUMP_LABEL_JMP)
  14. patch_branch(addr, jump_entry_target(entry), 0);
  15. else
  16. patch_instruction(addr, ppc_inst(PPC_RAW_NOP()));
  17. }