From 755b748fd9fbee8cad2e55535d23298e8ac76b15 Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Wed, 3 Oct 2018 18:37:07 +0100 Subject: AArch64: Refactor verifiers to make more general. The current verifiers only take an instruction description and encoded value as arguments. This was enough when the verifiers only needed to do simple checking but it's insufficient for the purposes of validating instruction sequences. This patch adds the required arguments and also a flag to allow a verifier to distinguish between whether it's being run during encoding or decoding. It also allows for errors and warnings to be returned by a verifier instead of a simple pass/fail. include/ * opcode/aarch64.h (struct aarch64_opcode): Expand verifiers to take more arguments. opcodes/ * aarch64-dis.c (aarch64_opcode_decode): Update verifier call. * aarch64-opc.c (verify_ldpsw): Update arguments. --- include/ChangeLog | 5 +++++ include/opcode/aarch64.h | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/ChangeLog b/include/ChangeLog index 97f36ed..dc200a1 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,5 +1,10 @@ 2018-10-03 Tamar Christina + * opcode/aarch64.h (struct aarch64_opcode): Expand verifiers to take + more arguments. + +2018-10-03 Tamar Christina + * opcode/aarch64.h (enum err_type): New. (aarch64_decode_insn): Use it. diff --git a/include/opcode/aarch64.h b/include/opcode/aarch64.h index 40de440..751d7bb 100644 --- a/include/opcode/aarch64.h +++ b/include/opcode/aarch64.h @@ -727,7 +727,9 @@ struct aarch64_opcode unsigned char tied_operand; /* If non-NULL, a function to verify that a given instruction is valid. */ - bfd_boolean (* verifier) (const struct aarch64_opcode *, const aarch64_insn); + enum err_type (* verifier) (const struct aarch64_inst *, const aarch64_insn, + bfd_vma, bfd_boolean, aarch64_operand_error *, + struct aarch64_instr_sequence *); }; typedef struct aarch64_opcode aarch64_opcode; -- cgit v1.1