diff options
author | Jason Downs <downsj@cvs.openbsd.org> | 1997-07-14 08:15:01 +0000 |
---|---|---|
committer | Jason Downs <downsj@cvs.openbsd.org> | 1997-07-14 08:15:01 +0000 |
commit | 68982ee9315c1d2dfd5ae49889ef59a9a0a2b18e (patch) | |
tree | 49722ae0f8e398f3a79268c08a236e5b9bf0c3ad /sys/arch/hp300/stand/include | |
parent | 5f2612599833ff2e0bc32cb218ce6f42643092b2 (diff) |
The grand reorganization, OpenBSD style.
Lossely based on the NetBSD reorg, but much improved upon, simpler, and doesn't
scribble needless junk into the bootblocks.
Diffstat (limited to 'sys/arch/hp300/stand/include')
-rw-r--r-- | sys/arch/hp300/stand/include/consdefs.h | 69 | ||||
-rw-r--r-- | sys/arch/hp300/stand/include/device.h | 79 | ||||
-rw-r--r-- | sys/arch/hp300/stand/include/hpibvar.h | 62 | ||||
-rw-r--r-- | sys/arch/hp300/stand/include/if_lereg.h | 163 | ||||
-rw-r--r-- | sys/arch/hp300/stand/include/itevar.h | 232 | ||||
-rw-r--r-- | sys/arch/hp300/stand/include/kbdvar.h | 66 | ||||
-rw-r--r-- | sys/arch/hp300/stand/include/rominfo.h | 69 | ||||
-rw-r--r-- | sys/arch/hp300/stand/include/samachdep.h | 98 | ||||
-rw-r--r-- | sys/arch/hp300/stand/include/scsivar.h | 52 | ||||
-rw-r--r-- | sys/arch/hp300/stand/include/volhdr.h | 82 |
10 files changed, 972 insertions, 0 deletions
diff --git a/sys/arch/hp300/stand/include/consdefs.h b/sys/arch/hp300/stand/include/consdefs.h new file mode 100644 index 00000000000..81b81c49ce0 --- /dev/null +++ b/sys/arch/hp300/stand/include/consdefs.h @@ -0,0 +1,69 @@ +/* $OpenBSD: consdefs.h,v 1.1 1997/07/14 08:14:31 downsj Exp $ */ +/* $NetBSD: consdefs.h,v 1.2 1997/05/12 07:45:41 thorpej Exp $ */ + +/* + * Copyright (c) 1982, 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * 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. 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, Berkeley and its contributors. + * 4. 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. + */ + +/* + * Glue for determining console select code. + */ +extern int curcons_scode; +extern int cons_scode; + +/* + * Console routine prototypes. + */ +#ifdef ITECONSOLE +void iteprobe __P((struct consdev *)); +void iteinit __P((struct consdev *)); +int itegetchar __P((dev_t)); +void iteputchar __P((dev_t, int)); +#endif +#ifdef DCACONSOLE +void dcaprobe __P((struct consdev *)); +void dcainit __P((struct consdev *)); +int dcagetchar __P((dev_t)); +void dcaputchar __P((dev_t, int)); +#endif +#ifdef APCICONSOLE +void apciprobe __P((struct consdev *)); +void apciinit __P((struct consdev *)); +int apcigetchar __P((dev_t)); +void apciputchar __P((dev_t, int)); +#endif +#ifdef DCMCONSOLE +void dcmprobe __P((struct consdev *)); +void dcminit __P((struct consdev *)); +int dcmgetchar __P((dev_t)); +void dcmputchar __P((dev_t, int)); +#endif diff --git a/sys/arch/hp300/stand/include/device.h b/sys/arch/hp300/stand/include/device.h new file mode 100644 index 00000000000..5c25cf01907 --- /dev/null +++ b/sys/arch/hp300/stand/include/device.h @@ -0,0 +1,79 @@ +/* $OpenBSD: device.h,v 1.1 1997/07/14 08:14:32 downsj Exp $ */ +/* $NetBSD: device.h,v 1.1 1997/01/30 10:31:44 thorpej Exp $ */ + +/* + * Copyright (c) 1982, 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * 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. 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, Berkeley and its contributors. + * 4. 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. + * + * @(#)device.h 8.1 (Berkeley) 6/10/93 + */ + +struct hp_hw { + caddr_t hw_pa; /* physical address of control space */ + int hw_size; /* size of control space */ + caddr_t hw_kva; /* kernel virtual address of control space */ + short hw_id; /* HW returned id */ + short hw_secid; /* secondary HW id (displays) */ + short hw_type; /* type (defined below) */ + short hw_sc; /* select code (if applicable) */ +}; + +#define MAXCTLRS 16 /* Size of HW table (arbitrary) */ +#define MAXSLAVES 8 /* Slaves per controller (HPIB/SCSI limit) */ + +/* bus types */ +#define B_MASK 0xE000 +#define B_DIO 0x2000 +#define B_DIOII 0x4000 +#define B_VME 0x6000 +/* controller types */ +#define C_MASK 0x8F +#define C_FLAG 0x80 +#define C_HPIB 0x81 +#define C_SCSI 0x82 +#define C_VME 0x83 +/* device types (controllers with no slaves) */ +#define D_MASK 0x8F +#define D_BITMAP 0x01 +#define D_LAN 0x02 +#define D_FPA 0x03 +#define D_KEYBOARD 0x04 +#define D_COMMDCA 0x05 +#define D_COMMDCM 0x06 +#define D_COMMDCL 0x07 +#define D_PPORT 0x08 +#define D_MISC 0x7F + +#define HW_ISCTLR(hw) ((hw)->hw_type & C_FLAG) +#define HW_ISDIOII(hw) ((hw)->hw_type & B_DIOII) +#define HW_ISHPIB(hw) (((hw)->hw_type & C_MASK) == C_HPIB) +#define HW_ISSCSI(hw) (((hw)->hw_type & C_MASK) == C_SCSI) +#define HW_ISDEV(hw,d) (((hw)->hw_type & D_MASK) == (d)) diff --git a/sys/arch/hp300/stand/include/hpibvar.h b/sys/arch/hp300/stand/include/hpibvar.h new file mode 100644 index 00000000000..da178c0bb4e --- /dev/null +++ b/sys/arch/hp300/stand/include/hpibvar.h @@ -0,0 +1,62 @@ +/* $OpenBSD: hpibvar.h,v 1.1 1997/07/14 08:14:33 downsj Exp $ */ +/* $NetBSD: hpibvar.h,v 1.4 1994/10/26 07:27:24 cgd Exp $ */ + +/* + * Copyright (c) 1982, 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * 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. 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, Berkeley and its contributors. + * 4. 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. + * + * @(#)hpibvar.h 8.1 (Berkeley) 6/10/93 + */ + +#define HPIBA 32 +#define HPIBB 1 +#define HPIBC 8 +#define HPIBA_BA 21 +#define HPIBC_BA 30 + +#define CSA_BA 0x1F + +#define C_DCL 20 +#define C_LAG 32 +#define C_UNL 63 +#define C_TAG 64 +#define C_UNA 94 +#define C_UNT 95 +#define C_SCG 96 + +struct hpib_softc { + char sc_alive; + char sc_type; + int sc_ba; + char *sc_addr; +}; + +extern struct hpib_softc hpib_softc[]; diff --git a/sys/arch/hp300/stand/include/if_lereg.h b/sys/arch/hp300/stand/include/if_lereg.h new file mode 100644 index 00000000000..701c8d707f4 --- /dev/null +++ b/sys/arch/hp300/stand/include/if_lereg.h @@ -0,0 +1,163 @@ +/* $OpenBSD: if_lereg.h,v 1.1 1997/07/14 08:14:34 downsj Exp $ */ +/* $NetBSD: if_lereg.h,v 1.1 1996/01/01 18:10:56 thorpej Exp $ */ + +/* + * Copyright (c) 1982, 1990 The Regents of the University of California. + * All rights reserved. + * + * 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. 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, Berkeley and its contributors. + * 4. 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. + * + * @(#)if_lereg.h 7.1 (Berkeley) 5/8/90 + */ + +#define LEID 21 + +#define NTBUF 2 +#define TLEN 1 +#define NRBUF 8 +#define RLEN 3 +#define BUFSIZE 1518 + +#define vu_char volatile u_char +#define vu_short volatile u_short + +/* + * LANCE registers. + */ +struct lereg0 { + u_char ler0_pad0; + vu_char ler0_id; /* ID */ + u_char ler0_pad1; + vu_char ler0_status; /* interrupt enable/status */ +}; + +/* + * Control and status bits -- lereg0 + */ +#define LE_IE 0x80 /* interrupt enable */ +#define LE_IR 0x40 /* interrupt requested */ +#define LE_LOCK 0x08 /* lock status register */ +#define LE_ACK 0x04 /* ack of lock */ +#define LE_JAB 0x02 /* loss of tx clock (???) */ +#define LE_IPL(x) ((((x) >> 4) & 0x3) + 3) + +struct lereg1 { + vu_short ler1_rdp; /* data port */ + vu_short ler1_rap; /* register select port */ +}; + +/* + * Control and status bits -- lereg1 + */ +#define LE_SERR 0x8000 +#define LE_BABL 0x4000 +#define LE_CERR 0x2000 +#define LE_MISS 0x1000 +#define LE_MERR 0x0800 +#define LE_RINT 0x0400 +#define LE_TINT 0x0200 +#define LE_IDON 0x0100 +#define LE_INTR 0x0080 +#define LE_INEA 0x0040 +#define LE_RXON 0x0020 +#define LE_TXON 0x0010 +#define LE_TDMD 0x0008 +#define LE_STOP 0x0004 +#define LE_STRT 0x0002 +#define LE_INIT 0x0001 + +#define LE_BSWP 0x0004 +#define LE_ACON 0x0002 +#define LE_BCON 0x0001 + +/* + * Overlayed on 16K dual-port RAM. + * Current size is 15,284 bytes with 8 x 1518 receive buffers and + * 2 x 1518 transmit buffers. + */ + +/* + * LANCE initialization block + */ +struct init_block { + u_short mode; /* mode register */ + u_char padr[6]; /* ethernet address */ + u_long ladrf[2]; /* logical address filter (multicast) */ + u_short rdra; /* low order pointer to receive ring */ + u_short rlen; /* high order pointer and no. rings */ + u_short tdra; /* low order pointer to transmit ring */ + u_short tlen; /* high order pointer and no rings */ +}; + +/* + * Mode bits -- init_block + */ +#define LE_PROM 0x8000 /* promiscuous */ +#define LE_INTL 0x0040 /* internal loopback */ +#define LE_DRTY 0x0020 /* disable retry */ +#define LE_COLL 0x0010 /* force collision */ +#define LE_DTCR 0x0008 /* disable transmit crc */ +#define LE_LOOP 0x0004 /* loopback */ +#define LE_DTX 0x0002 /* disable transmitter */ +#define LE_DRX 0x0001 /* disable receiver */ +#define LE_NORMAL 0x0000 + +/* + * Message descriptor + */ +struct mds { + u_short addr; + u_short flags; + u_short bcnt; + u_short mcnt; +}; + +/* Message descriptor flags */ +#define LE_OWN 0x8000 /* owner bit, 0=host, 1=LANCE */ +#define LE_ERR 0x4000 /* error */ +#define LE_STP 0x0200 /* start of packet */ +#define LE_ENP 0x0100 /* end of packet */ + +/* Receive ring status flags */ +#define LE_FRAM 0x2000 /* framing error error */ +#define LE_OFLO 0x1000 /* silo overflow */ +#define LE_CRC 0x0800 /* CRC error */ +#define LE_RBUFF 0x0400 /* buffer error */ + +/* Transmit ring status flags */ +#define LE_MORE 0x1000 /* more than 1 retry */ +#define LE_ONE 0x0800 /* one retry */ +#define LE_DEF 0x0400 /* deferred transmit */ + +/* Transmit errors */ +#define LE_TBUFF 0x8000 /* buffer error */ +#define LE_UFLO 0x4000 /* silo underflow */ +#define LE_LCOL 0x1000 /* late collision */ +#define LE_LCAR 0x0800 /* loss of carrier */ +#define LE_RTRY 0x0400 /* tried 16 times */ diff --git a/sys/arch/hp300/stand/include/itevar.h b/sys/arch/hp300/stand/include/itevar.h new file mode 100644 index 00000000000..7bf9c8abe52 --- /dev/null +++ b/sys/arch/hp300/stand/include/itevar.h @@ -0,0 +1,232 @@ +/* $OpenBSD: itevar.h,v 1.1 1997/07/14 08:14:35 downsj Exp $ */ +/* $NetBSD: itevar.h,v 1.1 1996/03/03 04:23:42 thorpej Exp $ */ + +/* + * Copyright (c) 1988 University of Utah. + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * the Systems Programming Group of the University of Utah Computer + * Science Department. + * + * 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. 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, Berkeley and its contributors. + * 4. 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. + * + * from: Utah $Hdr: itevar.h 1.15 92/12/20$ + * + * @(#)itevar.h 8.1 (Berkeley) 6/10/93 + */ + +/* + * Standalone version of hp300 ITE. + */ + +#define ITEUNIT(dev) minor(dev) + +#define getbyte(ip, offset) \ + ((*(ip)->isw->ite_readbyte)(ip, offset)) + +#define getword(ip, offset) \ + ((getbyte(ip, offset) << 8) | getbyte(ip, (offset) + 2)) + +#define writeglyph(ip, offset, fontbuf) \ + ((*(ip)->isw->ite_writeglyph)((ip), (offset), (fontbuf))) + +struct ite_data { + int flags; + struct tty *tty; + struct itesw *isw; + struct grf_data *grf; + caddr_t regbase, fbbase; + short curx, cury; + short cursorx, cursory; + short cblankx, cblanky; + short rows, cols; + short cpl; + short dheight, dwidth; + short fbheight, fbwidth; + short ftheight, ftwidth; + short fontx, fonty; + short attribute; + u_char *attrbuf; + short planemask; + short pos; + char imode, escape, fpd, hold; + caddr_t devdata; /* display dependent data */ +}; + +struct itesw { + int ite_hwid; + void (*ite_init) __P((struct ite_data *)); + void (*ite_deinit) __P((struct ite_data *)); + void (*ite_clear) __P((struct ite_data *, int, int, int, int)); + void (*ite_putc) __P((struct ite_data *, int, int, int, int)); + void (*ite_cursor) __P((struct ite_data *, int)); + void (*ite_scroll) __P((struct ite_data *, int, int, int, int)); + u_char (*ite_readbyte) __P((struct ite_data *, int)); + void (*ite_writeglyph) __P((struct ite_data *, u_char *, u_char *)); +}; + +/* Flags */ +#define ITE_ALIVE 0x01 /* hardware exists */ +#define ITE_INITED 0x02 /* device has been initialized */ +#define ITE_CONSOLE 0x04 /* device can be console */ +#define ITE_ISCONS 0x08 /* device is console */ +#define ITE_ACTIVE 0x10 /* device is being used as ITE */ +#define ITE_INGRF 0x20 /* device in use as non-ITE */ +#define ITE_CURSORON 0x40 /* cursor being tracked */ + +#define attrloc(ip, y, x) \ + (ip->attrbuf + ((y) * ip->cols) + (x)) + +#define attrclr(ip, sy, sx, h, w) \ + bzero(ip->attrbuf + ((sy) * ip->cols) + (sx), (h) * (w)) + +#define attrmov(ip, sy, sx, dy, dx, h, w) \ + bcopy(ip->attrbuf + ((sy) * ip->cols) + (sx), \ + ip->attrbuf + ((dy) * ip->cols) + (dx), \ + (h) * (w)) + +#define attrtest(ip, attr) \ + ((* (u_char *) attrloc(ip, ip->cury, ip->curx)) & attr) + +#define attrset(ip, attr) \ + ((* (u_char *) attrloc(ip, ip->cury, ip->curx)) = attr) + +/* + * X and Y location of character 'c' in the framebuffer, in pixels. + */ +#define charX(ip,c) \ + (((c) % (ip)->cpl) * (ip)->ftwidth + (ip)->fontx) + +#define charY(ip,c) \ + (((c) / (ip)->cpl) * (ip)->ftheight + (ip)->fonty) + +/* + * The cursor is just an inverted space. + */ +#define draw_cursor(ip) { \ + WINDOWMOVER(ip, ip->cblanky, ip->cblankx, \ + ip->cury * ip->ftheight, \ + ip->curx * ip->ftwidth, \ + ip->ftheight, ip->ftwidth, RR_XOR); \ + ip->cursorx = ip->curx; \ + ip->cursory = ip->cury; } + +#define erase_cursor(ip) \ + WINDOWMOVER(ip, ip->cblanky, ip->cblankx, \ + ip->cursory * ip->ftheight, \ + ip->cursorx * ip->ftwidth, \ + ip->ftheight, ip->ftwidth, RR_XOR); + +/* Character attributes */ +#define ATTR_NOR 0x0 /* normal */ +#define ATTR_INV 0x1 /* inverse */ +#define ATTR_UL 0x2 /* underline */ +#define ATTR_ALL (ATTR_INV | ATTR_UL) + +/* Keyboard attributes */ +#define ATTR_KPAD 0x4 /* keypad transmit */ + +/* Replacement Rules */ +#define RR_CLEAR 0x0 +#define RR_COPY 0x3 +#define RR_XOR 0x6 +#define RR_COPYINVERTED 0xc + +#define SCROLL_UP 0x01 +#define SCROLL_DOWN 0x02 +#define SCROLL_LEFT 0x03 +#define SCROLL_RIGHT 0x04 +#define DRAW_CURSOR 0x05 +#define ERASE_CURSOR 0x06 +#define MOVE_CURSOR 0x07 + +#define KBD_SSHIFT 4 /* bits to shift status */ +#define KBD_CHARMASK 0x7F + +/* keyboard status */ +#define KBD_SMASK 0xF /* service request status mask */ +#define KBD_CTRLSHIFT 0x8 /* key + CTRL + SHIFT */ +#define KBD_CTRL 0x9 /* key + CTRL */ +#define KBD_SHIFT 0xA /* key + SHIFT */ +#define KBD_KEY 0xB /* key only */ + +#define KBD_CAPSLOCK 0x18 + +#define KBD_EXT_LEFT_DOWN 0x12 +#define KBD_EXT_LEFT_UP 0x92 +#define KBD_EXT_RIGHT_DOWN 0x13 +#define KBD_EXT_RIGHT_UP 0x93 + +#define TABSIZE 8 +#define TABEND(ip) ((ip)->tty->t_winsize.ws_col - TABSIZE) + +extern struct ite_data ite_data[]; +extern struct itesw itesw[]; +extern int nitesw; + +/* + * Prototypes. + */ +u_char ite_readbyte __P((struct ite_data *, int)); +void ite_writeglyph __P((struct ite_data *, u_char *, u_char *)); + +/* + * Framebuffer-specific ITE prototypes. + */ +void topcat_init __P((struct ite_data *)); +void topcat_clear __P((struct ite_data *, int, int, int, int)); +void topcat_putc __P((struct ite_data *, int, int, int, int)); +void topcat_cursor __P((struct ite_data *, int)); +void topcat_scroll __P((struct ite_data *, int, int, int, int)); + +void gbox_init __P((struct ite_data *)); +void gbox_clear __P((struct ite_data *, int, int, int, int)); +void gbox_putc __P((struct ite_data *, int, int, int, int)); +void gbox_cursor __P((struct ite_data *, int)); +void gbox_scroll __P((struct ite_data *, int, int, int, int)); + +void rbox_init __P((struct ite_data *)); +void rbox_clear __P((struct ite_data *, int, int, int, int)); +void rbox_putc __P((struct ite_data *, int, int, int, int)); +void rbox_cursor __P((struct ite_data *, int)); +void rbox_scroll __P((struct ite_data *, int, int, int, int)); + +void dvbox_init __P((struct ite_data *)); +void dvbox_clear __P((struct ite_data *, int, int, int, int)); +void dvbox_putc __P((struct ite_data *, int, int, int, int)); +void dvbox_cursor __P((struct ite_data *, int)); +void dvbox_scroll __P((struct ite_data *, int, int, int, int)); + +void hyper_init __P((struct ite_data *)); +void hyper_clear __P((struct ite_data *, int, int, int, int)); +void hyper_putc __P((struct ite_data *, int, int, int, int)); +void hyper_cursor __P((struct ite_data *, int)); +void hyper_scroll __P((struct ite_data *, int, int, int, int)); diff --git a/sys/arch/hp300/stand/include/kbdvar.h b/sys/arch/hp300/stand/include/kbdvar.h new file mode 100644 index 00000000000..c4a3b8e845f --- /dev/null +++ b/sys/arch/hp300/stand/include/kbdvar.h @@ -0,0 +1,66 @@ +/* $OpenBSD: kbdvar.h,v 1.1 1997/07/14 08:14:36 downsj Exp $ */ +/* $NetBSD: kbdvar.h,v 1.1 1997/04/14 19:00:13 thorpej Exp $ */ + +/*- + * Copyright (c) 1997 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jason R. Thorpe. + * + * 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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. + */ + +/* + * Structure definitions and prototypes for the indirect keyboard driver + * for standalone ITE. + */ + +struct kbdsw { + int (*k_getc) __P((void)); /* get character */ + void (*k_nmi) __P((void)); /* handle non-maskable interrupt */ + int (*k_init) __P((void)); /* probe/initialize keyboard */ +}; + +#ifdef ITECONSOLE + +extern struct kbdsw kbdsw[]; + +#ifdef HIL_KEYBOARD +int hilkbd_getc __P((void)); +void hilkbd_nmi __P((void)); +int hilkbd_init __P((void)); +#endif + +#ifdef DOMAIN_KEYBOARD +int dnkbd_getc __P((void)); +void dnkbd_nmi __P((void)); +int dnkbd_init __P((void)); +#endif +#endif /* ITECONSOLE */ diff --git a/sys/arch/hp300/stand/include/rominfo.h b/sys/arch/hp300/stand/include/rominfo.h new file mode 100644 index 00000000000..21f1351ffa5 --- /dev/null +++ b/sys/arch/hp300/stand/include/rominfo.h @@ -0,0 +1,69 @@ +/* $OpenBSD: rominfo.h,v 1.1 1997/07/14 08:14:37 downsj Exp $ */ +/* $NetBSD: rominfo.h,v 1.5 1994/10/26 07:27:53 cgd Exp $ */ + +/* + * Copyright (c) 1988 University of Utah. + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * the Systems Programming Group of the University of Utah Computer + * Science Department. + * + * 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. 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, Berkeley and its contributors. + * 4. 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. + * + * from: Utah $Hdr: rominfo.h 1.2 88/05/24$ + * + * @(#)rominfo.h 8.1 (Berkeley) 6/10/93 + */ + +#define ROMADDR 0xFFFFF000 + +struct jmpvec { + short op; /* jmp instruction */ + long addr; /* address */ +}; + +struct rominfo { + char p1[0xDC0]; + short boottype; /* ?? (FFFFFDC0) */ + char name[10]; /* HP system name, e.g. SYSHPUX (FFFFFDC2) */ + short p2; /* ?? (FFFFFDCC) */ + long lowram; /* lowest useable RAM location (FFFFFDCE) */ + char p3[0x100]; /* ?? (FFFFFDD2) */ + char sysflag; /* HP system flags (FFFFFED2) */ + char p4; /* ?? (FFFFFED3) */ + long rambase; /* physaddr of lowest RAM (FFFFFED4) */ + char ndrives; /* number of drives (FFFFFED8) */ + char p5; /* ?? (FFFFFED9) */ + char sysflag2; /* more system flags (FFFFFEDA) */ + char p6; /* ?? (FFFFFEDB) */ + long msus; /* ?? (FFFFFEDC) */ + struct jmpvec jvec[48]; /* jump vectors (FFFFFEE0) */ +}; diff --git a/sys/arch/hp300/stand/include/samachdep.h b/sys/arch/hp300/stand/include/samachdep.h new file mode 100644 index 00000000000..19522c79d1c --- /dev/null +++ b/sys/arch/hp300/stand/include/samachdep.h @@ -0,0 +1,98 @@ +/* $OpenBSD: samachdep.h,v 1.1 1997/07/14 08:14:38 downsj Exp $ */ +/* $NetBSD: samachdep.h,v 1.3 1997/05/12 07:54:45 thorpej Exp $ */ + +/* + * Copyright (c) 1982, 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * 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. 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, Berkeley and its contributors. + * 4. 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. + * + * @(#)samachdep.h 8.1 (Berkeley) 6/10/93 + */ + +#include <sys/types.h> +#include <machine/hp300spu.h> + +#define NHPIB 4 +#define NSCSI 2 +#define NHD 8 +#define NCT 8 +#define NSD 8 + +#define NITE 4 + +/* from cpu.h */ +#define INTIOBASE (0x00400000) +#define IIOV(x) (x) +#define DIOBASE (0x600000) +#define DIOCSIZE (0x10000) +#define DIOIIBASE (0x01000000) +#define DIOIICSIZE (0x00400000) + +#define MHZ_8 1 +#define MHZ_16 2 +#define MHZ_25 3 +#define MHZ_33 4 +#define MHZ_50 6 + +extern int cpuspeed, machineid, mmuid; +extern int howto; +extern int cons_scode; +extern u_int opendev; +extern u_int bootdev; +extern char *getmachineid(); + +extern int userom; +extern void romputchar __P((int)); + +#define DELAY(n) { register int N = cpuspeed * (n); while (--N > 0); } + +/* bogon grfinfo structure to keep grf_softc happy */ +struct grfinfo { + int grf_foo; +}; + +/* + * Switch we use to set punit in devopen. + */ +struct punitsw { + int (*p_punit) __P((int, int, int *)); +}; +extern struct punitsw punitsw[]; +extern int npunit; + +extern struct devsw devsw_net[]; +extern int ndevs_net; + +extern struct devsw devsw_general[]; +extern int ndevs_general; + +extern struct fs_ops file_system_rawfs[]; +extern struct fs_ops file_system_ufs[]; +extern struct fs_ops file_system_nfs[]; diff --git a/sys/arch/hp300/stand/include/scsivar.h b/sys/arch/hp300/stand/include/scsivar.h new file mode 100644 index 00000000000..bd479cc298c --- /dev/null +++ b/sys/arch/hp300/stand/include/scsivar.h @@ -0,0 +1,52 @@ +/* $OpenBSD: scsivar.h,v 1.1 1997/07/14 08:14:39 downsj Exp $ */ +/* $NetBSD: scsivar.h,v 1.4 1994/10/26 07:27:58 cgd Exp $ */ + +/* + * Copyright (c) 1982, 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Van Jacobson of Lawrence Berkeley Laboratory and the Systems + * Programming Group of the University of Utah Computer Science Department. + * + * 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. 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, Berkeley and its contributors. + * 4. 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. + * + * @(#)scsivar.h 8.1 (Berkeley) 6/10/93 + */ + +struct scsi_softc { + int sc_ba; + char *sc_addr; + char sc_alive; + char sc_scsi_addr; + char sc_stat; + char sc_msg[7]; +}; + +extern struct scsi_softc scsi_softc[]; diff --git a/sys/arch/hp300/stand/include/volhdr.h b/sys/arch/hp300/stand/include/volhdr.h new file mode 100644 index 00000000000..3f55ae44d0c --- /dev/null +++ b/sys/arch/hp300/stand/include/volhdr.h @@ -0,0 +1,82 @@ +/* $OpenBSD: volhdr.h,v 1.1 1997/07/14 08:14:40 downsj Exp $ */ +/* $NetBSD: volhdr.h,v 1.4 1994/10/26 07:28:08 cgd Exp $ */ + +/* + * Copyright (c) 1988 University of Utah. + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * the Systems Programming Group of the University of Utah Computer + * Science Department. + * + * 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. 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, Berkeley and its contributors. + * 4. 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. + * + * @(#)volhdr.h 8.1 (Berkeley) 6/10/93 + */ + +/* + * vohldr.h: volume header for "LIF" format volumes + */ + +struct lifvol { + short vol_id; + char vol_label[6]; + int vol_addr; + short vol_oct; + short vol_dummy; + int vol_dirsize; + short vol_version; + short vol_zero; + int vol_huh1; + int vol_huh2; + int vol_length; +}; + +struct lifdir { + char dir_name[10]; + short dir_type; + int dir_addr; + int dir_length; + char dir_toc[6]; + short dir_flag; + int dir_exec; +}; + +/* load header for boot rom */ +struct load { + int address; + int count; +}; + +#define VOL_ID -32768 +#define VOL_OCT 4096 +#define DIR_TYPE -5822 +#define DIR_FLAG 0x8001 /* dont ask me! */ +#define SECTSIZE 256 |