From: Pekka Enberg Date: Sun, 11 Apr 2010 18:05:36 +0000 (+0300) Subject: kvm: Clean up early serial code X-Git-Tag: next-20110824~3^2~528^2~161 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9e855eb9afc15b3312011c9526879b2d669b3ab4;p=karo-tx-linux.git kvm: Clean up early serial code Use similar constants and variable names as in arch/x86/kernel/early_printk.c in the Linux kernel. Signed-off-by: Pekka Enberg --- diff --git a/tools/kvm/early_printk.c b/tools/kvm/early_printk.c index 026ab7895209..49e58d452e87 100644 --- a/tools/kvm/early_printk.c +++ b/tools/kvm/early_printk.c @@ -4,6 +4,13 @@ #include +static int early_serial_base = 0x3f8; /* ttyS0 */ + +#define XMTRDY 0x20 + +#define TXR 0 /* Transmit register (WRITE) */ +#define LSR 5 /* Line Status */ + static bool early_serial_txr_out(struct kvm *self, uint16_t port, void *data, int size, uint32_t count) { char *p = data; @@ -21,7 +28,7 @@ static bool early_serial_lsr_in(struct kvm *self, uint16_t port, void *data, int { uint8_t *p = data; - *p = 0x20; /* xmtrdy */ + *p = XMTRDY; return true; } @@ -32,6 +39,6 @@ static struct ioport_operations early_serial_lsr_ops = { void early_printk__init(void) { - ioport__register(0x03F8, &early_serial_txr_ops); - ioport__register(0x03FD, &early_serial_lsr_ops); + ioport__register(early_serial_base + TXR, &early_serial_txr_ops); + ioport__register(early_serial_base + LSR, &early_serial_lsr_ops); }