aboutsummaryrefslogtreecommitdiffstats
path: root/xen
diff options
context:
space:
mode:
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2003-09-22 22:14:13 +0000
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2003-09-22 22:14:13 +0000
commit4cbc390bba6f7c15f95a1804516d7d42e41b2cec (patch)
tree636ce885f9df16c9dfc87bd31568282466cbe199 /xen
parent3c64421304ae2b2ca8e8e0a883c621f4b67ec603 (diff)
downloadxen-4cbc390bba6f7c15f95a1804516d7d42e41b2cec.tar.gz
xen-4cbc390bba6f7c15f95a1804516d7d42e41b2cec.tar.bz2
xen-4cbc390bba6f7c15f95a1804516d7d42e41b2cec.zip
bitkeeper revision 1.458 (3f6f7435Or79x1vh5ypTVbN9G7OJUg)
config.h, xen_serial.c, kernel.c, README.CD: Allow serial I/O to be entirely disabled, and make this teh default. Enable by specifying a ser_baud during boot.
Diffstat (limited to 'xen')
-rw-r--r--xen/common/kernel.c8
-rw-r--r--xen/drivers/char/xen_serial.c3
-rw-r--r--xen/include/xeno/config.h7
3 files changed, 16 insertions, 2 deletions
diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index 7b384a90ca..032c96236e 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -48,7 +48,8 @@ void start_of_day(void);
/* opt_console: If true, Xen sends logging to the VGA console. */
int opt_console = 1;
/* opt_ser_baud: Baud rate at which logging is sent to COM1. */
-unsigned int opt_ser_baud = 9600;
+/* NB. Default (0) means that serial I/O is disabled. */
+unsigned int opt_ser_baud = 0;
/* opt_dom0_mem: Kilobytes of memory allocated to domain 0. */
unsigned int opt_dom0_mem = 16000;
/* opt_ifname: Name of physical network interface to use. */
@@ -232,6 +233,9 @@ void cmain (unsigned long magic, multiboot_info_t *mbi)
void init_serial(void)
{
+ if ( !SERIAL_ENABLED )
+ return;
+
/* 'opt_ser_baud' baud, no parity, 1 stop bit, 8 data bits. */
outb(0x83, SERIAL_BASE+DATA_FORMAT);
outb(115200/opt_ser_baud, SERIAL_BASE+DIVISOR_LO);
@@ -249,6 +253,8 @@ void init_serial(void)
#ifdef CONFIG_OUTPUT_SERIAL
void putchar_serial(unsigned char c)
{
+ if ( !SERIAL_ENABLED )
+ return;
if ( c == '\n' ) putchar_serial('\r');
while ( !(inb(SERIAL_BASE+LINE_STATUS)&(1<<5)) ) barrier();
outb(c, SERIAL_BASE+TX_HOLD);
diff --git a/xen/drivers/char/xen_serial.c b/xen/drivers/char/xen_serial.c
index 2d0d3a2f5a..c6457bf998 100644
--- a/xen/drivers/char/xen_serial.c
+++ b/xen/drivers/char/xen_serial.c
@@ -71,6 +71,9 @@ static void serial_rx_int(int irq, void *dev_id, struct pt_regs *regs)
void initialize_serial()
{
int rc;
+
+ if ( !SERIAL_ENABLED )
+ return;
/* setup key handler */
add_key_handler('~', toggle_echo, "toggle serial echo");
diff --git a/xen/include/xeno/config.h b/xen/include/xeno/config.h
index b4935f706f..a4a62cafe2 100644
--- a/xen/include/xeno/config.h
+++ b/xen/include/xeno/config.h
@@ -146,9 +146,14 @@
#define capable(_c) 0
#ifndef __ASSEMBLY__
+
extern unsigned long _end; /* standard ELF symbol */
extern void __out_of_line_bug(int line) __attribute__((noreturn));
#define out_of_line_bug() __out_of_line_bug(__LINE__)
-#endif
+
+extern unsigned int opt_ser_baud;
+#define SERIAL_ENABLED (opt_ser_baud != 0)
+
+#endif /* __ASSEMBLY__ */
#endif /* __XENO_CONFIG_H__ */