Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/atari/isa Implement at least a bit of isa_intr_allo...



details:   https://anonhg.NetBSD.org/src/rev/c45f921cc1c0
branches:  trunk
changeset: 477557:c45f921cc1c0
user:      leo <leo%NetBSD.org@localhost>
date:      Thu Oct 21 15:26:57 1999 +0000

description:
Implement at least a bit of isa_intr_alloc().

diffstat:

 sys/arch/atari/isa/isa_machdep.c |  48 +++++++++++++++++++++++++++++++++++++--
 1 files changed, 45 insertions(+), 3 deletions(-)

diffs (78 lines):

diff -r 6edc4b48aaa3 -r c45f921cc1c0 sys/arch/atari/isa/isa_machdep.c
--- a/sys/arch/atari/isa/isa_machdep.c  Thu Oct 21 15:05:08 1999 +0000
+++ b/sys/arch/atari/isa/isa_machdep.c  Thu Oct 21 15:26:57 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: isa_machdep.c,v 1.13 1999/08/06 08:27:47 leo Exp $     */
+/*     $NetBSD: isa_machdep.c,v 1.14 1999/10/21 15:26:57 leo Exp $     */
 
 /*
  * Copyright (c) 1997 Leo Weppelman.  All rights reserved.
@@ -130,6 +130,9 @@
  *   - irq <= 6 -> slot 1
  *   - irq >  6 -> slot 2
  */
+
+#define        SLOTNR(irq)     ((irq <= 6) ? 0 : 1)
+
 static isa_intr_info_t iinfo[2] = { { -1 }, { -1 } };
 
 static int     iifun __P((int, int));
@@ -181,6 +184,45 @@
        return 1;
 }
 
+
+/*
+ * XXXX
+ * XXXX Note that this function is not really working yet! The big problem is
+ * XXXX to only generate interrupts for the slot the card is in...
+ */
+int
+isa_intr_alloc(ic, mask, type, irq)
+       isa_chipset_tag_t ic;
+       int mask;
+       int type;
+       int *irq;
+{
+       isa_intr_info_t *iinfo_p;
+       int             slot, i;
+
+
+       /*
+        * The Hades only supports edge triggered interrupts!
+        */
+       if (type != IST_EDGE)
+               return 1;
+
+#define        MAXIRQ          10      /* XXX: Pure fiction    */
+       for (i = 0; i < MAXIRQ; i++) {
+               if (mask & (1<<i)) {
+                   slot    = SLOTNR(i);
+                   iinfo_p = &iinfo[slot];
+
+                   if (iinfo_p->slot >= 0) {
+                       *irq = i;
+                       printf("WARNING: isa_intr_alloc is not yet ready!\n");
+                       return 0;
+                   }
+               }
+       }
+       return (1);
+}
+
 void *
 isa_intr_establish(ic, irq, type, level, ih_fun, ih_arg)
        isa_chipset_tag_t ic;
@@ -198,10 +240,10 @@
        if (type != IST_EDGE)
                return NULL;
 
-       slot    = (irq <= 6) ? 0 : 1;
+       slot    = SLOTNR(irq);
        iinfo_p = &iinfo[slot];
 
-       if (iinfo_p->slot > 0)
+       if (iinfo_p->slot >= 0)
            panic("isa_intr_establish: interrupt was already established\n");
 
        ihand = intr_establish((slot == 0) ? 3 : 15, USER_VEC, 0,



Home | Main Index | Thread Index | Old Index