diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-10-26 20:14:43 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-10-26 20:14:43 +0000 |
commit | a9810f2e4406559596eb8337a7a35f248cdbb080 (patch) | |
tree | 027638ddb5508c6551e679ab445d62238249c13d | |
parent | 12246e2cdd28b55501930660691d84be05add8d6 (diff) |
Rename struct confargs to struct mainbus_attach_args for consistency and also
to prevent further abuse of it.
-rw-r--r-- | sys/arch/mips64/mips64/clock.c | 6 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/cpu.c | 8 | ||||
-rw-r--r-- | sys/arch/sgi/dev/dsrtc.c | 11 | ||||
-rw-r--r-- | sys/arch/sgi/dev/gbe.c | 6 | ||||
-rw-r--r-- | sys/arch/sgi/dev/power.c | 6 | ||||
-rw-r--r-- | sys/arch/sgi/include/autoconf.h | 8 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/autoconf.c | 6 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/ip27_machdep.c | 30 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/mainbus.c | 30 | ||||
-rw-r--r-- | sys/arch/sgi/xbow/xbow.c | 10 |
10 files changed, 63 insertions, 58 deletions
diff --git a/sys/arch/mips64/mips64/clock.c b/sys/arch/mips64/mips64/clock.c index 765b87eeed0..71474a3404e 100644 --- a/sys/arch/mips64/mips64/clock.c +++ b/sys/arch/mips64/mips64/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.25 2009/10/22 22:08:54 miod Exp $ */ +/* $OpenBSD: clock.c,v 1.26 2009/10/26 20:14:40 miod Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -80,9 +80,9 @@ struct timecounter cp0_timecounter = { int clockmatch(struct device *parent, void *vcf, void *aux) { - struct confargs *ca = aux; + struct mainbus_attach_args *maa = aux; - if (strcmp(ca->ca_name, clock_cd.cd_name) != 0) + if (strcmp(maa->maa_name, clock_cd.cd_name) != 0) return 0; return 10; /* Try to get clock early */ diff --git a/sys/arch/mips64/mips64/cpu.c b/sys/arch/mips64/mips64/cpu.c index 747b7a6ed00..428285ee1ef 100644 --- a/sys/arch/mips64/mips64/cpu.c +++ b/sys/arch/mips64/mips64/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.14 2009/09/15 04:54:31 syuu Exp $ */ +/* $OpenBSD: cpu.c,v 1.15 2009/10/26 20:14:40 miod Exp $ */ /* * Copyright (c) 1997-2004 Opsycon AB (www.opsycon.se) @@ -80,10 +80,10 @@ int cpumatch(struct device *parent, void *match, void *aux) { struct cfdata *cf = match; - struct confargs *ca = aux; + struct mainbus_attach_args *maa = aux; /* make sure that we're looking for a CPU. */ - if (strcmp(ca->ca_name, cpu_cd.cd_name) != 0) + if (strcmp(maa->maa_name, cpu_cd.cd_name) != 0) return 0; if (cf->cf_unit >= MAX_CPUS) return 0; @@ -102,7 +102,7 @@ cpuattach(struct device *parent, struct device *dev, void *aux) #ifdef MULTIPROCESSOR cpuset_add(&cpus_running, ci); #endif - if(cpuno == 0) { + if (cpuno == 0) { ci = &cpu_info_primary; #ifdef MULTIPROCESSOR ci->ci_flags |= CPUF_RUNNING | CPUF_PRESENT | CPUF_PRIMARY; diff --git a/sys/arch/sgi/dev/dsrtc.c b/sys/arch/sgi/dev/dsrtc.c index 2507ed6ed2d..fd681153c1d 100644 --- a/sys/arch/sgi/dev/dsrtc.c +++ b/sys/arch/sgi/dev/dsrtc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsrtc.c,v 1.9 2009/10/26 18:34:53 miod Exp $ */ +/* $OpenBSD: dsrtc.c,v 1.10 2009/10/26 20:14:42 miod Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -104,9 +104,14 @@ tobcd(int x, int binary) int dsrtc_match(struct device *parent, void *match, void *aux) { - struct confargs *ca = (struct confargs *)aux; + /* + * Depending on what dsrtc attaches to, the actual attach_args + * may be a different struct, but all of them start with the + * same name field. + */ + struct mainbus_attach_args *maa = aux; - return strcmp(ca->ca_name, dsrtc_cd.cd_name) == 0; + return strcmp(maa->maa_name, dsrtc_cd.cd_name) == 0; } void diff --git a/sys/arch/sgi/dev/gbe.c b/sys/arch/sgi/dev/gbe.c index 5abf7d22552..4c2abf3529d 100644 --- a/sys/arch/sgi/dev/gbe.c +++ b/sys/arch/sgi/dev/gbe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gbe.c,v 1.9 2009/10/26 18:00:06 miod Exp $ */ +/* $OpenBSD: gbe.c,v 1.10 2009/10/26 20:14:42 miod Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Joel Sing <jsing@openbsd.org> @@ -185,9 +185,9 @@ struct cfdriver gbe_cd = { int gbe_match(struct device *parent, void *cf, void *aux) { - struct confargs *ca = aux; + struct mainbus_attach_args *maa = aux; - if (strcmp(ca->ca_name, gbe_cd.cd_name) != 0) + if (strcmp(maa->maa_name, gbe_cd.cd_name) != 0) return 0; return 1; diff --git a/sys/arch/sgi/dev/power.c b/sys/arch/sgi/dev/power.c index fbf00c1a846..9468e9208d0 100644 --- a/sys/arch/sgi/dev/power.c +++ b/sys/arch/sgi/dev/power.c @@ -1,4 +1,4 @@ -/* $OpenBSD: power.c,v 1.11 2009/10/26 18:13:34 miod Exp $ */ +/* $OpenBSD: power.c,v 1.12 2009/10/26 20:14:42 miod Exp $ */ /* * Copyright (c) 2007 Jasper Lievisse Adriaanse <jasper@openbsd.org> @@ -88,9 +88,9 @@ struct cfattach power_mainbus_ca = { int power_mainbus_match(struct device *parent, void *match, void *aux) { - struct confargs *ca = aux; + struct mainbus_attach_args *maa = aux; - if (strcmp(ca->ca_name, power_cd.cd_name) != 0) + if (strcmp(maa->maa_name, power_cd.cd_name) != 0) return 0; return sys_config.system_type == SGI_OCTANE ? 1 : 0; diff --git a/sys/arch/sgi/include/autoconf.h b/sys/arch/sgi/include/autoconf.h index 977f073359a..d7003f4157e 100644 --- a/sys/arch/sgi/include/autoconf.h +++ b/sys/arch/sgi/include/autoconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.h,v 1.21 2009/10/26 18:00:06 miod Exp $ */ +/* $OpenBSD: autoconf.h,v 1.22 2009/10/26 20:14:42 miod Exp $ */ /* * Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -70,9 +70,9 @@ struct sys_rec { extern struct sys_rec sys_config; -struct confargs { - char *ca_name; - int16_t ca_nasid; +struct mainbus_attach_args { + const char *maa_name; + int16_t maa_nasid; }; void enaddr_aton(const char *, u_int8_t *); diff --git a/sys/arch/sgi/sgi/autoconf.c b/sys/arch/sgi/sgi/autoconf.c index 0f51fe898aa..2c6c448c325 100644 --- a/sys/arch/sgi/sgi/autoconf.c +++ b/sys/arch/sgi/sgi/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.25 2009/10/22 19:55:45 miod Exp $ */ +/* $OpenBSD: autoconf.c,v 1.26 2009/10/26 20:14:42 miod Exp $ */ /* * Copyright (c) 2009 Miodrag Vallat. * @@ -327,9 +327,9 @@ device_register(struct device *dev, void *aux) */ if (strcmp(component, "xio") == 0) { - struct confargs *ca = aux; + struct mainbus_attach_args *maa = aux; - if (strcmp(cd->cd_name, "xbow") == 0 && unit == ca->ca_nasid) + if (strcmp(cd->cd_name, "xbow") == 0 && unit == maa->maa_nasid) goto found_advance; } diff --git a/sys/arch/sgi/sgi/ip27_machdep.c b/sys/arch/sgi/sgi/ip27_machdep.c index cc3dae388f5..edbcda251fb 100644 --- a/sys/arch/sgi/sgi/ip27_machdep.c +++ b/sys/arch/sgi/sgi/ip27_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip27_machdep.c,v 1.30 2009/10/26 18:11:25 miod Exp $ */ +/* $OpenBSD: ip27_machdep.c,v 1.31 2009/10/26 20:14:42 miod Exp $ */ /* * Copyright (c) 2008, 2009 Miodrag Vallat. @@ -310,7 +310,7 @@ ip27_setup() void ip27_autoconf(struct device *parent) { - struct confargs nca; + struct mainbus_attach_args maa; uint node; /* @@ -318,12 +318,12 @@ ip27_autoconf(struct device *parent) * if any, will get attached as they are discovered. */ - bzero(&nca, sizeof nca); - nca.ca_nasid = masternasid; - nca.ca_name = "cpu"; - config_found(parent, &nca, ip27_print); - nca.ca_name = "clock"; - config_found(parent, &nca, ip27_print); + bzero(&maa, sizeof maa); + maa.maa_nasid = masternasid; + maa.maa_name = "cpu"; + config_found(parent, &maa, ip27_print); + maa.maa_name = "clock"; + config_found(parent, &maa, ip27_print); /* * Now attach all nodes' I/O devices. @@ -342,20 +342,20 @@ ip27_autoconf(struct device *parent) void ip27_attach_node(struct device *parent, int16_t nasid) { - struct confargs nca; + struct mainbus_attach_args maa; - bzero(&nca, sizeof nca); - nca.ca_name = "xbow"; - nca.ca_nasid = nasid; - config_found(parent, &nca, ip27_print); + bzero(&maa, sizeof maa); + maa.maa_name = "xbow"; + maa.maa_nasid = nasid; + config_found(parent, &maa, ip27_print); } int ip27_print(void *aux, const char *pnp) { - struct confargs *ca = aux; + struct mainbus_attach_args *maa = aux; - printf(" nasid %d", ca->ca_nasid); + printf(" nasid %d", maa->maa_nasid); return UNCONF; } diff --git a/sys/arch/sgi/sgi/mainbus.c b/sys/arch/sgi/sgi/mainbus.c index 442724ace43..bcc43a4358f 100644 --- a/sys/arch/sgi/sgi/mainbus.c +++ b/sys/arch/sgi/sgi/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.3 2009/10/26 18:13:34 miod Exp $ */ +/* $OpenBSD: mainbus.c,v 1.4 2009/10/26 20:14:42 miod Exp $ */ /* * Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -61,7 +61,7 @@ mbmatch(struct device *parent, void *cfdata, void *aux) void mbattach(struct device *parent, struct device *self, void *aux) { - struct confargs nca; + struct mainbus_attach_args maa; extern char *hw_prod; if (hw_prod != NULL) @@ -89,27 +89,27 @@ mbattach(struct device *parent, struct device *self, void *aux) * discovered. */ - bzero(&nca, sizeof nca); - nca.ca_name = "cpu"; - config_found(self, &nca, mbprint); - nca.ca_name = "clock"; - config_found(self, &nca, mbprint); + bzero(&maa, sizeof maa); + maa.maa_name = "cpu"; + config_found(self, &maa, mbprint); + maa.maa_name = "clock"; + config_found(self, &maa, mbprint); switch (sys_config.system_type) { #ifdef TGT_O2 case SGI_O2: - nca.ca_name = "macebus"; - config_found(self, &nca, mbprint); - nca.ca_name = "gbe"; - config_found(self, &nca, mbprint); + maa.maa_name = "macebus"; + config_found(self, &maa, mbprint); + maa.maa_name = "gbe"; + config_found(self, &maa, mbprint); break; #endif #ifdef TGT_OCTANE case SGI_OCTANE: - nca.ca_name = "xbow"; - config_found(self, &nca, mbprint); - nca.ca_name = "power"; - config_found(self, &nca, mbprint); + maa.maa_name = "xbow"; + config_found(self, &maa, mbprint); + maa.maa_name = "power"; + config_found(self, &maa, mbprint); break; #endif default: diff --git a/sys/arch/sgi/xbow/xbow.c b/sys/arch/sgi/xbow/xbow.c index 566c99bda9d..44f2907a614 100644 --- a/sys/arch/sgi/xbow/xbow.c +++ b/sys/arch/sgi/xbow/xbow.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xbow.c,v 1.21 2009/10/26 18:11:27 miod Exp $ */ +/* $OpenBSD: xbow.c,v 1.22 2009/10/26 20:14:42 miod Exp $ */ /* * Copyright (c) 2008, 2009 Miodrag Vallat. @@ -155,9 +155,9 @@ int (*xbow_widget_id)(int16_t, u_int, uint32_t *); int xbowmatch(struct device *parent, void *match, void *aux) { - struct confargs *ca = aux; + struct mainbus_attach_args *maa = aux; - if (strcmp(ca->ca_name, xbow_cd.cd_name) != 0) + if (strcmp(maa->maa_name, xbow_cd.cd_name) != 0) return (0); switch (sys_config.system_type) { @@ -266,8 +266,8 @@ void xbowattach(struct device *parent, struct device *self, void *aux) { struct xbow_softc *sc = (struct xbow_softc *)self; - struct confargs *ca = aux; - int16_t nasid = ca->ca_nasid; + struct mainbus_attach_args *maa = aux; + int16_t nasid = maa->maa_nasid; uint32_t wid, vendor, product; const struct xbow_product *p; struct xbow_config cfg; |