summaryrefslogtreecommitdiff
path: root/sys/arch/hp300/dev
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-04-15 20:38:12 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-04-15 20:38:12 +0000
commitea33ab4b0ef2e0a4e072a0a3ada4bcbe9d1eea71 (patch)
treefe258671e9526fe32bbd4869c1ba2fed1b26b184 /sys/arch/hp300/dev
parenta7375318eae82e4d8d486ce09e9f2b43f54e94ed (diff)
Turn DIO_INHOLE() into a function, returning the next select code to probe at;
and skip function codes 132 to 135, inclusive, on models 362 and 382 - this is a fake DIO device probably intended to let non-SGC aware (i.e. legacy) HP-UX lowlevel code be able to ``detect'' a frame buffer. This change (as well as letting sgc attach) is untested due to the lack of any 3x2 hardware, but shouldn't make things worse.
Diffstat (limited to 'sys/arch/hp300/dev')
-rw-r--r--sys/arch/hp300/dev/dio.c32
-rw-r--r--sys/arch/hp300/dev/dioreg.h8
-rw-r--r--sys/arch/hp300/dev/diovar.h8
3 files changed, 36 insertions, 12 deletions
diff --git a/sys/arch/hp300/dev/dio.c b/sys/arch/hp300/dev/dio.c
index 7bb76c89d41..308785cd4e9 100644
--- a/sys/arch/hp300/dev/dio.c
+++ b/sys/arch/hp300/dev/dio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dio.c,v 1.13 2008/06/26 05:42:10 ray Exp $ */
+/* $OpenBSD: dio.c,v 1.14 2010/04/15 20:38:09 miod Exp $ */
/* $NetBSD: dio.c,v 1.7 1997/05/05 21:00:32 thorpej Exp $ */
/*-
@@ -92,15 +92,15 @@ dioattach(parent, self, aux)
{
struct dio_attach_args da;
caddr_t pa, va;
- int scode, scmax, didmap, scodesize;
+ int scode, sctmp, scmax, didmap, scodesize;
scmax = DIO_SCMAX(machineid);
printf(": ");
dmainit();
for (scode = 0; scode < scmax; ) {
- if (DIO_INHOLE(scode)) {
- scode++;
+ if ((sctmp = dio_inhole(scode)) != 0) {
+ scode = sctmp;
continue;
}
@@ -347,3 +347,27 @@ dio_intr_disestablish(struct isr *isr)
if (isr->isr_priority == IPL_BIO)
dmacomputeipl();
}
+
+/*
+ * Return the next select code if the given select code lies within a hole,
+ * zero otherwise.
+ */
+int
+dio_inhole(int scode)
+{
+ /* unconditionnaly skip the DIO-II hole */
+ if (scode >= 32 && scode < DIOII_SCBASE)
+ return DIOII_SCBASE;
+
+ /* skip the frame buffer memory on 3x2 systems */
+ switch (machineid) {
+ case HP_362:
+ case HP_382:
+ if (scode >= DIOII_SCBASE && scode < DIOII_SCBASE + 4)
+ return DIOII_SCBASE + 4;
+ default:
+ break;
+ }
+
+ return 0;
+}
diff --git a/sys/arch/hp300/dev/dioreg.h b/sys/arch/hp300/dev/dioreg.h
index 3fbf1127bf7..a612ceaec9c 100644
--- a/sys/arch/hp300/dev/dioreg.h
+++ b/sys/arch/hp300/dev/dioreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dioreg.h,v 1.5 2008/06/26 05:42:10 ray Exp $ */
+/* $OpenBSD: dioreg.h,v 1.6 2010/04/15 20:38:09 miod Exp $ */
/* $NetBSD: dioreg.h,v 1.3 1997/01/30 09:18:40 thorpej Exp $ */
/*-
@@ -92,12 +92,6 @@
#define DIOII_SCBASE 132
/*
- * Macro that returns true if a select code lies within
- * the select code `hole'.
- */
-#define DIO_INHOLE(scode) ((scode) >= 32 && (scode) < DIOII_SCBASE)
-
-/*
* Macros to determine if device is DIO or DIO-II.
*/
#define DIO_ISDIO(scode) ((scode) >= 0 && (scode) < 32)
diff --git a/sys/arch/hp300/dev/diovar.h b/sys/arch/hp300/dev/diovar.h
index e41c5074c58..05d8e0900ef 100644
--- a/sys/arch/hp300/dev/diovar.h
+++ b/sys/arch/hp300/dev/diovar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: diovar.h,v 1.7 2008/06/26 05:42:10 ray Exp $ */
+/* $OpenBSD: diovar.h,v 1.8 2010/04/15 20:38:09 miod Exp $ */
/* $NetBSD: diovar.h,v 1.3 1997/05/05 21:01:33 thorpej Exp $ */
/*-
@@ -72,4 +72,10 @@ struct dio_devdesc {
void *dio_scodetopa(int);
void dio_intr_establish(struct isr *, const char *);
void dio_intr_disestablish(struct isr *);
+
+/*
+ * Return the next select code if the given select code lies within a hole,
+ * zero otherwise.
+ */
+int dio_inhole(int);
#endif /* _KERNEL */