summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/machdep.c16
-rw-r--r--sys/arch/amd64/include/biosvar.h10
-rw-r--r--sys/arch/amd64/stand/boot/conf.c4
-rw-r--r--sys/arch/amd64/stand/cdboot/conf.c4
-rw-r--r--sys/arch/amd64/stand/libsa/bioscons.c21
-rw-r--r--sys/arch/amd64/stand/libsa/cmd_i386.c15
-rw-r--r--sys/arch/amd64/stand/libsa/exec_i386.c5
-rw-r--r--sys/arch/amd64/stand/pxeboot/conf.c4
8 files changed, 55 insertions, 24 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index 25aa5bb7199..814a71658a2 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.153 2012/05/06 04:20:40 guenther Exp $ */
+/* $OpenBSD: machdep.c,v 1.154 2012/06/03 13:18:32 kettenis Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -1797,17 +1797,23 @@ getbootinfo(char *bootinfo, int bootinfo_size)
#endif
#endif
case BOOTARG_CONSDEV:
- if (q->ba_size >= sizeof(bios_consdev_t)) {
+ if (q->ba_size >= sizeof(bios_oconsdev_t)) {
bios_consdev_t *cdp =
(bios_consdev_t*)q->ba_arg;
#if NCOM > 0
static const int ports[] =
{ 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
int unit = minor(cdp->consdev);
- if (major(cdp->consdev) == 8 && unit >= 0 &&
- unit < (sizeof(ports)/sizeof(ports[0]))) {
+ int consaddr = -1;
+ if (q->ba_size >= sizeof(bios_consdev_t))
+ consaddr = cdp->consaddr;
+ if (consaddr == -1 && unit >= 0 &&
+ unit < (sizeof(ports)/sizeof(ports[0])))
+ consaddr = ports[unit];
+ if (major(cdp->consdev) == 8 &&
+ consaddr != -1) {
comconsunit = unit;
- comconsaddr = ports[unit];
+ comconsaddr = consaddr;
comconsrate = cdp->conspeed;
/* Probe the serial port this time. */
diff --git a/sys/arch/amd64/include/biosvar.h b/sys/arch/amd64/include/biosvar.h
index abdb416b45e..7c993d09439 100644
--- a/sys/arch/amd64/include/biosvar.h
+++ b/sys/arch/amd64/include/biosvar.h
@@ -1,5 +1,5 @@
/* XXX - DSR */
-/* $OpenBSD: biosvar.h,v 1.15 2012/01/11 15:58:27 jsing Exp $ */
+/* $OpenBSD: biosvar.h,v 1.16 2012/06/03 13:18:33 kettenis Exp $ */
/*
* Copyright (c) 1997-1999 Michael Shalayeff
@@ -196,8 +196,16 @@ typedef struct _bios_pciinfo {
typedef struct _bios_consdev {
dev_t consdev;
int conspeed;
+ int consaddr;
+ int consfreq;
} __packed bios_consdev_t;
+/* XXX Remove before OpenBSD 5.3 gets released. */
+typedef struct _bios_oconsdev {
+ dev_t consdev;
+ int conspeed;
+} __packed bios_oconsdev_t;
+
#define BOOTARG_BOOTMAC 7
typedef struct _bios_bootmac {
char mac[6];
diff --git a/sys/arch/amd64/stand/boot/conf.c b/sys/arch/amd64/stand/boot/conf.c
index 017370e1c31..07a8d41e5ec 100644
--- a/sys/arch/amd64/stand/boot/conf.c
+++ b/sys/arch/amd64/stand/boot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.22 2012/03/19 15:20:16 jsing Exp $ */
+/* $OpenBSD: conf.c,v 1.23 2012/06/03 13:18:33 kettenis Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -42,7 +42,7 @@
#include <biosdev.h>
#include <dev/cons.h>
-const char version[] = "3.19";
+const char version[] = "3.20";
int debug = 1;
diff --git a/sys/arch/amd64/stand/cdboot/conf.c b/sys/arch/amd64/stand/cdboot/conf.c
index 51b2534636f..b9d0b5ec142 100644
--- a/sys/arch/amd64/stand/cdboot/conf.c
+++ b/sys/arch/amd64/stand/cdboot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.19 2011/03/08 17:24:31 krw Exp $ */
+/* $OpenBSD: conf.c,v 1.20 2012/06/03 13:18:33 kettenis Exp $ */
/*
* Copyright (c) 2004 Tom Cosgrove
@@ -43,7 +43,7 @@
#include <biosdev.h>
#include <dev/cons.h>
-const char version[] = "3.16";
+const char version[] = "3.17";
int debug = 1;
diff --git a/sys/arch/amd64/stand/libsa/bioscons.c b/sys/arch/amd64/stand/libsa/bioscons.c
index d414a4f47ff..481289ef468 100644
--- a/sys/arch/amd64/stand/libsa/bioscons.c
+++ b/sys/arch/amd64/stand/libsa/bioscons.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bioscons.c,v 1.5 2008/04/20 01:46:35 dlg Exp $ */
+/* $OpenBSD: bioscons.c,v 1.6 2012/06/03 13:18:33 kettenis Exp $ */
/*
* Copyright (c) 1997-1999 Michael Shalayeff
@@ -132,11 +132,12 @@ com_probe(struct consdev *cn)
}
int com_speed = -1; /* default speed is 9600 baud */
+int com_addr = -1;
void
com_init(struct consdev *cn)
{
- int port = comports[minor(cn->cn_dev)];
+ int port = (com_addr == -1) ? comports[minor(cn->cn_dev)] : com_addr;
outb(port + com_ier, 0);
if (com_speed == -1)
@@ -153,7 +154,7 @@ com_init(struct consdev *cn)
int
com_getc(dev_t dev)
{
- int port = comports[minor(dev & 0x7f)];
+ int port = (com_addr == -1) ? comports[minor(dev & 0x7f)] : com_addr;
if (dev & 0x80)
return (inb(port + com_lsr) & LSR_RXRDY);
@@ -168,8 +169,9 @@ com_getc(dev_t dev)
int
comspeed(dev_t dev, int sp)
{
+ int port = (com_addr == -1) ? comports[minor(dev)] : com_addr;
int i, newsp;
- int err;
+ int err;
if (sp <= 0)
return com_speed;
@@ -206,10 +208,10 @@ comspeed(dev_t dev, int sp)
sleep(5);
}
- outb(comports[minor(dev)] + com_cfcr, LCR_DLAB);
- outb(comports[minor(dev)] + com_dlbl, newsp);
- outb(comports[minor(dev)] + com_dlbh, newsp>>8);
- outb(comports[minor(dev)] + com_cfcr, LCR_8BITS);
+ outb(port + com_cfcr, LCR_DLAB);
+ outb(port + com_dlbl, newsp);
+ outb(port + com_dlbh, newsp>>8);
+ outb(port + com_cfcr, LCR_8BITS);
if (com_speed != -1)
printf("\ncom%d: %d baud\n", minor(dev), sp);
@@ -221,11 +223,10 @@ comspeed(dev_t dev, int sp)
void
com_putc(dev_t dev, int c)
{
- int port = comports[minor(dev)];
+ int port = (com_addr == -1) ? comports[minor(dev)] : com_addr;
while ((inb(port + com_lsr) & LSR_TXRDY) == 0)
;
outb(port + com_data, c);
}
-
diff --git a/sys/arch/amd64/stand/libsa/cmd_i386.c b/sys/arch/amd64/stand/libsa/cmd_i386.c
index ea6c5f636b0..f2a4ddd2ea9 100644
--- a/sys/arch/amd64/stand/libsa/cmd_i386.c
+++ b/sys/arch/amd64/stand/libsa/cmd_i386.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd_i386.c,v 1.3 2010/07/02 00:36:52 weingart Exp $ */
+/* $OpenBSD: cmd_i386.c,v 1.4 2012/06/03 13:18:33 kettenis Exp $ */
/*
* Copyright (c) 1997-1999 Michael Shalayeff
@@ -41,6 +41,7 @@
extern const char version[];
int Xboot(void);
+int Xcomaddr(void);
int Xdiskinfo(void);
int Xmemory(void);
int Xregs(void);
@@ -50,6 +51,7 @@ int bootbuf(void *, int);
const struct cmd_table cmd_machine[] = {
{ "boot", CMDT_CMD, Xboot },
+ { "comaddr", CMDT_CMD, Xcomaddr },
{ "diskinfo", CMDT_CMD, Xdiskinfo },
{ "memory", CMDT_CMD, Xmemory },
#ifdef DEBUG
@@ -203,3 +205,14 @@ Xmemory(void)
return 0;
}
+
+int
+Xcomaddr(void)
+{
+ extern int com_addr;
+
+ if (cmd.argc >= 2)
+ com_addr = (int)strtol(cmd.argv[1], NULL, 0);
+
+ return 0;
+}
diff --git a/sys/arch/amd64/stand/libsa/exec_i386.c b/sys/arch/amd64/stand/libsa/exec_i386.c
index fce78a12636..82999fa0218 100644
--- a/sys/arch/amd64/stand/libsa/exec_i386.c
+++ b/sys/arch/amd64/stand/libsa/exec_i386.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_i386.c,v 1.8 2012/01/11 15:58:27 jsing Exp $ */
+/* $OpenBSD: exec_i386.c,v 1.9 2012/06/03 13:18:33 kettenis Exp $ */
/*
* Copyright (c) 1997-1998 Michael Shalayeff
@@ -54,6 +54,7 @@ run_loadfile(u_long *marks, int howto)
caddr_t av = (caddr_t)BOOTARG_OFF;
bios_consdev_t cd;
extern int com_speed; /* from bioscons.c */
+ extern int com_addr;
bios_ddb_t ddb;
extern int db_console;
bios_bootduid_t bootduid;
@@ -63,6 +64,8 @@ run_loadfile(u_long *marks, int howto)
cd.consdev = cn_tab->cn_dev;
cd.conspeed = com_speed;
+ cd.consaddr = com_addr;
+ cd.consfreq = 0;
addbootarg(BOOTARG_CONSDEV, sizeof(cd), &cd);
if (bootmac != NULL)
diff --git a/sys/arch/amd64/stand/pxeboot/conf.c b/sys/arch/amd64/stand/pxeboot/conf.c
index c253a7155a9..5d95c767ead 100644
--- a/sys/arch/amd64/stand/pxeboot/conf.c
+++ b/sys/arch/amd64/stand/pxeboot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.23 2011/03/08 17:24:31 krw Exp $ */
+/* $OpenBSD: conf.c,v 1.24 2012/06/03 13:18:33 kettenis Exp $ */
/*
* Copyright (c) 2004 Tom Cosgrove
@@ -45,7 +45,7 @@
#include "pxeboot.h"
#include "pxe_net.h"
-const char version[] = "3.16";
+const char version[] = "3.17";
int debug = 0;
#undef _TEST