#include <stdio.h>
+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;
{
uint8_t *p = data;
- *p = 0x20; /* xmtrdy */
+ *p = XMTRDY;
return true;
}
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);
}