summaryrefslogtreecommitdiff
path: root/sys/arch/alpha/isa/mcclock_isa.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/alpha/isa/mcclock_isa.c')
-rw-r--r--sys/arch/alpha/isa/mcclock_isa.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/sys/arch/alpha/isa/mcclock_isa.c b/sys/arch/alpha/isa/mcclock_isa.c
index ef6b8acc696..392a63842b6 100644
--- a/sys/arch/alpha/isa/mcclock_isa.c
+++ b/sys/arch/alpha/isa/mcclock_isa.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: mcclock_isa.c,v 1.5 1996/12/08 00:20:27 niklas Exp $ */
-/* $NetBSD: mcclock_isa.c,v 1.3 1996/10/23 04:12:19 cgd Exp $ */
+/* $OpenBSD: mcclock_isa.c,v 1.6 1997/01/24 19:57:24 niklas Exp $ */
+/* $NetBSD: mcclock_isa.c,v 1.5 1996/12/05 01:39:29 cgd Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -47,7 +47,11 @@ struct mcclock_isa_softc {
bus_space_handle_t sc_ioh;
};
+#ifdef __BROKEN_INDIRECT_CONFIG
int mcclock_isa_match __P((struct device *, void *, void *));
+#else
+int mcclock_isa_match __P((struct device *, struct cfdata *, void *));
+#endif
void mcclock_isa_attach __P((struct device *, struct device *, void *));
struct cfattach mcclock_isa_ca = {
@@ -65,16 +69,29 @@ const struct mcclock_busfns mcclock_isa_busfns = {
int
mcclock_isa_match(parent, match, aux)
struct device *parent;
- void *match, *aux;
+#ifdef __BROKEN_INDIRECT_CONFIG
+ void *match;
+#else
+ struct cfdata *match;
+#endif
+ void *aux;
{
struct isa_attach_args *ia = aux;
+ bus_space_handle_t ioh;
+
+ if ((ia->ia_iobase != IOBASEUNK && ia->ia_iobase != 0x70) ||
+ /* (ia->ia_iosize != 0 && ia->ia_iosize != 0x2) || XXX isa.c */
+ ia->ia_maddr != MADDRUNK || ia->ia_msize != 0 ||
+ ia->ia_irq != IRQUNK || ia->ia_drq != DRQUNK)
+ return (0);
- if (ia->ia_iobase != 0x70 && ia->ia_iobase != -1)
+ if (bus_space_map(ia->ia_iot, 0x70, 0x2, 0, &ioh))
return (0);
- ia->ia_iobase = 0x70; /* XXX */
- ia->ia_iosize = 2; /* XXX */
- ia->ia_msize = 0;
+ bus_space_unmap(ia->ia_iot, ioh, 0x2);
+
+ ia->ia_iobase = 0x70;
+ ia->ia_iosize = 0x2;
return (1);
}