diff options
Diffstat (limited to 'arch/arm64/kernel/insn.c')
-rw-r--r-- | arch/arm64/kernel/insn.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm64/kernel/insn.c b/arch/arm64/kernel/insn.c index 67979364daf6..b65edc02cf81 100644 --- a/arch/arm64/kernel/insn.c +++ b/arch/arm64/kernel/insn.c | |||
@@ -380,6 +380,23 @@ u32 aarch64_insn_gen_comp_branch_imm(unsigned long pc, unsigned long addr, | |||
380 | offset >> 2); | 380 | offset >> 2); |
381 | } | 381 | } |
382 | 382 | ||
383 | u32 aarch64_insn_gen_cond_branch_imm(unsigned long pc, unsigned long addr, | ||
384 | enum aarch64_insn_condition cond) | ||
385 | { | ||
386 | u32 insn; | ||
387 | long offset; | ||
388 | |||
389 | offset = branch_imm_common(pc, addr, SZ_1M); | ||
390 | |||
391 | insn = aarch64_insn_get_bcond_value(); | ||
392 | |||
393 | BUG_ON(cond < AARCH64_INSN_COND_EQ || cond > AARCH64_INSN_COND_AL); | ||
394 | insn |= cond; | ||
395 | |||
396 | return aarch64_insn_encode_immediate(AARCH64_INSN_IMM_19, insn, | ||
397 | offset >> 2); | ||
398 | } | ||
399 | |||
383 | u32 __kprobes aarch64_insn_gen_hint(enum aarch64_insn_hint_op op) | 400 | u32 __kprobes aarch64_insn_gen_hint(enum aarch64_insn_hint_op op) |
384 | { | 401 | { |
385 | return aarch64_insn_get_hint_value() | op; | 402 | return aarch64_insn_get_hint_value() | op; |