summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/include
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/sparc/include')
-rw-r--r--sys/arch/sparc/include/_types.h5
-rw-r--r--sys/arch/sparc/include/cpu.h59
-rw-r--r--sys/arch/sparc/include/intr.h102
-rw-r--r--sys/arch/sparc/include/psl.h9
-rw-r--r--sys/arch/sparc/include/z8530var.h3
5 files changed, 115 insertions, 63 deletions
diff --git a/sys/arch/sparc/include/_types.h b/sys/arch/sparc/include/_types.h
index 0353ef1e1ae..23331af88f9 100644
--- a/sys/arch/sparc/include/_types.h
+++ b/sys/arch/sparc/include/_types.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: _types.h,v 1.9 2008/07/21 20:50:55 martynas Exp $ */
+/* $OpenBSD: _types.h,v 1.10 2009/04/10 20:53:54 miod Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -116,4 +116,7 @@ typedef int __rune_t;
typedef void * __wctrans_t;
typedef void * __wctype_t;
+/* Feature test macros */
+#define __HAVE_GENERIC_SOFT_INTERRUPTS
+
#endif /* _SPARC__TYPES_H_ */
diff --git a/sys/arch/sparc/include/cpu.h b/sys/arch/sparc/include/cpu.h
index 27dbcc663df..2f68e5bb6aa 100644
--- a/sys/arch/sparc/include/cpu.h
+++ b/sys/arch/sparc/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.31 2009/03/26 17:24:33 oga Exp $ */
+/* $OpenBSD: cpu.h,v 1.32 2009/04/10 20:53:54 miod Exp $ */
/* $NetBSD: cpu.h,v 1.24 1997/03/15 22:25:15 pk Exp $ */
/*
@@ -66,9 +66,9 @@
* Exported definitions unique to SPARC cpu support.
*/
-#include <sys/evcount.h>
#include <machine/psl.h>
#include <machine/reg.h>
+#include <machine/intr.h>
#include <sparc/sparc/intreg.h>
#include <sparc/sparc/cpuvar.h>
@@ -94,32 +94,6 @@ extern int eintstack[];
#define CLKF_INTR(framep) ((framep)->fp < (u_int)eintstack)
/*
- * Software interrupt request `register'.
- */
-union sir {
- int sir_any;
- char sir_which[4];
-};
-extern union sir sir;
-
-#define SIR_NET 0
-#define SIR_CLOCK 1
-
-#if defined(SUN4M)
-extern void raise(int, int);
-#if !(defined(SUN4) || defined(SUN4C))
-#define setsoftint() raise(0,1)
-#else /* both defined */
-#define setsoftint() (cputyp == CPU_SUN4M ? raise(0,1) : ienab_bis(IE_L1))
-#endif /* !4,!4c */
-#else /* 4m not defined */
-#define setsoftint() ienab_bis(IE_L1)
-#endif /* SUN4M */
-
-#define setsoftnet() (sir.sir_which[SIR_NET] = 1, setsoftint())
-#define setsoftclock() (sir.sir_which[SIR_CLOCK] = 1, setsoftint())
-
-/*
* Preempt the current process if in interrupt from user mode,
* or after the current trap/syscall if in system mode.
*/
@@ -148,34 +122,6 @@ extern int want_ast;
extern int foundfpu; /* true => we have an FPU */
-/*
- * Interrupt handler chains. Interrupt handlers should return 0 for
- * ``not me'' or 1 (``I took care of it''). intr_establish() inserts a
- * handler into the list. The handler is called with its (single)
- * argument, or with a pointer to a clockframe if ih_arg is NULL.
- * ih_ipl specifies the interrupt level that should be blocked when
- * executing this handler.
- */
-struct intrhand {
- int (*ih_fun)(void *);
- void *ih_arg;
- int ih_ipl;
- int ih_vec; /* human readable ipl for vmstat */
- struct evcount ih_count;
- struct intrhand *ih_next;
-};
-extern struct intrhand *intrhand[15];
-void intr_establish(int level, struct intrhand *, int, const char *);
-void vmeintr_establish(int vec, int level, struct intrhand *, int, const char *);
-
-/*
- * intr_fasttrap() is a lot like intr_establish, but is used for ``fast''
- * interrupt vectors (vectors that are not shared and are handled in the
- * trap window). Such functions must be written in assembly.
- */
-int intr_fasttrap(int, void (*)(void), int (*)(void *), void *);
-void intr_fastuntrap(int);
-
/* auxreg.c */
void led_blink(void *);
/* scf.c */
@@ -186,7 +132,6 @@ int isbad(struct dkbad *bt, int, int, int);
/* machdep.c */
int ldcontrolb(caddr_t);
void dumpconf(void);
-void intr_init(void);
caddr_t reserve_dumppages(caddr_t);
/* clock.c */
struct timeval;
diff --git a/sys/arch/sparc/include/intr.h b/sys/arch/sparc/include/intr.h
new file mode 100644
index 00000000000..b4fff3a96ac
--- /dev/null
+++ b/sys/arch/sparc/include/intr.h
@@ -0,0 +1,102 @@
+/* $OpenBSD: intr.h,v 1.1 2009/04/10 20:53:54 miod Exp $ */
+/* $NetBSD: cpu.h,v 1.24 1997/03/15 22:25:15 pk Exp $ */
+
+/*
+ * Copyright (c) 1992, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This software was developed by the Computer Systems Engineering group
+ * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
+ * contributed to Berkeley.
+ *
+ * All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Lawrence Berkeley Laboratory.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)cpu.h 8.4 (Berkeley) 1/5/94
+ */
+
+#ifndef _SPARC_INTR_H_
+#define _SPARC_INTR_H_
+
+#ifdef _KERNEL
+#include <sys/evcount.h>
+
+/*
+ * Interrupt handler chains. Interrupt handlers should return 0 for
+ * ``not me'' or 1 (``I took care of it''). intr_establish() inserts a
+ * handler into the list. The handler is called with its (single)
+ * argument, or with a pointer to a clockframe if ih_arg is NULL.
+ * ih_ipl specifies the interrupt level that should be blocked when
+ * executing this handler.
+ */
+struct intrhand {
+ int (*ih_fun)(void *);
+ void *ih_arg;
+ int ih_ipl;
+ int ih_vec; /* ipl for vmstat */
+ struct evcount ih_count;
+ struct intrhand *ih_next; /* global list */
+};
+extern struct intrhand *intrhand[15]; /* XXX obio.c */
+
+void intr_establish(int, struct intrhand *, int, const char *);
+void vmeintr_establish(int, int, struct intrhand *, int, const char *);
+
+/*
+ * intr_fasttrap() is a lot like intr_establish, but is used for ``fast''
+ * interrupt vectors (vectors that are not shared and are handled in the
+ * trap window). Such functions must be written in assembly.
+ */
+int intr_fasttrap(int, void (*)(void), int (*)(void *), void *);
+void intr_fastuntrap(int);
+
+void intr_init(void);
+
+/*
+ * Soft interrupt handler chains. In addition to a struct intrhand for
+ * proper dispatching, we also remember a pending state as well as the
+ * bits to frob in the software interrupt register.
+ */
+struct sintrhand {
+ struct intrhand sih_ih;
+ int sih_pending; /* nonzero if triggered */
+ int sih_hw; /* hw dependent */
+ int sih_ipl; /* ipl it's registered at */
+};
+
+void softintr_disestablish(void *);
+void *softintr_establish(int, void (*)(void *), void *);
+void softintr_schedule(void *);
+
+/* XXX legacy software interrupts */
+extern void *softnet_ih;
+#define setsoftnet() softintr_schedule(softnet_ih)
+
+#endif /* _KERNEL */
+#endif /* _SPARC_INTR_H_ */
diff --git a/sys/arch/sparc/include/psl.h b/sys/arch/sparc/include/psl.h
index cb9fc9022f4..b8afe55177f 100644
--- a/sys/arch/sparc/include/psl.h
+++ b/sys/arch/sparc/include/psl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: psl.h,v 1.24 2009/03/15 19:40:40 miod Exp $ */
+/* $OpenBSD: psl.h,v 1.25 2009/04/10 20:53:54 miod Exp $ */
/* $NetBSD: psl.h,v 1.12 1997/03/10 21:49:11 pk Exp $ */
/*
@@ -77,12 +77,13 @@
*/
#define IPL_NONE 0
#define IPL_SOFTINT 1
-#define IPL_SOFTCLOCK IPL_SOFTINT /* softclock() interrupts */
-#define IPL_SOFTNET IPL_SOFTINT /* soft network interrupts */
+#define IPL_SOFTCLOCK 1 /* softclock() interrupts */
+#define IPL_SOFTNET 1 /* soft network interrupts */
#define IPL_AUSOFT 4 /* audio soft interrupts */
#define IPL_FDSOFT 4 /* floppy soft interrupts */
#define IPL_BIO 5 /* block devices are at 5 and below */
-#define IPL_TTY 6 /* tty soft interrupts */
+#define IPL_TTY 6 /* MD tty soft interrupts */
+#define IPL_SOFTTTY IPL_TTY
#define IPL_NET 7 /* network hardware at 7 or below */
#define IPL_VM 7 /* max(BIO, NET, TTY) */
#define IPL_FB 9 /* framebuffer interrupts */
diff --git a/sys/arch/sparc/include/z8530var.h b/sys/arch/sparc/include/z8530var.h
index 387c49a5e40..05469563496 100644
--- a/sys/arch/sparc/include/z8530var.h
+++ b/sys/arch/sparc/include/z8530var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: z8530var.h,v 1.3 2004/09/29 07:35:13 miod Exp $ */
+/* $OpenBSD: z8530var.h,v 1.4 2009/04/10 20:53:54 miod Exp $ */
/* $NetBSD: z8530var.h,v 1.1 1997/10/18 00:01:30 gwr Exp $ */
/*
@@ -45,6 +45,7 @@
struct zsc_softc {
struct device zsc_dev; /* required first: base device */
+ void *zsc_softih; /* softintr cookie */
struct zs_chanstate zsc_cs[2]; /* channel A and B soft state */
};