aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2013-05-31 08:05:57 -0700
committerH. Peter Anvin <hpa@zytor.com>2013-05-31 08:08:36 -0700
commitc4fa33189f1d725fcd7c7457e45f37e970f5cdac (patch)
treedd731a228b6023f4ff1e20a728d9e60634ed20a6 /com32
parentbe5a345d385d14bb740df7075c78dec5dcfbfc2a (diff)
downloadsyslinux-c4fa33189f1d725fcd7c7457e45f37e970f5cdac.tar.gz
syslinux-c4fa33189f1d725fcd7c7457e45f37e970f5cdac.tar.xz
syslinux-c4fa33189f1d725fcd7c7457e45f37e970f5cdac.zip
serial: Clean up and abstract handling of serial ports
The special handling of serial ports 0-3 meaning "look in a BIOS table" is at least officially BIOS-specific, so create an inline function and move it to bios.h. While we are at it, make the function look slightly less like converted assembly. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'com32')
-rw-r--r--com32/elflink/ldlinux/readconfig.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/com32/elflink/ldlinux/readconfig.c b/com32/elflink/ldlinux/readconfig.c
index 7ac216b0..7701acfe 100644
--- a/com32/elflink/ldlinux/readconfig.c
+++ b/com32/elflink/ldlinux/readconfig.c
@@ -1,7 +1,7 @@
/* ----------------------------------------------------------------------- *
*
* Copyright 2004-2009 H. Peter Anvin - All Rights Reserved
- * Copyright 2009 Intel Corporation; author: H. Peter Anvin
+ * Copyright 2009-2013 Intel Corporation; author: H. Peter Anvin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -759,7 +759,6 @@ static uint8_t SerialNotice = 1;
#define DEFAULT_BAUD 9600
#define BAUD_DIVISOR 115200
-#define serial_base 0x0400
extern void sirq_cleanup_nowipe(void);
extern void sirq_install(void);
@@ -1279,18 +1278,7 @@ do_include:
baud = BAUD_DIVISOR / baud;
baud &= 0xffff;
BaudDivisor = baud;
-
- /*
- * If port > 3 then port is I/O addr
- */
- if (port <= 3) {
- /* Get the I/O port from the BIOS */
- port <<= 1;
- port = *(volatile uint16_t *)(serial_base + port);
- }
-
-
- SerialPort = port;
+ SerialPort = get_serial_port(port);
/*
* Begin code to actually set up the serial port