From 491bb53ae4e146b2682e22062a1ebf5064292f94 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Mon, 8 May 2006 14:36:11 +0000 Subject: Replace gazillions of badvaddr() or badwordaddr() calls with badaddr() calls. With a few prototype declarations shuffling, this finally allows to die. --- sys/arch/mvme88k/dev/bussw.c | 11 +++-------- sys/arch/mvme88k/dev/cl.c | 5 ++--- sys/arch/mvme88k/dev/dart.c | 5 ++--- sys/arch/mvme88k/dev/if_ie.c | 4 ++-- sys/arch/mvme88k/dev/if_le.c | 4 ++-- sys/arch/mvme88k/dev/memc.c | 4 ++-- sys/arch/mvme88k/dev/nvram.c | 4 ++-- sys/arch/mvme88k/dev/osiop_pcctwo.c | 8 ++++---- sys/arch/mvme88k/dev/pcctwo.c | 4 ++-- sys/arch/mvme88k/dev/vme.c | 11 +---------- sys/arch/mvme88k/dev/vs.c | 6 +++--- sys/arch/mvme88k/dev/vx.c | 4 ++-- 12 files changed, 27 insertions(+), 43 deletions(-) (limited to 'sys/arch/mvme88k/dev') diff --git a/sys/arch/mvme88k/dev/bussw.c b/sys/arch/mvme88k/dev/bussw.c index 1258509c9c3..f15038d220e 100644 --- a/sys/arch/mvme88k/dev/bussw.c +++ b/sys/arch/mvme88k/dev/bussw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bussw.c,v 1.16 2005/07/18 02:43:25 fgsch Exp $ */ +/* $OpenBSD: bussw.c,v 1.17 2006/05/08 14:36:10 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * @@ -26,16 +26,11 @@ #include #include -#include #include #include -#include -#include -#include + #include #include -#include -#include #include @@ -78,7 +73,7 @@ bussw_match(parent, vcf, args) if (bus_space_map(ca->ca_iot, ca->ca_paddr, BS_SIZE, 0, &ioh) != 0) return 0; - rc = badvaddr((vaddr_t)bus_space_vaddr(ca->ca_iot, ioh), 4); + rc = badaddr((vaddr_t)bus_space_vaddr(ca->ca_iot, ioh), 4); if (rc == 0) { chipid = bus_space_read_1(ca->ca_iot, ioh, BS_CHIPID); if (chipid != BUSSWITCH_ID) { diff --git a/sys/arch/mvme88k/dev/cl.c b/sys/arch/mvme88k/dev/cl.c index 08cd39db96a..010afea9399 100644 --- a/sys/arch/mvme88k/dev/cl.c +++ b/sys/arch/mvme88k/dev/cl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cl.c,v 1.51 2006/04/15 22:29:49 miod Exp $ */ +/* $OpenBSD: cl.c,v 1.52 2006/05/08 14:36:10 miod Exp $ */ /* * Copyright (c) 1995 Dale Rahn. All rights reserved. @@ -39,7 +39,6 @@ #include #include #include -#include #include #include @@ -230,7 +229,7 @@ clprobe(parent, self, aux) if (bus_space_map(ca->ca_iot, ca->ca_paddr, CD2400_SIZE, 0, &ioh) != 0) return 0; - rc = badvaddr((vaddr_t)bus_space_vaddr(ca->ca_iot, ioh), 1); + rc = badaddr((vaddr_t)bus_space_vaddr(ca->ca_iot, ioh), 1); bus_space_unmap(ca->ca_iot, ioh, CD2400_SIZE); return rc == 0; } diff --git a/sys/arch/mvme88k/dev/dart.c b/sys/arch/mvme88k/dev/dart.c index 218eb3d4c79..8616f729176 100644 --- a/sys/arch/mvme88k/dev/dart.c +++ b/sys/arch/mvme88k/dev/dart.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dart.c,v 1.47 2006/04/17 13:30:02 miod Exp $ */ +/* $OpenBSD: dart.c,v 1.48 2006/05/08 14:36:10 miod Exp $ */ /* * Mach Operating System @@ -36,7 +36,6 @@ #include #include #include -#include #include @@ -131,7 +130,7 @@ dartmatch(struct device *parent, void *cf, void *aux) if (bus_space_map(ca->ca_iot, ca->ca_paddr, DART_SIZE, 0, &ioh) != 0) return (0); - rc = badvaddr((vaddr_t)bus_space_vaddr(ca->ca_iot, ioh), 4); + rc = badaddr((vaddr_t)bus_space_vaddr(ca->ca_iot, ioh), 4); bus_space_unmap(ca->ca_iot, ca->ca_paddr, DART_SIZE); return (rc == 0); diff --git a/sys/arch/mvme88k/dev/if_ie.c b/sys/arch/mvme88k/dev/if_ie.c index 05690af57ee..107cb65fcbe 100644 --- a/sys/arch/mvme88k/dev/if_ie.c +++ b/sys/arch/mvme88k/dev/if_ie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ie.c,v 1.40 2006/04/17 13:39:48 miod Exp $ */ +/* $OpenBSD: if_ie.c,v 1.41 2006/05/08 14:36:10 miod Exp $ */ /*- * Copyright (c) 1998 Steve Murphree, Jr. @@ -343,7 +343,7 @@ iematch(parent, vcf, args) { struct confargs *ca = args; - if (badvaddr(ca->ca_paddr, 1)) { + if (badaddr(ca->ca_paddr, 1)) { return(0); } diff --git a/sys/arch/mvme88k/dev/if_le.c b/sys/arch/mvme88k/dev/if_le.c index e23e69cbd3d..d7f203103c5 100644 --- a/sys/arch/mvme88k/dev/if_le.c +++ b/sys/arch/mvme88k/dev/if_le.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le.c,v 1.14 2006/04/26 21:09:48 miod Exp $ */ +/* $OpenBSD: if_le.c,v 1.15 2006/05/08 14:36:10 miod Exp $ */ /*- * Copyright (c) 1982, 1992, 1993 @@ -219,7 +219,7 @@ lematch(parent, vcf, args) if (bus_space_map(iot, ca->ca_paddr, PAGE_SIZE, 0, &ioh) != 0) return 0; - rc = badvaddr((vaddr_t)bus_space_vaddr(iot, ioh), 2); + rc = badaddr((vaddr_t)bus_space_vaddr(iot, ioh), 2); bus_space_unmap(iot, ioh, PAGE_SIZE); return rc == 0; diff --git a/sys/arch/mvme88k/dev/memc.c b/sys/arch/mvme88k/dev/memc.c index ec762b816a3..0a7ba2a87ea 100644 --- a/sys/arch/mvme88k/dev/memc.c +++ b/sys/arch/mvme88k/dev/memc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: memc.c,v 1.11 2004/07/30 19:02:06 miod Exp $ */ +/* $OpenBSD: memc.c,v 1.12 2006/05/08 14:36:10 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -79,7 +79,7 @@ memcmatch(parent, vcf, args) struct confargs *ca = args; struct memcreg *memc = (struct memcreg *)ca->ca_paddr; - if (badvaddr((vaddr_t)memc, 4)) + if (badaddr((vaddr_t)memc, 4)) return (0); if (memc->memc_chipid==MEMC_CHIPID || memc->memc_chipid==MCECC_CHIPID) return (1); diff --git a/sys/arch/mvme88k/dev/nvram.c b/sys/arch/mvme88k/dev/nvram.c index 158feb78123..99929bd9023 100644 --- a/sys/arch/mvme88k/dev/nvram.c +++ b/sys/arch/mvme88k/dev/nvram.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nvram.c,v 1.27 2006/04/27 20:13:42 miod Exp $ */ +/* $OpenBSD: nvram.c,v 1.28 2006/05/08 14:36:10 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -87,7 +87,7 @@ nvrammatch(parent, vcf, args) if (bus_space_map(ca->ca_iot, ca->ca_paddr, PAGE_SIZE, 0, &ioh) != 0) return (0); - rc = badvaddr((vaddr_t)bus_space_vaddr(ca->ca_iot, ioh), 1) == 0; + rc = badaddr((vaddr_t)bus_space_vaddr(ca->ca_iot, ioh), 1) == 0; bus_space_unmap(ca->ca_iot, ioh, PAGE_SIZE); return (rc); } diff --git a/sys/arch/mvme88k/dev/osiop_pcctwo.c b/sys/arch/mvme88k/dev/osiop_pcctwo.c index 38d4dcfcea9..8f86767a82f 100644 --- a/sys/arch/mvme88k/dev/osiop_pcctwo.c +++ b/sys/arch/mvme88k/dev/osiop_pcctwo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: osiop_pcctwo.c,v 1.4 2006/04/15 22:29:49 miod Exp $ */ +/* $OpenBSD: osiop_pcctwo.c,v 1.5 2006/05/08 14:36:10 miod Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. * @@ -69,7 +69,7 @@ osiop_pcctwo_match(struct device *parent, void *cf, void *aux) if (bus_space_map(ca->ca_iot, ca->ca_paddr, OSIOP_NREGS, 0, &ioh) != 0) return (0); - rc = badvaddr((vaddr_t)bus_space_vaddr(ca->ca_iot, ioh), 4); + rc = badaddr((vaddr_t)bus_space_vaddr(ca->ca_iot, ioh), 4); if (rc == 0) { bus_space_unmap(ca->ca_iot, ioh, OSIOP_NREGS); return (1); @@ -77,7 +77,7 @@ osiop_pcctwo_match(struct device *parent, void *cf, void *aux) /* * For some reason, if the SCSI hardware is not ``warmed'' by the - * BUG (netboot or boot from external SCSI controller), badvaddr() + * BUG (netboot or boot from external SCSI controller), badaddr() * will always fail, although the hardware is there. * Since the BUG will do the right thing, we'll defer a dummy read * from the controller and retry. @@ -94,7 +94,7 @@ osiop_pcctwo_match(struct device *parent, void *cf, void *aux) dio.blk_cnt = 1; bugdiskrd(&dio); - rc = badvaddr((vaddr_t)bus_space_vaddr(ca->ca_iot, ioh), 4); + rc = badaddr((vaddr_t)bus_space_vaddr(ca->ca_iot, ioh), 4); } bus_space_unmap(ca->ca_iot, ioh, OSIOP_NREGS); diff --git a/sys/arch/mvme88k/dev/pcctwo.c b/sys/arch/mvme88k/dev/pcctwo.c index 1d73c24e061..d3886aaf660 100644 --- a/sys/arch/mvme88k/dev/pcctwo.c +++ b/sys/arch/mvme88k/dev/pcctwo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcctwo.c,v 1.28 2006/04/27 20:19:28 miod Exp $ */ +/* $OpenBSD: pcctwo.c,v 1.29 2006/05/08 14:36:10 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt * All rights reserved. @@ -87,7 +87,7 @@ pcctwomatch(parent, vcf, args) if (bus_space_map(ca->ca_iot, PCC2_BASE, PCC2_SIZE, 0, &ioh) != 0) return 0; - rc = badvaddr((vaddr_t)bus_space_vaddr(ca->ca_iot, ioh), 4); + rc = badaddr((vaddr_t)bus_space_vaddr(ca->ca_iot, ioh), 4); if (rc == 0) { chipid = bus_space_read_1(ca->ca_iot, ioh, PCCTWO_CHIPID); if (chipid != PCC2_ID) { diff --git a/sys/arch/mvme88k/dev/vme.c b/sys/arch/mvme88k/dev/vme.c index 04b9a385ff6..b383fa82ea0 100644 --- a/sys/arch/mvme88k/dev/vme.c +++ b/sys/arch/mvme88k/dev/vme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vme.c,v 1.43 2006/04/26 20:48:06 miod Exp $ */ +/* $OpenBSD: vme.c,v 1.44 2006/05/08 14:36:10 miod Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. * Copyright (c) 1999 Steve Murphree, Jr. @@ -38,7 +38,6 @@ #include #include #include -#include #include "pcctwo.h" #include "syscon.h" @@ -96,11 +95,7 @@ vme_map(bus_addr_t addr, bus_size_t size, int flags, bus_space_handle_t *ret) { vaddr_t map; -#if 0 - map = iomap_mapin(addr, size, 0); -#else map = (vaddr_t)mapiodev((paddr_t)addr, size); -#endif if (map == NULL) return ENOMEM; @@ -111,11 +106,7 @@ vme_map(bus_addr_t addr, bus_size_t size, int flags, bus_space_handle_t *ret) void vme_unmap(bus_space_handle_t handle, bus_size_t size) { -#if 0 - iomap_mapout(handle, size); -#else unmapiodev((vaddr_t)handle, size); -#endif } int diff --git a/sys/arch/mvme88k/dev/vs.c b/sys/arch/mvme88k/dev/vs.c index f5ec640a562..622e1c15961 100644 --- a/sys/arch/mvme88k/dev/vs.c +++ b/sys/arch/mvme88k/dev/vs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vs.c,v 1.61 2006/03/15 20:20:40 miod Exp $ */ +/* $OpenBSD: vs.c,v 1.62 2006/05/08 14:36:10 miod Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. @@ -56,7 +56,7 @@ #include #include -#include +#include #include #include @@ -125,7 +125,7 @@ vsmatch(struct device *device, void *cf, void *args) if (bus_space_map(iot, ca->ca_paddr, S_SHORTIO, 0, &ioh) != 0) return 0; - rc = badvaddr((vaddr_t)bus_space_vaddr(iot, ioh), 1); + rc = badaddr((vaddr_t)bus_space_vaddr(iot, ioh), 1); bus_space_unmap(iot, ioh, S_SHORTIO); return rc == 0; diff --git a/sys/arch/mvme88k/dev/vx.c b/sys/arch/mvme88k/dev/vx.c index 8551cf47184..c9848b5a58a 100644 --- a/sys/arch/mvme88k/dev/vx.c +++ b/sys/arch/mvme88k/dev/vx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vx.c,v 1.36 2004/07/30 19:02:06 miod Exp $ */ +/* $OpenBSD: vx.c,v 1.37 2006/05/08 14:36:10 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * All rights reserved. @@ -175,7 +175,7 @@ vxmatch(struct device *parent, void *self, void *aux) if (bus_space_map(iot, ca->ca_paddr, 0x10000, 0, &ioh) != 0) return 0; vx_reg = (struct vxreg *)bus_space_vaddr(iot, ioh); - rc = badvaddr((vaddr_t)&vx_reg->ipc_cr, 1); + rc = badaddr((vaddr_t)&vx_reg->ipc_cr, 1); bus_space_unmap(iot, ioh, 0x10000); return rc == 0; -- cgit v1.2.3