diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2013-05-17 22:40:02 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2013-05-17 22:40:02 +0000 |
commit | 1fd02cebf2a2327f8a99a03f131c8a2403c1d5b6 (patch) | |
tree | 13aa79fa40493781912ca6fa4670468ddd01bd15 /sys/arch | |
parent | ac2926810ed186ffb6bf1a5d56a417c2fdc1825e (diff) |
Move interrupt-related defines from <machine/cpu.h> to <machine/intr.h>.
No functional change.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/mvme88k/include/cpu.h | 38 | ||||
-rw-r--r-- | sys/arch/mvme88k/include/intr.h | 95 |
2 files changed, 97 insertions, 36 deletions
diff --git a/sys/arch/mvme88k/include/cpu.h b/sys/arch/mvme88k/include/cpu.h index f5e8b4b9fba..073612dec07 100644 --- a/sys/arch/mvme88k/include/cpu.h +++ b/sys/arch/mvme88k/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.45 2011/03/23 16:54:36 pirofti Exp $ */ +/* $OpenBSD: cpu.h,v 1.46 2013/05/17 22:40:01 miod Exp $ */ /* * Copyright (c) 1996 Nivas Madhur * Copyright (c) 1992, 1993 @@ -44,7 +44,7 @@ #ifdef _KERNEL -#include <sys/evcount.h> +extern int cpuspeed; /* board dependent pointers */ extern void (*md_interrupt_func_ptr)(struct trapframe *); @@ -60,39 +60,7 @@ extern void (*md_init_clocks)(void); extern void (*md_send_ipi)(int, cpuid_t); extern void (*md_delay)(int); extern void (*md_smp_setup)(struct cpu_info *); - -struct intrhand { - SLIST_ENTRY(intrhand) ih_link; - int (*ih_fn)(void *); - void *ih_arg; - int ih_ipl; - int ih_wantframe; - struct evcount ih_count; -}; - -int intr_establish(int, struct intrhand *, const char *); -int intr_findvec(int, int, int); - -/* - * There are 256 possible vectors on a mvme88k platform (including - * onboard and VME vectors. Use intr_establish() to register a - * handler for the given vector. vector number is used to index - * into the intr_handlers[] table. - */ -#define NVMEINTR 256 -typedef SLIST_HEAD(, intrhand) intrhand_t; -extern intrhand_t intr_handlers[NVMEINTR]; - -#ifdef MVME188 -/* - * Currently registered VME interrupt vectors for a given IPL, if they - * are unique. Used to help the MVME188 interrupt handler when it's getting - * behind. - */ -extern u_int vmevec_hints[8]; -#endif - -void doboot(void); +__dead void doboot(void); void nmihand(void *); #endif /* _KERNEL */ diff --git a/sys/arch/mvme88k/include/intr.h b/sys/arch/mvme88k/include/intr.h index 854ccd51bce..0b82ad607ab 100644 --- a/sys/arch/mvme88k/include/intr.h +++ b/sys/arch/mvme88k/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.21 2011/03/23 16:54:36 pirofti Exp $ */ +/* $OpenBSD: intr.h,v 1.22 2013/05/17 22:40:01 miod Exp $ */ /* * Copyright (C) 2000 Steve Murphree, Jr. * All rights reserved. @@ -25,6 +25,44 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* + * Copyright (c) 1996 Nivas Madhur + * 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. + */ #ifndef _MACHINE_INTR_H_ #define _MACHINE_INTR_H_ @@ -51,6 +89,61 @@ #define NIPLS 8 +#if defined(_KERNEL) && !defined(_LOCORE) + +#include <sys/evcount.h> + +struct intrhand { + SLIST_ENTRY(intrhand) ih_link; + int (*ih_fn)(void *); + void *ih_arg; + int ih_ipl; + int ih_wantframe; + struct evcount ih_count; +}; + +int intr_establish(int, struct intrhand *, const char *); +int intr_findvec(int, int, int); + +/* + * There are 256 possible VME interrupt vectors on a mvme88k platform + * (although some systems use VME vectors for onboard devices). + * Use either vmeintr_establish() or intr_establish() to register a handler + * for the given vector. Vector number is used to index into the + * intr_handlers[] table. + */ +#define NVMEINTR 256 +typedef SLIST_HEAD(, intrhand) intrhand_t; +extern intrhand_t intr_handlers[NVMEINTR]; + +/* + * Currently registered VME interrupt vectors for a given IPL, if they + * are unique. Used to help the MVME181 and MVME188 interrupt handlers when + * they fail to complete the VME interrupt acknowledge cycle to get the + * interrupt vector number. + */ +extern u_int vmevec_hints[NIPLS]; + +/* Interrupt masks (MVME181, MVME188) */ +extern u_int32_t int_mask_val[NIPLS]; + +/* + * Logical values for non-VME interrupt sources on boards with dedicated + * interrupt controllers (MVME181, MVME188). Not all sources may be available + * on a given board. + */ + +#define INTSRC_ABORT 1 /* abort button */ +#define INTSRC_ACFAIL 2 /* AC failure */ +#define INTSRC_SYSFAIL 3 /* system failure */ +#define INTSRC_PARERR 4 /* memory parity error */ +#define INTSRC_CIO 5 /* Z8536 */ +#define INTSRC_DTIMER 6 /* MC68692 timer interrupt */ +#define INTSRC_DUART 7 /* MC68692 serial interrupt */ +#define INTSRC_VME 8 /* up to seven VME interrupt levels */ + +#endif /* _KERNEL && !_LOCORE */ + #include <m88k/intr.h> #endif /* _MACHINE_INTR_H_ */ |