summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/alternative.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/alternative.c')
-rw-r--r--arch/x86/kernel/alternative.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index f8f34f94d13d..cfcfadf5cc80 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -1247,29 +1247,3 @@ void __ref text_poke_bp(void *addr, const void *opcode, size_t len, const void *
text_poke_loc_init(&tp, addr, opcode, len, emulate);
text_poke_bp_batch(&tp, 1);
}
-
-union text_poke_insn {
- u8 text[POKE_MAX_OPCODE_SIZE];
- struct {
- u8 opcode;
- s32 disp;
- } __attribute__((packed));
-};
-
-void *text_gen_insn(u8 opcode, const void *addr, const void *dest)
-{
- static union text_poke_insn insn; /* text_mutex */
- int size = text_opcode_size(opcode);
-
- lockdep_assert_held(&text_mutex);
-
- insn.opcode = opcode;
-
- if (size > 1) {
- insn.disp = (long)dest - (long)(addr + size);
- if (size == 2)
- BUG_ON((insn.disp >> 31) != (insn.disp >> 7));
- }
-
- return &insn.text;
-}