blob: 144858027fa38f245e04301bef8b6b0539b955d1 [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001// SPDX-License-Identifier: GPL-2.0-or-later
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002/*
3 * Copyright 2010 Michael Ellerman, IBM Corp.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00004 */
5
6#include <linux/kernel.h>
7#include <linux/jump_label.h>
8#include <asm/code-patching.h>
Olivier Deprez157378f2022-04-04 15:47:50 +02009#include <asm/inst.h>
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000010
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000011void arch_jump_label_transform(struct jump_entry *entry,
12 enum jump_label_type type)
13{
Olivier Deprez157378f2022-04-04 15:47:50 +020014 struct ppc_inst *addr = (struct ppc_inst *)(unsigned long)entry->code;
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000015
16 if (type == JUMP_LABEL_JMP)
17 patch_branch(addr, entry->target, 0);
18 else
Olivier Deprez157378f2022-04-04 15:47:50 +020019 patch_instruction(addr, ppc_inst(PPC_INST_NOP));
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000020}