arm64: move encode_insn_immediate() from module.c to insn.c
Function encode_insn_immediate() will be used by other instruction manipulate related functions, so move it into insn.c and rename it as aarch64_insn_encode_immediate(). 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>
This commit is contained in:

committed by
Catalin Marinas

parent
ae16480785
commit
c84fced8d9
@@ -55,6 +55,17 @@ enum aarch64_insn_hint_op {
|
||||
AARCH64_INSN_HINT_SEVL = 0x5 << 5,
|
||||
};
|
||||
|
||||
enum aarch64_insn_imm_type {
|
||||
AARCH64_INSN_IMM_ADR,
|
||||
AARCH64_INSN_IMM_26,
|
||||
AARCH64_INSN_IMM_19,
|
||||
AARCH64_INSN_IMM_16,
|
||||
AARCH64_INSN_IMM_14,
|
||||
AARCH64_INSN_IMM_12,
|
||||
AARCH64_INSN_IMM_9,
|
||||
AARCH64_INSN_IMM_MAX
|
||||
};
|
||||
|
||||
#define __AARCH64_INSN_FUNCS(abbr, mask, val) \
|
||||
static __always_inline bool aarch64_insn_is_##abbr(u32 code) \
|
||||
{ return (code & (mask)) == (val); } \
|
||||
@@ -76,6 +87,8 @@ bool aarch64_insn_is_nop(u32 insn);
|
||||
int aarch64_insn_read(void *addr, u32 *insnp);
|
||||
int aarch64_insn_write(void *addr, u32 insn);
|
||||
enum aarch64_insn_encoding_class aarch64_get_insn_class(u32 insn);
|
||||
u32 aarch64_insn_encode_immediate(enum aarch64_insn_imm_type type,
|
||||
u32 insn, u64 imm);
|
||||
bool aarch64_insn_hotpatch_safe(u32 old_insn, u32 new_insn);
|
||||
|
||||
int aarch64_insn_patch_text_nosync(void *addr, u32 insn);
|
||||
|
Reference in New Issue
Block a user