diff options
author | Jiang Liu <liuj97@gmail.com> | 2014-01-07 09:17:11 -0500 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2014-01-08 10:21:29 -0500 |
commit | 5c5bf25d4f7a950382f94fc120a5818197b48fe9 (patch) | |
tree | c5b7ade94cccaec0e8ab746a704f534b5748f4f6 /arch/arm64/include | |
parent | c84fced8d990dd86c523233d38b4685a52a4fc3f (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.h | 10 |
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 | ||
69 | enum 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) \ |
70 | static __always_inline bool aarch64_insn_is_##abbr(u32 code) \ | 75 | static __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); | |||
89 | enum aarch64_insn_encoding_class aarch64_get_insn_class(u32 insn); | 94 | enum aarch64_insn_encoding_class aarch64_get_insn_class(u32 insn); |
90 | u32 aarch64_insn_encode_immediate(enum aarch64_insn_imm_type type, | 95 | u32 aarch64_insn_encode_immediate(enum aarch64_insn_imm_type type, |
91 | u32 insn, u64 imm); | 96 | u32 insn, u64 imm); |
97 | u32 aarch64_insn_gen_branch_imm(unsigned long pc, unsigned long addr, | ||
98 | enum aarch64_insn_branch_type type); | ||
99 | u32 aarch64_insn_gen_hint(enum aarch64_insn_hint_op op); | ||
100 | u32 aarch64_insn_gen_nop(void); | ||
101 | |||
92 | bool aarch64_insn_hotpatch_safe(u32 old_insn, u32 new_insn); | 102 | bool aarch64_insn_hotpatch_safe(u32 old_insn, u32 new_insn); |
93 | 103 | ||
94 | int aarch64_insn_patch_text_nosync(void *addr, u32 insn); | 104 | int aarch64_insn_patch_text_nosync(void *addr, u32 insn); |