summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2013-11-02 15:02:28 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2013-11-02 15:02:28 +0000
commit1a80b58394d3fe0b52f48d0cdbf9ce121666e2a2 (patch)
treef8211881a8f32a37d350e7e152ec76467be91ddc /sys
parentc4d758fac0ed5b703d0a9570e58d3d36af6e6309 (diff)
Cleanup bios_oconsdev_t. Make sure you have a halfway recent bootloader
(at least BOOT 3.20 on amd64 and BOOT 3.18 on i386) or you'll risk losing your serial console. ok deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/machdep.c9
-rw-r--r--sys/arch/amd64/include/biosvar.h8
-rw-r--r--sys/arch/i386/i386/bios.c9
-rw-r--r--sys/arch/i386/include/biosvar.h8
4 files changed, 8 insertions, 26 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index 80e2c7855d1..2873bedfd2a 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.169 2013/10/05 17:25:00 guenther Exp $ */
+/* $OpenBSD: machdep.c,v 1.170 2013/11/02 15:02:27 kettenis Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -1856,7 +1856,7 @@ getbootinfo(char *bootinfo, int bootinfo_size)
#endif
#endif
case BOOTARG_CONSDEV:
- if (q->ba_size >= sizeof(bios_oconsdev_t) +
+ if (q->ba_size >= sizeof(bios_consdev_t) +
offsetof(struct _boot_args32, ba_arg)) {
bios_consdev_t *cdp =
(bios_consdev_t*)q->ba_arg;
@@ -1864,10 +1864,7 @@ getbootinfo(char *bootinfo, int bootinfo_size)
static const int ports[] =
{ 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
int unit = minor(cdp->consdev);
- int consaddr = -1;
- if (q->ba_size >= sizeof(bios_consdev_t) +
- offsetof(struct _boot_args32, ba_arg))
- consaddr = cdp->consaddr;
+ int consaddr = cdp->consaddr;
if (consaddr == -1 && unit >= 0 &&
unit < (sizeof(ports)/sizeof(ports[0])))
consaddr = ports[unit];
diff --git a/sys/arch/amd64/include/biosvar.h b/sys/arch/amd64/include/biosvar.h
index f3bf6d59ea7..8163f27be66 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.18 2013/03/23 16:12:20 deraadt Exp $ */
+/* $OpenBSD: biosvar.h,v 1.19 2013/11/02 15:02:27 kettenis Exp $ */
/*
* Copyright (c) 1997-1999 Michael Shalayeff
@@ -200,12 +200,6 @@ typedef struct _bios_consdev {
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/i386/i386/bios.c b/sys/arch/i386/i386/bios.c
index e2e6d4e566e..3a5eb859fc1 100644
--- a/sys/arch/i386/i386/bios.c
+++ b/sys/arch/i386/i386/bios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bios.c,v 1.102 2013/10/16 13:41:17 deraadt Exp $ */
+/* $OpenBSD: bios.c,v 1.103 2013/11/02 15:02:27 kettenis Exp $ */
/*
* Copyright (c) 1997-2001 Michael Shalayeff
@@ -547,7 +547,7 @@ bios_getopt()
break;
#endif
case BOOTARG_CONSDEV:
- if (q->ba_size >= sizeof(bios_oconsdev_t) +
+ if (q->ba_size >= sizeof(bios_consdev_t) +
offsetof(bootarg_t, ba_arg)) {
bios_consdev_t *cdp =
(bios_consdev_t*)q->ba_arg;
@@ -555,10 +555,7 @@ bios_getopt()
static const int ports[] =
{ 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
int unit = minor(cdp->consdev);
- int consaddr = -1;
- if (q->ba_size >= sizeof(bios_consdev_t) +
- offsetof(bootarg_t, ba_arg))
- consaddr = cdp->consaddr;
+ int consaddr = cdp->consaddr;
if (consaddr == -1 && unit >=0 &&
unit < (sizeof(ports)/sizeof(ports[0])))
consaddr = ports[unit];
diff --git a/sys/arch/i386/include/biosvar.h b/sys/arch/i386/include/biosvar.h
index 37f2efd19e7..1f95cdc1376 100644
--- a/sys/arch/i386/include/biosvar.h
+++ b/sys/arch/i386/include/biosvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: biosvar.h,v 1.60 2013/03/23 16:12:23 deraadt Exp $ */
+/* $OpenBSD: biosvar.h,v 1.61 2013/11/02 15:02:27 kettenis Exp $ */
/*
* Copyright (c) 1997-1999 Michael Shalayeff
@@ -200,12 +200,6 @@ typedef struct _bios_consdev {
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_SMPINFO 6 /* struct mp_float[] */
#define BOOTARG_BOOTMAC 7