From 9b3474249513267bb4e50d450c70e688bffbc082 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 11 Jul 2018 10:30:12 -0700 Subject: intel: Make the disassembler take a const pointer to the assembly. Disassembling doesn't modify the assembly. Reviewed-by: Lionel Landwerlin --- src/intel/common/gen_disasm.c | 7 ++++--- src/intel/common/gen_disasm.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/intel/common/gen_disasm.c b/src/intel/common/gen_disasm.c index 1de20f576d4..4f835c19883 100644 --- a/src/intel/common/gen_disasm.c +++ b/src/intel/common/gen_disasm.c @@ -44,14 +44,15 @@ is_send(uint32_t opcode) } static int -gen_disasm_find_end(struct gen_disasm *disasm, void *assembly, int start) +gen_disasm_find_end(struct gen_disasm *disasm, + const void *assembly, int start) { struct gen_device_info *devinfo = &disasm->devinfo; int offset = start; /* This loop exits when send-with-EOT or when opcode is 0 */ while (true) { - brw_inst *insn = assembly + offset; + const brw_inst *insn = assembly + offset; if (brw_inst_cmpt_control(devinfo, insn)) { offset += 8; @@ -70,7 +71,7 @@ gen_disasm_find_end(struct gen_disasm *disasm, void *assembly, int start) } void -gen_disasm_disassemble(struct gen_disasm *disasm, void *assembly, +gen_disasm_disassemble(struct gen_disasm *disasm, const void *assembly, int start, FILE *out) { struct gen_device_info *devinfo = &disasm->devinfo; diff --git a/src/intel/common/gen_disasm.h b/src/intel/common/gen_disasm.h index c8c18b2cf03..d979114588d 100644 --- a/src/intel/common/gen_disasm.h +++ b/src/intel/common/gen_disasm.h @@ -34,7 +34,7 @@ struct gen_disasm; struct gen_disasm *gen_disasm_create(const struct gen_device_info *devinfo); void gen_disasm_disassemble(struct gen_disasm *disasm, - void *assembly, int start, FILE *out); + const void *assembly, int start, FILE *out); void gen_disasm_destroy(struct gen_disasm *disasm); -- cgit v1.2.3