Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sgimips/hpc Less odious hack for powerfail interrup...



details:   https://anonhg.NetBSD.org/src/rev/f79df3b5c00e
branches:  trunk
changeset: 521162:f79df3b5c00e
user:      rafal <rafal%NetBSD.org@localhost>
date:      Fri Jan 25 04:54:31 2002 +0000

description:
Less odious hack for powerfail interrupt; even thought it's still odious,
at least now we only attempt to install the handler once.

diffstat:

 sys/arch/sgimips/hpc/hpc.c |  18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diffs (40 lines):

diff -r 1559efa05ba5 -r f79df3b5c00e sys/arch/sgimips/hpc/hpc.c
--- a/sys/arch/sgimips/hpc/hpc.c        Fri Jan 25 04:11:30 2002 +0000
+++ b/sys/arch/sgimips/hpc/hpc.c        Fri Jan 25 04:54:31 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hpc.c,v 1.5 2001/11/20 21:21:03 rafal Exp $    */
+/*     $NetBSD: hpc.c,v 1.6 2002/01/25 04:54:31 rafal Exp $    */
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang
@@ -107,6 +107,8 @@
 
 extern struct sgimips_bus_dma_tag sgimips_default_bus_dma_tag;
 
+static int powerintr_established;
+
 int    hpc_match(struct device *, struct cfdata *, void *);
 void   hpc_attach(struct device *, struct device *, void *);
 int    hpc_print(void *, const char *);
@@ -179,11 +181,17 @@
        }
 
        /* 
-        * XXXrkb: only true for first HPC, but didn't know where else to
-        * shove it (ip22_intr is too early).  I suppose I should request
-        * a post-config callback or something, but where?
+        * XXX: Only attach the powerfail interrupt once, since the 
+        * interrupt code doesn't let you share interrupt just yet.
+        *
+        * Since the powerfail interrupt is hardcoded to read from 
+        * a specific register anyway (XXX#2!), we don't care when
+        * it gets attached, as long as it only happens once.
         */
-       cpu_intr_establish(9, IPL_NONE, hpc_power_intr, sc);
+       if (!powerintr_established) {
+               cpu_intr_establish(9, IPL_NONE, hpc_power_intr, sc);
+               powerintr_established++;
+       }
 }
 
 int



Home | Main Index | Thread Index | Old Index