intel/disasm: Take a devinfo in gen_disasm_create
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
This commit is contained in:
parent
a7ae72032f
commit
79269e8f4b
|
@ -846,7 +846,7 @@ handle_trace_header(uint32_t *p)
|
|||
spec = gen_spec_load(&devinfo);
|
||||
else
|
||||
spec = gen_spec_load_from_path(&devinfo, xml_path);
|
||||
disasm = gen_disasm_create(pci_id);
|
||||
disasm = gen_disasm_create(&devinfo);
|
||||
|
||||
if (spec == NULL || disasm == NULL)
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
|
@ -603,7 +603,7 @@ read_data_file(FILE *file)
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
disasm = gen_disasm_create(reg);
|
||||
disasm = gen_disasm_create(&devinfo);
|
||||
|
||||
printf("Detected GEN%i chipset\n", devinfo.gen);
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ gen_disasm_disassemble(struct gen_disasm *disasm, void *assembly,
|
|||
}
|
||||
|
||||
struct gen_disasm *
|
||||
gen_disasm_create(int pciid)
|
||||
gen_disasm_create(const struct gen_device_info *devinfo)
|
||||
{
|
||||
struct gen_disasm *gd;
|
||||
|
||||
|
@ -116,10 +116,7 @@ gen_disasm_create(int pciid)
|
|||
if (gd == NULL)
|
||||
return NULL;
|
||||
|
||||
if (!gen_get_device_info(pciid, &gd->devinfo)) {
|
||||
free(gd);
|
||||
return NULL;
|
||||
}
|
||||
gd->devinfo = *devinfo;
|
||||
|
||||
brw_init_compaction_tables(&gd->devinfo);
|
||||
|
||||
|
|
|
@ -24,13 +24,15 @@
|
|||
#ifndef GEN_DISASM_H
|
||||
#define GEN_DISASM_H
|
||||
|
||||
#include "intel/common/gen_device_info.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct gen_disasm;
|
||||
|
||||
struct gen_disasm *gen_disasm_create(int pciid);
|
||||
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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue