Logging fixes in cpu/x86.c.
This commit is contained in:
@@ -87,7 +87,7 @@ int x86_do_log = ENABLE_X86_LOG;
|
|||||||
int indump = 0;
|
int indump = 0;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
x808x_log(const char *fmt, ...)
|
x86_log(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
@@ -108,40 +108,42 @@ dumpregs(int force)
|
|||||||
if (indump || (!force && !dump_on_exit))
|
if (indump || (!force && !dump_on_exit))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
x808x_log("EIP=%08X CS=%04X DS=%04X ES=%04X SS=%04X FLAGS=%04X\n",
|
x86_log("EIP=%08X CS=%04X DS=%04X ES=%04X SS=%04X FLAGS=%04X\n",
|
||||||
cpu_state.pc, CS, DS, ES, SS, cpu_state.flags);
|
cpu_state.pc, CS, DS, ES, SS, cpu_state.flags);
|
||||||
x808x_log("Old CS:EIP: %04X:%08X; %i ins\n", oldcs, cpu_state.oldpc, ins);
|
x85_log("Old CS:EIP: %04X:%08X; %i ins\n", oldcs, cpu_state.oldpc, ins);
|
||||||
for (c = 0; c < 4; c++) {
|
for (c = 0; c < 4; c++) {
|
||||||
x808x_log("%s : base=%06X limit=%08X access=%02X limit_low=%08X limit_high=%08X\n",
|
x86_log("%s : base=%06X limit=%08X access=%02X limit_low=%08X limit_high=%08X\n",
|
||||||
seg_names[c], _opseg[c]->base, _opseg[c]->limit,
|
seg_names[c], _opseg[c]->base, _opseg[c]->limit,
|
||||||
_opseg[c]->access, _opseg[c]->limit_low, _opseg[c]->limit_high);
|
_opseg[c]->access, _opseg[c]->limit_low, _opseg[c]->limit_high);
|
||||||
}
|
}
|
||||||
if (is386) {
|
if (is386) {
|
||||||
x808x_log("FS : base=%06X limit=%08X access=%02X limit_low=%08X limit_high=%08X\n",
|
x86_log("FS : base=%06X limit=%08X access=%02X limit_low=%08X limit_high=%08X\n",
|
||||||
seg_fs, cpu_state.seg_fs.limit, cpu_state.seg_fs.access, cpu_state.seg_fs.limit_low, cpu_state.seg_fs.limit_high);
|
seg_fs, cpu_state.seg_fs.limit, cpu_state.seg_fs.access, cpu_state.seg_fs.limit_low,
|
||||||
x808x_log("GS : base=%06X limit=%08X access=%02X limit_low=%08X limit_high=%08X\n",
|
cpu_state.seg_fs.limit_high);
|
||||||
gs, cpu_state.seg_gs.limit, cpu_state.seg_gs.access, cpu_state.seg_gs.limit_low, cpu_state.seg_gs.limit_high);
|
x86_log("GS : base=%06X limit=%08X access=%02X limit_low=%08X limit_high=%08X\n",
|
||||||
x808x_log("GDT : base=%06X limit=%04X\n", gdt.base, gdt.limit);
|
gs, cpu_state.seg_gs.limit, cpu_state.seg_gs.access, cpu_state.seg_gs.limit_low,
|
||||||
x808x_log("LDT : base=%06X limit=%04X\n", ldt.base, ldt.limit);
|
cpu_state.seg_gs.limit_high);
|
||||||
x808x_log("IDT : base=%06X limit=%04X\n", idt.base, idt.limit);
|
x86_log("GDT : base=%06X limit=%04X\n", gdt.base, gdt.limit);
|
||||||
x808x_log("TR : base=%06X limit=%04X\n", tr.base, tr.limit);
|
x86_log("LDT : base=%06X limit=%04X\n", ldt.base, ldt.limit);
|
||||||
x808x_log("386 in %s mode: %i-bit data, %-i-bit stack\n",
|
x86_log("IDT : base=%06X limit=%04X\n", idt.base, idt.limit);
|
||||||
(msw & 1) ? ((cpu_state.eflags & VM_FLAG) ? "V86" : "protected") : "real",
|
x86_log("TR : base=%06X limit=%04X\n", tr.base, tr.limit);
|
||||||
(use32) ? 32 : 16, (stack32) ? 32 : 16);
|
x86_log("386 in %s mode: %i-bit data, %-i-bit stack\n",
|
||||||
x808x_log("CR0=%08X CR2=%08X CR3=%08X CR4=%08x\n", cr0, cr2, cr3, cr4);
|
(msw & 1) ? ((cpu_state.eflags & VM_FLAG) ? "V86" : "protected") : "real",
|
||||||
x808x_log("EAX=%08X EBX=%08X ECX=%08X EDX=%08X\nEDI=%08X ESI=%08X EBP=%08X ESP=%08X\n",
|
(use32) ? 32 : 16, (stack32) ? 32 : 16);
|
||||||
EAX, EBX, ECX, EDX, EDI, ESI, EBP, ESP);
|
x86_log("CR0=%08X CR2=%08X CR3=%08X CR4=%08x\n", cr0, cr2, cr3, cr4);
|
||||||
|
x86_log("EAX=%08X EBX=%08X ECX=%08X EDX=%08X\nEDI=%08X ESI=%08X EBP=%08X ESP=%08X\n",
|
||||||
|
EAX, EBX, ECX, EDX, EDI, ESI, EBP, ESP);
|
||||||
} else {
|
} else {
|
||||||
x808x_log("808x/286 in %s mode\n", (msw & 1) ? "protected" : "real");
|
x86_log("808x/286 in %s mode\n", (msw & 1) ? "protected" : "real");
|
||||||
x808x_log("AX=%04X BX=%04X CX=%04X DX=%04X DI=%04X SI=%04X BP=%04X SP=%04X\n",
|
x86_log("AX=%04X BX=%04X CX=%04X DX=%04X DI=%04X SI=%04X BP=%04X SP=%04X\n",
|
||||||
AX, BX, CX, DX, DI, SI, BP, SP);
|
AX, BX, CX, DX, DI, SI, BP, SP);
|
||||||
}
|
}
|
||||||
x808x_log("Entries in readlookup : %i writelookup : %i\n", readlnum, writelnum);
|
x86_log("Entries in readlookup : %i writelookup : %i\n", readlnum, writelnum);
|
||||||
x87_dumpregs();
|
x87_dumpregs();
|
||||||
indump = 0;
|
indump = 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
# define x808x_log(fmt, ...)
|
# define x86_log(fmt, ...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Preparation of the various arrays needed to speed up the MOD and R/M work. */
|
/* Preparation of the various arrays needed to speed up the MOD and R/M work. */
|
||||||
@@ -192,9 +194,9 @@ makeznptable(void)
|
|||||||
znptable8[c] = 0;
|
znptable8[c] = 0;
|
||||||
else
|
else
|
||||||
znptable8[c] = P_FLAG;
|
znptable8[c] = P_FLAG;
|
||||||
#ifdef ENABLE_808X_LOG
|
#ifdef ENABLE_X86_LOG
|
||||||
if (c == 0xb1)
|
if (c == 0xb1)
|
||||||
x808x_log("znp8 b1 = %i %02X\n", d, znptable8[c]);
|
x86_log("znp8 b1 = %i %02X\n", d, znptable8[c]);
|
||||||
#endif
|
#endif
|
||||||
if (!c)
|
if (!c)
|
||||||
znptable8[c] |= Z_FLAG;
|
znptable8[c] |= Z_FLAG;
|
||||||
@@ -212,11 +214,11 @@ makeznptable(void)
|
|||||||
znptable16[c] = 0;
|
znptable16[c] = 0;
|
||||||
else
|
else
|
||||||
znptable16[c] = P_FLAG;
|
znptable16[c] = P_FLAG;
|
||||||
#ifdef ENABLE_808X_LOG
|
#ifdef ENABLE_X86_LOG
|
||||||
if (c == 0xb1)
|
if (c == 0xb1)
|
||||||
x808x_log("znp16 b1 = %i %02X\n", d, znptable16[c]);
|
x86_log("znp16 b1 = %i %02X\n", d, znptable16[c]);
|
||||||
if (c == 0x65b1)
|
if (c == 0x65b1)
|
||||||
x808x_log("znp16 65b1 = %i %02X\n", d, znptable16[c]);
|
x86_log("znp16 65b1 = %i %02X\n", d, znptable16[c]);
|
||||||
#endif
|
#endif
|
||||||
if (!c)
|
if (!c)
|
||||||
znptable16[c] |= Z_FLAG;
|
znptable16[c] |= Z_FLAG;
|
||||||
@@ -229,9 +231,9 @@ makeznptable(void)
|
|||||||
static void
|
static void
|
||||||
reset_common(int hard)
|
reset_common(int hard)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_808X_LOG
|
#ifdef ENABLE_X86_LOG
|
||||||
if (hard)
|
if (hard)
|
||||||
x808x_log("x86 reset\n");
|
x86_log("x86 reset\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!hard && reset_on_hlt) {
|
if (!hard && reset_on_hlt) {
|
||||||
|
Reference in New Issue
Block a user