Hi,
> It looks like the patch didn't make it. Would you mind resending?
Patch has been sent by e-mail in the hope that it will arrive this
way. For any others who may be interested I included the patch text
below.
With kind regargs,
Erik
--- git/palacios/src/devices/serial.c 2011-01-11 11:03:36.755919400
+0100
+++ minix/palacios/src/devices/serial.c 2011-01-11 11:50:35.863163100
+0100
@@ -460,7 +460,7 @@
PrintDebug("Write to Data Port 0x%x (val=%x)\n", port, *val);
if (length != 1) {
- PrintDebug("Invalid length(%d) in write to 0x%x\n", length, port);
+ PrintError("Invalid length(%d) in write to 0x%x\n", length, port);
return -1;
}
@@ -473,7 +473,7 @@
com_port = get_com_from_port(state, port);
if (com_port == NULL) {
- PrintDebug("UART:read from NOBODY");
+ PrintError("UART:read from NOBODY");
return -1;
}
@@ -506,7 +506,7 @@
PrintDebug("Read from Data Port 0x%x\n", port);
if (length != 1) {
- PrintDebug("Invalid length(%d) in write to 0x%x\n", length, port);
+ PrintError("Invalid length(%d) in write to 0x%x\n", length, port);
return -1;
}
@@ -519,7 +519,7 @@
com_port = get_com_from_port(state, port);
if (com_port == NULL) {
- PrintDebug("UART:read from NOBODY");
+ PrintError("UART:read from NOBODY");
return -1;
}
@@ -589,7 +589,7 @@
PrintDebug("UART:Write to Control Port (val=%x)\n", val);
if (length != 1) {
- PrintDebug("UART:Invalid Write length to control port%d\n", port);
+ PrintError("UART:Invalid Write length to control port%d\n", port);
return -1;
}
@@ -653,7 +653,7 @@
break;
}
default:
- PrintDebug("UART:Write to NOBODY, ERROR");
+ PrintError("UART:Write to NOBODY, ERROR");
return -1;
}
@@ -673,7 +673,7 @@
PrintDebug("Read from Control Port\n");
if (length != 1) {
- PrintDebug("Invalid Read length to control port\n");
+ PrintError("Invalid Read length to control port\n");
return -1;
}
@@ -733,7 +733,7 @@
break;
default:
- PrintDebug("UART:read from NOBODY");
+ PrintError("UART:read from NOBODY");
return -1;
}
@@ -750,7 +750,7 @@
PrintDebug("Write to Status Port (val=%x)\n", val);
if (length != 1) {
- PrintDebug("Invalid Write length to status port %d\n", port);
+ PrintError("Invalid Write length to status port %d\n", port);
return -1;
}
@@ -779,7 +779,7 @@
break;
default:
- PrintDebug("UART:write to NOBODY");
+ PrintError("UART:write to NOBODY");
return -1;
}
@@ -794,11 +794,6 @@
PrintDebug("Read from Status Port 0x%x\n", port);
- if (length != 1) {
- PrintDebug("Invalid Read length to control port\n");
- return -1;
- }
-
com_port = get_com_from_port(state, port);
if (com_port == NULL) {
@@ -811,6 +806,11 @@
case COM2_LINE_STATUS_PORT:
case COM3_LINE_STATUS_PORT:
case COM4_LINE_STATUS_PORT:
+ if (length != 1) {
+ PrintError("Invalid Read length to LSR port\n");
+ return -1;
+ }
+
PrintDebug("UART:read from LSR");
*val = com_port->lsr.val;
@@ -822,12 +822,29 @@
case COM2_MODEM_STATUS_PORT:
case COM3_MODEM_STATUS_PORT:
case COM4_MODEM_STATUS_PORT:
- PrintDebug("UART:read from COM4 MSR");
- *val = com_port->msr.val;
+ switch (length) {
+ case 2:
+ /* Windows XP expects to be able to read this register and the next
in one go */
+ PrintDebug("UART:word read from COM4 MSR");
+ if (read_ctrl_port(core, port + 1, val + 1, 1, priv_data) < 0)
return -1;
+ /* fall through */
+ case 1:
+ PrintDebug("UART:read from COM4 MSR");
+ *val = com_port->msr.val;
+ break;
+ default:
+ PrintError("Invalid Read length to MSR port\n");
+ return -1;
+ }
break;
default:
- PrintDebug("UART:read from NOBODY");
+ if (length != 1) {
+ PrintError("Invalid Read length to status port\n");
+ return -1;
+ }
+
+ PrintError("UART:read from NOBODY");
return -1;
}