summaryrefslogtreecommitdiff
path: root/sys/arch/atari/dev
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2021-04-24 23:36:23 +0000
committerthorpej <thorpej@NetBSD.org>2021-04-24 23:36:23 +0000
commit3bee0c110b9ff2a9a0e2833be339e1c873af3a44 (patch)
tree82c9f34b9867882723e76eff95e5d7ca6cab69bf /sys/arch/atari/dev
parente77b3a7c4b6598de68d8b78f86e7851410840595 (diff)
Merge thorpej-cfargs branch:
Simplify and make extensible the config_search() / config_found() / config_attach() interfaces: rather than having different variants for which arguments you want pass along, just have a single call that takes a variadic list of tag-value arguments. Adjust all call sites: - Simplify wherever possible; don't pass along arguments that aren't actually needed. - Don't be explicit about what interface attribute is attaching if the device only has one. (More simplification.) - Add a config_probe() function to be used in indirect configuiration situations, making is visibly easier to see when indirect config is in play, and allowing for future change in semantics. (As of now, this is just a wrapper around config_match(), but that is an implementation detail.) Remove unnecessary or redundant interface attributes where they're not needed. There are currently 5 "cfargs" defined: - CFARG_SUBMATCH (submatch function for direct config) - CFARG_SEARCH (search function for indirect config) - CFARG_IATTR (interface attribte) - CFARG_LOCATORS (locators array) - CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles) ...and a sentinel value CFARG_EOL. Add some extra sanity checking to ensure that interface attributes aren't ambiguous. Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark ports to associate those device handles with device_t instance. This will trickle trough to more places over time (need back-end for pre-OFW Sun OBP; any others?).
Diffstat (limited to 'sys/arch/atari/dev')
-rw-r--r--sys/arch/atari/dev/fd.c6
-rw-r--r--sys/arch/atari/dev/grf.c6
-rw-r--r--sys/arch/atari/dev/hdfd.c6
-rw-r--r--sys/arch/atari/dev/ite_cc.c9
-rw-r--r--sys/arch/atari/dev/ite_et.c8
-rw-r--r--sys/arch/atari/dev/kbd.c7
-rw-r--r--sys/arch/atari/dev/ncr5380.c6
7 files changed, 25 insertions, 23 deletions
diff --git a/sys/arch/atari/dev/fd.c b/sys/arch/atari/dev/fd.c
index e499da06711..fb09de8ddab 100644
--- a/sys/arch/atari/dev/fd.c
+++ b/sys/arch/atari/dev/fd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fd.c,v 1.87 2018/09/03 16:29:24 riastradh Exp $ */
+/* $NetBSD: fd.c,v 1.88 2021/04/24 23:36:29 thorpej Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman.
@@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.87 2018/09/03 16:29:24 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.88 2021/04/24 23:36:29 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -341,7 +341,7 @@ fdcattach(device_t parent, device_t self, void *aux)
if (nfound == 0)
first_found = i;
nfound++;
- config_found(self, (void *)i, fdcprint);
+ config_found(self, (void *)i, fdcprint, CFARG_EOL);
}
}
diff --git a/sys/arch/atari/dev/grf.c b/sys/arch/atari/dev/grf.c
index 4d5394cf75b..1c550be0738 100644
--- a/sys/arch/atari/dev/grf.c
+++ b/sys/arch/atari/dev/grf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: grf.c,v 1.50 2019/06/29 16:41:18 tsutsui Exp $ */
+/* $NetBSD: grf.c,v 1.51 2021/04/24 23:36:29 thorpej Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: grf.c,v 1.50 2019/06/29 16:41:18 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: grf.c,v 1.51 2021/04/24 23:36:29 thorpej Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@@ -151,7 +151,7 @@ grfbusattach(device_t parent, device_t self, void *aux)
atari_config_found(cfdata_gbus, NULL, &grf_auxp, grfbusprint);
else {
printf("\n");
- config_found(self, &grf_auxp, grfbusprint);
+ config_found(self, &grf_auxp, grfbusprint, CFARG_EOL);
}
}
diff --git a/sys/arch/atari/dev/hdfd.c b/sys/arch/atari/dev/hdfd.c
index bceeee33f57..397e1d65031 100644
--- a/sys/arch/atari/dev/hdfd.c
+++ b/sys/arch/atari/dev/hdfd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hdfd.c,v 1.87 2021/01/03 17:42:10 thorpej Exp $ */
+/* $NetBSD: hdfd.c,v 1.88 2021/04/24 23:36:29 thorpej Exp $ */
/*-
* Copyright (c) 1996 Leo Weppelman
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdfd.c,v 1.87 2021/01/03 17:42:10 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdfd.c,v 1.88 2021/04/24 23:36:29 thorpej Exp $");
#include "opt_ddb.h"
@@ -464,7 +464,7 @@ fdcattach(device_t parent, device_t self, void *aux)
* XXX: Choose something sensible as a default...
*/
fa.fa_deftype = &fd_types[2]; /* 1.44MB */
- (void)config_found(self, (void *)&fa, fdprint);
+ (void)config_found(self, (void *)&fa, fdprint, CFARG_EOL);
}
}
diff --git a/sys/arch/atari/dev/ite_cc.c b/sys/arch/atari/dev/ite_cc.c
index 178a091de9d..51b04145af0 100644
--- a/sys/arch/atari/dev/ite_cc.c
+++ b/sys/arch/atari/dev/ite_cc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ite_cc.c,v 1.40 2019/06/29 16:41:19 tsutsui Exp $ */
+/* $NetBSD: ite_cc.c,v 1.41 2021/04/24 23:36:29 thorpej Exp $ */
/*
* Copyright (c) 1996 Leo Weppelman
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ite_cc.c,v 1.40 2019/06/29 16:41:19 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ite_cc.c,v 1.41 2021/04/24 23:36:29 thorpej Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -267,7 +267,7 @@ grfccattach(device_t parent, device_t self, void *aux)
/*
* try and attach an ite
*/
- config_found(self, sc /* XXX */, grfccprint);
+ config_found(self, sc /* XXX */, grfccprint, CFARG_EOL);
/*
* If attaching the first unit, go ahead and 'find' the rest of us
@@ -276,7 +276,8 @@ grfccattach(device_t parent, device_t self, void *aux)
first_attach = 0;
grf_auxp.from_bus_match = 0;
for (grf_auxp.unit=1; grf_auxp.unit < NGRFCC; grf_auxp.unit++) {
- config_found(parent, &grf_auxp, grf_bus_auxp->busprint);
+ config_found(parent, &grf_auxp, grf_bus_auxp->busprint,
+ CFARG_EOL);
}
}
}
diff --git a/sys/arch/atari/dev/ite_et.c b/sys/arch/atari/dev/ite_et.c
index f39abca6fb1..eaedfec052d 100644
--- a/sys/arch/atari/dev/ite_et.c
+++ b/sys/arch/atari/dev/ite_et.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ite_et.c,v 1.31 2019/06/29 16:41:19 tsutsui Exp $ */
+/* $NetBSD: ite_et.c,v 1.32 2021/04/24 23:36:29 thorpej Exp $ */
/*
* Copyright (c) 1996 Leo Weppelman.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ite_et.c,v 1.31 2019/06/29 16:41:19 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ite_et.c,v 1.32 2021/04/24 23:36:29 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -240,7 +240,7 @@ grfetattach(device_t parent, device_t self, void *aux)
/*
* try and attach an ite
*/
- config_found(self, sc /* XXX */, grfetprint);
+ config_found(self, sc /* XXX */, grfetprint, CFARG_EOL);
/*
* If attaching the first unit, go ahead and 'find' the rest of us
@@ -250,7 +250,7 @@ grfetattach(device_t parent, device_t self, void *aux)
grf_auxp.from_bus_match = 0;
for (grf_auxp.unit=0; grf_auxp.unit < NGRFET; grf_auxp.unit++) {
config_found(parent, (void*)&grf_auxp,
- grf_bus_auxp->busprint);
+ grf_bus_auxp->busprint, CFARG_EOL);
}
}
}
diff --git a/sys/arch/atari/dev/kbd.c b/sys/arch/atari/dev/kbd.c
index 1785ee5007a..30211d1a29e 100644
--- a/sys/arch/atari/dev/kbd.c
+++ b/sys/arch/atari/dev/kbd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: kbd.c,v 1.47 2018/02/08 09:05:17 dholland Exp $ */
+/* $NetBSD: kbd.c,v 1.48 2021/04/24 23:36:29 thorpej Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.47 2018/02/08 09:05:17 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.48 2021/04/24 23:36:29 thorpej Exp $");
#include "mouse.h"
#include "ite.h"
@@ -245,7 +245,8 @@ kbdattach(device_t parent, device_t self, void *aux)
waa.keymap = &kbd_mapdata;
waa.accessops = &kbd_accessops;
waa.accesscookie = NULL;
- kbd_softc.k_wskbddev = config_found(self, &waa, wskbddevprint);
+ kbd_softc.k_wskbddev = config_found(self, &waa, wskbddevprint,
+ CFARG_EOL);
kbd_softc.k_pollingmode = 0;
diff --git a/sys/arch/atari/dev/ncr5380.c b/sys/arch/atari/dev/ncr5380.c
index 48745166769..2c5ff8c9aa4 100644
--- a/sys/arch/atari/dev/ncr5380.c
+++ b/sys/arch/atari/dev/ncr5380.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ncr5380.c,v 1.74 2020/09/29 03:02:18 msaitoh Exp $ */
+/* $NetBSD: ncr5380.c,v 1.75 2021/04/24 23:36:29 thorpej Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ncr5380.c,v 1.74 2020/09/29 03:02:18 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ncr5380.c,v 1.75 2021/04/24 23:36:29 thorpej Exp $");
/*
* Bit mask of targets you want debugging to be shown
@@ -251,7 +251,7 @@ ncr_attach(device_t parent, device_t self, void *aux)
/*
* attach all scsi units on us
*/
- config_found(self, &sc->sc_channel, scsiprint);
+ config_found(self, &sc->sc_channel, scsiprint, CFARG_EOL);
}
/*