diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-08-08 14:31:37 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-08-12 08:27:00 -0500 |
commit | 4333979e3d8c129953bba36ed87ce543d33cbea1 (patch) | |
tree | 397b3930ea9effa60bc0c01b3071fd0b7f938956 | |
parent | 9b024b5f965a3c11aa65435df5b9e8f1cc24d3fa (diff) |
pc: make vgabios exit port more useful
We've always listened on port 501 for vgabios panic messages. In the entire
time I've worked on QEMU, I've never actually seen a vgabios panic message :-)
If we change the semantics of this port a little bit, it makes it possible to
use it for more interesting use-cases. I chose this approach instead of adding
a new I/O port because it avoids having a guest visible change.
This change allows single-byte access to port 501 and also uses the value
written to construct an exit code.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r-- | hw/pc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -549,8 +549,7 @@ static void bochs_bios_write(void *opaque, uint32_t addr, uint32_t val) /* LGPL'ed VGA BIOS messages */ case 0x501: case 0x502: - fprintf(stderr, "VGA BIOS panic, line %d\n", val); - exit(1); + exit((val << 1) | 1); case 0x500: case 0x503: #ifdef DEBUG_BIOS @@ -591,6 +590,7 @@ static void *bochs_bios_init(void) register_ioport_write(0x403, 1, 1, bochs_bios_write, NULL); register_ioport_write(0x8900, 1, 1, bochs_bios_write, NULL); + register_ioport_write(0x501, 1, 1, bochs_bios_write, NULL); register_ioport_write(0x501, 1, 2, bochs_bios_write, NULL); register_ioport_write(0x502, 1, 2, bochs_bios_write, NULL); register_ioport_write(0x500, 1, 1, bochs_bios_write, NULL); |