diff options
author | Kenneth Graunke <[email protected]> | 2018-07-11 10:30:12 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2018-07-24 11:04:56 -0700 |
commit | 9b3474249513267bb4e50d450c70e688bffbc082 (patch) | |
tree | 79d44d26f40f8129fd2871c4d08a0623aa88eaa4 | |
parent | 3647b16675f98577e19674ff25a9136ad3af8f73 (diff) |
intel: Make the disassembler take a const pointer to the assembly.
Disassembling doesn't modify the assembly.
Reviewed-by: Lionel Landwerlin <[email protected]>
-rw-r--r-- | src/intel/common/gen_disasm.c | 7 | ||||
-rw-r--r-- | src/intel/common/gen_disasm.h | 2 |
2 files changed, 5 insertions, 4 deletions
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); |