aboutsummaryrefslogtreecommitdiffstats
path: root/src/output.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-05-12 22:59:41 -0400
committerKevin O'Connor <kevin@koconnor.net>2009-05-12 22:59:41 -0400
commitc151b3bf755c7dcdadd38500138f66de8a731578 (patch)
treeae57cfa4bde32747d6682ac7b80dbebc525a05a8 /src/output.c
parentd9fc0a09f744fe9aec3de8e51c1c8cf393d735c0 (diff)
downloadseabios-c151b3bf755c7dcdadd38500138f66de8a731578.tar.gz
Improve serial port detection.
Add port names for serial port registers. When detecting serial port, ignore top two bits of IIR register.
Diffstat (limited to 'src/output.c')
-rw-r--r--src/output.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/output.c b/src/output.c
index 518730a2..96f444f8 100644
--- a/src/output.c
+++ b/src/output.c
@@ -12,7 +12,7 @@
#include "config.h" // CONFIG_*
#include "biosvar.h" // GET_GLOBAL
-#define DEBUG_PORT 0x03f8
+#define DEBUG_PORT PORT_SERIAL1
#define DEBUG_TIMEOUT 100000
void
@@ -22,12 +22,12 @@ debug_serial_setup()
return;
// setup for serial logging: 8N1
u8 oldparam, newparam = 0x03;
- oldparam = inb(DEBUG_PORT+3);
- outb(newparam, DEBUG_PORT+3);
+ oldparam = inb(DEBUG_PORT+SEROFF_LCR);
+ outb(newparam, DEBUG_PORT+SEROFF_LCR);
// Disable irqs
u8 oldier, newier = 0;
- oldier = inb(DEBUG_PORT+1);
- outb(newier, DEBUG_PORT+1);
+ oldier = inb(DEBUG_PORT+SEROFF_IER);
+ outb(newier, DEBUG_PORT+SEROFF_IER);
if (oldparam != newparam || oldier != newier)
dprintf(1, "Changing serial settings was %x/%x now %x/%x\n"
@@ -39,11 +39,11 @@ static void
debug_serial(char c)
{
int timeout = DEBUG_TIMEOUT;
- while ((inb(DEBUG_PORT+5) & 0x60) != 0x60)
+ while ((inb(DEBUG_PORT+SEROFF_LSR) & 0x60) != 0x60)
if (!timeout--)
// Ran out of time.
return;
- outb(c, DEBUG_PORT);
+ outb(c, DEBUG_PORT+SEROFF_DATA);
}
// Show a character on the screen.