more printd
This commit is contained in:
parent
570ca380ab
commit
c63db4df26
@ -1,6 +1,6 @@
|
||||
$OpenBSD: patch-cpu_access_cc,v 1.1 2001/02/02 16:59:06 todd Exp $
|
||||
$OpenBSD: patch-cpu_access_cc,v 1.2 2001/03/30 18:53:25 todd Exp $
|
||||
--- cpu/access.cc.orig Sat Mar 25 21:39:07 2000
|
||||
+++ cpu/access.cc Tue Oct 31 12:48:34 2000
|
||||
+++ cpu/access.cc Fri Mar 30 11:16:57 2001
|
||||
@@ -39,18 +39,18 @@ BX_CPU_C::write_virtual_checks(bx_segmen
|
||||
|
||||
if ( protected_mode() ) {
|
||||
@ -10,11 +10,11 @@ $OpenBSD: patch-cpu_access_cc,v 1.1 2001/02/02 16:59:06 todd Exp $
|
||||
- bx_printf("write_virtual_checks: valid bit = 0\n");
|
||||
-bx_printf("CS: %04x\n", (unsigned) BX_CPU_THIS_PTR sregs[1].selector.value);
|
||||
-bx_printf("IP: %04x\n", (unsigned) BX_CPU_THIS_PTR prev_eip);
|
||||
+ bio->printf("[CPU%u] seg = %s\n", BX_CPU_THIS_PTR strseg(seg), BX_SIM_ID);
|
||||
+ bio->printf("[CPU%u] seg->selector.value = %04x\n", BX_SIM_ID, (unsigned) seg->selector.value);
|
||||
+ bio->printf("[CPU%u] write_virtual_checks: valid bit = 0\n", BX_SIM_ID);
|
||||
+bio->printf("[CPU%u] CS: %04x\n", BX_SIM_ID, (unsigned) BX_CPU_THIS_PTR sregs[1].selector.value);
|
||||
+bio->printf("[CPU%u] IP: %04x\n", BX_SIM_ID, (unsigned) BX_CPU_THIS_PTR prev_eip);
|
||||
+ bio->printd("[CPU%u] seg = %s\n", BX_SIM_ID, BX_CPU_THIS_PTR strseg(seg));
|
||||
+ bio->printd("[CPU%u] seg->selector.value = %04x\n", BX_SIM_ID, (unsigned) seg->selector.value);
|
||||
+ bio->printd("[CPU%u] write_virtual_checks: valid bit = 0\n", BX_SIM_ID);
|
||||
+bio->printd("[CPU%u] CS: %04x\n", BX_SIM_ID, (unsigned) BX_CPU_THIS_PTR sregs[1].selector.value);
|
||||
+bio->printd("[CPU%u] IP: %04x\n", BX_SIM_ID, (unsigned) BX_CPU_THIS_PTR prev_eip);
|
||||
debug(BX_CPU_THIS_PTR eip);
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
return;
|
||||
@ -22,7 +22,7 @@ $OpenBSD: patch-cpu_access_cc,v 1.1 2001/02/02 16:59:06 todd Exp $
|
||||
|
||||
if (seg->cache.p == 0) { /* not present */
|
||||
-bx_printf("write_virtual_checks(): segment not present\n");
|
||||
+bio->printf("[CPU%u] write_virtual_checks(): segment not present\n", BX_SIM_ID);
|
||||
+bio->printd("[CPU%u] write_virtual_checks(): segment not present\n", BX_SIM_ID);
|
||||
exception(int_number(seg), 0, 0);
|
||||
return;
|
||||
}
|
||||
@ -31,14 +31,14 @@ $OpenBSD: patch-cpu_access_cc,v 1.1 2001/02/02 16:59:06 todd Exp $
|
||||
case 12: case 13: // execute only, conforming
|
||||
case 14: case 15: // execute/read-only, conforming
|
||||
-bx_printf("write_virtual_checks(): no write access to seg\n");
|
||||
+bio->printf("[CPU%u] write_virtual_checks(): no write access to seg\n", BX_SIM_ID);
|
||||
+bio->printd("[CPU%u] write_virtual_checks(): no write access to seg\n", BX_SIM_ID);
|
||||
exception(int_number(seg), 0, 0);
|
||||
return;
|
||||
|
||||
case 2: case 3: /* read/write */
|
||||
if ( (offset+length-1) > seg->cache.u.segment.limit_scaled ) {
|
||||
-bx_printf("write_virtual_checks(): write beyond limit, r/w\n");
|
||||
+bio->printf("[CPU%u] write_virtual_checks(): write beyond limit, r/w\n", BX_SIM_ID);
|
||||
+bio->printd("[CPU%u] write_virtual_checks(): write beyond limit, r/w\n", BX_SIM_ID);
|
||||
exception(int_number(seg), 0, 0);
|
||||
return;
|
||||
}
|
||||
@ -47,7 +47,7 @@ $OpenBSD: patch-cpu_access_cc,v 1.1 2001/02/02 16:59:06 todd Exp $
|
||||
(offset > upper_limit) ||
|
||||
((upper_limit - offset) < (length - 1)) ) {
|
||||
-bx_printf("write_virtual_checks(): write beyond limit, r/w ED\n");
|
||||
+bio->printf("[CPU%] write_virtual_checks(): write beyond limit, r/w ED\n", BX_SIM_ID);
|
||||
+bio->printd("[CPU%] write_virtual_checks(): write beyond limit, r/w ED\n", BX_SIM_ID);
|
||||
exception(int_number(seg), 0, 0);
|
||||
return;
|
||||
}
|
||||
@ -56,7 +56,7 @@ $OpenBSD: patch-cpu_access_cc,v 1.1 2001/02/02 16:59:06 todd Exp $
|
||||
else { /* real mode */
|
||||
if ( (offset + length - 1) > seg->cache.u.segment.limit_scaled) {
|
||||
- //bx_printf("write_virtual_checks() SEG EXCEPTION: %x:%x + %x\n",
|
||||
+ //bio->printf("[CPU%u] write_virtual_checks() SEG EXCEPTION: %x:%x + %x\n", BX_SIM_ID,
|
||||
+ //bio->printd("[CPU%u] write_virtual_checks() SEG EXCEPTION: %x:%x + %x\n", BX_SIM_ID,
|
||||
// (unsigned) seg->selector.value, (unsigned) offset, (unsigned) length);
|
||||
if (seg == & BX_CPU_THIS_PTR sregs[2]) exception(BX_SS_EXCEPTION, 0, 0);
|
||||
else exception(BX_GP_EXCEPTION, 0, 0);
|
||||
@ -68,13 +68,13 @@ $OpenBSD: patch-cpu_access_cc,v 1.1 2001/02/02 16:59:06 todd Exp $
|
||||
- bx_printf("seg->selector.value = %04x\n", (unsigned) seg->selector.value);
|
||||
- //bx_printf("read_virtual_checks: valid bit = 0\n");
|
||||
- //bx_printf("CS: %04x\n", (unsigned)
|
||||
+ bio->printf("[CPU%u] seg = %s\n", BX_CPU_THIS_PTR strseg(seg), BX_SIM_ID);
|
||||
+ bio->printf("[CPU%u] seg->selector.value = %04x\n", BX_SIM_ID, (unsigned) seg->selector.value);
|
||||
+ //bio->printf("[CPU%u] read_virtual_checks: valid bit = 0\n", BX_SIM_ID);
|
||||
+ //bio->printf("[CPU%u] CS: %04x\n", BX_SIM_ID, (unsigned)
|
||||
+ bio->printd("[CPU%u] seg = %s\n", BX_CPU_THIS_PTR strseg(seg), BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] seg->selector.value = %04x\n", BX_SIM_ID, (unsigned) seg->selector.value);
|
||||
+ //bio->printd("[CPU%u] read_virtual_checks: valid bit = 0\n", BX_SIM_ID);
|
||||
+ //bio->printd("[CPU%u] CS: %04x\n", BX_SIM_ID, (unsigned)
|
||||
// BX_CPU_THIS_PTR sregs[1].selector.value);
|
||||
- //bx_printf("IP: %04x\n", (unsigned) BX_CPU_THIS_PTR prev_eip);
|
||||
+ //bio->printf("[CPU%u] IP: %04x\n", BX_SIM_ID, (unsigned) BX_CPU_THIS_PTR prev_eip);
|
||||
+ //bio->printd("[CPU%u] IP: %04x\n", BX_SIM_ID, (unsigned) BX_CPU_THIS_PTR prev_eip);
|
||||
//debug(BX_CPU_THIS_PTR eip);
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
return;
|
||||
@ -82,7 +82,7 @@ $OpenBSD: patch-cpu_access_cc,v 1.1 2001/02/02 16:59:06 todd Exp $
|
||||
|
||||
if (seg->cache.p == 0) { /* not present */
|
||||
-bx_printf("read_virtual_checks(): segment not present\n");
|
||||
+bio->printf("[CPU%u] read_virtual_checks(): segment not present\n", BX_SIM_ID);
|
||||
+bio->printd("[CPU%u] read_virtual_checks(): segment not present\n", BX_SIM_ID);
|
||||
exception(int_number(seg), 0, 0);
|
||||
return;
|
||||
}
|
||||
@ -91,7 +91,7 @@ $OpenBSD: patch-cpu_access_cc,v 1.1 2001/02/02 16:59:06 todd Exp $
|
||||
case 14: case 15: /* execute/read-only, conforming */
|
||||
if ( (offset+length-1) > seg->cache.u.segment.limit_scaled ) {
|
||||
-bx_printf("read_virtual_checks(): write beyond limit\n");
|
||||
+bio->printf("[CPU%u] read_virtual_checks(): write beyond limit\n", BX_SIM_ID);
|
||||
+bio->printd("[CPU%u] read_virtual_checks(): write beyond limit\n", BX_SIM_ID);
|
||||
exception(int_number(seg), 0, 0);
|
||||
return;
|
||||
}
|
||||
@ -100,7 +100,7 @@ $OpenBSD: patch-cpu_access_cc,v 1.1 2001/02/02 16:59:06 todd Exp $
|
||||
case 2: case 3: /* read/write */
|
||||
if ( (offset+length-1) > seg->cache.u.segment.limit_scaled ) {
|
||||
-bx_printf("read_virtual_checks(): write beyond limit\n");
|
||||
+bio->printf("[CPU%u] read_virtual_checks(): write beyond limit\n", BX_SIM_ID);
|
||||
+bio->printd("[CPU%u] read_virtual_checks(): write beyond limit\n", BX_SIM_ID);
|
||||
exception(int_number(seg), 0, 0);
|
||||
return;
|
||||
}
|
||||
@ -109,7 +109,7 @@ $OpenBSD: patch-cpu_access_cc,v 1.1 2001/02/02 16:59:06 todd Exp $
|
||||
(offset > upper_limit) ||
|
||||
((upper_limit - offset) < (length - 1)) ) {
|
||||
-bx_printf("read_virtual_checks(): write beyond limit\n");
|
||||
+bio->printf("[CPU%u] read_virtual_checks(): write beyond limit\n", BX_SIM_ID);
|
||||
+bio->printd("[CPU%u] read_virtual_checks(): write beyond limit\n", BX_SIM_ID);
|
||||
exception(int_number(seg), 0, 0);
|
||||
return;
|
||||
}
|
||||
@ -118,7 +118,7 @@ $OpenBSD: patch-cpu_access_cc,v 1.1 2001/02/02 16:59:06 todd Exp $
|
||||
(offset > upper_limit) ||
|
||||
((upper_limit - offset) < (length - 1)) ) {
|
||||
-bx_printf("read_virtual_checks(): write beyond limit\n");
|
||||
+bio->printf("[CPU%u] read_virtual_checks(): write beyond limit\n", BX_SIM_ID);
|
||||
+bio->printd("[CPU%u] read_virtual_checks(): write beyond limit\n", BX_SIM_ID);
|
||||
exception(int_number(seg), 0, 0);
|
||||
return;
|
||||
}
|
||||
@ -127,7 +127,7 @@ $OpenBSD: patch-cpu_access_cc,v 1.1 2001/02/02 16:59:06 todd Exp $
|
||||
case 12: case 13: /* execute only, conforming */
|
||||
/* can't read or write an execute-only segment */
|
||||
-bx_printf("read_virtual_checks(): execute only\n");
|
||||
+bio->printf("[CPU%u] read_virtual_checks(): execute only\n", BX_SIM_ID);
|
||||
+bio->printd("[CPU%u] read_virtual_checks(): execute only\n", BX_SIM_ID);
|
||||
exception(int_number(seg), 0, 0);
|
||||
return;
|
||||
break;
|
||||
@ -136,7 +136,7 @@ $OpenBSD: patch-cpu_access_cc,v 1.1 2001/02/02 16:59:06 todd Exp $
|
||||
else { /* real mode */
|
||||
if ( (offset + length - 1) > seg->cache.u.segment.limit_scaled) {
|
||||
- //bx_printf("read_virtual_checks() SEG EXCEPTION: %x:%x + %x\n",
|
||||
+ //bio->printf("[CPU%u] read_virtual_checks() SEG EXCEPTION: %x:%x + %x\n", BX_SIM_ID,
|
||||
+ //bio->printd("[CPU%u] read_virtual_checks() SEG EXCEPTION: %x:%x + %x\n", BX_SIM_ID,
|
||||
// (unsigned) seg->selector.value, (unsigned) offset, (unsigned) length);
|
||||
if (seg == & BX_CPU_THIS_PTR sregs[2]) exception(BX_SS_EXCEPTION, 0, 0);
|
||||
else exception(BX_GP_EXCEPTION, 0, 0);
|
||||
@ -145,7 +145,7 @@ $OpenBSD: patch-cpu_access_cc,v 1.1 2001/02/02 16:59:06 todd Exp $
|
||||
else if (seg == &BX_CPU_THIS_PTR sregs[5]) return("GS");
|
||||
else {
|
||||
- bx_printf("undefined segment passed to strseg()!\n");
|
||||
+ bio->printf("[CPU%u] undefined segment passed to strseg()!\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] undefined segment passed to strseg()!\n", BX_SIM_ID);
|
||||
return("??");
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
$OpenBSD: patch-cpu_ctrl_xfer32_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
$OpenBSD: patch-cpu_ctrl_xfer32_cc,v 1.2 2001/03/30 18:53:25 todd Exp $
|
||||
--- cpu/ctrl_xfer32.cc.orig Sat Mar 25 21:39:07 2000
|
||||
+++ cpu/ctrl_xfer32.cc Tue Oct 31 12:52:03 2000
|
||||
+++ cpu/ctrl_xfer32.cc Fri Mar 30 11:34:57 2001
|
||||
@@ -52,7 +52,7 @@ BX_CPU_C::RETnear32_Iw(BxInstruction_t *
|
||||
|
||||
if (protected_mode()) {
|
||||
@ -15,7 +15,7 @@ $OpenBSD: patch-cpu_ctrl_xfer32_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
if (protected_mode() &&
|
||||
(return_EIP > BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.limit_scaled) ) {
|
||||
- bx_panic("retnear_iw: EIP > limit\n");
|
||||
+ bio->printf("[CPU%u] retnear_iw: EIP(0x%x) > limit(0x%x)\n", BX_SIM_ID,
|
||||
+ bio->printd("[CPU%u] retnear_iw: EIP(0x%x) > limit(0x%x)\n", BX_SIM_ID,
|
||||
+ return_EIP, BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.limit_scaled);
|
||||
+ exception(BX_GP_EXCEPTION, 0, 0);
|
||||
}
|
||||
@ -42,7 +42,7 @@ $OpenBSD: patch-cpu_ctrl_xfer32_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
if ( return_EIP > BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.limit_scaled ) {
|
||||
- bx_panic("retnear: EIP > limit\n");
|
||||
- //exception(BX_GP_EXCEPTION, 0, 0);
|
||||
+ bio->printf("[CPU%u] retnear: EIP(0x%x) > limit(0x%x)\n", BX_SIM_ID,
|
||||
+ bio->printd("[CPU%u] retnear: EIP(0x%x) > limit(0x%x)\n", BX_SIM_ID,
|
||||
+ return_EIP,
|
||||
+ BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.limit_scaled);
|
||||
+ exception(BX_GP_EXCEPTION, 0, 0);
|
||||
@ -54,7 +54,7 @@ $OpenBSD: patch-cpu_ctrl_xfer32_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
if ( protected_mode() ) {
|
||||
if ( new_EIP > BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.limit_scaled ) {
|
||||
- bx_panic("call_av: offset outside of CS limits\n");
|
||||
+ bio->panic("call_av: offset outside of CS limits\n");
|
||||
+ bio->printd("call_av: offset outside of CS limits\n");
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
}
|
||||
}
|
||||
@ -63,7 +63,7 @@ $OpenBSD: patch-cpu_ctrl_xfer32_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
if (protected_mode()) {
|
||||
if (op1_32 > BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.limit_scaled) {
|
||||
- bx_panic("call_ev: EIP out of CS limits!\n");
|
||||
+ bio->printf("[CPU%u] call_ev: EIP(0x%x) out of CS limits(0x%x)!\n", BX_SIM_ID,
|
||||
+ bio->printd("[CPU%u] call_ev: EIP(0x%x) out of CS limits(0x%x)!\n", BX_SIM_ID,
|
||||
+ op1_32,
|
||||
+ BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.limit_scaled);
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
@ -88,7 +88,7 @@ $OpenBSD: patch-cpu_ctrl_xfer32_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
if (protected_mode()) {
|
||||
if ( new_EIP > BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.limit_scaled ) {
|
||||
- bx_panic("jmp_jv: offset outside of CS limits\n");
|
||||
+ bio->panic("jmp_jv: offset outside of CS limits\n");
|
||||
+ bio->printd("jmp_jv: offset outside of CS limits\n");
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
}
|
||||
}
|
||||
@ -97,7 +97,7 @@ $OpenBSD: patch-cpu_ctrl_xfer32_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
if (protected_mode()) {
|
||||
if ( new_EIP > BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.limit_scaled ) {
|
||||
- bx_panic("jo_routine: offset outside of CS limits\n");
|
||||
+ bio->panic("jo_routine: offset outside of CS limits\n");
|
||||
+ bio->printd("jo_routine: offset outside of CS limits\n");
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
}
|
||||
}
|
||||
@ -106,7 +106,7 @@ $OpenBSD: patch-cpu_ctrl_xfer32_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
if (protected_mode()) {
|
||||
if (new_EIP > BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.limit_scaled) {
|
||||
- bx_panic("jmp_ev: IP out of CS limits!\n");
|
||||
+ bio->panic("jmp_ev: IP out of CS limits!\n");
|
||||
+ bio->printd("jmp_ev: IP out of CS limits!\n");
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
$OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
$OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.2 2001/03/30 18:53:25 todd Exp $
|
||||
--- cpu/ctrl_xfer_pro.cc.orig Sat Mar 25 21:39:07 2000
|
||||
+++ cpu/ctrl_xfer_pro.cc Tue Oct 31 13:01:30 2000
|
||||
+++ cpu/ctrl_xfer_pro.cc Fri Mar 30 11:05:29 2001
|
||||
@@ -40,7 +40,7 @@ BX_CPU_C::jump_protected(BxInstruction_t
|
||||
|
||||
/* destination selector is not null else #GP(0) */
|
||||
@ -15,7 +15,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
if ( descriptor.segment ) {
|
||||
if ( descriptor.u.segment.executable==0 ) {
|
||||
- bx_printf("jump_protected: S=1: descriptor not executable\n");
|
||||
+ bio->printf("[CPU%u] jump_protected: S=1: descriptor not executable\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] jump_protected: S=1: descriptor not executable\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, cs_raw & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -24,7 +24,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
// descripor DPL must be <= CPL else #GP(selector)
|
||||
if (descriptor.dpl > CPL) {
|
||||
- bx_printf("jump_protected: dpl > CPL\n");
|
||||
+ bio->printf("[CPU%u] jump_protected: dpl > CPL\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] jump_protected: dpl > CPL\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, cs_raw & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -32,7 +32,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
/* segment must be PRESENT else #NP(selector) */
|
||||
if (descriptor.p == 0) {
|
||||
- bx_printf("jump_protected: p == 0\n");
|
||||
+ bio->printf("[CPU%u] jump_protected: p == 0\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] jump_protected: p == 0\n", BX_SIM_ID);
|
||||
exception(BX_NP_EXCEPTION, cs_raw & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -57,7 +57,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
// descriptor DPL must = CPL else #GP(selector)
|
||||
if (descriptor.dpl != CPL) {
|
||||
- bx_printf("jump_protected: dpl != CPL\n");
|
||||
+ bio->printf("[CPU%u] jump_protected: dpl != CPL\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] jump_protected: dpl != CPL\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, cs_raw & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -65,7 +65,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
/* segment must be PRESENT else #NP(selector) */
|
||||
if (descriptor.p == 0) {
|
||||
- bx_printf("jump_protected: p == 0\n");
|
||||
+ bio->printf("[CPU%u] jump_protected: p == 0\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] jump_protected: p == 0\n", BX_SIM_ID);
|
||||
exception(BX_NP_EXCEPTION, cs_raw & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -91,10 +91,10 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
case 9: // 386 available TSS
|
||||
//if ( descriptor.type==1 )
|
||||
- // bx_printf("jump to 286 TSS\n");
|
||||
+ // bio->printf("[CPU%u] jump to 286 TSS\n", BX_SIM_ID);
|
||||
+ // bio->printd("[CPU%u] jump to 286 TSS\n", BX_SIM_ID);
|
||||
//else
|
||||
- // bx_printf("jump to 386 TSS\n");
|
||||
+ // bio->printf("[CPU%u] jump to 386 TSS\n", BX_SIM_ID);
|
||||
+ // bio->printd("[CPU%u] jump to 386 TSS\n", BX_SIM_ID);
|
||||
|
||||
// TSS DPL must be >= CPL, else #GP(TSS selector)
|
||||
if (descriptor.dpl < CPL) {
|
||||
@ -116,7 +116,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
// IP must be in code seg limit, else #GP(0)
|
||||
if (EIP > BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.limit_scaled) {
|
||||
- bx_printf("jump_protected: TSS.p == 0\n");
|
||||
+ bio->printf("[CPU%u] jump_protected: TSS.p == 0\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] jump_protected: TSS.p == 0\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
return;
|
||||
}
|
||||
@ -131,12 +131,12 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
|
||||
case 4: // 286 call gate
|
||||
- //bx_printf("jump_protected: JUMP TO 286 CALL GATE:\n");
|
||||
+ //bio->printf("[CPU%u] jump_protected: JUMP TO 286 CALL GATE:\n", BX_SIM_ID);
|
||||
+ //bio->printd("[CPU%u] jump_protected: JUMP TO 286 CALL GATE:\n", BX_SIM_ID);
|
||||
|
||||
// descriptor DPL must be >= CPL else #GP(gate selector)
|
||||
if (descriptor.dpl < CPL) {
|
||||
- bx_printf("jump_protected: gate.dpl < CPL\n");
|
||||
+ bio->printf("[CPU%u] jump_protected: gate.dpl < CPL\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] jump_protected: gate.dpl < CPL\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, cs_raw & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -144,7 +144,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
// descriptor DPL must be >= gate selector RPL else #GP(gate selector)
|
||||
if (descriptor.dpl < selector.rpl) {
|
||||
- bx_printf("jump_protected: gate.dpl < selector.rpl\n");
|
||||
+ bio->printf("[CPU%u] jump_protected: gate.dpl < selector.rpl\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] jump_protected: gate.dpl < selector.rpl\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, cs_raw & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -170,7 +170,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
(gate_cs_descriptor.segment==0) ||
|
||||
(gate_cs_descriptor.u.segment.executable==0) ) {
|
||||
- bx_printf("jump_protected: AR byte: not code segment.\n");
|
||||
+ bio->printf("[CPU%u] jump_protected: AR byte: not code segment.\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] jump_protected: AR byte: not code segment.\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, gate_cs_raw & 0xfffc, 0);
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
if (gate_cs_descriptor.u.segment.c_ed==0) {
|
||||
if (gate_cs_descriptor.dpl != CPL) {
|
||||
- bx_printf("jump_protected: non-conform: code seg des DPL != CPL.\n");
|
||||
+ bio->printf("[CPU%u] jump_protected: non-conform: code seg des DPL != CPL.\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] jump_protected: non-conform: code seg des DPL != CPL.\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, gate_cs_raw & 0xfffc, 0);
|
||||
}
|
||||
}
|
||||
@ -186,7 +186,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
else {
|
||||
if (gate_cs_descriptor.dpl > CPL) {
|
||||
- bx_printf("jump_protected: conform: code seg des DPL > CPL.\n");
|
||||
+ bio->printf("[CPU%u] jump_protected: conform: code seg des DPL > CPL.\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] jump_protected: conform: code seg des DPL > CPL.\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, gate_cs_raw & 0xfffc, 0);
|
||||
}
|
||||
}
|
||||
@ -194,7 +194,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
// code segment must be present else #NP(CS selector)
|
||||
if (gate_cs_descriptor.p==0) {
|
||||
- bx_printf("jump_protected: code seg not present.\n");
|
||||
+ bio->printf("[CPU%u] jump_protected: code seg not present.\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] jump_protected: code seg not present.\n", BX_SIM_ID);
|
||||
exception(BX_NP_EXCEPTION, gate_cs_raw & 0xfffc, 0);
|
||||
}
|
||||
|
||||
@ -211,7 +211,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
|
||||
case 5: // task gate
|
||||
-//bx_printf("jump_pro: task gate\n");
|
||||
+//bio->printf("[CPU%u] jump_pro: task gate\n", BX_SIM_ID);
|
||||
+//bio->printd("[CPU%u] jump_pro: task gate\n", BX_SIM_ID);
|
||||
|
||||
// gate descriptor DPL must be >= CPL else #GP(gate selector)
|
||||
if (descriptor.dpl < CPL) {
|
||||
@ -251,12 +251,12 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
parse_descriptor(dword1, dword2, &tss_descriptor);
|
||||
if (tss_descriptor.valid==0 || tss_descriptor.segment) {
|
||||
- bx_printf("jump_protected: TSS selector points to bad TSS\n");
|
||||
+ bio->printf("[CPU%u] jump_protected: TSS selector points to bad TSS\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] jump_protected: TSS selector points to bad TSS\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, raw_tss_selector & 0xfffc, 0);
|
||||
}
|
||||
if (tss_descriptor.type!=9 && tss_descriptor.type!=1) {
|
||||
- bx_printf("jump_protected: TSS selector points to bad TSS\n");
|
||||
+ bio->printf("[CPU%u] jump_protected: TSS selector points to bad TSS\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] jump_protected: TSS selector points to bad TSS\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, raw_tss_selector & 0xfffc, 0);
|
||||
}
|
||||
|
||||
@ -287,7 +287,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
|
||||
case 12: // 386 call gate
|
||||
- //bx_printf("jump_protected: JUMP TO 386 CALL GATE:\n");
|
||||
+ //bio->printf("[CPU%u] jump_protected: JUMP TO 386 CALL GATE:\n", BX_SIM_ID);
|
||||
+ //bio->printd("[CPU%u] jump_protected: JUMP TO 386 CALL GATE:\n", BX_SIM_ID);
|
||||
|
||||
// descriptor DPL must be >= CPL else #GP(gate selector)
|
||||
if (descriptor.dpl < CPL) {
|
||||
@ -367,7 +367,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
|
||||
default:
|
||||
- bx_printf("jump_protected: gate type %u unsupported\n",
|
||||
+ bio->printf("[CPU%u] jump_protected: gate type %u unsupported\n", BX_SIM_ID,
|
||||
+ bio->printd("[CPU%u] jump_protected: gate type %u unsupported\n", BX_SIM_ID,
|
||||
(unsigned) descriptor.type);
|
||||
exception(BX_GP_EXCEPTION, cs_raw & 0xfffc, 0);
|
||||
return;
|
||||
@ -376,7 +376,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
/* new cs selector must not be null, else #GP(0) */
|
||||
if ( (cs_raw & 0xfffc) == 0 ) {
|
||||
- bx_panic("call_protected: CS selector null\n");
|
||||
+ bio->panic("call_protected: CS selector null\n");
|
||||
+ bio->printd("call_protected: CS selector null\n");
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
}
|
||||
|
||||
@ -385,7 +385,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
// examine AR byte of selected descriptor for various legal values
|
||||
if (cs_descriptor.valid==0) {
|
||||
- bx_panic("call_protected: invalid CS descriptor\n");
|
||||
+ bio->panic("call_protected: invalid CS descriptor\n");
|
||||
+ bio->printd("call_protected: invalid CS descriptor\n");
|
||||
exception(BX_GP_EXCEPTION, cs_raw & 0xfffc, 0);
|
||||
}
|
||||
|
||||
@ -394,7 +394,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
|
||||
if (cs_descriptor.u.segment.executable==0) {
|
||||
- bx_panic("call_protected: non executable segment\n");
|
||||
+ bio->panic("call_protected: non executable segment\n");
|
||||
+ bio->printd("call_protected: non executable segment\n");
|
||||
exception(BX_GP_EXCEPTION, cs_raw & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -403,7 +403,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
// DPL must be <= CPL, else #GP(code seg selector)
|
||||
if (cs_descriptor.dpl > CPL) {
|
||||
- bx_panic("call_protected: cs.dpl > CPL\n");
|
||||
+ bio->panic("call_protected: cs.dpl > CPL\n");
|
||||
+ bio->printd("call_protected: cs.dpl > CPL\n");
|
||||
exception(BX_GP_EXCEPTION, cs_raw & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -412,7 +412,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
if ( (cs_selector.rpl > CPL) ||
|
||||
(cs_descriptor.dpl != CPL) ) {
|
||||
- bx_panic("call_protected: cs.rpl > CPL\n");
|
||||
+ bio->panic("call_protected: cs.rpl > CPL\n");
|
||||
+ bio->printd("call_protected: cs.rpl > CPL\n");
|
||||
exception(BX_GP_EXCEPTION, cs_raw & 0xfffc, 0);
|
||||
}
|
||||
}
|
||||
@ -420,7 +420,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
// segment must be present, else #NP(code seg selector)
|
||||
if (cs_descriptor.p == 0) {
|
||||
- bx_printf("call_protected: cs.p = 0\n");
|
||||
+ bio->printf("[CPU%u] call_protected: cs.p = 0\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] call_protected: cs.p = 0\n", BX_SIM_ID);
|
||||
exception(BX_NP_EXCEPTION, cs_raw & 0xfffc, 0);
|
||||
}
|
||||
|
||||
@ -456,15 +456,18 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
}
|
||||
|
||||
@@ -578,20 +578,20 @@ BX_CPU_C::call_protected(BxInstruction_t
|
||||
@@ -577,21 +577,21 @@ BX_CPU_C::call_protected(BxInstruction_t
|
||||
switch (gate_descriptor.type) {
|
||||
case 1: // available 16bit TSS
|
||||
case 9: // available 32bit TSS
|
||||
//if (gate_descriptor.type==1)
|
||||
- //if (gate_descriptor.type==1)
|
||||
- // bx_printf("call_protected: 16bit available TSS\n");
|
||||
+ // bio->printf("[CPU%u] call_protected: 16bit available TSS\n", BX_SIM_ID);
|
||||
//else
|
||||
- //else
|
||||
- // bx_printf("call_protected: 32bit available TSS\n");
|
||||
+ // bio->printf("[CPU%u] call_protected: 32bit available TSS\n", BX_SIM_ID);
|
||||
+ if (gate_descriptor.type==1)
|
||||
+ bio->printd("[CPU%u] call_protected: 16bit available TSS\n", BX_SIM_ID);
|
||||
+ else
|
||||
+ bio->printd("[CPU%u] call_protected: 32bit available TSS\n", BX_SIM_ID);
|
||||
|
||||
// TSS DPL must be >= CPL, else #TS(TSS selector)
|
||||
if (gate_descriptor.dpl < CPL) {
|
||||
@ -486,7 +489,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
// IP must be in code seg limit, else #TS(0)
|
||||
if (EIP > BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.limit_scaled) {
|
||||
- bx_printf("call_protected: TSS.p == 0\n");
|
||||
+ bio->printf("[CPU%u] call_protected: TSS.p == 0\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] call_protected: TSS.p == 0\n", BX_SIM_ID);
|
||||
exception(BX_TS_EXCEPTION, 0, 0);
|
||||
return;
|
||||
}
|
||||
@ -495,11 +498,11 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
|
||||
case 5: // TASK GATE
|
||||
- //bx_printf("call_protected: task gate\n");
|
||||
+ //bio->printf("[CPU%u] call_protected: task gate\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] call_protected: task gate\n", BX_SIM_ID);
|
||||
// gate descriptor DPL must be >= CPL else #TS(gate selector)
|
||||
if (gate_descriptor.dpl < CPL) {
|
||||
- bx_panic("call_protected: gate.dpl < CPL\n");
|
||||
+ bio->panic("call_protected: gate.dpl < CPL\n");
|
||||
+ bio->printd("call_protected: gate.dpl < CPL\n");
|
||||
exception(BX_TS_EXCEPTION, cs_raw & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -560,15 +563,18 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
exception(BX_TS_EXCEPTION, 0x0000, 0);
|
||||
}
|
||||
|
||||
@@ -694,21 +694,21 @@ BX_CPU_C::call_protected(BxInstruction_t
|
||||
@@ -693,22 +693,22 @@ BX_CPU_C::call_protected(BxInstruction_t
|
||||
|
||||
case 4: // 16bit CALL GATE
|
||||
case 12: // 32bit CALL GATE
|
||||
//if (gate_descriptor.type==4)
|
||||
-//if (gate_descriptor.type==4)
|
||||
-// bx_printf("CALL: 16bit call gate\n");
|
||||
+// bio->printf("[CPU%u] CALL: 16bit call gate\n", BX_SIM_ID);
|
||||
//else
|
||||
-//else
|
||||
-// bx_printf("CALL: 32bit call gate\n");
|
||||
+// bio->printf("[CPU%u] CALL: 32bit call gate\n", BX_SIM_ID);
|
||||
+if (gate_descriptor.type==4)
|
||||
+ bio->printd("[CPU%u] CALL: 16bit call gate\n", BX_SIM_ID);
|
||||
+else
|
||||
+ bio->printd("[CPU%u] CALL: 32bit call gate\n", BX_SIM_ID);
|
||||
|
||||
// call gate DPL must be >= CPL, else #GP(call gate selector)
|
||||
// call gate DPL must be >= RPL, else #GP(call gate selector)
|
||||
@ -609,7 +615,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
Bit32u temp_ESP;
|
||||
|
||||
-//bx_printf("CALL: Call Gate: to more priviliged level\n");
|
||||
+//bio->printf("[CPU%u] CALL: Call Gate: to more priviliged level\n", BX_SIM_ID);
|
||||
+bio->printd("[CPU%u] CALL: Call Gate: to more priviliged level\n", BX_SIM_ID);
|
||||
|
||||
// get new SS selector for new privilege level from TSS
|
||||
get_SS_ESP_from_TSS(cs_descriptor.dpl,
|
||||
@ -645,7 +651,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
ss_descriptor.u.segment.executable ||
|
||||
ss_descriptor.u.segment.r_w==0) {
|
||||
- bx_printf("call_protected: ss descriptor not writable data seg\n");
|
||||
+ bio->printf("[CPU%u] call_protected: ss descriptor not writable data seg\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] call_protected: ss descriptor not writable data seg\n", BX_SIM_ID);
|
||||
exception(BX_TS_EXCEPTION, SS_for_cpl_x & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -662,7 +668,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
|
||||
if ( !can_push(&ss_descriptor, ESP_for_cpl_x, room_needed) ) {
|
||||
- bx_printf("call_protected: stack doesn't have room\n");
|
||||
+ bio->printf("[CPU%u] call_protected: stack doesn't have room\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] call_protected: stack doesn't have room\n", BX_SIM_ID);
|
||||
exception(BX_SS_EXCEPTION, SS_for_cpl_x & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -679,7 +685,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
Bit32u temp_ESP;
|
||||
|
||||
-//bx_printf("CALL: Call Gate: to same priviliged level\n");
|
||||
+//bio->printf("[CPU%u] CALL: Call Gate: to same priviliged level\n", BX_SIM_ID);
|
||||
+bio->printd("[CPU%u] CALL: Call Gate: to same priviliged level\n", BX_SIM_ID);
|
||||
if (BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].cache.u.segment.d_b)
|
||||
temp_ESP = ESP;
|
||||
else
|
||||
@ -756,32 +762,36 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
if ( cs_selector.rpl < CPL ) {
|
||||
- bx_printf("return_protected: CS.rpl < CPL\n");
|
||||
- bx_printf(" CS.rpl=%u CPL=%u\n", (unsigned) cs_selector.rpl,
|
||||
+ bio->printf("[CPU%u] return_protected: CS.rpl < CPL\n", BX_SIM_ID);
|
||||
+ bio->printf("[CPU%u] CS.rpl=%u CPL=%u\n", BX_SIM_ID, (unsigned) cs_selector.rpl,
|
||||
+ bio->printd("[CPU%u] return_protected: CS.rpl < CPL\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] CS.rpl=%u CPL=%u\n", BX_SIM_ID, (unsigned) cs_selector.rpl,
|
||||
(unsigned) CPL);
|
||||
exception(BX_GP_EXCEPTION, raw_cs_selector & 0xfffc, 0);
|
||||
return;
|
||||
@@ -1089,12 +1089,12 @@ BX_CPU_C::return_protected(BxInstruction
|
||||
@@ -1089,13 +1089,13 @@ BX_CPU_C::return_protected(BxInstruction
|
||||
// if return selector RPL == CPL then
|
||||
// RETURN TO SAME LEVEL
|
||||
if ( cs_selector.rpl == CPL ) {
|
||||
- //bx_printf("return: to same level %04x:%08x\n",
|
||||
+ //bio->printf("[CPU%u] return: to same level %04x:%08x\n", BX_SIM_ID,
|
||||
// BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.value,
|
||||
// BX_CPU_THIS_PTR prev_eip);
|
||||
- // BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.value,
|
||||
- // BX_CPU_THIS_PTR prev_eip);
|
||||
+ bio->printd("[CPU%u] return: to same level %04x:%08x\n", BX_SIM_ID,
|
||||
+ BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.value,
|
||||
+ BX_CPU_THIS_PTR prev_eip);
|
||||
// return selector must be non-null, else #GP(0)
|
||||
if ( (raw_cs_selector & 0xfffc) == 0 ) {
|
||||
- bx_panic("return_protected: CS null\n");
|
||||
+ bio->panic("return_protected: CS null\n");
|
||||
/* #GP(0) */
|
||||
- /* #GP(0) */
|
||||
+ bio->printd("return_protected: CS null\n");
|
||||
+ exception(BX_GP_EXCEPTION, raw_cs_selector & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1109,14 +1109,14 @@ BX_CPU_C::return_protected(BxInstruction
|
||||
if (cs_descriptor.valid==0 ||
|
||||
cs_descriptor.segment==0 ||
|
||||
cs_descriptor.u.segment.executable==0) {
|
||||
- bx_printf("return_protected: same: AR byte not code\n");
|
||||
+ bio->printf("return_protected: same: AR byte not code\n");
|
||||
+ bio->printd("return_protected: same: AR byte not code\n");
|
||||
exception(BX_GP_EXCEPTION, raw_cs_selector & 0xfffc, 0);
|
||||
}
|
||||
|
||||
@ -798,14 +808,14 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
// else #GP(selector)
|
||||
if (cs_descriptor.u.segment.c_ed && (cs_descriptor.dpl>CPL)) {
|
||||
- bx_printf("return_protected: conforming, DPL>CPL\n");
|
||||
+ bio->printf("[CPU%u] return_protected: conforming, DPL>CPL\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] return_protected: conforming, DPL>CPL\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, raw_cs_selector & 0xfffc, 0);
|
||||
}
|
||||
|
||||
// code segment must be present, else #NP(selector)
|
||||
if (cs_descriptor.p==0) {
|
||||
- bx_printf("return_protected: not present\n");
|
||||
+ bio->printf("[CPU%u] return_protected: not present\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] return_protected: not present\n", BX_SIM_ID);
|
||||
exception(BX_NP_EXCEPTION, raw_cs_selector & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -831,7 +841,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
/* + 0: IP | + 0: EIP */
|
||||
|
||||
-//bx_printf("return: to outer level %04x:%08x\n",
|
||||
+//bio->printf("[CPU%u] return: to outer level %04x:%08x\n", BX_SIM_ID,
|
||||
+//bio->printd("[CPU%u] return: to outer level %04x:%08x\n", BX_SIM_ID,
|
||||
// BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.value,
|
||||
// BX_CPU_THIS_PTR prev_eip);
|
||||
|
||||
@ -910,7 +920,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
* else #GP(selector) */
|
||||
if (ss_selector.rpl != cs_selector.rpl) {
|
||||
- bx_printf("return_protected: ss.rpl != cs.rpl\n");
|
||||
+ bio->printf("[CPU%u] return_protected: ss.rpl != cs.rpl\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] return_protected: ss.rpl != cs.rpl\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, raw_ss_selector & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -958,7 +968,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
// TASK_RETURN:
|
||||
|
||||
- //bx_printf("IRET: nested task return\n");
|
||||
+ //bio->printf("[CPU%u] IRET: nested task return\n", BX_SIM_ID);
|
||||
+ //bio->printd("[CPU%u] IRET: nested task return\n", BX_SIM_ID);
|
||||
|
||||
if (BX_CPU_THIS_PTR tr.cache.valid==0)
|
||||
- bx_panic("IRET: TR not valid\n");
|
||||
@ -987,12 +997,12 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
parse_descriptor(dword1, dword2, &tss_descriptor);
|
||||
if (tss_descriptor.valid==0 || tss_descriptor.segment) {
|
||||
- bx_printf("iret: TSS selector points to bad TSS\n");
|
||||
+ bio->printf("[CPU%u] iret: TSS selector points to bad TSS\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] iret: TSS selector points to bad TSS\n", BX_SIM_ID);
|
||||
exception(BX_TS_EXCEPTION, raw_link_selector & 0xfffc, 0);
|
||||
}
|
||||
if ((tss_descriptor.type!=11) && (tss_descriptor.type!=3)) {
|
||||
- bx_printf("iret: TSS selector points to bad TSS\n");
|
||||
+ bio->printf("[CPU%u] iret: TSS selector points to bad TSS\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] iret: TSS selector points to bad TSS\n", BX_SIM_ID);
|
||||
exception(BX_TS_EXCEPTION, raw_link_selector & 0xfffc, 0);
|
||||
}
|
||||
|
||||
@ -1000,7 +1010,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
// TSS must be present, else #NP(new TSS selector)
|
||||
if (tss_descriptor.p==0) {
|
||||
- bx_printf("iret: task descriptor.p == 0\n");
|
||||
+ bio->printf("[CPU%u] iret: task descriptor.p == 0\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] iret: task descriptor.p == 0\n", BX_SIM_ID);
|
||||
exception(BX_NP_EXCEPTION, raw_link_selector & 0xfffc, 0);
|
||||
}
|
||||
|
||||
@ -1071,7 +1081,7 @@ $OpenBSD: patch-cpu_ctrl_xfer_pro_cc,v 1.1 2001/02/02 16:59:07 todd Exp $
|
||||
if ( cs_descriptor.u.segment.c_ed==0 &&
|
||||
cs_descriptor.dpl != cs_selector.rpl ) {
|
||||
- bx_printf("(mch) iret: Return with DPL != RPL. #GP(selector)\n");
|
||||
+ bio->printf("[CPU%u] (mch) iret: Return with DPL != RPL. #GP(selector)\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] (mch) iret: Return with DPL != RPL. #GP(selector)\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, raw_cs_selector & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
$OpenBSD: patch-cpu_exception_cc,v 1.2 2001/03/01 22:44:18 todd Exp $
|
||||
$OpenBSD: patch-cpu_exception_cc,v 1.3 2001/03/30 18:53:25 todd Exp $
|
||||
--- cpu/exception.cc.orig Sat Mar 25 21:39:08 2000
|
||||
+++ cpu/exception.cc Tue Feb 27 10:29:42 2001
|
||||
+++ cpu/exception.cc Fri Mar 30 11:15:14 2001
|
||||
@@ -52,7 +52,7 @@ BX_CPU_C::interrupt(Bit8u vector, Boolea
|
||||
BX_CPU_THIS_PTR show_flag |= Flag_intsig;
|
||||
#endif
|
||||
|
||||
-//fprintf(stderr, "::interrupt(%u)\n", vector);
|
||||
+//bio->printf("[CPU%d] interrupt(%u)\n", BX_SIM_ID, vector);
|
||||
+//bio->printd("[CPU%d] interrupt(%u)\n", BX_SIM_ID, vector);
|
||||
|
||||
BX_INSTR_INTERRUPT(vector);
|
||||
invalidate_prefetch_q();
|
||||
@ -17,7 +17,7 @@ $OpenBSD: patch-cpu_exception_cc,v 1.2 2001/03/01 22:44:18 todd Exp $
|
||||
- if (bx_dbg.interrupts)
|
||||
- bx_printf("interrupt(): vector = %u, INT = %u, EXT = %u\n",
|
||||
+ if (bio->getdbg().interrupts)
|
||||
+ bio->printf("[CPU%u] interrupt(): vector = %u, INT = %u, EXT = %u\n",
|
||||
+ bio->printd("[CPU%u] interrupt(): vector = %u, INT = %u, EXT = %u\n",
|
||||
+ BX_SIM_ID,
|
||||
(unsigned) vector, (unsigned) is_INT, (unsigned) BX_CPU_THIS_PTR EXT);
|
||||
|
||||
@ -32,13 +32,13 @@ $OpenBSD: patch-cpu_exception_cc,v 1.2 2001/03/01 22:44:18 todd Exp $
|
||||
- bx_printf("interrupt vector must be within IDT table limits\n");
|
||||
- bx_printf("bailing\n");
|
||||
+ if (bio->getdbg().interrupts) {
|
||||
+ bio->printf("[CPU%u] IDT.limit = %04x\n", BX_SIM_ID, (unsigned) BX_CPU_THIS_PTR idtr.limit);
|
||||
+ bio->printf("[CPU%u] IDT.base = %06x\n", BX_SIM_ID, (unsigned) BX_CPU_THIS_PTR idtr.base);
|
||||
+ bio->printf("[CPU%u] interrupt vector must be within IDT table limits\n",BX_SIM_ID);
|
||||
+ bio->printf("[CPU%u] bailing\n",BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] IDT.limit = %04x\n", BX_SIM_ID, (unsigned) BX_CPU_THIS_PTR idtr.limit);
|
||||
+ bio->printd("[CPU%u] IDT.base = %06x\n", BX_SIM_ID, (unsigned) BX_CPU_THIS_PTR idtr.base);
|
||||
+ bio->printd("[CPU%u] interrupt vector must be within IDT table limits\n",BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] bailing\n",BX_SIM_ID);
|
||||
}
|
||||
- bx_printf("interrupt(): vector > idtr.limit\n");
|
||||
+ bio->printf("[CPU%u] interrupt(): vector > idtr.limit\n",BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] interrupt(): vector > idtr.limit\n",BX_SIM_ID);
|
||||
|
||||
exception(BX_GP_EXCEPTION, vector*8 + 2, 0);
|
||||
}
|
||||
@ -57,7 +57,7 @@ $OpenBSD: patch-cpu_exception_cc,v 1.2 2001/03/01 22:44:18 todd Exp $
|
||||
default:
|
||||
- bx_printf("interrupt(): gate.type(%u) != {5,6,7,14,15}\n",
|
||||
- (unsigned) gate_descriptor.type);
|
||||
+ bio->printf("[CPU%u] interrupt(): gate.type(%u) != {5,6,7,14,15}\n",
|
||||
+ bio->printd("[CPU%u] interrupt(): gate.type(%u) != {5,6,7,14,15}\n",
|
||||
+ BX_SIM_ID, (unsigned) gate_descriptor.type);
|
||||
exception(BX_GP_EXCEPTION, vector*8 + 2, 0);
|
||||
return;
|
||||
@ -67,7 +67,7 @@ $OpenBSD: patch-cpu_exception_cc,v 1.2 2001/03/01 22:44:18 todd Exp $
|
||||
if (is_INT && (gate_descriptor.dpl < CPL)) {
|
||||
/* ??? */
|
||||
- bx_printf("interrupt(): is_INT && (dpl < CPL)\n");
|
||||
+ // bio->printf("[CPU%u] interrupt(): is_INT && (dpl < CPL)\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] interrupt(): is_INT && (dpl < CPL)\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, vector*8 + 2, 0);
|
||||
return;
|
||||
}
|
||||
@ -75,7 +75,7 @@ $OpenBSD: patch-cpu_exception_cc,v 1.2 2001/03/01 22:44:18 todd Exp $
|
||||
// Gate must be present, else #NP(vector * 8 + 2 + EXT)
|
||||
if (gate_descriptor.p == 0) {
|
||||
- bx_printf("interrupt(): p == 0\n");
|
||||
+ bio->printf("[CPU%u] interrupt(): p == 0\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] interrupt(): p == 0\n", BX_SIM_ID);
|
||||
exception(BX_NP_EXCEPTION, vector*8 + 2, 0);
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ $OpenBSD: patch-cpu_exception_cc,v 1.2 2001/03/01 22:44:18 todd Exp $
|
||||
// PPro+ says #GP(selector)
|
||||
if (tss_selector.ti) {
|
||||
- bx_panic("interrupt: tss_selector.ti=1\n");
|
||||
+ bio->printf("[CPU%u] interrupt: tss_selector.ti=1\n",BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] interrupt: tss_selector.ti=1\n",BX_SIM_ID);
|
||||
exception(BX_TS_EXCEPTION, raw_tss_selector & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -93,7 +93,7 @@ $OpenBSD: patch-cpu_exception_cc,v 1.2 2001/03/01 22:44:18 todd Exp $
|
||||
parse_descriptor(dword1, dword2, &tss_descriptor);
|
||||
if (tss_descriptor.valid==0 || tss_descriptor.segment) {
|
||||
- bx_panic("exception: TSS selector points to bad TSS\n");
|
||||
+ bio->printf("[CPU%u] exception: TSS selector points to bad TSS\n",BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] exception: TSS selector points to bad TSS\n",BX_SIM_ID);
|
||||
exception(BX_TS_EXCEPTION, raw_tss_selector & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -126,7 +126,7 @@ $OpenBSD: patch-cpu_exception_cc,v 1.2 2001/03/01 22:44:18 todd Exp $
|
||||
cs_descriptor.u.segment.executable==0 ||
|
||||
cs_descriptor.dpl>CPL ) {
|
||||
- bx_printf("interrupt(): not code segment\n");
|
||||
+ bio->printf("[CPU%u] interrupt(): not code segment\n",BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] interrupt(): not code segment\n",BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, cs_selector.value & 0xfffc, 0);
|
||||
}
|
||||
|
||||
@ -144,7 +144,7 @@ $OpenBSD: patch-cpu_exception_cc,v 1.2 2001/03/01 22:44:18 todd Exp $
|
||||
- if (bx_dbg.interrupts)
|
||||
- bx_printf("interrupt(): INTERRUPT TO INNER PRIVILEGE\n");
|
||||
+ if (bio->getdbg().interrupts)
|
||||
+ bio->printf("[CPU%u] interrupt(): INTERRUPT TO INNER PRIVILEGE\n",BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] interrupt(): INTERRUPT TO INNER PRIVILEGE\n",BX_SIM_ID);
|
||||
|
||||
// check selector and descriptor for new stack in current TSS
|
||||
get_SS_ESP_from_TSS(cs_descriptor.dpl,
|
||||
@ -233,7 +233,7 @@ $OpenBSD: patch-cpu_exception_cc,v 1.2 2001/03/01 22:44:18 todd Exp $
|
||||
- if (bx_dbg.interrupts)
|
||||
- bx_printf("int_trap_gate286(): INTERRUPT TO SAME PRIVILEGE\n");
|
||||
+ if (bio->getdbg().interrupts)
|
||||
+ bio->printf("[CPU%u] int_trap_gate286(): INTERRUPT TO SAME PRIVILEGE\n",BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] int_trap_gate286(): INTERRUPT TO SAME PRIVILEGE\n",BX_SIM_ID);
|
||||
|
||||
// Current stack limits must allow pushing 6|8 bytes, else #SS(0)
|
||||
if (gate_descriptor.type >= 14) { // 386 gate
|
||||
@ -242,7 +242,7 @@ $OpenBSD: patch-cpu_exception_cc,v 1.2 2001/03/01 22:44:18 todd Exp $
|
||||
if ( !can_push(&BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS].cache,
|
||||
temp_ESP, bytes) ) {
|
||||
- bx_printf("interrupt(): stack doesn't have room\n");
|
||||
+ bio->printf("[CPU%u] interrupt(): stack doesn't have room\n",BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] interrupt(): stack doesn't have room\n",BX_SIM_ID);
|
||||
exception(BX_SS_EXCEPTION, 0, 0);
|
||||
}
|
||||
|
||||
@ -259,13 +259,13 @@ $OpenBSD: patch-cpu_exception_cc,v 1.2 2001/03/01 22:44:18 todd Exp $
|
||||
// else #GP(CS selector + ext)
|
||||
- bx_printf("interrupt: bad descriptor\n");
|
||||
- bx_printf("c_ed=%u, descriptor.dpl=%u, CPL=%u\n",
|
||||
+ bio->printf("[CPU%u] interrupt: bad descriptor\n", BX_SIM_ID);
|
||||
+ bio->printf("[CPU%u] c_ed=%u, descriptor.dpl=%u, CPL=%u\n", BX_SIM_ID,
|
||||
+ bio->printd("[CPU%u] interrupt: bad descriptor\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] c_ed=%u, descriptor.dpl=%u, CPL=%u\n", BX_SIM_ID,
|
||||
(unsigned) cs_descriptor.u.segment.c_ed,
|
||||
(unsigned) cs_descriptor.dpl,
|
||||
(unsigned) CPL);
|
||||
- bx_printf("cs.segment = %u\n", (unsigned) cs_descriptor.segment);
|
||||
+ bio->printf("[CPU%u] cs.segment = %u\n", BX_SIM_ID, (unsigned) cs_descriptor.segment);
|
||||
+ bio->printd("[CPU%u] cs.segment = %u\n", BX_SIM_ID, (unsigned) cs_descriptor.segment);
|
||||
exception(BX_GP_EXCEPTION, cs_selector.value & 0xfffc, 0);
|
||||
break;
|
||||
|
||||
@ -289,7 +289,7 @@ $OpenBSD: patch-cpu_exception_cc,v 1.2 2001/03/01 22:44:18 todd Exp $
|
||||
unsigned prev_errno;
|
||||
|
||||
-//fprintf(stderr, "::exception(%u)\n", vector);
|
||||
+//bio->printf("::exception(%u)\n", vector);
|
||||
+//bio->printd("::exception(%u)\n", vector);
|
||||
|
||||
BX_INSTR_EXCEPTION(vector);
|
||||
invalidate_prefetch_q();
|
||||
@ -299,7 +299,7 @@ $OpenBSD: patch-cpu_exception_cc,v 1.2 2001/03/01 22:44:18 todd Exp $
|
||||
- if (bx_dbg.exceptions)
|
||||
- bx_printf("exception(%02x h)\n", (unsigned) vector);
|
||||
+ if (bio->getdbg().exceptions)
|
||||
+ bio->printf("[CPU%u] exception(%02x h)\n", (unsigned) vector);
|
||||
+ bio->printd("[CPU%u] exception(%02x h)\n", (unsigned) vector);
|
||||
|
||||
// if not initial error, restore previous register values from
|
||||
// previous attempt to handle exception
|
||||
@ -369,7 +369,7 @@ $OpenBSD: patch-cpu_exception_cc,v 1.2 2001/03/01 22:44:18 todd Exp $
|
||||
BX_CPU_THIS_PTR interrupt(vector, 0, push_error, error_code);
|
||||
// if (BX_CPU_THIS_PTR errorno > prev_errno) {
|
||||
-// bx_printf("segment_exception(): errorno changed\n");
|
||||
+// bio->printf("[CPU%u] segment_exception(): errorno changed\n", BX_SIM_ID);
|
||||
+// bio->printd("[CPU%u] segment_exception(): errorno changed\n", BX_SIM_ID);
|
||||
// longjmp(jmp_buf_env, 1); // go back to main decode loop
|
||||
// return;
|
||||
// }
|
||||
|
@ -1,6 +1,6 @@
|
||||
$OpenBSD: patch-cpu_proc_ctrl_cc,v 1.2 2001/03/30 16:47:02 todd Exp $
|
||||
$OpenBSD: patch-cpu_proc_ctrl_cc,v 1.3 2001/03/30 18:53:25 todd Exp $
|
||||
--- cpu/proc_ctrl.cc.orig Sat Mar 25 21:39:09 2000
|
||||
+++ cpu/proc_ctrl.cc Fri Mar 30 10:09:57 2001
|
||||
+++ cpu/proc_ctrl.cc Fri Mar 30 12:42:03 2001
|
||||
@@ -35,7 +35,7 @@ BX_CPU_C::UndefinedOpcode(BxInstruction_
|
||||
if (i->b1 != 0x63) {
|
||||
// Windows hits the ARPL command a bunch of times.
|
||||
@ -685,25 +685,27 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.2 2001/03/30 16:47:02 todd Exp $
|
||||
|
||||
if (prev_pe==0 && BX_CPU_THIS_PTR cr0.pe) {
|
||||
enter_protected_mode();
|
||||
@@ -1121,7 +1126,7 @@ BX_CPU_C::RSM(BxInstruction_t *i)
|
||||
@@ -1121,7 +1126,8 @@ BX_CPU_C::RSM(BxInstruction_t *i)
|
||||
#if BX_CPU_LEVEL >= 4
|
||||
invalidate_prefetch_q();
|
||||
|
||||
- bx_panic("RSM: System Management Mode not implemented yet\n");
|
||||
+ bio->panic("RSM: System Management Mode not implemented yet\n");
|
||||
+ bio->printd("RSM: System Management Mode not implemented yet\n");
|
||||
+ UndefinedOpcode(i);
|
||||
#else
|
||||
UndefinedOpcode(i);
|
||||
#endif
|
||||
@@ -1131,7 +1136,7 @@ BX_CPU_C::RSM(BxInstruction_t *i)
|
||||
@@ -1131,7 +1137,8 @@ BX_CPU_C::RSM(BxInstruction_t *i)
|
||||
BX_CPU_C::RDTSC(BxInstruction_t *i)
|
||||
{
|
||||
#if BX_CPU_LEVEL >= 5
|
||||
- bx_panic("RDTSC: not implemented yet\n");
|
||||
+ bio->panic("RDTSC: not implemented yet\n");
|
||||
+ bio->printd("RDTSC: not implemented yet\n");
|
||||
+ UndefinedOpcode(i);
|
||||
#else
|
||||
UndefinedOpcode(i);
|
||||
#endif
|
||||
@@ -1141,7 +1146,8 @@ BX_CPU_C::RDTSC(BxInstruction_t *i)
|
||||
@@ -1141,7 +1148,8 @@ BX_CPU_C::RDTSC(BxInstruction_t *i)
|
||||
BX_CPU_C::RDMSR(BxInstruction_t *i)
|
||||
{
|
||||
#if BX_CPU_LEVEL >= 5
|
||||
@ -713,12 +715,13 @@ $OpenBSD: patch-cpu_proc_ctrl_cc,v 1.2 2001/03/30 16:47:02 todd Exp $
|
||||
#else
|
||||
UndefinedOpcode(i);
|
||||
#endif
|
||||
@@ -1153,7 +1159,7 @@ BX_CPU_C::WRMSR(BxInstruction_t *i)
|
||||
@@ -1153,7 +1161,8 @@ BX_CPU_C::WRMSR(BxInstruction_t *i)
|
||||
#if BX_CPU_LEVEL >= 5
|
||||
invalidate_prefetch_q();
|
||||
|
||||
- bx_panic("WRMSR: not implemented yet\n");
|
||||
+ bio->panic("WRMSR: not implemented yet\n");
|
||||
+ bio->printd("WRMSR: not implemented yet\n");
|
||||
+ UndefinedOpcode(i);
|
||||
#else
|
||||
UndefinedOpcode(i);
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
$OpenBSD: patch-cpu_protect_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
$OpenBSD: patch-cpu_protect_ctrl_cc,v 1.2 2001/03/30 18:53:25 todd Exp $
|
||||
--- cpu/protect_ctrl.cc.orig Sat Mar 25 21:39:09 2000
|
||||
+++ cpu/protect_ctrl.cc Tue Oct 31 13:12:54 2000
|
||||
+++ cpu/protect_ctrl.cc Fri Mar 30 11:26:13 2001
|
||||
@@ -35,7 +35,7 @@
|
||||
BX_CPU_C::ARPL_EwGw(BxInstruction_t *i)
|
||||
{
|
||||
@ -28,7 +28,7 @@ $OpenBSD: patch-cpu_protect_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
if (descriptor.valid==0) {
|
||||
set_ZF(0);
|
||||
- //bx_printf("lar(): descriptor valid bit cleared\n");
|
||||
+ //bio->printf("[CPU%u] lar(): descriptor valid bit cleared\n", BX_SIM_ID);
|
||||
+ //bio->printd("[CPU%u] lar(): descriptor valid bit cleared\n", BX_SIM_ID);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ $OpenBSD: patch-cpu_protect_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
set_ZF(0);
|
||||
- bx_printf("lar(): not accepted type\n");
|
||||
+ if(bio->getdbg().cpu)
|
||||
+ bio->printf("[CPU%u] lar(): not accepted type\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] lar(): not accepted type\n", BX_SIM_ID);
|
||||
return;
|
||||
break;
|
||||
}
|
||||
@ -120,7 +120,7 @@ $OpenBSD: patch-cpu_protect_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
if (selector.ti != 0) {
|
||||
- bx_printf("LLDT: selector.ti != 0\n");
|
||||
+ if(bio->getdbg().cpu)
|
||||
+ bio->printf("[CPU%u] LLDT: selector.ti != 0\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] LLDT: selector.ti != 0\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, raw_selector & 0xfffc, 0);
|
||||
}
|
||||
|
||||
@ -136,7 +136,7 @@ $OpenBSD: patch-cpu_protect_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
(descriptor.type!=2) ) {
|
||||
- bx_printf("lldt: doesn't point to an LDT descriptor!\n");
|
||||
+ if(bio->getdbg().cpu)
|
||||
+ bio->printf("[CPU%u] lldt: doesn't point to an LDT descriptor!\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] lldt: doesn't point to an LDT descriptor!\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, raw_selector & 0xfffc, 0);
|
||||
}
|
||||
|
||||
@ -144,13 +144,13 @@ $OpenBSD: patch-cpu_protect_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
if (descriptor.p==0) {
|
||||
- bx_printf("lldt: LDT descriptor not present!\n");
|
||||
+ if(bio->getdbg().cpu)
|
||||
+ bio->printf("[CPU%u] lldt: LDT descriptor not present!\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] lldt: LDT descriptor not present!\n", BX_SIM_ID);
|
||||
exception(BX_NP_EXCEPTION, raw_selector & 0xfffc, 0);
|
||||
}
|
||||
|
||||
if (descriptor.u.ldt.limit < 7) {
|
||||
- bx_printf("lldt: ldtr.limit < 7\n");
|
||||
+ bio->printf("[CPU%u] lldt: ldtr.limit < 7\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] lldt: ldtr.limit < 7\n", BX_SIM_ID);
|
||||
}
|
||||
|
||||
BX_CPU_THIS_PTR ldtr.selector = selector;
|
||||
@ -250,7 +250,7 @@ $OpenBSD: patch-cpu_protect_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
set_ZF(0);
|
||||
- bx_printf("VERR: null selector\n");
|
||||
+ if(bio->getdbg().cpu)
|
||||
+ bio->printf("[CPU%u] VERR: null selector\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] VERR: null selector\n", BX_SIM_ID);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -260,7 +260,7 @@ $OpenBSD: patch-cpu_protect_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
set_ZF(0);
|
||||
- bx_printf("VERR: not in table\n");
|
||||
+ if(bio->getdbg().cpu)
|
||||
+ bio->printf("[CPU%u] VERR: not in table\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] VERR: not in table\n", BX_SIM_ID);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -270,7 +270,7 @@ $OpenBSD: patch-cpu_protect_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
set_ZF(0); /* inaccessible */
|
||||
- bx_printf("VERR: system descriptor\n");
|
||||
+ if(bio->getdbg().cpu)
|
||||
+ bio->printf("[CPU%u] VERR: system descriptor\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] VERR: system descriptor\n", BX_SIM_ID);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -278,7 +278,7 @@ $OpenBSD: patch-cpu_protect_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
set_ZF(0);
|
||||
- bx_printf("VERR: valid bit cleared\n");
|
||||
+ if(bio->getdbg().cpu)
|
||||
+ bio->printf("[CPU%u] VERR: valid bit cleared\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] VERR: valid bit cleared\n", BX_SIM_ID);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -288,14 +288,14 @@ $OpenBSD: patch-cpu_protect_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
set_ZF(1); /* accessible */
|
||||
- bx_printf("VERR: conforming code, OK\n");
|
||||
+ if(bio->getdbg().cpu)
|
||||
+ bio->printf("[CPU%u] VERR: conforming code, OK\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] VERR: conforming code, OK\n", BX_SIM_ID);
|
||||
return;
|
||||
}
|
||||
if ( descriptor.u.segment.r_w==0 ) {
|
||||
set_ZF(0); /* inaccessible */
|
||||
- bx_printf("VERR: code not readable\n");
|
||||
+ if(bio->getdbg().cpu)
|
||||
+ bio->printf("[CPU%u] VERR: code not readable\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] VERR: code not readable\n", BX_SIM_ID);
|
||||
return;
|
||||
}
|
||||
/* readable, non-conforming code segment */
|
||||
@ -303,13 +303,13 @@ $OpenBSD: patch-cpu_protect_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
set_ZF(0); /* inaccessible */
|
||||
- bx_printf("VERR: non-coforming code not withing priv level\n");
|
||||
+ if(bio->getdbg().cpu)
|
||||
+ bio->printf("[CPU%u] VERR: non-coforming code not withing priv level\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] VERR: non-coforming code not withing priv level\n", BX_SIM_ID);
|
||||
return;
|
||||
}
|
||||
set_ZF(1); /* accessible */
|
||||
- bx_printf("VERR: code seg readable\n");
|
||||
+ if(bio->getdbg().cpu)
|
||||
+ bio->printf("[CPU%u] VERR: code seg readable\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] VERR: code seg readable\n", BX_SIM_ID);
|
||||
return;
|
||||
}
|
||||
else { /* data segment */
|
||||
@ -317,13 +317,13 @@ $OpenBSD: patch-cpu_protect_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
set_ZF(0); /* not accessible */
|
||||
- bx_printf("VERR: data seg not withing priv level\n");
|
||||
+ if(bio->getdbg().cpu)
|
||||
+ bio->printf("[CPU%u] VERR: data seg not withing priv level\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] VERR: data seg not withing priv level\n", BX_SIM_ID);
|
||||
return;
|
||||
}
|
||||
set_ZF(1); /* accessible */
|
||||
- bx_printf("VERR: data segment OK\n");
|
||||
+ if(bio->getdbg().cpu)
|
||||
+ bio->printf("[CPU%u] VERR: data segment OK\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] VERR: data segment OK\n", BX_SIM_ID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -347,7 +347,7 @@ $OpenBSD: patch-cpu_protect_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
set_ZF(0);
|
||||
- bx_printf("VERW: null selector\n");
|
||||
+ if(bio->getdbg().cpu)
|
||||
+ bio->printf("[CPU%u] VERW: null selector\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] VERW: null selector\n", BX_SIM_ID);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -357,7 +357,7 @@ $OpenBSD: patch-cpu_protect_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
set_ZF(0);
|
||||
- bx_printf("VERW: not in table\n");
|
||||
+ if(bio->getdbg().cpu)
|
||||
+ bio->printf("[CPU%u] VERW: not in table\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] VERW: not in table\n", BX_SIM_ID);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -367,7 +367,7 @@ $OpenBSD: patch-cpu_protect_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
set_ZF(0);
|
||||
- bx_printf("VERW: system seg or code\n");
|
||||
+ if(bio->getdbg().cpu)
|
||||
+ bio->printf("[CPU%u] VERW: system seg or code\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] VERW: system seg or code\n", BX_SIM_ID);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -375,7 +375,7 @@ $OpenBSD: patch-cpu_protect_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
set_ZF(0);
|
||||
- bx_printf("VERW: valid bit cleared\n");
|
||||
+ if(bio->getdbg().cpu)
|
||||
+ bio->printf("[CPU%u] VERW: valid bit cleared\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] VERW: valid bit cleared\n", BX_SIM_ID);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -385,18 +385,18 @@ $OpenBSD: patch-cpu_protect_ctrl_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
set_ZF(0); /* not accessible */
|
||||
- bx_printf("VERW: writable data seg not within priv level\n");
|
||||
+ if(bio->getdbg().cpu)
|
||||
+ bio->printf("[CPU%u] VERW: writable data seg not within priv level\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] VERW: writable data seg not within priv level\n", BX_SIM_ID);
|
||||
return;
|
||||
}
|
||||
set_ZF(1); /* accessible */
|
||||
- bx_printf("VERW: data seg writable\n");
|
||||
+ bio->printf("[CPU%u] VERW: data seg writable\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] VERW: data seg writable\n", BX_SIM_ID);
|
||||
return;
|
||||
}
|
||||
|
||||
set_ZF(0); /* not accessible */
|
||||
- bx_printf("VERW: data seg not writable\n");
|
||||
+ bio->printf("[CPU%u] VERW: data seg not writable\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] VERW: data seg not writable\n", BX_SIM_ID);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
$OpenBSD: patch-cpu_segment_ctrl_pro_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
$OpenBSD: patch-cpu_segment_ctrl_pro_cc,v 1.2 2001/03/30 18:53:25 todd Exp $
|
||||
--- cpu/segment_ctrl_pro.cc.orig Sat Mar 25 21:39:09 2000
|
||||
+++ cpu/segment_ctrl_pro.cc Tue Oct 31 12:21:32 2000
|
||||
+++ cpu/segment_ctrl_pro.cc Fri Mar 30 11:29:40 2001
|
||||
@@ -70,7 +70,7 @@ BX_CPU_C::load_seg_reg(bx_segment_reg_t
|
||||
Bit32u dword1, dword2;
|
||||
|
||||
if ((new_value & 0xfffc) == 0) { /* null selector */
|
||||
- bx_panic("load_seg_reg: SS: new_value == 0\n");
|
||||
+ bio->panic("[CPU%u] load_seg_reg: SS: new_value == 0\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] load_seg_reg: SS: new_value == 0\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
return;
|
||||
}
|
||||
@ -16,7 +16,7 @@ $OpenBSD: patch-cpu_segment_ctrl_pro_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
if ((index*8 + 7) > BX_CPU_THIS_PTR gdtr.limit) {
|
||||
- bx_panic("load_seg_reg: GDT: %s: index(%04x) > limit(%06x)\n",
|
||||
- BX_CPU_THIS_PTR strseg(seg), (unsigned) index, (unsigned) BX_CPU_THIS_PTR gdtr.limit);
|
||||
+ bio->panic("[CPU%u] load_seg_reg: GDT: %s: index(%04x) > limit(%06x)\n",
|
||||
+ bio->printd("[CPU%u] load_seg_reg: GDT: %s: index(%04x) > limit(%06x)\n",
|
||||
+ BX_SIM_ID, BX_CPU_THIS_PTR strseg(seg), (unsigned) index, (unsigned) BX_CPU_THIS_PTR gdtr.limit);
|
||||
exception(BX_GP_EXCEPTION, new_value & 0xfffc, 0);
|
||||
return;
|
||||
@ -26,13 +26,13 @@ $OpenBSD: patch-cpu_segment_ctrl_pro_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
else { /* LDT */
|
||||
if (BX_CPU_THIS_PTR ldtr.cache.valid==0) { /* ??? */
|
||||
- bx_printf("load_seg_reg: LDT invalid\n");
|
||||
+ bio->printf("[CPU%u] load_seg_reg: LDT invalid\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] load_seg_reg: LDT invalid\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, new_value & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
if ((index*8 + 7) > BX_CPU_THIS_PTR ldtr.cache.u.ldt.limit) {
|
||||
- bx_printf("load_seg_reg ss: LDT: index > limit\n");
|
||||
+ bio->printf("[CPU%u] load_seg_reg ss: LDT: index > limit\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] load_seg_reg ss: LDT: index > limit\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, new_value & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -41,7 +41,7 @@ $OpenBSD: patch-cpu_segment_ctrl_pro_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
/* selector's RPL must = CPL, else #GP(selector) */
|
||||
if (rpl != CPL) {
|
||||
- bx_printf("load_seg_reg(): rpl != CPL\n");
|
||||
+ bio->printf("[CPU%u] load_seg_reg(): rpl != CPL\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] load_seg_reg(): rpl != CPL\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, new_value & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -50,7 +50,7 @@ $OpenBSD: patch-cpu_segment_ctrl_pro_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
|
||||
if (descriptor.valid==0) {
|
||||
- bx_printf("load_seg_reg(): valid bit cleared\n");
|
||||
+ bio->printf("[CPU%u] load_seg_reg(): valid bit cleared\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] load_seg_reg(): valid bit cleared\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, new_value & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -59,21 +59,21 @@ $OpenBSD: patch-cpu_segment_ctrl_pro_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
descriptor.u.segment.executable ||
|
||||
descriptor.u.segment.r_w==0 ) {
|
||||
- bx_printf("load_seg_reg(): not writable data segment\n");
|
||||
+ bio->printf("[CPU%u] load_seg_reg(): not writable data segment\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] load_seg_reg(): not writable data segment\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, new_value & 0xfffc, 0);
|
||||
}
|
||||
|
||||
/* DPL in the AR byte must equal CPL else #GP(selector) */
|
||||
if (descriptor.dpl != CPL) {
|
||||
- bx_printf("load_seg_reg(): dpl != CPL\n");
|
||||
+ bio->printf("[CPU%u] load_seg_reg(): dpl != CPL\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] load_seg_reg(): dpl != CPL\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, new_value & 0xfffc, 0);
|
||||
}
|
||||
|
||||
/* segment must be marked PRESENT else #SS(selector) */
|
||||
if (descriptor.p == 0) {
|
||||
- bx_printf("load_seg_reg(): not present\n");
|
||||
+ bio->printf("[CPU%u] load_seg_reg(): not present\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] load_seg_reg(): not present\n", BX_SIM_ID);
|
||||
exception(BX_SS_EXCEPTION, new_value & 0xfffc, 0);
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ $OpenBSD: patch-cpu_segment_ctrl_pro_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
if ((index*8 + 7) > BX_CPU_THIS_PTR gdtr.limit) {
|
||||
- bx_printf("load_seg_reg: GDT: %s: index(%04x) > limit(%06x)\n",
|
||||
- BX_CPU_THIS_PTR strseg(seg), (unsigned) index, (unsigned) BX_CPU_THIS_PTR gdtr.limit);
|
||||
+ bio->printf("[CPU%u] load_seg_reg: GDT: %s: index(%04x) > limit(%06x)\n",
|
||||
+ bio->printd("[CPU%u] load_seg_reg: GDT: %s: index(%04x) > limit(%06x)\n",
|
||||
+ BX_SIM_ID, BX_CPU_THIS_PTR strseg(seg), (unsigned) index, (unsigned) BX_CPU_THIS_PTR gdtr.limit);
|
||||
exception(BX_GP_EXCEPTION, new_value & 0xfffc, 0);
|
||||
return;
|
||||
@ -93,13 +93,13 @@ $OpenBSD: patch-cpu_segment_ctrl_pro_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
else { /* LDT */
|
||||
if (BX_CPU_THIS_PTR ldtr.cache.valid==0) {
|
||||
- bx_printf("load_seg_reg: LDT invalid\n");
|
||||
+ bio->printf("[CPU%u] load_seg_reg: LDT invalid\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] load_seg_reg: LDT invalid\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, new_value & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
if ((index*8 + 7) > BX_CPU_THIS_PTR ldtr.cache.u.ldt.limit) {
|
||||
- bx_printf("load_seg_reg ds,es: LDT: index > limit\n");
|
||||
+ bio->printf("[CPU%u] load_seg_reg ds,es: LDT: index > limit\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] load_seg_reg ds,es: LDT: index > limit\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, new_value & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -108,7 +108,7 @@ $OpenBSD: patch-cpu_segment_ctrl_pro_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
|
||||
if (descriptor.valid==0) {
|
||||
- bx_printf("load_seg_reg(): valid bit cleared\n");
|
||||
+ bio->printf("[CPU%u] load_seg_reg(): valid bit cleared\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] load_seg_reg(): valid bit cleared\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, new_value & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -117,7 +117,7 @@ $OpenBSD: patch-cpu_segment_ctrl_pro_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
(descriptor.u.segment.executable==1 &&
|
||||
descriptor.u.segment.r_w==0) ) {
|
||||
- bx_printf("load_seg_reg(): not data or readable code\n");
|
||||
+ bio->printf("[CPU%u] load_seg_reg(): not data or readable code\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] load_seg_reg(): not data or readable code\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, new_value & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -126,7 +126,7 @@ $OpenBSD: patch-cpu_segment_ctrl_pro_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
descriptor.u.segment.c_ed==0 ) {
|
||||
if ((rpl > descriptor.dpl) || (CPL > descriptor.dpl)) {
|
||||
- bx_printf("load_seg_reg: RPL & CPL must be <= DPL\n");
|
||||
+ bio->printf("[CPU%u] load_seg_reg: RPL & CPL must be <= DPL\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] load_seg_reg: RPL & CPL must be <= DPL\n", BX_SIM_ID);
|
||||
exception(BX_GP_EXCEPTION, new_value & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -135,7 +135,7 @@ $OpenBSD: patch-cpu_segment_ctrl_pro_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
/* segment must be marked PRESENT else #NP(selector) */
|
||||
if (descriptor.p == 0) {
|
||||
- bx_printf("load_seg_reg: segment not present\n");
|
||||
+ bio->printf("[CPU%u] load_seg_reg: segment not present\n", BX_SIM_ID);
|
||||
+ bio->printd("[CPU%u] load_seg_reg: segment not present\n", BX_SIM_ID);
|
||||
exception(BX_NP_EXCEPTION, new_value & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -194,13 +194,13 @@ $OpenBSD: patch-cpu_segment_ctrl_pro_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
-bx_printf("selector->index*8 + 7 = %u\n", (unsigned) selector->index*8 + 7);
|
||||
-bx_printf("gdtr.limit = %u\n", (unsigned) BX_CPU_THIS_PTR gdtr.limit);
|
||||
- bx_printf("fetch_raw_descriptor: GDT: index > limit\n");
|
||||
+bio->printf("-----------------------------------\n");
|
||||
+bio->printf("selector->index*8 + 7 = %u\n", (unsigned) selector->index*8 + 7);
|
||||
+bio->printf("gdtr.limit = %u\n", (unsigned) BX_CPU_THIS_PTR gdtr.limit);
|
||||
+ bio->printf("fetch_raw_descriptor: GDT: index > limit\n");
|
||||
+bio->printd("-----------------------------------\n");
|
||||
+bio->printd("selector->index*8 + 7 = %u\n", (unsigned) selector->index*8 + 7);
|
||||
+bio->printd("gdtr.limit = %u\n", (unsigned) BX_CPU_THIS_PTR gdtr.limit);
|
||||
+ bio->printd("fetch_raw_descriptor: GDT: index > limit\n");
|
||||
debug(BX_CPU_THIS_PTR prev_eip);
|
||||
-bx_printf("-----------------------------------\n");
|
||||
+bio->printf("-----------------------------------\n");
|
||||
+bio->printd("-----------------------------------\n");
|
||||
exception(exception_no, selector->value & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
@ -213,7 +213,7 @@ $OpenBSD: patch-cpu_segment_ctrl_pro_cc,v 1.1 2001/02/02 16:59:09 todd Exp $
|
||||
}
|
||||
if ((selector->index*8 + 7) > BX_CPU_THIS_PTR ldtr.cache.u.ldt.limit) {
|
||||
- bx_panic("fetch_raw_descriptor: LDT: index > limit\n");
|
||||
+ bio->panic("fetch_raw_descriptor: LDT: index > limit\n");
|
||||
+ bio->printd("fetch_raw_descriptor: LDT: index > limit\n");
|
||||
exception(exception_no, selector->value & 0xfffc, 0);
|
||||
return;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
$OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
$OpenBSD: patch-iodev_dma_cc,v 1.2 2001/03/30 18:53:25 todd Exp $
|
||||
--- iodev/dma.cc.orig Sat Mar 25 21:28:48 2000
|
||||
+++ iodev/dma.cc Tue Oct 31 12:16:53 2000
|
||||
+++ iodev/dma.cc Fri Mar 30 11:22:51 2001
|
||||
@@ -140,12 +140,12 @@ bx_dma_c::read( Bit32u address, unsign
|
||||
Bit8u channel;
|
||||
|
||||
@ -13,7 +13,7 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.dma)
|
||||
- bx_printf("dma: read addr=%04x\n", (unsigned) address);
|
||||
+ if (bio->getdbg().dma)
|
||||
+ bio->printf("[DMA] read addr=%04x\n", (unsigned) address);
|
||||
+ bio->printd("[DMA] read addr=%04x\n", (unsigned) address);
|
||||
|
||||
#if BX_DMA_FLOPPY_IO < 1
|
||||
/* if we're not supporting DMA/floppy IO just return a bogus value */
|
||||
@ -32,7 +32,7 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
channel = channelindex[address - 0x89] + 4;
|
||||
- bx_printf("dma: read: unsupported address=%04x (channel %d)\n",
|
||||
+ if(bio->getdbg().dma)
|
||||
+ bio->printf("[DMA] read: unsupported address=%04x (channel %d)\n",
|
||||
+ bio->printd("[DMA] read: unsupported address=%04x (channel %d)\n",
|
||||
(unsigned) address, channel);
|
||||
return( 0x00 );
|
||||
|
||||
@ -42,7 +42,7 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
case 0x00de:
|
||||
- bx_printf("dma: read: unsupported address=%04x\n", (unsigned) address);
|
||||
+ if(bio->getdbg().dma)
|
||||
+ bio->printf("[DMA] read: unsupported address=%04x\n", (unsigned) address);
|
||||
+ bio->printd("[DMA] read: unsupported address=%04x\n", (unsigned) address);
|
||||
return(0x0000);
|
||||
break;
|
||||
|
||||
@ -65,7 +65,7 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.dma)
|
||||
- bx_printf("\ndma: write: address=%04x value=%02x\n",
|
||||
+ if (bio->getdbg().dma)
|
||||
+ bio->printf("[DMA] write: address=%04x value=%02x\n",
|
||||
+ bio->printd("[DMA] write: address=%04x value=%02x\n",
|
||||
(unsigned) address, (unsigned) value);
|
||||
|
||||
#if BX_DMA_FLOPPY_IO < 1
|
||||
@ -76,7 +76,7 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.dma)
|
||||
- bx_printf(" DMA-1 base and current address, channel %d\n", channel);
|
||||
+ if (bio->getdbg().dma)
|
||||
+ bio->printf("[DMA1] base and current address, channel %d\n", channel);
|
||||
+ bio->printd("[DMA1] base and current address, channel %d\n", channel);
|
||||
if (BX_DMA_THIS s.flip_flop==0) { /* 1st byte */
|
||||
BX_DMA_THIS s.chan[channel].base_address = value;
|
||||
BX_DMA_THIS s.chan[channel].current_address = value;
|
||||
@ -87,10 +87,10 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.dma) {
|
||||
- bx_printf(" base = %04x\n",
|
||||
+ if (bio->getdbg().dma) {
|
||||
+ bio->printf("[DMA] base = %04x\n",
|
||||
+ bio->printd("[DMA] base = %04x\n",
|
||||
(unsigned) BX_DMA_THIS s.chan[channel].base_address);
|
||||
- bx_printf(" curr = %04x\n",
|
||||
+ bio->printf("[DMA] curr = %04x\n",
|
||||
+ bio->printd("[DMA] curr = %04x\n",
|
||||
(unsigned) BX_DMA_THIS s.chan[channel].current_address);
|
||||
}
|
||||
}
|
||||
@ -101,7 +101,7 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.dma)
|
||||
- bx_printf(" DMA-1 base and current count, channel %d\n", channel);
|
||||
+ if (bio->getdbg().dma)
|
||||
+ bio->printf("[DMA1] base and current count, channel %d\n", channel);
|
||||
+ bio->printd("[DMA1] base and current count, channel %d\n", channel);
|
||||
if (BX_DMA_THIS s.flip_flop==0) { /* 1st byte */
|
||||
BX_DMA_THIS s.chan[channel].base_count = value;
|
||||
BX_DMA_THIS s.chan[channel].current_count = value;
|
||||
@ -112,10 +112,10 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.dma) {
|
||||
- bx_printf(" base = %04x\n",
|
||||
+ if (bio->getdbg().dma) {
|
||||
+ bio->printf("[DMA] base = %04x\n",
|
||||
+ bio->printd("[DMA] base = %04x\n",
|
||||
(unsigned) BX_DMA_THIS s.chan[channel].base_count);
|
||||
- bx_printf(" curr = %04x\n",
|
||||
+ bio->printf("[DMA] curr = %04x\n",
|
||||
+ bio->printd("[DMA] curr = %04x\n",
|
||||
(unsigned) BX_DMA_THIS s.chan[channel].current_count);
|
||||
}
|
||||
}
|
||||
@ -124,7 +124,7 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
case 0x08: /* DMA-1: command register */
|
||||
if (value != 0x04)
|
||||
- bx_printf("DMA: write to 0008: value(%02xh) not 04h\n",
|
||||
+ bio->printf("[DMA1] write to 0008: value(%02xh) not 04h\n",
|
||||
+ bio->printd("[DMA1] write to 0008: value(%02xh) not 04h\n",
|
||||
(unsigned) value);
|
||||
BX_DMA_THIS s.command_reg = value;
|
||||
return;
|
||||
@ -132,7 +132,7 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
|
||||
case 0x09: // DMA-1: request register
|
||||
- bx_printf("DMA-1: write to request register (%02x)\n", (unsigned) value);
|
||||
+ bio->printf("[DMA1] write to request register (%02x)\n", (unsigned) value);
|
||||
+ bio->printd("[DMA1] write to request register (%02x)\n", (unsigned) value);
|
||||
// note: write to 0x0d clears this register
|
||||
if (value & 0x04) {
|
||||
// set request bit
|
||||
@ -141,7 +141,7 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
channel = value & 0x03;
|
||||
BX_DMA_THIS s.status_reg &= ~(1 << (channel+4));
|
||||
- bx_printf("dma-1: cleared request bit for channel %u\n", (unsigned) channel);
|
||||
+ bio->printf("[DMA1] cleared request bit for channel %u\n", (unsigned) channel);
|
||||
+ bio->printd("[DMA1] cleared request bit for channel %u\n", (unsigned) channel);
|
||||
}
|
||||
return;
|
||||
break;
|
||||
@ -152,7 +152,7 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.dma)
|
||||
- bx_printf("DMA1: set_mask_bit=%u, channel=%u, mask now=%02xh\n",
|
||||
+ if (bio->getdbg().dma)
|
||||
+ bio->printf("[DMA1] set_mask_bit=%u, channel=%u, mask now=%02xh\n",
|
||||
+ bio->printd("[DMA1] set_mask_bit=%u, channel=%u, mask now=%02xh\n",
|
||||
(unsigned) set_mask_bit, (unsigned) channel, (unsigned) BX_DMA_THIS s.mask[channel]);
|
||||
return;
|
||||
break;
|
||||
@ -161,12 +161,12 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
BX_DMA_THIS s.chan[channel].mode.autoinit_enable = (value >> 4) & 0x01;
|
||||
BX_DMA_THIS s.chan[channel].mode.transfer_type = (value >> 2) & 0x03;
|
||||
-//bx_printf("DMA1: mode register[%u] = %02x\n",
|
||||
+//bio->printf("[DMA1] mode register[%u] = %02x\n",
|
||||
+//bio->printd("[DMA1] mode register[%u] = %02x\n",
|
||||
//(unsigned) channel, (unsigned) value);
|
||||
- if (bx_dbg.dma)
|
||||
- bx_printf("DMA1: mode register[%u] = %02x\n",
|
||||
+ if (bio->getdbg().dma)
|
||||
+ bio->printf("[DMA1] mode register[%u] = %02x\n",
|
||||
+ bio->printd("[DMA1] mode register[%u] = %02x\n",
|
||||
(unsigned) channel, (unsigned) value);
|
||||
return;
|
||||
break;
|
||||
@ -175,7 +175,7 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.dma)
|
||||
- bx_printf("DMA1: clear flip/flop\n");
|
||||
+ if (bio->getdbg().dma)
|
||||
+ bio->printf("[DMA1] clear flip/flop\n");
|
||||
+ bio->printd("[DMA1] clear flip/flop\n");
|
||||
BX_DMA_THIS s.flip_flop = 0;
|
||||
return;
|
||||
break;
|
||||
@ -183,7 +183,7 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
case 0x0d: // dma-1: master disable
|
||||
/* ??? */
|
||||
- bx_printf("dma: master disable\n");
|
||||
+ bio->printf("[DMA] master disable\n");
|
||||
+ bio->printd("[DMA] master disable\n");
|
||||
// writing any value to this port resets DMA controller 1
|
||||
// same action as a hardware reset
|
||||
// mask register is set (chan 0..3 disabled)
|
||||
@ -192,7 +192,7 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
|
||||
case 0x0e: // dma-1: clear mask register
|
||||
- bx_printf("dma-1: clear mask register\n");
|
||||
+ bio->printf("[DMA1] clear mask register\n");
|
||||
+ bio->printd("[DMA1] clear mask register\n");
|
||||
BX_DMA_THIS s.mask[0] = 0;
|
||||
BX_DMA_THIS s.mask[1] = 0;
|
||||
BX_DMA_THIS s.mask[2] = 0;
|
||||
@ -201,7 +201,7 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
|
||||
case 0x0f: // dma-1: write all mask bits
|
||||
- bx_printf("dma-1: write all mask bits\n");
|
||||
+ bio->printf("[DMA1] write all mask bits\n");
|
||||
+ bio->printd("[DMA1] write all mask bits\n");
|
||||
BX_DMA_THIS s.mask[0] = value & 0x01; value >>= 1;
|
||||
BX_DMA_THIS s.mask[1] = value & 0x01; value >>= 1;
|
||||
BX_DMA_THIS s.mask[2] = value & 0x01; value >>= 1;
|
||||
@ -212,7 +212,7 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- if (bx_dbg.dma)
|
||||
- bx_printf("DMA1: page register %d = %02x\n", channel, (unsigned) value);
|
||||
+ if (bio->getdbg().dma)
|
||||
+ bio->printf("[DMA1] page register %d = %02x\n", channel, (unsigned) value);
|
||||
+ bio->printd("[DMA1] page register %d = %02x\n", channel, (unsigned) value);
|
||||
return;
|
||||
break;
|
||||
|
||||
@ -221,7 +221,7 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
//case 0xd0: /* DMA-2 command register */
|
||||
// if (value != 0x04)
|
||||
- // bx_printf("DMA2: write command register: value(%02xh)!=04h\n",
|
||||
+ // bio->printf("[DMA2] write command register: value(%02xh)!=04h\n",
|
||||
+ // bio->printd("[DMA2] write command register: value(%02xh)!=04h\n",
|
||||
// (unsigned) value);
|
||||
// return;
|
||||
// break;
|
||||
@ -230,7 +230,7 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
case 0x00dc:
|
||||
case 0x00de:
|
||||
- bx_printf("DMA(ignored): write: %04xh = %04xh\n",
|
||||
+ bio->printf("[DMA] write: %04xh = %04xh (ignored)\n",
|
||||
+ bio->printd("[DMA] write: %04xh = %04xh (ignored)\n",
|
||||
(unsigned) address, (unsigned) value);
|
||||
return;
|
||||
break;
|
||||
@ -238,7 +238,7 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
|
||||
default:
|
||||
- bx_printf("DMA(ignored): write: %04xh = %02xh\n",
|
||||
+ bio->printf("[DMA] write: %04xh = %02xh (ignored)\n",
|
||||
+ bio->printd("[DMA] write: %04xh = %02xh (ignored)\n",
|
||||
(unsigned) address, (unsigned) value);
|
||||
}
|
||||
}
|
||||
@ -257,7 +257,7 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
#endif
|
||||
if (!val) {
|
||||
- //bx_printf("bx_dma_c::DRQ(): val == 0\n");
|
||||
+ //bio->printf("[DMA] bx_dma_c::DRQ(): val == 0\n");
|
||||
+ //bio->printd("[DMA] bx_dma_c::DRQ(): val == 0\n");
|
||||
// clear bit in status reg
|
||||
// deassert HRQ if not pending DRQ's ?
|
||||
// etc.
|
||||
@ -277,18 +277,18 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
- bx_printf(".base_count: %04x\n", (unsigned) BX_DMA_THIS s.chan[channel].base_count);
|
||||
- bx_printf(".current_count: %04x\n", (unsigned) BX_DMA_THIS s.chan[channel].current_count);
|
||||
- bx_printf(".page_reg: %02x\n", (unsigned) BX_DMA_THIS s.chan[channel].page_reg);
|
||||
+ bio->printf("[DMA] BX_DMA_THIS s.mask[2]: %02x\n", (unsigned) BX_DMA_THIS s.mask[2]);
|
||||
+ bio->printf("[DMA] BX_DMA_THIS s.flip_flop: %u\n", (unsigned) BX_DMA_THIS s.flip_flop);
|
||||
+ bio->printf("[DMA] BX_DMA_THIS s.status_reg: %02x\n", (unsigned) BX_DMA_THIS s.status_reg);
|
||||
+ bio->printf("[DMA] mode_type: %02x\n", (unsigned) BX_DMA_THIS s.chan[channel].mode.mode_type);
|
||||
+ bio->printf("[DMA] address_decrement: %02x\n", (unsigned) BX_DMA_THIS s.chan[channel].mode.address_decrement);
|
||||
+ bio->printf("[DMA] autoinit_enable: %02x\n", (unsigned) BX_DMA_THIS s.chan[channel].mode.autoinit_enable);
|
||||
+ bio->printf("[DMA] transfer_type: %02x\n", (unsigned) BX_DMA_THIS s.chan[channel].mode.transfer_type);
|
||||
+ bio->printf("[DMA] .base_address: %04x\n", (unsigned) BX_DMA_THIS s.chan[channel].base_address);
|
||||
+ bio->printf("[DMA] .current_address: %04x\n", (unsigned) BX_DMA_THIS s.chan[channel].current_address);
|
||||
+ bio->printf("[DMA] .base_count: %04x\n", (unsigned) BX_DMA_THIS s.chan[channel].base_count);
|
||||
+ bio->printf("[DMA] .current_count: %04x\n", (unsigned) BX_DMA_THIS s.chan[channel].current_count);
|
||||
+ bio->printf("[DMA] .page_reg: %02x\n", (unsigned) BX_DMA_THIS s.chan[channel].page_reg);
|
||||
+ bio->printd("[DMA] BX_DMA_THIS s.mask[2]: %02x\n", (unsigned) BX_DMA_THIS s.mask[2]);
|
||||
+ bio->printd("[DMA] BX_DMA_THIS s.flip_flop: %u\n", (unsigned) BX_DMA_THIS s.flip_flop);
|
||||
+ bio->printd("[DMA] BX_DMA_THIS s.status_reg: %02x\n", (unsigned) BX_DMA_THIS s.status_reg);
|
||||
+ bio->printd("[DMA] mode_type: %02x\n", (unsigned) BX_DMA_THIS s.chan[channel].mode.mode_type);
|
||||
+ bio->printd("[DMA] address_decrement: %02x\n", (unsigned) BX_DMA_THIS s.chan[channel].mode.address_decrement);
|
||||
+ bio->printd("[DMA] autoinit_enable: %02x\n", (unsigned) BX_DMA_THIS s.chan[channel].mode.autoinit_enable);
|
||||
+ bio->printd("[DMA] transfer_type: %02x\n", (unsigned) BX_DMA_THIS s.chan[channel].mode.transfer_type);
|
||||
+ bio->printd("[DMA] .base_address: %04x\n", (unsigned) BX_DMA_THIS s.chan[channel].base_address);
|
||||
+ bio->printd("[DMA] .current_address: %04x\n", (unsigned) BX_DMA_THIS s.chan[channel].current_address);
|
||||
+ bio->printd("[DMA] .base_count: %04x\n", (unsigned) BX_DMA_THIS s.chan[channel].base_count);
|
||||
+ bio->printd("[DMA] .current_count: %04x\n", (unsigned) BX_DMA_THIS s.chan[channel].current_count);
|
||||
+ bio->printd("[DMA] .page_reg: %02x\n", (unsigned) BX_DMA_THIS s.chan[channel].page_reg);
|
||||
#endif
|
||||
|
||||
BX_DMA_THIS s.status_reg |= (1 << (channel+4));
|
||||
@ -317,15 +317,15 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
-bx_printf("dma_base_count = %08x\n", (unsigned) BX_DMA_THIS s.chan[channel].base_count);
|
||||
-bx_printf("dma_roof = %08x\n", (unsigned) dma_roof);
|
||||
- bx_panic("dma: DMA request outside 64k boundary\n");
|
||||
+bio->printf("[DMA] dma_base = %08x\n", (unsigned) dma_base);
|
||||
+bio->printf("[DMA] dma_base_count = %08x\n", (unsigned) BX_DMA_THIS s.chan[channel].base_count);
|
||||
+bio->printf("[DMA] dma_roof = %08x\n", (unsigned) dma_roof);
|
||||
+bio->printd("[DMA] dma_base = %08x\n", (unsigned) dma_base);
|
||||
+bio->printd("[DMA] dma_base_count = %08x\n", (unsigned) BX_DMA_THIS s.chan[channel].base_count);
|
||||
+bio->printd("[DMA] dma_roof = %08x\n", (unsigned) dma_roof);
|
||||
+ bio->panic("[DMA] DMA request outside 64k boundary\n");
|
||||
}
|
||||
|
||||
|
||||
- //bx_printf("DRQ set up for single mode, increment, auto-init disabled, write\n");
|
||||
+ //bio->printf("[DMA] DRQ set up for single mode, increment, auto-init disabled, write\n");
|
||||
+ //bio->printd("[DMA] DRQ set up for single mode, increment, auto-init disabled, write\n");
|
||||
// should check mask register VS DREQ's in status register here?
|
||||
// assert Hold ReQuest line to CPU
|
||||
bx_pc_system.set_HRQ(1);
|
||||
@ -339,7 +339,7 @@ $OpenBSD: patch-iodev_dma_cc,v 1.1 2001/02/02 16:59:11 todd Exp $
|
||||
}
|
||||
|
||||
- //bx_printf("hlda: OK in response to DRQ(%u)\n", (unsigned) channel);
|
||||
+ //bio->printf("[DMA] hlda: OK in response to DRQ(%u)\n", (unsigned) channel);
|
||||
+ //bio->printd("[DMA] hlda: OK in response to DRQ(%u)\n", (unsigned) channel);
|
||||
phy_addr = (BX_DMA_THIS s.chan[channel].page_reg << 16) |
|
||||
BX_DMA_THIS s.chan[channel].current_address;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
--- iodev/harddrv.cc.orig Sat Mar 25 21:28:49 2000
|
||||
+++ iodev/harddrv.cc Fri Mar 30 10:31:29 2001
|
||||
+++ iodev/harddrv.cc Fri Mar 30 10:55:24 2001
|
||||
@@ -103,10 +103,11 @@ bx_hard_drive_c::init(bx_devices_c *d, b
|
||||
BX_HD_THIS s[1].hard_drive->cylinders = bx_options.diskd.cylinders;
|
||||
BX_HD_THIS s[1].hard_drive->heads = bx_options.diskd.heads;
|
||||
@ -135,7 +135,7 @@
|
||||
- if (bx_dbg.disk || (CDROM_SELECTED && bx_dbg.cdrom))
|
||||
- bx_printf ("disk: Read all drive ID Bytes ...\n");
|
||||
+ if (bio->getdbg().disk || (CDROM_SELECTED && bio->getdbg().cdrom))
|
||||
+ bio->printf ("[HDD] Read all drive ID Bytes ...\n");
|
||||
+ bio->printd ("[HDD] Read all drive ID Bytes ...\n");
|
||||
}
|
||||
if (io_len == 1) {
|
||||
value8 = (Bit8u)value32;
|
||||
@ -165,10 +165,10 @@
|
||||
+ if (bio->getdbg().disk || (CDROM_SELECTED && bio->getdbg().cdrom))
|
||||
if (!BX_SELECTED_HD.cdrom.remaining_blocks)
|
||||
- bx_printf("disk: Last READ block loaded {CDROM}\n");
|
||||
+ bio->printf("[HDD] Last READ block loaded {CDROM}\n");
|
||||
+ bio->printd("[HDD] Last READ block loaded {CDROM}\n");
|
||||
else
|
||||
- bx_printf("disk: READ block loaded (%d remaining) {CDROM}\n",
|
||||
+ bio->printf("[HDD] READ block loaded (%d remaining) {CDROM}\n",
|
||||
+ bio->printd("[HDD] READ block loaded (%d remaining) {CDROM}\n",
|
||||
BX_SELECTED_HD.cdrom.remaining_blocks);
|
||||
|
||||
// one block transfered
|
||||
@ -188,7 +188,7 @@
|
||||
- if (bx_dbg.disk || (CDROM_SELECTED && bx_dbg.cdrom))
|
||||
- bx_printf("disk: PACKET drq bytes read\n");
|
||||
+ if (bio->getdbg().disk || (CDROM_SELECTED && bio->getdbg().cdrom))
|
||||
+ bio->printf("[HDD] PACKET drq bytes read\n");
|
||||
+ bio->printd("[HDD] PACKET drq bytes read\n");
|
||||
BX_SELECTED_CONTROLLER.interrupt_reason.i_o = 1;
|
||||
BX_SELECTED_CONTROLLER.status.busy = 0;
|
||||
BX_SELECTED_CONTROLLER.status.drq = 1;
|
||||
@ -199,7 +199,7 @@
|
||||
- if (bx_dbg.disk || (CDROM_SELECTED && bx_dbg.cdrom))
|
||||
- bx_printf("disk: PACKET all bytes read\n");
|
||||
+ if (bio->getdbg().disk || (CDROM_SELECTED && bio->getdbg().cdrom))
|
||||
+ bio->printf("[HDD] PACKET all bytes read\n");
|
||||
+ bio->printd("[HDD] PACKET all bytes read\n");
|
||||
BX_SELECTED_CONTROLLER.interrupt_reason.i_o = 1;
|
||||
BX_SELECTED_CONTROLLER.interrupt_reason.c_d = 1;
|
||||
BX_SELECTED_CONTROLLER.status.drive_ready = 1;
|
||||
@ -217,7 +217,7 @@
|
||||
goto return_value8;
|
||||
}
|
||||
- bx_panic("disk: IO read(0x1f2): current command not read/write\n");
|
||||
+ bio->printf("[HDD] IO read(0x1f2): current command(0x%x) not read/write\n",
|
||||
+ bio->printd("[HDD] IO read(0x1f2): current command(0x%x) not read/write\n",
|
||||
+ BX_SELECTED_CONTROLLER.current_command);
|
||||
+ value8 = BX_SELECTED_CONTROLLER.sector_count;
|
||||
+ goto return_value8;
|
||||
@ -241,7 +241,7 @@
|
||||
- if (bx_dbg.disk || (CDROM_SELECTED && bx_dbg.cdrom))
|
||||
- bx_printf("disk: 32-bit read from %04x = %08x {%s}\n",
|
||||
+ if (bio->getdbg().disk || (CDROM_SELECTED && bio->getdbg().cdrom))
|
||||
+ bio->printf("[HDD] 32-bit read from %04x = %08x {%s}\n",
|
||||
+ bio->printd("[HDD] 32-bit read from %04x = %08x {%s}\n",
|
||||
(unsigned) address, value32, DEVICE_TYPE_STRING);
|
||||
return value32;
|
||||
|
||||
@ -249,7 +249,7 @@
|
||||
- if (bx_dbg.disk || (CDROM_SELECTED && bx_dbg.cdrom))
|
||||
- bx_printf("disk: 16-bit read from %04x = %04x {%s}\n",
|
||||
+ if (bio->getdbg().disk || (CDROM_SELECTED && bio->getdbg().cdrom))
|
||||
+ bio->printf("[HDD] 16-bit read from %04x = %04x {%s}\n",
|
||||
+ bio->printd("[HDD] 16-bit read from %04x = %04x {%s}\n",
|
||||
(unsigned) address, value16, DEVICE_TYPE_STRING);
|
||||
return value16;
|
||||
|
||||
@ -257,7 +257,7 @@
|
||||
- if (bx_dbg.disk || (CDROM_SELECTED && bx_dbg.cdrom))
|
||||
- bx_printf("disk: 8-bit read from %04x = %02x {%s}\n",
|
||||
+ if (bio->getdbg().disk || (CDROM_SELECTED && bio->getdbg().cdrom))
|
||||
+ bio->printf("[HDD] 8-bit read from %04x = %02x {%s}\n",
|
||||
+ bio->printd("[HDD] 8-bit read from %04x = %02x {%s}\n",
|
||||
(unsigned) address, value8, DEVICE_TYPE_STRING);
|
||||
return value8;
|
||||
}
|
||||
@ -274,32 +274,32 @@
|
||||
switch (io_len) {
|
||||
case 1:
|
||||
- bx_printf("disk: 8-bit write to %04x = %02x {%s}\n",
|
||||
+ bio->printf("[HDD] 8-bit write to %04x = %02x {%s}\n",
|
||||
+ bio->printd("[HDD] 8-bit write to %04x = %02x {%s}\n",
|
||||
(unsigned) address, (unsigned) value, DEVICE_TYPE_STRING);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
- bx_printf("disk: 16-bit write to %04x = %04x {%s}\n",
|
||||
+ bio->printf("[HDD] 16-bit write to %04x = %04x {%s}\n",
|
||||
+ bio->printd("[HDD] 16-bit write to %04x = %04x {%s}\n",
|
||||
(unsigned) address, (unsigned) value, DEVICE_TYPE_STRING);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
- bx_printf("disk: 32-bit write to %04x = %08x {%s}\n",
|
||||
+ bio->printf("[HDD] 32-bit write to %04x = %08x {%s}\n",
|
||||
+ bio->printd("[HDD] 32-bit write to %04x = %08x {%s}\n",
|
||||
(unsigned) address, (unsigned) value, DEVICE_TYPE_STRING);
|
||||
break;
|
||||
|
||||
default:
|
||||
- bx_printf("disk: unknown-size write to %04x = %08x {%s}\n",
|
||||
+ bio->printf("[HDD] unknown-size write to %04x = %08x {%s}\n",
|
||||
+ bio->printd("[HDD] unknown-size write to %04x = %08x {%s}\n",
|
||||
(unsigned) address, (unsigned) value, DEVICE_TYPE_STRING);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
-//bx_printf("disk: IO write to %04x = %02x\n",
|
||||
+//bio->printf("[HDD] IO write to %04x = %02x\n",
|
||||
+//bio->printd("[HDD] IO write to %04x = %02x\n",
|
||||
// (unsigned) address, (unsigned) value);
|
||||
|
||||
switch (address) {
|
||||
@ -346,7 +346,7 @@
|
||||
- if (bx_dbg.cdrom)
|
||||
- bx_printf("cdrom: ATAPI command 0x%x started\n", atapi_command);
|
||||
+ if (bio->getdbg().cdrom)
|
||||
+ bio->printf("[CDD] ATAPI command 0x%x started\n", atapi_command);
|
||||
+ bio->printd("[CDD] ATAPI command 0x%x started\n", atapi_command);
|
||||
|
||||
switch (atapi_command) {
|
||||
case 0x00: // test unit ready
|
||||
@ -386,7 +386,7 @@
|
||||
default:
|
||||
// not implemeted by this device
|
||||
- bx_printf("cdrom: MODE SENSE PC=%x, PageCode=%x,"
|
||||
+ bio->printf("[CDD] MODE SENSE PC=%x, PageCode=%x,"
|
||||
+ bio->printd("[CDD] MODE SENSE PC=%x, PageCode=%x,"
|
||||
" not implemented by device\n",
|
||||
PC, PageCode);
|
||||
atapi_cmd_error(SENSE_ILLEGAL_REQUEST,
|
||||
@ -402,7 +402,7 @@
|
||||
default:
|
||||
// not implemeted by this device
|
||||
- bx_printf("cdrom: MODE SENSE PC=%x, PageCode=%x,"
|
||||
+ bio->printf("[CDD] MODE SENSE PC=%x, PageCode=%x,"
|
||||
+ bio->printd("[CDD] MODE SENSE PC=%x, PageCode=%x,"
|
||||
" not implemented by device\n",
|
||||
PC, PageCode);
|
||||
atapi_cmd_error(SENSE_ILLEGAL_REQUEST,
|
||||
@ -418,7 +418,7 @@
|
||||
default:
|
||||
// not implemeted by this device
|
||||
- bx_printf("cdrom: MODE SENSE PC=%x, PageCode=%x,"
|
||||
+ bio->printf("[CDD] MODE SENSE PC=%x, PageCode=%x,"
|
||||
+ bio->printd("[CDD] MODE SENSE PC=%x, PageCode=%x,"
|
||||
" not implemented by device\n",
|
||||
PC, PageCode);
|
||||
atapi_cmd_error(SENSE_ILLEGAL_REQUEST,
|
||||
@ -436,7 +436,7 @@
|
||||
if (BX_SELECTED_HD.cdrom.ready) {
|
||||
uint32 capacity = BX_SELECTED_HD.cdrom.capacity;
|
||||
- bx_printf("disk: Capacity is %d sectors (%d bytes)\n", capacity, capacity * 2048);
|
||||
+ bio->printf("[HDD] Capacity is %d sectors (%d bytes)\n", capacity, capacity * 2048);
|
||||
+ bio->printd("[HDD] Capacity is %d sectors (%d bytes)\n", capacity, capacity * 2048);
|
||||
BX_SELECTED_CONTROLLER.buffer[0] = (capacity >> 24) & 0xff;
|
||||
BX_SELECTED_CONTROLLER.buffer[1] = (capacity >> 16) & 0xff;
|
||||
BX_SELECTED_CONTROLLER.buffer[2] = (capacity >> 8) & 0xff;
|
||||
@ -472,7 +472,7 @@
|
||||
atapi_cmd_nop();
|
||||
raise_interrupt();
|
||||
- bx_printf("disk: READ(10) with transfer length 0, ok\n");
|
||||
+ bio->printf("[HDD] READ(10) with transfer length 0, ok\n");
|
||||
+ bio->printd("[HDD] READ(10) with transfer length 0, ok\n");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -481,7 +481,7 @@
|
||||
}
|
||||
|
||||
- //bx_printf("cdrom: READ LBA=%d LEN=%d\n", lba, transfer_length);
|
||||
+ //bio->printf("[CDD] READ LBA=%d LEN=%d\n", lba, transfer_length);
|
||||
+ //bio->printd("[CDD] READ LBA=%d LEN=%d\n", lba, transfer_length);
|
||||
|
||||
// handle command
|
||||
init_send_atapi_command(atapi_command, transfer_length * 2048,
|
||||
@ -490,7 +490,7 @@
|
||||
break;
|
||||
}
|
||||
- bx_printf("cdrom: SEEK (ignored)\n");
|
||||
+ bio->printf("[CDD] SEEK (ignored)\n");
|
||||
+ bio->printd("[CDD] SEEK (ignored)\n");
|
||||
atapi_cmd_nop();
|
||||
raise_interrupt();
|
||||
}
|
||||
@ -528,10 +528,10 @@
|
||||
+ if (bio->getdbg().disk || (CDROM_SELECTED && bio->getdbg().cdrom)) {
|
||||
if (value == 0xff)
|
||||
- bx_printf("disk: no precompensation {%s}\n", DEVICE_TYPE_STRING);
|
||||
+ bio->printf("[HDD] no precompensation {%s}\n", DEVICE_TYPE_STRING);
|
||||
+ bio->printd("[HDD] no precompensation {%s}\n", DEVICE_TYPE_STRING);
|
||||
else
|
||||
- bx_printf("disk: precompensation value %02x {%s}\n", (unsigned) value, DEVICE_TYPE_STRING);
|
||||
+ bio->printf("[HDD] precompensation value %02x {%s}\n", (unsigned) value, DEVICE_TYPE_STRING);
|
||||
+ bio->printd("[HDD] precompensation value %02x {%s}\n", (unsigned) value, DEVICE_TYPE_STRING);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -540,7 +540,7 @@
|
||||
- if (bx_dbg.disk || (CDROM_SELECTED && bx_dbg.cdrom))
|
||||
- bx_printf("disk: sector count = %u {%s}\n", (unsigned) value, DEVICE_TYPE_STRING);
|
||||
+ if (bio->getdbg().disk || (CDROM_SELECTED && bio->getdbg().cdrom))
|
||||
+ bio->printf("[HDD] sector count = %u {%s}\n", (unsigned) value, DEVICE_TYPE_STRING);
|
||||
+ bio->printd("[HDD] sector count = %u {%s}\n", (unsigned) value, DEVICE_TYPE_STRING);
|
||||
break;
|
||||
|
||||
case 0x1f3: /* hard disk sector number */
|
||||
@ -548,7 +548,7 @@
|
||||
- if (bx_dbg.disk || (CDROM_SELECTED && bx_dbg.cdrom))
|
||||
- bx_printf("disk: sector number = %u {%s}\n", (unsigned) value, DEVICE_TYPE_STRING);
|
||||
+ if (bio->getdbg().disk || (CDROM_SELECTED && bio->getdbg().cdrom))
|
||||
+ bio->printf("[HDD] sector number = %u {%s}\n", (unsigned) value, DEVICE_TYPE_STRING);
|
||||
+ bio->printd("[HDD] sector number = %u {%s}\n", (unsigned) value, DEVICE_TYPE_STRING);
|
||||
break;
|
||||
|
||||
case 0x1f4: /* hard disk cylinder low */
|
||||
@ -556,7 +556,7 @@
|
||||
- if (bx_dbg.disk || (CDROM_SELECTED && bx_dbg.cdrom))
|
||||
- bx_printf("disk: cylinder low = %02xh {%s}\n", (unsigned) value, DEVICE_TYPE_STRING);
|
||||
+ if (bio->getdbg().disk || (CDROM_SELECTED && bio->getdbg().cdrom))
|
||||
+ bio->printf("[HDD] cylinder low = %02xh {%s}\n", (unsigned) value, DEVICE_TYPE_STRING);
|
||||
+ bio->printd("[HDD] cylinder low = %02xh {%s}\n", (unsigned) value, DEVICE_TYPE_STRING);
|
||||
break;
|
||||
|
||||
case 0x1f5: /* hard disk cylinder high */
|
||||
@ -564,7 +564,7 @@
|
||||
- if (bx_dbg.disk || (CDROM_SELECTED && bx_dbg.cdrom))
|
||||
- bx_printf("disk: cylinder high = %02xh {%s}\n", (unsigned) value, DEVICE_TYPE_STRING);
|
||||
+ if (bio->getdbg().disk || (CDROM_SELECTED && bio->getdbg().cdrom))
|
||||
+ bio->printf("[HDD] cylinder high = %02xh {%s}\n", (unsigned) value, DEVICE_TYPE_STRING);
|
||||
+ bio->printd("[HDD] cylinder high = %02xh {%s}\n", (unsigned) value, DEVICE_TYPE_STRING);
|
||||
break;
|
||||
|
||||
case 0x1f6: // hard disk drive and head register
|
||||
@ -573,12 +573,12 @@
|
||||
// b3..0 HD3..HD0
|
||||
if ( (value & 0xe0) != 0xa0 ) // 101xxxxx
|
||||
- bx_printf("disk: IO write 1f6 (%02x): not 101xxxxxb\n", (unsigned) value);
|
||||
+ bio->printf("[HDD] IO write 1f6 (%02x): not 101xxxxxb\n", (unsigned) value);
|
||||
+ bio->printd("[HDD] IO write 1f6 (%02x): not 101xxxxxb\n", (unsigned) value);
|
||||
BX_HD_THIS drive_select = (value >> 4) & 0x01;
|
||||
WRITE_HEAD_NO(value & 0xf);
|
||||
if (BX_SELECTED_CONTROLLER.lba_mode == 0 && ((value >> 6) & 1) == 1)
|
||||
- bx_printf("disk: enabling LBA mode\n");
|
||||
+ bio->printf("[HDD] enabling LBA mode\n");
|
||||
+ bio->printd("[HDD] enabling LBA mode\n");
|
||||
WRITE_LBA_MODE((value >> 6) & 1);
|
||||
break;
|
||||
|
||||
@ -604,7 +604,7 @@
|
||||
BX_SELECTED_CONTROLLER.status.err = 1;
|
||||
raise_interrupt();
|
||||
- bx_printf("disk: calibrate drive != 0, with diskd not present\n");
|
||||
+ bio->printf("[HDD] calibrate drive != 0, with diskd not present\n");
|
||||
+ bio->printd("[HDD] calibrate drive != 0, with diskd not present\n");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -622,7 +622,7 @@
|
||||
!BX_SELECTED_CONTROLLER.cylinder_no &&
|
||||
!BX_SELECTED_CONTROLLER.sector_no) {
|
||||
- bx_printf("disk: Read from 0/0/0, aborting command\n");
|
||||
+ bio->printf("[HDD] Read from 0/0/0, aborting command\n");
|
||||
+ bio->printd("[HDD] Read from 0/0/0, aborting command\n");
|
||||
command_aborted(value);
|
||||
break;
|
||||
}
|
||||
@ -939,7 +939,7 @@
|
||||
bx_hard_drive_c::command_aborted(unsigned value)
|
||||
{
|
||||
- bx_printf("disk: aborting on command 0x%02x {%s}\n", value, DEVICE_TYPE_STRING);
|
||||
+ bio->printf("[HDD] aborting on command 0x%02x {%s}\n", value, DEVICE_TYPE_STRING);
|
||||
+ bio->printd("[HDD] aborting on command 0x%02x {%s}\n", value, DEVICE_TYPE_STRING);
|
||||
BX_SELECTED_CONTROLLER.current_command = 0;
|
||||
BX_SELECTED_CONTROLLER.status.busy = 0;
|
||||
BX_SELECTED_CONTROLLER.status.drive_ready = 1;
|
||||
|
@ -1,6 +1,6 @@
|
||||
$OpenBSD: patch-iodev_pic_cc,v 1.2 2001/02/02 22:07:46 todd Exp $
|
||||
$OpenBSD: patch-iodev_pic_cc,v 1.3 2001/03/30 18:53:25 todd Exp $
|
||||
--- iodev/pic.cc.orig Sat Mar 25 21:28:49 2000
|
||||
+++ iodev/pic.cc Fri Feb 2 16:07:23 2001
|
||||
+++ iodev/pic.cc Fri Mar 30 12:29:11 2001
|
||||
@@ -121,11 +121,11 @@ bx_pic_c::read(Bit32u address, unsigned
|
||||
UNUSED(this_ptr);
|
||||
#endif // !BX_USE_PIC_SMF
|
||||
@ -12,7 +12,7 @@ $OpenBSD: patch-iodev_pic_cc,v 1.2 2001/02/02 22:07:46 todd Exp $
|
||||
- if (bx_dbg.pic)
|
||||
- bx_printf("pic: IO read from %04x\n", (unsigned) address);
|
||||
+ if (bio->getdbg().pic)
|
||||
+ bio->printf("[PIC] IO read from %04x\n", (unsigned) address);
|
||||
+ bio->printd("[PIC] IO read from %04x\n", (unsigned) address);
|
||||
|
||||
/*
|
||||
8259A PIC
|
||||
@ -21,40 +21,40 @@ $OpenBSD: patch-iodev_pic_cc,v 1.2 2001/02/02 22:07:46 todd Exp $
|
||||
case 0x20:
|
||||
if (BX_PIC_THIS s.master_pic.read_reg_select) { /* ISR */
|
||||
- if (bx_dbg.pic) bx_printf("pic: read master ISR = %02x\n",
|
||||
+ if (bio->getdbg().pic) bio->printf("[PIC] read master ISR = %02x\n",
|
||||
+ if (bio->getdbg().pic) bio->printd("[PIC] read master ISR = %02x\n",
|
||||
(unsigned) BX_PIC_THIS s.master_pic.isr);
|
||||
return(BX_PIC_THIS s.master_pic.isr);
|
||||
}
|
||||
else { /* IRR */
|
||||
- if (bx_dbg.pic) bx_printf("pic: read master IRR = %02x\n",
|
||||
+ if (bio->getdbg().pic) bio->printf("[PIC] read master IRR = %02x\n",
|
||||
+ if (bio->getdbg().pic) bio->printd("[PIC] read master IRR = %02x\n",
|
||||
(unsigned) BX_PIC_THIS s.master_pic.irr);
|
||||
return(BX_PIC_THIS s.master_pic.irr);
|
||||
}
|
||||
break;
|
||||
case 0x21:
|
||||
- if (bx_dbg.pic) bx_printf("pic: read master IMR = %02x\n",
|
||||
+ if (bio->getdbg().pic) bio->printf("[PIC] read master IMR = %02x\n",
|
||||
+ if (bio->getdbg().pic) bio->printd("[PIC] read master IMR = %02x\n",
|
||||
(unsigned) BX_PIC_THIS s.master_pic.imr);
|
||||
return(BX_PIC_THIS s.master_pic.imr);
|
||||
break;
|
||||
case 0xA0:
|
||||
if (BX_PIC_THIS s.slave_pic.read_reg_select) { /* ISR */
|
||||
- if (bx_dbg.pic) bx_printf("pic: read slave ISR = %02x\n",
|
||||
+ if (bio->getdbg().pic) bio->printf("[PIC] read slave ISR = %02x\n",
|
||||
+ if (bio->getdbg().pic) bio->printd("[PIC] read slave ISR = %02x\n",
|
||||
(unsigned) BX_PIC_THIS s.slave_pic.isr);
|
||||
return(BX_PIC_THIS s.slave_pic.isr);
|
||||
}
|
||||
else { /* IRR */
|
||||
- if (bx_dbg.pic) bx_printf("pic: read slave IRR = %02x\n",
|
||||
+ if (bio->getdbg().pic) bio->printf("[PIC] read slave IRR = %02x\n",
|
||||
+ if (bio->getdbg().pic) bio->printd("[PIC] read slave IRR = %02x\n",
|
||||
(unsigned) BX_PIC_THIS s.slave_pic.irr);
|
||||
return(BX_PIC_THIS s.slave_pic.irr);
|
||||
}
|
||||
break;
|
||||
case 0xA1:
|
||||
- if (bx_dbg.pic) bx_printf("pic: read slave IMR = %02x\n",
|
||||
+ if (bio->getdbg().pic) bio->printf("[PIC] read slave IMR = %02x\n",
|
||||
+ if (bio->getdbg().pic) bio->printd("[PIC] read slave IMR = %02x\n",
|
||||
(unsigned) BX_PIC_THIS s.slave_pic.imr);
|
||||
return(BX_PIC_THIS s.slave_pic.imr);
|
||||
break;
|
||||
@ -76,7 +76,7 @@ $OpenBSD: patch-iodev_pic_cc,v 1.2 2001/02/02 22:07:46 todd Exp $
|
||||
- if (bx_dbg.pic)
|
||||
- bx_printf("pic: IO write to %04x = %02x\n",
|
||||
+ if (bio->getdbg().pic)
|
||||
+ bio->printf("[PIC] IO write to %04x = %02x\n",
|
||||
+ bio->printd("[PIC] IO write to %04x = %02x\n",
|
||||
(unsigned) address, (unsigned) value);
|
||||
|
||||
/*
|
||||
@ -88,13 +88,13 @@ $OpenBSD: patch-iodev_pic_cc,v 1.2 2001/02/02 22:07:46 todd Exp $
|
||||
- if (bx_dbg.pic) {
|
||||
- bx_printf("pic:master: init command 1 found\n");
|
||||
- bx_printf(" requires 4 = %u\n",
|
||||
+ // bio->printf("[PIC] master: init command 1 found %02x\n", (unsigned) value);
|
||||
+ // bio->printd("[PIC] master: init command 1 found %02x\n", (unsigned) value);
|
||||
+ if (bio->getdbg().pic) {
|
||||
+ bio->printf("[PIC] master: init command 1 found\n");
|
||||
+ bio->printf("[PIC] requires 4 = %u\n",
|
||||
+ bio->printd("[PIC] master: init command 1 found\n");
|
||||
+ bio->printd("[PIC] requires 4 = %u\n",
|
||||
(unsigned) (value & 0x01) );
|
||||
- bx_printf(" cascade mode: [0=cascade,1=single] %u\n",
|
||||
+ bio->printf("[PIC] cascade mode: [0=cascade,1=single] %u\n",
|
||||
+ bio->printd("[PIC] cascade mode: [0=cascade,1=single] %u\n",
|
||||
(unsigned) ((value & 0x02) >> 1));
|
||||
}
|
||||
BX_PIC_THIS s.master_pic.init.in_init = 1;
|
||||
@ -130,7 +130,7 @@ $OpenBSD: patch-iodev_pic_cc,v 1.2 2001/02/02 22:07:46 todd Exp $
|
||||
case 0xC7: // 7 6 5 4 3 2 1 0
|
||||
// ignore for now
|
||||
- bx_printf("pic: IRQ lowest command 0x%x\n", value);
|
||||
+ bio->printf("[PIC] IRQ lowest command 0x%x\n", value);
|
||||
+ bio->printd("[PIC] IRQ lowest command 0x%x\n", value);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -147,8 +147,8 @@ $OpenBSD: patch-iodev_pic_cc,v 1.2 2001/02/02 22:07:46 todd Exp $
|
||||
- bx_printf("pic:master: init command 2 = %02x\n", (unsigned) value);
|
||||
- bx_printf(" offset = INT %02x\n",
|
||||
+ if (bio->getdbg().pic) {
|
||||
+ bio->printf("[PIC] master: init command 2 = %02x\n", (unsigned) value);
|
||||
+ bio->printf("[PIC] offset = INT %02x\n",
|
||||
+ bio->printd("[PIC] master: init command 2 = %02x\n", (unsigned) value);
|
||||
+ bio->printd("[PIC] offset = INT %02x\n",
|
||||
BX_PIC_THIS s.master_pic.interrupt_offset);
|
||||
}
|
||||
return;
|
||||
@ -157,7 +157,7 @@ $OpenBSD: patch-iodev_pic_cc,v 1.2 2001/02/02 22:07:46 todd Exp $
|
||||
- if (bx_dbg.pic)
|
||||
- bx_printf("pic:master: init command 3 = %02x\n", (unsigned) value);
|
||||
+ if (bio->getdbg().pic)
|
||||
+ bio->printf("[PIC] master: init command 3 = %02x\n", (unsigned) value);
|
||||
+ bio->printd("[PIC] master: init command 3 = %02x\n", (unsigned) value);
|
||||
if (BX_PIC_THIS s.master_pic.init.requires_4) {
|
||||
BX_PIC_THIS s.master_pic.init.byte_expected = 4;
|
||||
}
|
||||
@ -170,15 +170,15 @@ $OpenBSD: patch-iodev_pic_cc,v 1.2 2001/02/02 22:07:46 todd Exp $
|
||||
- if (value & 0x02) bx_printf("pic: auto EOI\n");
|
||||
- else bx_printf("pic: normal EOI interrupt\n");
|
||||
+ if (bio->getdbg().pic) {
|
||||
+ bio->printf("[PIC] master: init command 4 = %02x\n", (unsigned) value);
|
||||
+ if (value & 0x02) bio->printf("[PIC] auto EOI\n");
|
||||
+ else bio->printf("[PIC] normal EOI interrupt\n");
|
||||
+ bio->printd("[PIC] master: init command 4 = %02x\n", (unsigned) value);
|
||||
+ if (value & 0x02) bio->printd("[PIC] auto EOI\n");
|
||||
+ else bio->printd("[PIC] normal EOI interrupt\n");
|
||||
}
|
||||
if (value & 0x01) {
|
||||
- if (bx_dbg.pic)
|
||||
- bx_printf("pic: 80x86 mode\n");
|
||||
+ if (bio->getdbg().pic)
|
||||
+ bio->printf("[PIC] 80x86 mode\n");
|
||||
+ bio->printd("[PIC] 80x86 mode\n");
|
||||
} else
|
||||
- bx_panic("pic: not 80x86 mode\n");
|
||||
+ bio->panic("[PIC] not 80x86 mode\n");
|
||||
@ -195,7 +195,7 @@ $OpenBSD: patch-iodev_pic_cc,v 1.2 2001/02/02 22:07:46 todd Exp $
|
||||
- if (bx_dbg.pic)
|
||||
- bx_printf("pic: setting master pic IMR to %02x\n", value);
|
||||
+ if (bio->getdbg().pic)
|
||||
+ bio->printf("[PIC] setting master pic IMR to %02x\n", value);
|
||||
+ bio->printd("[PIC] setting master pic IMR to %02x\n", value);
|
||||
BX_PIC_THIS s.master_pic.imr = value;
|
||||
service_master_pic();
|
||||
return;
|
||||
@ -207,11 +207,11 @@ $OpenBSD: patch-iodev_pic_cc,v 1.2 2001/02/02 22:07:46 todd Exp $
|
||||
- bx_printf("pic:slave: init command 1 found\n");
|
||||
- bx_printf(" requires 4 = %u\n",
|
||||
+ if (bio->getdbg().pic) {
|
||||
+ bio->printf("[PIC] slave: init command 1 found\n");
|
||||
+ bio->printf("[PIC] requires 4 = %u\n",
|
||||
+ bio->printd("[PIC] slave: init command 1 found\n");
|
||||
+ bio->printd("[PIC] requires 4 = %u\n",
|
||||
(unsigned) (value & 0x01) );
|
||||
- bx_printf(" cascade mode: [0=cascade,1=single] %u\n",
|
||||
+ bio->printf("[PIC] cascade mode: [0=cascade,1=single] %u\n",
|
||||
+ bio->printd("[PIC] cascade mode: [0=cascade,1=single] %u\n",
|
||||
(unsigned) ((value & 0x02) >> 1));
|
||||
}
|
||||
BX_PIC_THIS s.slave_pic.init.in_init = 1;
|
||||
@ -238,7 +238,7 @@ $OpenBSD: patch-iodev_pic_cc,v 1.2 2001/02/02 22:07:46 todd Exp $
|
||||
BX_PIC_THIS s.slave_pic.special_mask = 1;
|
||||
service_slave_pic();
|
||||
- bx_printf("pic:slave: OCW3 not implemented (%02x)\n",
|
||||
+ bio->printf("[PIC] slave: OCW3 not implemented (%02x)\n",
|
||||
+ bio->printd("[PIC] slave: OCW3 not implemented (%02x)\n",
|
||||
(unsigned) value);
|
||||
}
|
||||
return;
|
||||
@ -259,8 +259,8 @@ $OpenBSD: patch-iodev_pic_cc,v 1.2 2001/02/02 22:07:46 todd Exp $
|
||||
- bx_printf("pic:slave: init command 2 = %02x\n", (unsigned) value);
|
||||
- bx_printf(" offset = INT %02x\n",
|
||||
+ if (bio->getdbg().pic) {
|
||||
+ bio->printf("[PIC] slave: init command 2 = %02x\n", (unsigned) value);
|
||||
+ bio->printf("[PIC] offset = INT %02x\n",
|
||||
+ bio->printd("[PIC] slave: init command 2 = %02x\n", (unsigned) value);
|
||||
+ bio->printd("[PIC] offset = INT %02x\n",
|
||||
BX_PIC_THIS s.slave_pic.interrupt_offset);
|
||||
}
|
||||
return;
|
||||
@ -269,7 +269,7 @@ $OpenBSD: patch-iodev_pic_cc,v 1.2 2001/02/02 22:07:46 todd Exp $
|
||||
- if (bx_dbg.pic)
|
||||
- bx_printf("pic:slave: init command 3 = %02x\n", (unsigned) value);
|
||||
+ if (bio->getdbg().pic)
|
||||
+ bio->printf("[PIC] slave: init command 3 = %02x\n", (unsigned) value);
|
||||
+ bio->printd("[PIC] slave: init command 3 = %02x\n", (unsigned) value);
|
||||
if (BX_PIC_THIS s.slave_pic.init.requires_4) {
|
||||
BX_PIC_THIS s.slave_pic.init.byte_expected = 4;
|
||||
}
|
||||
@ -282,16 +282,16 @@ $OpenBSD: patch-iodev_pic_cc,v 1.2 2001/02/02 22:07:46 todd Exp $
|
||||
- if (value & 0x02) bx_printf("pic: auto EOI\n");
|
||||
- else bx_printf("pic: normal EOI interrupt\n");
|
||||
+ if (bio->getdbg().pic) {
|
||||
+ bio->printf("[PIC] slave: init command 4 = %02x\n", (unsigned) value);
|
||||
+ if (value & 0x02) bio->printf("[PIC] auto EOI\n");
|
||||
+ else bio->printf("[PIC] normal EOI interrupt\n");
|
||||
+ bio->printd("[PIC] slave: init command 4 = %02x\n", (unsigned) value);
|
||||
+ if (value & 0x02) bio->printd("[PIC] auto EOI\n");
|
||||
+ else bio->printd("[PIC] normal EOI interrupt\n");
|
||||
}
|
||||
if (value & 0x01) {
|
||||
- if (bx_dbg.pic)
|
||||
- bx_printf("pic: 80x86 mode\n");
|
||||
- } else bx_panic("pic: not 80x86 mode\n");
|
||||
+ if (bio->getdbg().pic)
|
||||
+ bio->printf("[PIC] 80x86 mode\n");
|
||||
+ bio->printd("[PIC] 80x86 mode\n");
|
||||
+ } else bio->panic("[PIC] not 80x86 mode\n");
|
||||
BX_PIC_THIS s.slave_pic.init.in_init = 0;
|
||||
return;
|
||||
@ -306,7 +306,7 @@ $OpenBSD: patch-iodev_pic_cc,v 1.2 2001/02/02 22:07:46 todd Exp $
|
||||
- if (bx_dbg.pic)
|
||||
- bx_printf("pic: setting slave pic IMR to %02x\n", value);
|
||||
+ if (bio->getdbg().pic)
|
||||
+ bio->printf("[PIC] setting slave pic IMR to %02x\n", value);
|
||||
+ bio->printd("[PIC] setting slave pic IMR to %02x\n", value);
|
||||
BX_PIC_THIS s.slave_pic.imr = value;
|
||||
service_slave_pic();
|
||||
return;
|
||||
@ -321,7 +321,7 @@ $OpenBSD: patch-iodev_pic_cc,v 1.2 2001/02/02 22:07:46 todd Exp $
|
||||
- if (bx_dbg.pic)
|
||||
- bx_printf("trigger_irq(%d decimal)\n", (unsigned) irq_no);
|
||||
+ if (bio->getdbg().pic)
|
||||
+ bio->printf("[PIC] trigger_irq(%d decimal)\n", (unsigned) irq_no);
|
||||
+ bio->printd("[PIC] trigger_irq(%d decimal)\n", (unsigned) irq_no);
|
||||
|
||||
if (irq_no <= 7) {
|
||||
irq_no_bitmask = 1 << irq_no;
|
||||
@ -336,7 +336,7 @@ $OpenBSD: patch-iodev_pic_cc,v 1.2 2001/02/02 22:07:46 todd Exp $
|
||||
- if (bx_dbg.pic)
|
||||
- bx_printf("untrigger_irq(%d decimal)\n", (unsigned) irq_no);
|
||||
+ if (bio->getdbg().pic)
|
||||
+ bio->printf("[PIC] untrigger_irq(%d decimal)\n", (unsigned) irq_no);
|
||||
+ bio->printd("[PIC] untrigger_irq(%d decimal)\n", (unsigned) irq_no);
|
||||
|
||||
if (irq_no <= 7) {
|
||||
irq_no_bitmask = 1 << irq_no;
|
||||
@ -356,7 +356,7 @@ $OpenBSD: patch-iodev_pic_cc,v 1.2 2001/02/02 22:07:46 todd Exp $
|
||||
- if (bx_dbg.pic)
|
||||
- bx_printf("pic: signalling IRQ(%u)\n",
|
||||
+ if (bio->getdbg().pic)
|
||||
+ bio->printf("[PIC] signalling IRQ(%u)\n",
|
||||
+ bio->printd("[PIC] signalling IRQ(%u)\n",
|
||||
(unsigned) irq);
|
||||
BX_PIC_THIS s.master_pic.irr &= ~(1 << irq);
|
||||
/*??? do for slave too: BX_PIC_THIS s.master_pic.isr |= (1 << irq);*/
|
||||
@ -376,7 +376,7 @@ $OpenBSD: patch-iodev_pic_cc,v 1.2 2001/02/02 22:07:46 todd Exp $
|
||||
- if (bx_dbg.pic)
|
||||
- bx_printf("pic(slave): signalling IRQ(%u)\n",
|
||||
+ if (bio->getdbg().pic)
|
||||
+ bio->printf("pic(slave): signalling IRQ(%u)\n",
|
||||
+ bio->printd("pic(slave): signalling IRQ(%u)\n",
|
||||
(unsigned) 8 + irq);
|
||||
BX_PIC_THIS s.slave_pic.irr &= ~(1 << irq);
|
||||
BX_PIC_THIS s.slave_pic.INT = 1;
|
||||
@ -388,8 +388,8 @@ $OpenBSD: patch-iodev_pic_cc,v 1.2 2001/02/02 22:07:46 todd Exp $
|
||||
-bx_printf("s.master_pic.isr = %02x\n", BX_PIC_THIS s.master_pic.isr);
|
||||
-bx_printf("s.master_pic.irr = %02x\n", BX_PIC_THIS s.master_pic.irr);
|
||||
-bx_printf("s.master_pic.irq = %02x\n", BX_PIC_THIS s.master_pic.irq);
|
||||
+bio->printf("[PIC] s.master_pic.imr = %02x\n", BX_PIC_THIS s.master_pic.imr);
|
||||
+bio->printf("[PIC] s.master_pic.isr = %02x\n", BX_PIC_THIS s.master_pic.isr);
|
||||
+bio->printf("[PIC] s.master_pic.irr = %02x\n", BX_PIC_THIS s.master_pic.irr);
|
||||
+bio->printf("[PIC] s.master_pic.irq = %02x\n", BX_PIC_THIS s.master_pic.irq);
|
||||
+bio->printd("[PIC] s.master_pic.imr = %02x\n", BX_PIC_THIS s.master_pic.imr);
|
||||
+bio->printd("[PIC] s.master_pic.isr = %02x\n", BX_PIC_THIS s.master_pic.isr);
|
||||
+bio->printd("[PIC] s.master_pic.irr = %02x\n", BX_PIC_THIS s.master_pic.irr);
|
||||
+bio->printd("[PIC] s.master_pic.irq = %02x\n", BX_PIC_THIS s.master_pic.irq);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user