summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuliusz Chroboczek <jch@pps.jussieu.fr>2006-11-06 02:29:49 +0100
committerJuliusz Chroboczek <jch@pps.jussieu.fr>2006-11-06 02:29:49 +0100
commitaa0261a98e9d5b1349b33e2639bd83c556dd4000 (patch)
tree128bae25388c5b29685c00b3a648624e500be3ac
parent6b2c65fdd169037c6ede250d4a8fec3d29a080ae (diff)
Improve vm86 error handling in Xvesa.
-rw-r--r--hw/kdrive/vesa/vm86.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/hw/kdrive/vesa/vm86.c b/hw/kdrive/vesa/vm86.c
index c4aadbd85..d09a36dee 100644
--- a/hw/kdrive/vesa/vm86.c
+++ b/hw/kdrive/vesa/vm86.c
@@ -235,13 +235,9 @@ Vm86DoInterrupt(Vm86InfoPtr vi, int num)
OsBlockSignals ();
code = vm86_loop(vi);
OsReleaseSignals ();
- if(code < 0) {
- ErrorF("vm86 failed (errno %d)\n", errno);
+ if(code != 0)
return -1;
- } else if(code != 0) {
- ErrorF("vm86 returned 0x%04X\n", code);
- return -1;
- } else
+ else
return 0;
}
@@ -269,14 +265,10 @@ Vm86DoPOST(Vm86InfoPtr vi)
OsBlockSignals ();
code = vm86_loop(vi);
OsReleaseSignals ();
- if(code < 0) {
- ErrorF("vm86 failed (errno %d)\n", errno);
- return -1;
- } else if(code != 0) {
- ErrorF("vm86 returned 0x%04X\n", code);
+ if(code != 0)
return -1;
- } else
- return 0;
+ else
+ return 0;
}
#define DEBUG_VBE 0
@@ -573,8 +565,17 @@ vm86_loop(Vm86InfoPtr vi)
Vm86Debug(vi);
return -1;
default:
- ErrorF("Unexpected result code 0x%X from vm86\n", code);
- Vm86Debug(vi);
+ if(code < 0) {
+ if(errno == ENOSYS) {
+ ErrorF("No vm86 support. Are you running on AMD64?\n");
+ } else {
+ ErrorF("vm86 failed (errno = %d).\n", errno);
+ Vm86Debug(vi);
+ }
+ } else {
+ ErrorF("Unexpected result code 0x%X from vm86\n", code);
+ Vm86Debug(vi);
+ }
return -1;
}
}