use the generated macros in locators.h rather than hard-coded numbers

to index the cf_loc[] array.  reviewed by allen briggs.
This commit is contained in:
chs 2004-12-14 02:32:02 +00:00
parent ab6b8b7528
commit 267af995b7
18 changed files with 98 additions and 82 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pioc.c,v 1.7 2003/07/14 22:48:25 lukem Exp $ */
/* $NetBSD: pioc.c,v 1.8 2004/12/14 02:32:02 chs Exp $ */
/*
* Copyright (c) 1997 Mark Brinicombe.
@ -41,7 +41,7 @@
/*#define PIOC_DEBUG*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pioc.c,v 1.7 2003/07/14 22:48:25 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: pioc.c,v 1.8 2004/12/14 02:32:02 chs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -274,13 +274,13 @@ piocsubmatch(parent, cf, aux)
struct pioc_attach_args *pa = aux;
int tryagain;
if ((pa->pa_offset >> 2) != cf->cf_loc[0])
if ((pa->pa_offset >> 2) != cf->cf_loc[PIOCCF_OFFSET])
return(0);
do {
if (pa->pa_drq == -1)
pa->pa_drq = cf->cf_loc[1];
pa->pa_drq = cf->cf_loc[PIOCCF_DACK];
if (pa->pa_irq == -1)
pa->pa_irq = cf->cf_loc[2];
pa->pa_irq = cf->cf_loc[PIOCCF_IRQ];
tryagain = 0;
if (config_match(parent, cf, pa) > 0) {
config_attach(parent, cf, pa, piocprint);

View File

@ -1,4 +1,4 @@
/* $NetBSD: mainbus.c,v 1.21 2004/12/13 02:14:13 chs Exp $ */
/* $NetBSD: mainbus.c,v 1.22 2004/12/14 02:32:02 chs Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@ -70,7 +70,9 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.21 2004/12/13 02:14:13 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.22 2004/12/14 02:32:02 chs Exp $");
#include "locators.h"
#include <sys/param.h>
#include <sys/systm.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.h,v 1.3 2003/11/18 04:04:42 chs Exp $ */
/* $NetBSD: autoconf.h,v 1.4 2004/12/14 02:32:02 chs Exp $ */
/* $OpenBSD: autoconf.h,v 1.10 2001/05/05 22:33:42 art Exp $ */
@ -56,7 +56,7 @@ struct confargs {
};
#define HP700CF_IRQ_UNDEF (-1)
#define hp700cf_irq cf_loc[0]
#define hp700cf_irq cf_loc[MAINBUSCF_IRQ]
/* this is used for hppa_knownmodules table
* describing known to this port modules,

View File

@ -1,4 +1,4 @@
/* $NetBSD: iwm_fd.c,v 1.28 2004/10/28 07:07:36 yamt Exp $ */
/* $NetBSD: iwm_fd.c,v 1.29 2004/12/14 02:32:02 chs Exp $ */
/*
* Copyright (c) 1997, 1998 Hauke Fath. All rights reserved.
@ -34,7 +34,9 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: iwm_fd.c,v 1.28 2004/10/28 07:07:36 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: iwm_fd.c,v 1.29 2004/12/14 02:32:02 chs Exp $");
#include "locators.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -428,11 +430,11 @@ fd_match(parent, match, auxp)
cfp = match;
fdParams = (iwmAttachArgs_t *)auxp;
cfUnit = cfp->cf_loc[0];
cfUnit = cfp->cf_loc[IWMCF_DRIVE];
matched = (cfUnit == fdParams->unit || cfUnit == -1) ? 1 : 0;
if (TRACE_CONFIG) {
printf("fdMatch() drive %d ? cfUnit = %d\n",
fdParams->unit, cfp->cf_loc[0]);
fdParams->unit, cfUnit);
}
return matched;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: obio.c,v 1.16 2003/07/15 02:43:25 lukem Exp $ */
/* $NetBSD: obio.c,v 1.17 2004/12/14 02:32:02 chs Exp $ */
/*
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -37,12 +37,14 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.16 2003/07/15 02:43:25 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.17 2004/12/14 02:32:02 chs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include "locators.h"
#include <machine/autoconf.h>
#include <mac68k/obio/obiovar.h>
@ -105,9 +107,7 @@ obio_search(parent, cf, aux)
struct mainbus_attach_args *mba = (struct mainbus_attach_args *) aux;
struct obio_attach_args oa;
oa.oa_addr = cf->cf_loc[0];
oa.oa_drq = cf->cf_loc[1];
oa.oa_hsk = cf->cf_loc[2];
oa.oa_addr = cf->cf_loc[OBIOCF_ADDR];
oa.oa_tag = mba->mba_bst;
oa.oa_dmat = mba->mba_dmat;

View File

@ -1,4 +1,4 @@
/* $NetBSD: obiovar.h,v 1.5 2002/04/10 05:13:10 briggs Exp $ */
/* $NetBSD: obiovar.h,v 1.6 2004/12/14 02:32:02 chs Exp $ */
/*
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -46,8 +46,6 @@
*/
struct obio_attach_args {
int oa_addr; /* physical address */
int oa_drq; /* SCSI DRQ physical address */
int oa_hsk; /* SCSI HSK physical address */
bus_space_tag_t oa_tag; /* bus space tag */
bus_dma_tag_t oa_dmat; /* bus dma tag */
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.h,v 1.4 2003/03/22 14:26:42 simonb Exp $ */
/* $NetBSD: autoconf.h,v 1.5 2004/12/14 02:32:02 chs Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
@ -47,7 +47,7 @@ struct confargs {
};
/* Locator aliases */
#define cf_addr cf_loc[0]
#define cf_addr cf_loc[OBIOCF_ADDR]
int badaddr __P((void *, u_int));
void makebootdev __P((char *));

View File

@ -1,4 +1,4 @@
/* $NetBSD: obio.c,v 1.8 2003/07/15 02:43:44 lukem Exp $ */
/* $NetBSD: obio.c,v 1.9 2004/12/14 02:32:02 chs Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -37,7 +37,9 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.8 2003/07/15 02:43:44 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.9 2004/12/14 02:32:02 chs Exp $");
#include "locators.h"
#include <sys/param.h>
#include <sys/systm.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: ebus.c,v 1.1 2003/08/19 10:51:57 ragge Exp $ */
/* $NetBSD: ebus.c,v 1.2 2004/12/14 02:32:02 chs Exp $ */
/*
* Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se).
* All rights reserved.
@ -60,7 +60,7 @@ ebus_search(struct device *parent, struct cfdata *cf, void *aux)
int rv;
ea.ea_iot = 0;
ea.ea_ioh = cf->cf_loc[0];
ea.ea_ioh = cf->cf_loc[EBUSCF_CSR];
rv = config_match(parent, cf, &ea);
if (rv == 0)
return 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: opms.c,v 1.11 2003/10/22 09:03:40 agc Exp $ */
/* $NetBSD: opms.c,v 1.12 2004/12/14 02:32:02 chs Exp $ */
/*
* Copyright 1997
@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: opms.c,v 1.11 2003/10/22 09:03:40 agc Exp $");
__KERNEL_RCSID(0, "$NetBSD: opms.c,v 1.12 2004/12/14 02:32:02 chs Exp $");
#include "opms.h"
#if NOPMS > 1
@ -277,7 +277,7 @@ opmsprobe(parent, match, aux)
** we expect that the parent has mapped the io space.
** Check an IRQ has been specified in the configuration
*/
if (cf->cf_loc[0] != -1)
if (cf->cf_loc[SPCKBDCF_IRQ] != -1)
{
/* Clear out any garbage left in there at this point in time
*/
@ -360,7 +360,7 @@ opmsattach(parent, self, aux)
void *aux;
{
struct opms_softc *sc = (void *)self;
int irq = self->dv_cfdata->cf_loc[0];
int irq = self->dv_cfdata->cf_loc[SPCKBDCF_IRQ];
struct isa_attach_args *ia = aux;
printf(" irq %d\n", irq);

View File

@ -1,4 +1,4 @@
/* $NetBSD: obio.c,v 1.65 2004/06/27 18:24:47 pk Exp $ */
/* $NetBSD: obio.c,v 1.66 2004/12/14 02:32:03 chs Exp $ */
/*-
* Copyright (c) 1997,1998 The NetBSD Foundation, Inc.
@ -37,7 +37,9 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.65 2004/06/27 18:24:47 pk Exp $");
__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.66 2004/12/14 02:32:03 chs Exp $");
#include "locators.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -81,6 +83,8 @@ static void obioattach __P((struct device *, struct device *, void *));
CFATTACH_DECL(obio, sizeof(union obio_softc),
obiomatch, obioattach, NULL, NULL);
static int obio_attached;
/*
* This `obio4_busattachargs' data structure only exists to pass down
* to obiosearch() the name of a device that must be configured early.
@ -120,6 +124,9 @@ obiomatch(parent, cf, aux)
{
struct mainbus_attach_args *ma = aux;
if (obio_attached)
return 0;
return (strcmp(cf->cf_name, ma->ma_name) == 0);
}
@ -130,13 +137,8 @@ obioattach(parent, self, aux)
{
struct mainbus_attach_args *ma = aux;
/*
* There is only one obio bus
*/
if (self->dv_unit > 0) {
printf(" unsupported\n");
return;
}
obio_attached = 1;
printf("\n");
if (CPU_ISSUN4) {
@ -257,6 +259,7 @@ obiosearch(parent, cf, aux)
struct obio4_busattachargs *oap = aux;
union obio_attach_args uoba;
struct obio4_attach_args *oba = &uoba.uoba_oba4;
int addr;
/* Check whether we're looking for a specifically named device */
if (oap->name != NULL && strcmp(oap->name, cf->cf_name) != 0)
@ -266,7 +269,8 @@ obiosearch(parent, cf, aux)
* Avoid sun4m entries which don't have valid PAs.
* no point in even probing them.
*/
if (cf->cf_loc[0] == -1)
addr = cf->cf_loc[OBIOCF_ADDR];
if (addr == -1)
return (0);
/*
@ -276,16 +280,16 @@ obiosearch(parent, cf, aux)
* XXX: We also assume that 4/[23]00 obio addresses
* must be 0xZYYYYYYY, where (Z != 0)
*/
if (cpuinfo.cpu_type == CPUTYP_4_100 && (cf->cf_loc[0] & 0xf0000000))
if (cpuinfo.cpu_type == CPUTYP_4_100 && (addr & 0xf0000000))
return (0);
if (cpuinfo.cpu_type != CPUTYP_4_100 && !(cf->cf_loc[0] & 0xf0000000))
if (cpuinfo.cpu_type != CPUTYP_4_100 && !(addr & 0xf0000000))
return (0);
uoba.uoba_isobio4 = 1;
oba->oba_bustag = &obio_space_tag;
oba->oba_dmatag = oap->ma->ma_dmatag;
oba->oba_paddr = BUS_ADDR(PMAP_OBIO, cf->cf_loc[0]);
oba->oba_pri = cf->cf_loc[1];
oba->oba_paddr = BUS_ADDR(PMAP_OBIO, addr);
oba->oba_pri = cf->cf_loc[OBIOCF_LEVEL];
if (config_match(parent, cf, &uoba) == 0)
return (0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.h,v 1.2 2001/06/27 02:53:07 fredette Exp $ */
/* $NetBSD: autoconf.h,v 1.3 2004/12/14 02:32:03 chs Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -69,8 +69,6 @@ struct mainbus_attach_args {
#define obma_pri ma_pri
/* Locator aliases */
#define cf_paddr cf_loc[0]
#define cf_intpri cf_loc[1]
#define LOCATOR_OPTIONAL (0)
#define LOCATOR_REQUIRED (1)
#define LOCATOR_FORBIDDEN (2)

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.12 2003/07/15 03:36:21 lukem Exp $ */
/* $NetBSD: autoconf.c,v 1.13 2004/12/14 02:32:03 chs Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.12 2003/07/15 03:36:21 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.13 2004/12/14 02:32:03 chs Exp $");
#include "opt_kgdb.h"
@ -55,6 +55,8 @@ __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.12 2003/07/15 03:36:21 lukem Exp $");
#include <sys/device.h>
#include <sys/reboot.h>
#include "locators.h"
#include "scsibus.h"
#if NSCSIBUS > 0
@ -223,20 +225,23 @@ int sun68k_bus_search(parent, cf, aux)
* will pass to the device's match and attach functions.
*/
#ifdef DIAGNOSTIC
#define BAD_LOCATOR(ma_loc, what) panic("sun68k_bus_search: %s %s for: %s%d", \
map-> ma_loc == LOCATOR_REQUIRED ? "missing" : "unexpected", \
what, cf->cf_name, cf->cf_unit)
#define BAD_LOCATOR(ma_loc, what) \
panic("sun68k_bus_search: %s %s for: %s%d", \
map->ma_loc == LOCATOR_REQUIRED ? "missing" : "unexpected", \
what, cf->cf_name, cf->cf_unit)
#else
#define BAD_LOCATOR(ma_loc, what) return (0)
#endif
#define CHECK_LOCATOR(ma_loc, cf_loc, what) \
if ((map-> ma_loc == LOCATOR_FORBIDDEN && cf->cf_loc != -1) || \
(map-> ma_loc == LOCATOR_REQUIRED && cf->cf_loc == -1)) \
if ((map->ma_loc == LOCATOR_FORBIDDEN && cf->cf_loc != -1) || \
(map->ma_loc == LOCATOR_REQUIRED && cf->cf_loc == -1)) \
BAD_LOCATOR( ma_loc, what); \
else \
ma. ma_loc = cf->cf_loc
CHECK_LOCATOR(ma_paddr, cf_paddr, "address");
CHECK_LOCATOR(ma_pri, cf_intpri, "ipl");
ma.ma_loc = cf->cf_loc
CHECK_LOCATOR(ma_paddr, cf_loc[MBIOCF_ADDR], "address");
CHECK_LOCATOR(ma_pri, cf_loc[MBIOCF_IPL], "ipl");
/*
* Note that this allows the match function to save

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.82 2004/10/31 12:52:55 he Exp $ */
/* $NetBSD: autoconf.c,v 1.83 2004/12/14 02:32:03 chs Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.82 2004/10/31 12:52:55 he Exp $");
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.83 2004/12/14 02:32:03 chs Exp $");
#include "opt_compat_netbsd.h"
@ -362,7 +362,7 @@ booted_sd(struct device *dev, void *aux)
if ((jmfr("si", ppdev, BDEV_SD) == 0 || /* new name */
jmfr("asc", ppdev, BDEV_SD) == 0 ||
jmfr("asc", ppdev, BDEV_SDN) == 0) &&
(ppdev->dv_cfdata->cf_loc[0] == rpb.csrphy))
(ppdev->dv_cfdata->cf_loc[VSBUSCF_CSR] == rpb.csrphy))
return 1;
return 0; /* Where did we come from??? */

View File

@ -1,4 +1,4 @@
/* $NetBSD: asc_vsbus.c,v 1.30 2003/10/19 14:54:24 ragge Exp $ */
/* $NetBSD: asc_vsbus.c,v 1.31 2004/12/14 02:32:03 chs Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -36,11 +36,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "opt_cputype.h"
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: asc_vsbus.c,v 1.30 2003/10/19 14:54:24 ragge Exp $");
__KERNEL_RCSID(0, "$NetBSD: asc_vsbus.c,v 1.31 2004/12/14 02:32:03 chs Exp $");
#include "locators.h"
#include "opt_cputype.h"
#include <sys/types.h>
#include <sys/param.h>
@ -148,11 +149,11 @@ asc_vsbus_match( struct device *parent, struct cfdata *cf, void *aux)
return 0;
if (vax_boardtype == VAX_BTYP_46 || vax_boardtype == VAX_BTYP_48) {
if (cf->cf_loc[0] != 0x200c0080)
if (cf->cf_loc[VSBUSCF_CSR] != 0x200c0080)
return 0;
} else if (vax_boardtype == VAX_BTYP_49 ||
vax_boardtype == VAX_BTYP_53) {
if (cf->cf_loc[0] != 0x26000080)
if (cf->cf_loc[VSBUSCF_CSR] != 0x26000080)
return 0;
} else {
return 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: dz_vsbus.c,v 1.34 2003/12/13 23:02:33 ad Exp $ */
/* $NetBSD: dz_vsbus.c,v 1.35 2004/12/14 02:32:03 chs Exp $ */
/*
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dz_vsbus.c,v 1.34 2003/12/13 23:02:33 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: dz_vsbus.c,v 1.35 2004/12/14 02:32:03 chs Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@ -58,6 +58,7 @@ __KERNEL_RCSID(0, "$NetBSD: dz_vsbus.c,v 1.34 2003/12/13 23:02:33 ad Exp $");
#include <dev/dec/dzvar.h>
#include "ioconf.h"
#include "locators.h"
#include "dzkbd.h"
#include "dzms.h"
#include "opt_cputype.h"
@ -125,7 +126,7 @@ dz_vsbus_match(struct device *parent, struct cfdata *cf, void *aux)
#if VAX53 || VAX49 || VAXANY
if (vax_boardtype == VAX_BTYP_53 || vax_boardtype == VAX_BTYP_49)
if (cf->cf_loc[0] != 0x25000000)
if (cf->cf_loc[VSBUSCF_CSR] != 0x25000000)
return 0; /* Ugly */
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: vsbus.c,v 1.45 2004/05/02 08:16:52 ragge Exp $ */
/* $NetBSD: vsbus.c,v 1.46 2004/12/14 02:32:03 chs Exp $ */
/*
* Copyright (c) 1996, 1999 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vsbus.c,v 1.45 2004/05/02 08:16:52 ragge Exp $");
__KERNEL_RCSID(0, "$NetBSD: vsbus.c,v 1.46 2004/12/14 02:32:03 chs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -67,6 +67,7 @@ __KERNEL_RCSID(0, "$NetBSD: vsbus.c,v 1.45 2004/05/02 08:16:52 ragge Exp $");
#include <machine/vsbus.h>
#include "ioconf.h"
#include "locators.h"
#include "opt_cputype.h"
int vsbus_match(struct device *, struct cfdata *, void *);
@ -215,7 +216,7 @@ vsbus_search(parent, cf, aux)
int i, vec, br;
u_char c;
va.va_paddr = cf->cf_loc[0];
va.va_paddr = cf->cf_loc[VSBUSCF_CSR];
va.va_addr = vax_map_physmem(va.va_paddr, 1);
va.va_dmat = &sc->sc_dmatag;
va.va_iot = &vax_mem_bus_space;
@ -256,7 +257,7 @@ vsbus_search(parent, cf, aux)
fail:
printf("%s%d at %s csr 0x%x %s\n",
cf->cf_name, cf->cf_unit, parent->dv_xname,
cf->cf_loc[0], (i ? "zero vector" : "didn't interrupt"));
cf->cf_loc[VSBUSCF_CSR], (i ? "zero vector" : "didn't interrupt"));
forgetit:
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: uba.c,v 1.69 2004/09/08 20:13:52 drochner Exp $ */
/* $NetBSD: uba.c,v 1.70 2004/12/14 02:32:03 chs Exp $ */
/*
* Copyright (c) 1982, 1986 The Regents of the University of California.
* All rights reserved.
@ -69,7 +69,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uba.c,v 1.69 2004/09/08 20:13:52 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: uba.c,v 1.70 2004/12/14 02:32:03 chs Exp $");
#include <sys/param.h>
#include <sys/time.h>
@ -92,6 +92,7 @@ __KERNEL_RCSID(0, "$NetBSD: uba.c,v 1.69 2004/09/08 20:13:52 drochner Exp $");
#include <dev/qbus/ubavar.h>
#include "ioconf.h"
#include "locators.h"
static int ubasearch (struct device *, struct cfdata *,
const locdesc_t *, void *);
@ -291,12 +292,13 @@ ubasearch(struct device *parent, struct cfdata *cf,
{
struct uba_softc *sc = (struct uba_softc *)parent;
struct uba_attach_args ua;
int i, vec, br;
int i, csr, vec, br;
if (sc->uh_used[ubdevreg(cf->cf_loc[0])])
csr = cf->cf_loc[UBACF_CSR];
if (sc->uh_used[ubdevreg(csr)])
return 0; /* something are already at this address */
ua.ua_ioh = ubdevreg(cf->cf_loc[0]) + sc->uh_ioh;
ua.ua_ioh = ubdevreg(csr) + sc->uh_ioh;
ua.ua_iot = sc->uh_iot;
ua.ua_dmat = sc->uh_dmat;
@ -321,10 +323,10 @@ ubasearch(struct device *parent, struct cfdata *cf,
ua.ua_br = br;
ua.ua_cvec = vec;
ua.ua_iaddr = cf->cf_loc[0];
ua.ua_iaddr = csr;
ua.ua_evcnt = NULL;
sc->uh_used[ubdevreg(cf->cf_loc[0])] = 1;
sc->uh_used[ubdevreg(csr)] = 1;
config_attach(parent, cf, &ua, ubaprint);
return 0;
@ -332,7 +334,7 @@ ubasearch(struct device *parent, struct cfdata *cf,
fail:
printf("%s%d at %s csr %o %s\n",
cf->cf_name, cf->cf_unit, parent->dv_xname,
cf->cf_loc[0], (i ? "zero vector" : "didn't interrupt"));
csr, (i ? "zero vector" : "didn't interrupt"));
forgetit:
return 0;