diff options
author | Klemens Nanni <kn@cvs.openbsd.org> | 2023-09-08 20:47:23 +0000 |
---|---|---|
committer | Klemens Nanni <kn@cvs.openbsd.org> | 2023-09-08 20:47:23 +0000 |
commit | 3b1f086abf76bce20803800d62c87fefabefc2eb (patch) | |
tree | 88d69ae4406270faccc5b468820b853cd99c2ea3 /sys/arch/amd64 | |
parent | a8ce2ee981e9a9bbd855e2f250450bc41703f579 (diff) |
Clean up old console bootargs
7.3 is long gone, you must have new bootloaders and new kernels.
Zaps both condition and else block, unindent and merge lines where fit.
Feedback OK kettenis
Tests OK denis
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 73 | ||||
-rw-r--r-- | sys/arch/amd64/include/biosvar.h | 10 |
2 files changed, 23 insertions, 60 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index 8c5f398b88c..606630a9f0a 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.287 2023/08/23 01:55:45 cheloha Exp $ */ +/* $OpenBSD: machdep.c,v 1.288 2023/09/08 20:47:22 kn Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /*- @@ -2005,62 +2005,33 @@ getbootinfo(char *bootinfo, int bootinfo_size) case BOOTARG_PCIINFO: /* generated by i386 boot loader */ break; - case BOOTARG_CONSDEV: - if (q->ba_size > sizeof(bios_oconsdev_t) + - offsetof(struct _boot_args32, ba_arg)) { + case BOOTARG_CONSDEV: { #if NCOM > 0 - bios_consdev_t *cdp = - (bios_consdev_t*)q->ba_arg; - static const int ports[] = - { 0x3f8, 0x2f8, 0x3e8, 0x2e8 }; - int unit = minor(cdp->consdev); - uint64_t consaddr = cdp->consaddr; - if (consaddr == -1 && unit >= 0 && - unit < nitems(ports)) - consaddr = ports[unit]; - if (major(cdp->consdev) == 8 && - consaddr != -1) { - comconsunit = unit; - comconsaddr = consaddr; - comconsrate = cdp->conspeed; - comconsfreq = cdp->consfreq; - comcons_reg_width = cdp->reg_width; - comcons_reg_shift = cdp->reg_shift; - if (cdp->flags & BCD_MMIO) - comconsiot = X86_BUS_SPACE_MEM; - else - comconsiot = X86_BUS_SPACE_IO; - } -#endif -#ifdef BOOTINFO_DEBUG - printf(" console 0x%x:%d", - cdp->consdev, cdp->conspeed); -#endif - } else { -#if NCOM > 0 - bios_oconsdev_t *cdp = - (bios_oconsdev_t*)q->ba_arg; - static const int ports[] = - { 0x3f8, 0x2f8, 0x3e8, 0x2e8 }; - int unit = minor(cdp->consdev); - int consaddr = cdp->consaddr; - if (consaddr == -1 && unit >= 0 && - unit < nitems(ports)) - consaddr = ports[unit]; - if (major(cdp->consdev) == 8 && - consaddr != -1) { - comconsunit = unit; - comconsaddr = consaddr; - comconsrate = cdp->conspeed; + bios_consdev_t *cdp = (bios_consdev_t*)q->ba_arg; + static const int ports[] = + { 0x3f8, 0x2f8, 0x3e8, 0x2e8 }; + int unit = minor(cdp->consdev); + uint64_t consaddr = cdp->consaddr; + if (consaddr == -1 && unit >= 0 && unit < nitems(ports)) + consaddr = ports[unit]; + if (major(cdp->consdev) == 8 && consaddr != -1) { + comconsunit = unit; + comconsaddr = consaddr; + comconsrate = cdp->conspeed; + comconsfreq = cdp->consfreq; + comcons_reg_width = cdp->reg_width; + comcons_reg_shift = cdp->reg_shift; + if (cdp->flags & BCD_MMIO) + comconsiot = X86_BUS_SPACE_MEM; + else comconsiot = X86_BUS_SPACE_IO; - } + } #endif #ifdef BOOTINFO_DEBUG - printf(" console 0x%x:%d", - cdp->consdev, cdp->conspeed); + printf(" console 0x%x:%d", cdp->consdev, cdp->conspeed); #endif - } break; + } case BOOTARG_BOOTMAC: bios_bootmac = (bios_bootmac_t *)q->ba_arg; break; diff --git a/sys/arch/amd64/include/biosvar.h b/sys/arch/amd64/include/biosvar.h index 2d5b88f42e2..b0c71ea0350 100644 --- a/sys/arch/amd64/include/biosvar.h +++ b/sys/arch/amd64/include/biosvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: biosvar.h,v 1.31 2023/01/18 23:25:32 jsg Exp $ */ +/* $OpenBSD: biosvar.h,v 1.32 2023/09/08 20:47:22 kn Exp $ */ /* * Copyright (c) 1997-1999 Michael Shalayeff @@ -172,14 +172,6 @@ typedef struct _bios_consdev { int reg_shift; } __packed bios_consdev_t; -/* Old interface; remove after OpenBSD 7.3 is released */ -typedef struct _bios_oconsdev { - dev_t consdev; - int conspeed; - int consaddr; - int consfreq; -} __packed bios_oconsdev_t; - #define BOOTARG_BOOTMAC 7 typedef struct _bios_bootmac { char mac[6]; |