@@ -34,13 +34,9 @@ struct MonitorDef {
int offset;
target_long (*get_value)(Monitor *mon, const struct MonitorDef *md,
int val);
- int type;
};
#endif
-#define MD_TLONG 0
-#define MD_I32 1
-
const MonitorDef *target_monitor_defs(void);
int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval);
@@ -82,17 +82,7 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const char *name)
} else {
CPUArchState *env = mon_get_cpu_env(mon);
ptr = (uint8_t *)env + md->offset;
- switch(md->type) {
- case MD_I32:
- *pval = *(int32_t *)ptr;
- break;
- case MD_TLONG:
- *pval = *(target_long *)ptr;
- break;
- default:
- *pval = 0;
- break;
- }
+ *pval = *(int32_t *)ptr;
}
return 0;
}
@@ -602,7 +602,7 @@ static target_long monitor_get_pc(Monitor *mon, const struct MonitorDef *md,
const MonitorDef monitor_defs[] = {
#define SEG(name, seg) \
- { name ".limit", offsetof(CPUX86State, segs[seg].limit), NULL, MD_I32 },
+ { name ".limit", offsetof(CPUX86State, segs[seg].limit) },
SEG("cs", R_CS)
SEG("ds", R_DS)
SEG("es", R_ES)
@@ -24,18 +24,18 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict)
}
static const MonitorDef monitor_defs[] = {
- { "ssp", offsetof(CPUM68KState, sp[0]), NULL, MD_I32 },
- { "usp", offsetof(CPUM68KState, sp[1]), NULL, MD_I32 },
- { "isp", offsetof(CPUM68KState, sp[2]), NULL, MD_I32 },
- { "sfc", offsetof(CPUM68KState, sfc), NULL, MD_I32 },
- { "dfc", offsetof(CPUM68KState, dfc), NULL, MD_I32 },
- { "urp", offsetof(CPUM68KState, mmu.urp), NULL, MD_I32 },
- { "srp", offsetof(CPUM68KState, mmu.srp), NULL, MD_I32 },
- { "dttr0", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR0]), NULL, MD_I32 },
- { "dttr1", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR1]), NULL, MD_I32 },
- { "ittr0", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR0]), NULL, MD_I32 },
- { "ittr1", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR1]), NULL, MD_I32 },
- { "mmusr", offsetof(CPUM68KState, mmu.mmusr), NULL, MD_I32 },
+ { "ssp", offsetof(CPUM68KState, sp[0]) },
+ { "usp", offsetof(CPUM68KState, sp[1]) },
+ { "isp", offsetof(CPUM68KState, sp[2]) },
+ { "sfc", offsetof(CPUM68KState, sfc) },
+ { "dfc", offsetof(CPUM68KState, dfc) },
+ { "urp", offsetof(CPUM68KState, mmu.urp) },
+ { "srp", offsetof(CPUM68KState, mmu.srp) },
+ { "dttr0", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR0]) },
+ { "dttr1", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR1]) },
+ { "ittr0", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR0]) },
+ { "ittr1", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR1]) },
+ { "mmusr", offsetof(CPUM68KState, mmu.mmusr) },
{ NULL },
};
@@ -41,13 +41,13 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict)
const MonitorDef monitor_defs[] = {
#ifdef TARGET_SPARC64
- { "asi", offsetof(CPUSPARCState, asi), NULL, MD_I32 },
- { "pstate", offsetof(CPUSPARCState, pstate), NULL, MD_I32 },
- { "cansave", offsetof(CPUSPARCState, cansave), NULL, MD_I32 },
- { "canrestore", offsetof(CPUSPARCState, canrestore), NULL, MD_I32 },
- { "otherwin", offsetof(CPUSPARCState, otherwin), NULL, MD_I32 },
- { "wstate", offsetof(CPUSPARCState, wstate), NULL, MD_I32 },
- { "cleanwin", offsetof(CPUSPARCState, cleanwin), NULL, MD_I32 },
+ { "asi", offsetof(CPUSPARCState, asi) },
+ { "pstate", offsetof(CPUSPARCState, pstate) },
+ { "cansave", offsetof(CPUSPARCState, cansave) },
+ { "canrestore", offsetof(CPUSPARCState, canrestore) },
+ { "otherwin", offsetof(CPUSPARCState, otherwin) },
+ { "wstate", offsetof(CPUSPARCState, wstate) },
+ { "cleanwin", offsetof(CPUSPARCState, cleanwin) },
#endif
{ NULL },
};