aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/include
diff options
context:
space:
mode:
authorJiang Liu <liuj97@gmail.com>2014-01-07 09:17:11 -0500
committerCatalin Marinas <catalin.marinas@arm.com>2014-01-08 10:21:29 -0500
commit5c5bf25d4f7a950382f94fc120a5818197b48fe9 (patch)
treec5b7ade94cccaec0e8ab746a704f534b5748f4f6 /arch/arm64/include
parentc84fced8d990dd86c523233d38b4685a52a4fc3f (diff)
arm64: introduce aarch64_insn_gen_{nop|branch_imm}() helper functions
Introduce aarch64_insn_gen_{nop|branch_imm}() helper functions, which will be used to implement jump label on ARM64. Reviewed-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Jiang Liu <liuj97@gmail.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/include')
-rw-r--r--arch/arm64/include/asm/insn.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/insn.h b/arch/arm64/include/asm/insn.h
index fb4466022bd0..c44ad39ed310 100644
--- a/arch/arm64/include/asm/insn.h
+++ b/arch/arm64/include/asm/insn.h
@@ -66,6 +66,11 @@ enum aarch64_insn_imm_type {
66 AARCH64_INSN_IMM_MAX 66 AARCH64_INSN_IMM_MAX
67}; 67};
68 68
69enum aarch64_insn_branch_type {
70 AARCH64_INSN_BRANCH_NOLINK,
71 AARCH64_INSN_BRANCH_LINK,
72};
73
69#define __AARCH64_INSN_FUNCS(abbr, mask, val) \ 74#define __AARCH64_INSN_FUNCS(abbr, mask, val) \
70static __always_inline bool aarch64_insn_is_##abbr(u32 code) \ 75static __always_inline bool aarch64_insn_is_##abbr(u32 code) \
71{ return (code & (mask)) == (val); } \ 76{ return (code & (mask)) == (val); } \
@@ -89,6 +94,11 @@ int aarch64_insn_write(void *addr, u32 insn);
89enum aarch64_insn_encoding_class aarch64_get_insn_class(u32 insn); 94enum aarch64_insn_encoding_class aarch64_get_insn_class(u32 insn);
90u32 aarch64_insn_encode_immediate(enum aarch64_insn_imm_type type, 95u32 aarch64_insn_encode_immediate(enum aarch64_insn_imm_type type,
91 u32 insn, u64 imm); 96 u32 insn, u64 imm);
97u32 aarch64_insn_gen_branch_imm(unsigned long pc, unsigned long addr,
98 enum aarch64_insn_branch_type type);
99u32 aarch64_insn_gen_hint(enum aarch64_insn_hint_op op);
100u32 aarch64_insn_gen_nop(void);
101
92bool aarch64_insn_hotpatch_safe(u32 old_insn, u32 new_insn); 102bool aarch64_insn_hotpatch_safe(u32 old_insn, u32 new_insn);
93 103
94int aarch64_insn_patch_text_nosync(void *addr, u32 insn); 104int aarch64_insn_patch_text_nosync(void *addr, u32 insn);