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);
exit(EXIT_FAILURE);
}
- disasm = gen_disasm_create(reg);
+ disasm = gen_disasm_create(&devinfo);
printf("Detected GEN%i chipset\n", devinfo.gen);
}
struct gen_disasm *
-gen_disasm_create(int pciid)
+gen_disasm_create(const struct gen_device_info *devinfo)
{
struct gen_disasm *gd;
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);
#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);