diff options
author | Hugh Graham <hugh@cvs.openbsd.org> | 2001-08-25 13:33:38 +0000 |
---|---|---|
committer | Hugh Graham <hugh@cvs.openbsd.org> | 2001-08-25 13:33:38 +0000 |
commit | 2f9f539a801e8c00430eacc3a70495465ca02e4e (patch) | |
tree | a8c95a4e7bd59da4baa2c4974425216c11ff94b4 /sys/arch/vax/include | |
parent | 1195029145310bb1c26d5da6e89f13372126bc9b (diff) |
Bring in some useful stuff from NetBSD. Mostly work by Matt Thomas,
and concerned with intvec counting. Also some ANSIfication.
Diffstat (limited to 'sys/arch/vax/include')
-rw-r--r-- | sys/arch/vax/include/frame.h | 21 | ||||
-rw-r--r-- | sys/arch/vax/include/ioa.h | 4 | ||||
-rw-r--r-- | sys/arch/vax/include/nexus.h | 27 | ||||
-rw-r--r-- | sys/arch/vax/include/scb.h | 33 | ||||
-rw-r--r-- | sys/arch/vax/include/trap.h | 24 | ||||
-rw-r--r-- | sys/arch/vax/include/vsbus.h | 60 |
6 files changed, 90 insertions, 79 deletions
diff --git a/sys/arch/vax/include/frame.h b/sys/arch/vax/include/frame.h index fd092b47dbc..f83892f8195 100644 --- a/sys/arch/vax/include/frame.h +++ b/sys/arch/vax/include/frame.h @@ -1,5 +1,5 @@ -/* $OpenBSD: frame.h,v 1.2 1997/05/29 00:04:39 niklas Exp $ */ -/* $NetBSD: frame.h,v 1.1 1995/11/12 15:07:30 ragge Exp $ */ +/* $OpenBSD: frame.h,v 1.3 2001/08/25 13:33:36 hugh Exp $ */ +/* $NetBSD: frame.h,v 1.2 2000/06/04 19:30:15 matt Exp $ */ /* * Copyright (c) 1995 Ludd, University of Lule}, Sweden. * All rights reserved. @@ -31,6 +31,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef _VAX_FRAME_H_ +#define _VAX_FRAME_H_ + /* * Description of calls frame on stack. This is the * standard way of making procedure calls on vax systems. @@ -46,6 +49,16 @@ struct callsframe { /* This can be followed by more arguments */ }; -/* Offset to beginning of calls frame from first arg */ -#define FRAMEOFFSET(arg1) ((struct callsframe *)((unsigned int)&(arg1) - 24)) +struct icallsframe { + struct callsframe ica_frame; /* std call frame */ + unsigned int ica_r0; /* interrupt saved r0 */ + unsigned int ica_r1; /* interrupt saved r1 */ + unsigned int ica_r2; /* interrupt saved r2 */ + unsigned int ica_r3; /* interrupt saved r3 */ + unsigned int ica_r4; /* interrupt saved r4 */ + unsigned int ica_r5; /* interrupt saved r5 */ + unsigned int ica_pc; /* interrupt saved pc */ + unsigned int ica_psl; /* interrupt saved psl */ +}; +#endif /* _VAX_FRAME_H */ diff --git a/sys/arch/vax/include/ioa.h b/sys/arch/vax/include/ioa.h index e818d109080..5518d18a36f 100644 --- a/sys/arch/vax/include/ioa.h +++ b/sys/arch/vax/include/ioa.h @@ -1,5 +1,5 @@ -/* $OpenBSD: ioa.h,v 1.6 2001/08/12 12:03:03 heko Exp $ */ -/* $NetBSD: ioa.h,v 1.5 1999/04/12 20:57:52 pk Exp $ */ +/* $OpenBSD: ioa.h,v 1.7 2001/08/25 13:33:36 hugh Exp $ */ +/* $NetBSD: ioa.h,v 1.6 2000/01/24 02:40:32 matt Exp $ */ /*- * Copyright (c) 1982, 1986 The Regents of the University of California. * All rights reserved. diff --git a/sys/arch/vax/include/nexus.h b/sys/arch/vax/include/nexus.h index 7c50f1e1fec..9a377317deb 100644 --- a/sys/arch/vax/include/nexus.h +++ b/sys/arch/vax/include/nexus.h @@ -1,5 +1,5 @@ -/* $OpenBSD: nexus.h,v 1.8 2000/04/26 03:08:42 bjc Exp $ */ -/* $NetBSD: nexus.h,v 1.15 1999/08/07 10:36:46 ragge Exp $ */ +/* $OpenBSD: nexus.h,v 1.9 2001/08/25 13:33:36 hugh Exp $ */ +/* $NetBSD: nexus.h,v 1.17 2000/06/04 17:58:19 ragge Exp $ */ /*- * Copyright (c) 1982, 1986 The Regents of the University of California. @@ -38,6 +38,9 @@ #ifndef _VAX_NEXUS_H_ #define _VAX_NEXUS_H_ + +#include <machine/bus.h> + /* * Different definitions for nicer autoconf probing. */ @@ -97,10 +100,10 @@ struct nexus { }; struct sbi_attach_args { - u_int nexnum; /* This nexus TR number */ - u_int type; /* This nexus type */ - int nexinfo; /* Some info sent between attach & match */ - void *nexaddr; /* Virtual address of this nexus */ + int sa_nexnum; /* This nexus TR number */ + int sa_type; /* This nexus type */ + bus_space_tag_t sa_iot; + bus_space_handle_t sa_ioh; }; /* Memory device struct. This should be somewhere else */ @@ -118,9 +121,6 @@ struct bp_conf { int bp_addr; }; -extern caddr_t *nex_vec; -#define nex_vec_num(ipl, nexnum) nex_vec[(ipl-14)*16+nexnum] - #endif /* @@ -136,7 +136,7 @@ extern caddr_t *nex_vec; #define NEX_CFGFLT (0xfc000000) #ifndef _LOCORE -#if defined(VAX780) || defined(VAX8600) +#if VAX780 || VAX8600 #define NEXFLT_BITS \ "\20\40PARFLT\37WSQFLT\36URDFLT\35ISQFLT\34MXTFLT\33XMTFLT" #endif @@ -182,9 +182,10 @@ extern caddr_t *nex_vec; #define NEX_MEM256I 0x74 /* 256K chips, interleaved */ /* Memory classes */ -#define M780C 0 -#define M780EL 1 -#define M780EU 2 +#define M_NONE 0 +#define M780C 1 +#define M780EL 2 +#define M780EU 3 /* Memory recover defines */ #define MCHK_PANIC -1 diff --git a/sys/arch/vax/include/scb.h b/sys/arch/vax/include/scb.h index 745c2a372aa..c870085725f 100644 --- a/sys/arch/vax/include/scb.h +++ b/sys/arch/vax/include/scb.h @@ -1,5 +1,5 @@ -/* $OpenBSD: scb.h,v 1.5 2000/04/26 03:08:42 bjc Exp $ */ -/* $NetBSD: scb.h,v 1.6 2000/01/24 02:40:32 matt Exp $ */ +/* $OpenBSD: scb.h,v 1.6 2001/08/25 13:33:36 hugh Exp $ */ +/* $NetBSD: scb.h,v 1.11 2000/07/10 09:14:34 ragge Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -108,13 +108,34 @@ struct scb { #define SCB_KSTACK 0 #define SCB_ISTACK 1 +#define vecnum(bus, ipl, tr) (256+(ipl-0x14)*64+tr*4+bus*256) + +/* + * This struct is used when setting up interrupt vectors dynamically. + * It put a opaque 32 bit quanity on the stack and also has a placeholder + * for evcnt structure. + */ +struct ivec_dsp { + char pushr; /* pushr */ + char pushrarg; /* $0x3f */ + char jsb; + char mode; + long displacement; + void (*hoppaddr)(void *); + void *pushlarg; + struct evcnt *ev; +}; + #ifdef _KERNEL +extern const struct ivec_dsp idsptch; extern struct scb *scb; +extern struct ivec_dsp *scb_vec; +extern struct evcnt devipl_intrcnts[4]; /* IPL 2[0123] */ -extern paddr_t scb_init __P((paddr_t)); -extern int scb_vecref __P((int *, int *)); -extern void scb_fake __P((int, int)); -extern void scb_vecalloc __P((int, void(*)(void *), void *, int)); +extern paddr_t scb_init (paddr_t); +extern int scb_vecref (int *, int *); +extern void scb_fake (int, int); +extern void scb_vecalloc (int, void(*)(void *), void *, int, struct evcnt *); #endif /* _KERNEL */ #endif /* _VAX_SCB_H */ diff --git a/sys/arch/vax/include/trap.h b/sys/arch/vax/include/trap.h index 5b19bbb71e3..499c7e6d80d 100644 --- a/sys/arch/vax/include/trap.h +++ b/sys/arch/vax/include/trap.h @@ -1,5 +1,5 @@ -/* $OpenBSD: trap.h,v 1.10 2000/04/26 03:08:43 bjc Exp $ */ -/* $NetBSD: trap.h,v 1.17 2000/01/24 02:40:32 matt Exp $ */ +/* $OpenBSD: trap.h,v 1.11 2001/08/25 13:33:36 hugh Exp $ */ +/* $NetBSD: trap.h,v 1.18 2000/06/04 02:19:26 matt Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -92,26 +92,6 @@ struct trapframe { long psl; /* User psl */ }; -/* - * This struct is used when setting up interrupt vectors dynamically. - * It pushes a longword between 0-63 on the stack; this number is - * normally used as the ctlr number on devices. This use effectively - * limits the number of interruptable ctlrs on one unibus to 64. - */ -struct ivec_dsp { - char pushr; /* pushr */ - char pushrarg; /* $0x3f */ - char jsb; - char mode; - long displacement; - void (*hoppaddr) __P((void *)); - void *pushlarg; -}; - -#ifdef _KERNEL -extern const struct ivec_dsp idsptch; -#endif - #endif /* _LOCORE */ #endif /* _VAX_TRAP_H_ */ diff --git a/sys/arch/vax/include/vsbus.h b/sys/arch/vax/include/vsbus.h index 1c0eb6af228..2b99b7d7758 100644 --- a/sys/arch/vax/include/vsbus.h +++ b/sys/arch/vax/include/vsbus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vsbus.h,v 1.5 2000/10/09 23:11:57 bjc Exp $ */ +/* $OpenBSD: vsbus.h,v 1.6 2001/08/25 13:33:36 hugh Exp $ */ /* $NetBSD: vsbus.h,v 1.13 2000/06/25 16:00:46 ragge Exp $ */ /* * Copyright (c) 1996 Ludd, University of Lule}, Sweden. @@ -44,29 +44,6 @@ #include <machine/bus.h> #include <machine/sgmap.h> -struct vsbus_softc { - struct device sc_dev; -#if 0 - volatile struct vs_cpu *sc_cpu; -#endif - u_char *sc_intmsk; /* Mask register */ - u_char *sc_intclr; /* Clear interrupt register */ - u_char *sc_intreq; /* Interrupt request register */ - u_char sc_mask; /* Interrupts to enable after autoconf */ - vaddr_t sc_vsregs; /* Where the VS_REGS are mapped */ - vaddr_t sc_dmaaddr; /* Mass storage virtual DMA area */ - vsize_t sc_dmasize; /* Size of the DMA area */ - - struct vax_bus_dma_tag sc_dmatag; - struct vax_sgmap sc_sgmap; -}; - -struct vsbus_dma { - SIMPLEQ_ENTRY(vsbus_dma) vd_q; - void (*vd_go)(void *); - void *vd_arg; -}; - struct confargs { char ca_name[16]; /* device name */ int ca_intslot; /* device interrupt-slot */ @@ -143,14 +120,33 @@ struct vsbus_attach_args { #define SMADDR 0x30000000 #define SMSIZE 0x20000 /* Actually 256k, only 128k used */ +struct vsbus_softc { + struct device sc_dev; + u_char *sc_intmsk; /* Mask register */ + u_char *sc_intclr; /* Clear interrupt register */ + u_char *sc_intreq; /* Interrupt request register */ + u_char sc_mask; /* Interrupts to enable after autoconf */ + vaddr_t sc_vsregs; /* Where the VS_REGS are mapped */ + vaddr_t sc_dmaaddr; /* Mass storage virtual DMA area */ + vsize_t sc_dmasize; /* Size of the DMA area */ + + struct vax_bus_dma_tag sc_dmatag; + struct vax_sgmap sc_sgmap; +}; + +struct vsbus_dma { + SIMPLEQ_ENTRY(vsbus_dma) vd_q; + void (*vd_go)(void *); + void *vd_arg; +}; + #ifdef _KERNEL -void vsbus_dma_init __P((struct vsbus_softc *, unsigned ptecnt)); -u_char vsbus_setmask __P((unsigned char)); -void vsbus_clrintr __P((unsigned char)); -void vsbus_intr __P((void *)); -void vsbus_copytoproc __P((struct proc *, caddr_t, caddr_t, int)); -void vsbus_copyfromproc __P((struct proc *, caddr_t, caddr_t, int)); -void vsbus_dma_start __P((struct vsbus_dma *)); -void vsbus_dma_intr __P((void)); +void vsbus_dma_init(struct vsbus_softc *, unsigned ptecnt); +u_char vsbus_setmask(int); +void vsbus_clrintr(int); +void vsbus_copytoproc(struct proc *, caddr_t, caddr_t, int); +void vsbus_copyfromproc(struct proc *, caddr_t, caddr_t, int); +void vsbus_dma_start(struct vsbus_dma *); +void vsbus_dma_intr(void); #endif #endif /* _VAX_VSBUS_H_ */ |