diff options
author | svn2git <svn2git@FreeBSD.org> | 1994-07-01 00:00:00 -0800 |
---|---|---|
committer | svn2git <svn2git@FreeBSD.org> | 1994-07-01 00:00:00 -0800 |
commit | 5e0e9b99dc3fc0ecd49d929db0d57c784b66f481 (patch) | |
tree | e779b5a6edddbb949b7990751b12d6f25304ba86 /sys/i386/include | |
parent | a16f65c7d117419bd266c28a1901ef129a337569 (diff) | |
download | src-releng/1.tar.gz src-releng/1.zip |
Release FreeBSD 1.1.5.1release/1.1.5.1_cvsreleng/1
This commit was manufactured to restore the state of the 1.1.5.1-RELEASE image.
Releases prior to 5.3-RELEASE are omitting the secure/ and crypto/ subdirs.
Diffstat (limited to 'sys/i386/include')
-rw-r--r-- | sys/i386/include/ansi.h | 21 | ||||
-rw-r--r-- | sys/i386/include/asmacros.h | 6 | ||||
-rw-r--r-- | sys/i386/include/console.h | 31 | ||||
-rw-r--r-- | sys/i386/include/cpu.h | 13 | ||||
-rw-r--r-- | sys/i386/include/cpufunc.h | 13 | ||||
-rw-r--r-- | sys/i386/include/ioctl_fd.h | 31 | ||||
-rw-r--r-- | sys/i386/include/limits.h | 6 | ||||
-rw-r--r-- | sys/i386/include/lpt.h | 24 | ||||
-rw-r--r-- | sys/i386/include/mouse.h | 44 | ||||
-rw-r--r-- | sys/i386/include/npx.h | 10 | ||||
-rw-r--r-- | sys/i386/include/param.h | 6 | ||||
-rw-r--r-- | sys/i386/include/pcaudioio.h | 75 | ||||
-rw-r--r-- | sys/i386/include/pmap.h | 55 | ||||
-rw-r--r-- | sys/i386/include/psl.h | 6 | ||||
-rw-r--r-- | sys/i386/include/pte.h | 4 | ||||
-rw-r--r-- | sys/i386/include/soundcard.h | 50 | ||||
-rw-r--r-- | sys/i386/include/spl.h | 104 | ||||
-rw-r--r-- | sys/i386/include/ultrasound.h | 9 | ||||
-rw-r--r-- | sys/i386/include/vmparam.h | 2 |
19 files changed, 429 insertions, 81 deletions
diff --git a/sys/i386/include/ansi.h b/sys/i386/include/ansi.h index 3a54968b1595..c932ba7a598b 100644 --- a/sys/i386/include/ansi.h +++ b/sys/i386/include/ansi.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)ansi.h 7.1 (Berkeley) 3/9/91 - * $Id: ansi.h,v 1.2 1993/10/16 14:39:05 rgrimes Exp $ + * $Id: ansi.h,v 1.3 1994/04/04 21:11:11 wollman Exp $ */ #ifndef _ANSI_H_ @@ -53,6 +53,23 @@ #define _SIZE_T_ unsigned int /* sizeof() */ #define _TIME_T_ long /* time() */ #define _VA_LIST_ char * /* va_list */ -#define _WCHAR_T_ unsigned short /* wchar_t */ + +/* + * Runes (wchar_t) is declared to be an ``int'' instead of the more natural + * ``unsigned long'' or ``long''. Two things are happening here. It is not + * unsigned so that EOF (-1) can be naturally assigned to it and used. Also, + * it looks like 10646 will be a 31 bit standard. This means that if your + * ints cannot hold 32 bits, you will be in trouble. The reason an int was + * chosen over a long is that the is*() and to*() routines take ints (says + * ANSI C), but they use _RUNE_T_ instead of int. By changing it here, you + * lose a bit of ANSI conformance, but your programs will still work. + * + * Note that _WCHAR_T_ and _RUNE_T_ must be of the same type. When wchar_t + * and rune_t are typedef'd, _WCHAR_T_ will be undef'd, but _RUNE_T remains + * defined for ctype.h. + */ +#define _BSD_WCHAR_T_ int /* wchar_t */ +#define _BSD_RUNE_T_ int /* rune_t */ + #endif /* _ANSI_H_ */ diff --git a/sys/i386/include/asmacros.h b/sys/i386/include/asmacros.h index f0f2c014178c..4af0b97a8abf 100644 --- a/sys/i386/include/asmacros.h +++ b/sys/i386/include/asmacros.h @@ -5,6 +5,11 @@ #define GEN_ENTRY(name) ALIGN_TEXT; .globl name; name: #define NON_GPROF_ENTRY(name) GEN_ENTRY(_/**/name) +/* These three are place holders for future changes to the profiling code */ +#define MCOUNT_LABEL(name) +#define MEXITCOUNT +#define FAKE_MCOUNT(caller) + #ifdef GPROF /* * ALTENTRY() must be before a corresponding ENTRY() so that it can jump @@ -30,6 +35,7 @@ */ #define ALTENTRY(name) GEN_ENTRY(_/**/name) #define ENTRY(name) GEN_ENTRY(_/**/name) +#define MCOUNT #endif diff --git a/sys/i386/include/console.h b/sys/i386/include/console.h index 011889032ecc..c52a3943c764 100644 --- a/sys/i386/include/console.h +++ b/sys/i386/include/console.h @@ -14,7 +14,7 @@ * DK9210 Aalborg SO Phone: +45 9814 8076 * * from:@(#)console.h 1.1 940105 - * $Id: console.h,v 1.7 1994/02/04 10:35:29 chmr Exp $ + * $Id: console.h,v 1.9 1994/05/20 12:21:49 sos Exp $ */ #ifndef _CONSOLE_H_ @@ -55,7 +55,7 @@ #define GIO_FONT8x14 _IOR('c', 67, fnt14_t) #define PIO_FONT8x16 _IOW('c', 68, fnt16_t) #define GIO_FONT8x16 _IOR('c', 69, fnt16_t) -#define CONS_GETINFO _IOR('c', 73, vid_info_t) +#define CONS_GETINFO _IOWR('c', 73, vid_info_t) #define CONS_GETVERS _IOR('c', 74, long) #define CONS_80x25TEXT _IO('c', 102) #define CONS_80x50TEXT _IO('c', 103) @@ -124,16 +124,19 @@ struct vt_mode { #define NUM_STATES 8 /* states per key */ #define ALTGR_OFFSET 128 /* offset for altlock keys */ +struct key_t { + u_char map[NUM_STATES]; + u_char spcl; + u_char flgs; +}; + struct keymap { u_short n_keys; - struct key_t { - u_char map[NUM_STATES]; - u_char spcl; - u_char flgs; - } key[NUM_KEYS]; + struct key_t key[NUM_KEYS]; }; #define MAXFK 16 +#define NUM_FKEYS 60 struct fkeytab { u_char str[MAXFK]; @@ -190,6 +193,7 @@ typedef struct ssaver ssaver_t; #define NLK 0x05 /* num lock key */ #define SLK 0x06 /* scroll lock key */ #define LALT 0x07 /* left alt key */ +#define BTAB 0x08 /* backwards tab */ #define LCTR 0x09 /* left control key */ #define NEXT 0x0a /* switch to next screen */ #define F_SCR 0x0b /* switch to first screen */ @@ -214,11 +218,14 @@ typedef struct ssaver ssaver_t; #define KB_STAT 0x64 /* kbd status port */ #define KB_BUF_FULL 0x01 /* kbd has char pending */ #define KB_READY 0x02 /* kbd ready for command */ +#define KB_MODE 0x4D /* kbd mode (trans, ints enable)*/ #define KB_WRITE 0x60 /* kbd write command */ -#define KB_SETLEDS 0xed /* kbd set leds */ -#define KB_SETRAD 0xf3 /* kbd set repeat&delay command */ -#define KB_ACK 0xfa /* kbd acknowledge answer */ -#define KB_RESET_CPU 0xfe /* kbd reset main cpu command */ -#define KB_RESET 0xff /* kbd reset */ +#define KB_RESET_DONE 0xAA /* kbd reset command completed */ +#define KB_SETLEDS 0xED /* kbd set leds */ +#define KB_ECHO 0xEE /* kbd set leds */ +#define KB_SETRAD 0xF3 /* kbd set repeat&delay command */ +#define KB_ACK 0xFA /* kbd acknowledge answer */ +#define KB_RESEND 0xFE /* kbd resend cmd answer */ +#define KB_RESET 0xFF /* kbd reset */ #endif diff --git a/sys/i386/include/cpu.h b/sys/i386/include/cpu.h index 184f5b86151d..82ab4c3734dc 100644 --- a/sys/i386/include/cpu.h +++ b/sys/i386/include/cpu.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)cpu.h 5.4 (Berkeley) 5/9/91 - * $Id: cpu.h,v 1.4 1993/11/07 17:42:46 wollman Exp $ + * $Id: cpu.h,v 1.5 1994/04/02 07:00:35 davidg Exp $ */ #ifndef _MACHINE_CPU_H_ @@ -58,18 +58,21 @@ * Arguments to hardclock, softclock and gatherstats * encapsulate the previous machine state in an opaque * clockframe; for now, use generic intrframe. + * XXX softclock() has been fixed. It never needed a + * whole frame, only a usermode flag, at least on this + * machine. Fix the rest. */ typedef struct intrframe clockframe; #define CLKF_USERMODE(framep) (ISPL((framep)->if_cs) == SEL_UPL) -#define CLKF_BASEPRI(framep) ((framep)->if_ppl == 0) +#define CLKF_BASEPRI(framep) (((framep)->if_ppl & ~SWI_AST_MASK) == 0) #define CLKF_PC(framep) ((framep)->if_eip) /* * Preempt the current process if in interrupt from user mode, * or after the current trap/syscall if in system mode. */ -#define need_resched() { want_resched++; aston(); } +#define need_resched() { want_resched = 1; aston(); } /* * Give a profiling tick to the current process from the softclock @@ -84,7 +87,8 @@ typedef struct intrframe clockframe; */ #define signotify(p) aston() -#define aston() (astpending++) +#define aston() setsoftast() +#define astoff() /* * pull in #defines for kinds of processors @@ -97,7 +101,6 @@ struct cpu_nameclass { }; #ifdef KERNEL -extern int astpending; /* want a trap before returning to user mode */ extern int want_resched; /* resched was called */ extern int cpu; diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h index 65cc855793f0..16bb63b86a17 100644 --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/include/cpufunc.h @@ -2,7 +2,7 @@ * Functions to provide access to special i386 instructions. * XXX - bezillions more are defined in locore.s but are not declared anywhere. * - * $Id: cpufunc.h,v 1.9 1994/01/31 23:48:23 davidg Exp $ + * $Id: cpufunc.h,v 1.11 1994/06/01 03:09:51 davidg Exp $ */ #ifndef _MACHINE_CPUFUNC_H_ @@ -11,6 +11,8 @@ #include <sys/cdefs.h> #include <sys/types.h> +#include "machine/spl.h" + #ifdef __GNUC__ static inline int bdb(void) @@ -69,6 +71,14 @@ tlbflush() __asm __volatile("movl %%cr3, %%eax; movl %%eax, %%cr3" : : : "ax"); } +static inline u_long +rcr2() +{ + u_long data; + __asm __volatile("movl %%cr2,%%eax" : "=a" (data)); + return data; +} + static inline int imin(a, b) @@ -224,7 +234,6 @@ void load_cr0 __P((u_int cr0)); u_int rcr0 __P((void)); void load_cr3(u_long); u_long rcr3(void); -u_long rcr2(void); void setidt __P((int, void (*)(), int, int)); extern u_long kvtop(void *); diff --git a/sys/i386/include/ioctl_fd.h b/sys/i386/include/ioctl_fd.h index 2e3ac3104726..a8c17f69ac4a 100644 --- a/sys/i386/include/ioctl_fd.h +++ b/sys/i386/include/ioctl_fd.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1992-1993 by Joerg Wunsch, Dresden + * Copyright (C) 1992-1994 by Joerg Wunsch, Dresden * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -11,17 +11,18 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``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 AUTHOR(S) 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 _IOCTL_FD_H @@ -94,5 +95,11 @@ struct fd_type { #define FD_FORM _IOW('F', 61, struct fd_formb) /* format a track */ #define FD_GTYPE _IOR('F', 62, struct fd_type) /* get drive type */ +#define FD_STYPE _IOW('F', 63, struct fd_type) /* set drive type */ + +#define FD_GOPTS _IOR('F', 64, int) /* drive options, see below */ +#define FD_SOPTS _IOW('F', 65, int) + +#define FDOPT_NORETRY 0x0001 /* no retries on failure (cleared on close) */ #endif /* !def _IOCTL_FD_H */ diff --git a/sys/i386/include/limits.h b/sys/i386/include/limits.h index 568ad40848a3..586d6e2f5a69 100644 --- a/sys/i386/include/limits.h +++ b/sys/i386/include/limits.h @@ -31,15 +31,14 @@ * SUCH DAMAGE. * * from: @(#)limits.h 7.2 (Berkeley) 6/28/90 - * $Id: limits.h,v 1.4 1993/12/19 05:14:46 alm Exp $ + * $Id: limits.h,v 1.6 1994/04/04 21:11:12 wollman Exp $ */ #ifndef _MACHINE_LIMITS_H_ #define _MACHINE_LIMITS_H_ 1 #define CHAR_BIT 8 /* number of bits in a char */ -#define CLK_TCK 60 /* ticks per second */ -#define MB_LEN_MAX 1 /* no multibyte characters */ +#define MB_LEN_MAX 6 /* allow 21-bit UTF2 */ #define SCHAR_MIN (-0x7f-1) /* max value for a signed char */ #define SCHAR_MAX 0x7f /* min value for a signed char */ @@ -61,6 +60,7 @@ #define LONG_MIN (-0x7fffffff-1) /* min value for a long */ #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) +#define CLK_TCK 128 /* ticks per second */ #define UQUAD_MAX 0xffffffffffffffffLL /* max unsigned quad */ #define QUAD_MAX 0x7fffffffffffffffLL /* max signed quad */ #define QUAD_MIN (-0x7fffffffffffffffLL-1) /* min signed quad */ diff --git a/sys/i386/include/lpt.h b/sys/i386/include/lpt.h new file mode 100644 index 000000000000..87af5bcc5875 --- /dev/null +++ b/sys/i386/include/lpt.h @@ -0,0 +1,24 @@ +/* + * Copyright (C) 1994 Geoffrey M. Rehmet + * + * This program is free software; you may redistribute it and/or + * modify it, provided that it retain the above copyright notice + * and the following disclaimer. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Geoff Rehmet, Rhodes University, South Africa <csgr@cs.ru.ac.za> + * + */ + +#ifndef _LPT_PRINTER_H_ +#define _LPT_PRINTER_H_ + +#include <sys/types.h> +#include <sys/ioctl.h> + +#define LPT_IRQ _IOW('p', 1, long) /* set interrupt status */ + +#endif diff --git a/sys/i386/include/mouse.h b/sys/i386/include/mouse.h new file mode 100644 index 000000000000..95a66e474c6d --- /dev/null +++ b/sys/i386/include/mouse.h @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 1992, 1993 Erik Forsberg. + * 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. + * + * THIS SOFTWARE IS PROVIDED BY ``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 I 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. + * + * $Id: mouse.h,v 1.1 1994/05/17 14:05:31 jkh Exp $ + */ + +struct mouseinfo { + unsigned char status; + char xmotion, ymotion; +}; + +#define BUTSTATMASK 0x07 /* Any mouse button down if any bit set */ +#define BUTCHNGMASK 0x38 /* Any mouse button changed if any bit set */ + +#define BUT3STAT 0x01 /* Button 3 down if set */ +#define BUT2STAT 0x02 /* Button 2 down if set */ +#define BUT1STAT 0x04 /* Button 1 down if set */ +#define BUT3CHNG 0x08 /* Button 3 changed if set */ +#define BUT2CHNG 0x10 /* Button 2 changed if set */ +#define BUT1CHNG 0x20 /* Button 1 changed if set */ +#define MOVEMENT 0x40 /* Mouse movement detected */ + +/* Ioctl definitions */ + +#define MOUSEIOC ('M'<<8) +#define MOUSEIOCREAD (MOUSEIOC|60) diff --git a/sys/i386/include/npx.h b/sys/i386/include/npx.h index ec29bf4fa024..168ef19fadd2 100644 --- a/sys/i386/include/npx.h +++ b/sys/i386/include/npx.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)npx.h 5.3 (Berkeley) 1/18/91 - * $Id: npx.h,v 1.2 1993/10/16 14:39:22 rgrimes Exp $ + * $Id: npx.h,v 1.3 1994/04/29 21:44:23 gclarkii Exp $ */ /* @@ -73,11 +73,13 @@ struct fpacc87 { struct save87 { struct env87 sv_env; /* floating point control/status */ struct fpacc87 sv_ac[8]; /* accumulator contents, 0-7 */ -#ifndef dontdef u_long sv_ex_sw; /* status word for last exception (was pad) */ u_long sv_ex_tw; /* tag word for last exception (was pad) */ - u_char sv_pad[8 * 2 - 2 * 4]; /* bogus historical padding */ -#endif +#ifdef GPL_MATH_EMULATE + u_char sv_pad[60]; +#else + u_char sv_pad[8 * 2 - 2 * 4]; /* bogus historical padding */ +#endif /* GPL_MATH_EMULATE */ }; /* Cyrix EMC memory - mapped coprocessor context switch information */ diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h index fe97ad809b25..953ebb9d36c4 100644 --- a/sys/i386/include/param.h +++ b/sys/i386/include/param.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)param.h 5.8 (Berkeley) 6/28/91 - * $Id: param.h,v 1.13 1994/01/31 04:18:54 davidg Exp $ + * $Id: param.h,v 1.14 1994/03/07 11:38:47 davidg Exp $ */ #ifndef _MACHINE_PARAM_H_ @@ -62,7 +62,7 @@ #define PAGE_SIZE (1 << PAGE_SHIFT) #define PAGE_MASK (PAGE_SIZE-1) #define PGOFSET (NBPG-1) /* byte offset into page */ -#define NPTEPG (NBPG/(sizeof (struct pte))) +#define NPTEPG (NBPG/(sizeof (pt_entry_t))) /* XXX PDRSHIFT and PD_SHIFT are two names for the same thing */ #define PDRSHIFT 22 /* LOG2(NBPDR) */ @@ -103,7 +103,7 @@ #endif /* MSIZE */ #ifndef MCLSHIFT -#define MCLSHIFT 11 /* convert bytes to m_buf clusters */ +#define MCLSHIFT 12 /* convert bytes to m_buf clusters */ #endif /* MCLSHIFT */ #define MCLBYTES (1 << MCLSHIFT) /* size of an m_buf cluster */ #define MCLOFSET (MCLBYTES - 1) /* offset within an m_buf cluster */ diff --git a/sys/i386/include/pcaudioio.h b/sys/i386/include/pcaudioio.h new file mode 100644 index 000000000000..71c7ebb4c226 --- /dev/null +++ b/sys/i386/include/pcaudioio.h @@ -0,0 +1,75 @@ +/*- + * Copyright (c) 1994 Søren Schmidt + * 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. The name of the author may not be used to endorse or promote products + * derived from this software withough specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + * + * $Id: pcaudioio.h,v 1.2 1994/05/20 12:22:40 sos Exp $ + */ + +#ifndef _PCAUDIOIO_H_ +#define _PCAUDIOIO_H_ + +typedef struct audio_prinfo { + unsigned sample_rate; /* samples per second */ + unsigned channels; /* # of channels (interleaved) */ + unsigned precision; /* sample size in bits */ + unsigned encoding; /* encoding method used */ + + unsigned gain; /* volume level: 0 - 255 */ + unsigned port; /* input/output device */ + unsigned _fill1[4]; + + unsigned samples; /* samples played */ + unsigned eof; /* ?!? */ + unsigned char pause; /* !=0 pause, ==0 continue */ + unsigned char error; /* !=0 if overflow/underflow */ + unsigned char waiting; /* !=0 if others wants access */ + unsigned char _fill2[3]; + + unsigned char open; /* is device open */ + unsigned char active; /* !=0 if sound hardware is active */ +} audio_prinfo_t; + +typedef struct audio_info { + audio_prinfo_t play; + audio_prinfo_t record; + unsigned monitor_gain; + unsigned _fill[4]; +} audio_info_t; + +#define AUDIO_ENCODING_ULAW (1) /* u-law encoding */ +#define AUDIO_ENCODING_ALAW (2) /* A-law encoding */ +#define AUDIO_ENCODING_RAW (3) /* linear encoding */ + +#define AUDIO_MIN_GAIN (0) /* minimum volume value */ +#define AUDIO_MAX_GAIN (255) /* maximum volume value */ + +#define AUDIO_INITINFO(i) memset((void*)i, 0xff, sizeof(audio_info_t)) + +#define AUDIO_GETINFO _IOR('A', 1, audio_info_t) +#define AUDIO_SETINFO _IOWR('A', 2, audio_info_t) +#define AUDIO_DRAIN _IO('A', 3) +#define AUDIO_FLUSH _IO('A', 4) + +#endif /*!_PCAUDIOIO_H*/ diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h index ba27f793735d..507baf94b356 100644 --- a/sys/i386/include/pmap.h +++ b/sys/i386/include/pmap.h @@ -42,7 +42,7 @@ * * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 - * $Id: pmap.h,v 1.10 1994/01/31 04:19:00 davidg Exp $ + * $Id: pmap.h,v 1.16 1994/06/07 17:48:46 davidg Exp $ */ #ifndef _PMAP_MACHINE_ @@ -58,7 +58,8 @@ struct pde unsigned int pd_v:1, /* valid bit */ pd_prot:2, /* access control */ - pd_mbz1:2, /* reserved, must be zero */ + pd_ncpwt:1, /* page cache write through */ + pd_ncpcd:1, /* page cache disable */ pd_u:1, /* hardware maintained 'used' bit */ :1, /* not used */ pd_mbz2:2, /* reserved, must be zero */ @@ -76,7 +77,8 @@ struct pte unsigned int pg_v:1, /* valid bit */ pg_prot:2, /* access control */ - pg_mbz1:2, /* reserved, must be zero */ + pg_ncpwt:1, /* page cache write through */ + pg_ncpcd:1, /* page cache disable */ pg_u:1, /* hardware maintained 'used' bit */ pg_m:1, /* hardware maintained modified bit */ pg_mbz2:2, /* reserved, must be zero */ @@ -91,10 +93,12 @@ unsigned int #define PG_RW 0x00000002 #define PG_u 0x00000004 #define PG_PROT 0x00000006 /* all protection bits . */ -#define PG_W 0x00000200 -#define PG_N 0x00000800 /* Non-cacheable */ -#define PG_M 0x00000040 +#define PG_NC_PWT 0x00000008 /* page cache write through */ +#define PG_NC_PCD 0x00000010 /* page cache disable */ +#define PG_N 0x00000018 /* Non-cacheable */ #define PG_U 0x00000020 +#define PG_M 0x00000040 +#define PG_W 0x00000200 #define PG_FRAME 0xfffff000UL #define PG_NOACC 0 @@ -115,8 +119,10 @@ unsigned int #define PGEX_W 0x02 /* during a Write cycle */ #define PGEX_U 0x04 /* access from User mode (UPL) */ -typedef struct pde pd_entry_t; /* page directory entry */ -typedef struct pte pt_entry_t; /* Mach page table entry */ +/* typedef struct pde pd_entry_t; */ /* page directory entry */ +/* typedef struct pte pt_entry_t; */ /* Mach page table entry */ +typedef unsigned int *pd_entry_t; +typedef unsigned int *pt_entry_t; /* * NKPDE controls the virtual space of the kernel, what ever is left, minus @@ -145,18 +151,18 @@ typedef struct pte pt_entry_t; /* Mach page table entry */ #define KPTDI (APTDPTDI-NKPDE)/* start of kernel virtual pde's */ #define PTDPTDI (KPTDI-1) /* ptd entry that points to ptd! */ #define KSTKPTDI (PTDPTDI-1) /* ptd entry for u./kernel&user stack */ -#define KSTKPTEOFF (NBPG/sizeof(struct pde)-UPAGES) /* pte entry for kernel stack */ +#define KSTKPTEOFF (NBPG/sizeof(pd_entry_t)-UPAGES) /* pte entry for kernel stack */ -#define PDESIZE sizeof(struct pde) /* for assembly files */ -#define PTESIZE sizeof(struct pte) /* for assembly files */ +#define PDESIZE sizeof(pd_entry_t) /* for assembly files */ +#define PTESIZE sizeof(pt_entry_t) /* for assembly files */ /* * Address of current and alternate address space page table maps * and directories. */ #ifdef KERNEL -extern struct pte PTmap[], APTmap[], Upte; -extern struct pde PTD[], APTD[], PTDpde, APTDpde, Upde; +extern pt_entry_t PTmap[], APTmap[], Upte; +extern pd_entry_t PTD[], APTD[], PTDpde, APTDpde, Upde; extern pt_entry_t *Sysmap; extern int IdlePTD; /* physical address of "Idle" state directory */ @@ -171,12 +177,29 @@ extern int IdlePTD; /* physical address of "Idle" state directory */ #define vtopte(va) (PTmap + i386_btop(va)) #define kvtopte(va) vtopte(va) #define ptetov(pt) (i386_ptob(pt - PTmap)) -#define vtophys(va) (i386_ptob(vtopte(va)->pg_pfnum) | ((int)(va) & PGOFSET)) +#define vtophys(va) (((int) (*vtopte(va))&PG_FRAME) | ((int)(va) & PGOFSET)) #define ispt(va) ((va) >= UPT_MIN_ADDRESS && (va) <= KPT_MAX_ADDRESS) #define avtopte(va) (APTmap + i386_btop(va)) #define ptetoav(pt) (i386_ptob(pt - APTmap)) -#define avtophys(va) (i386_ptob(avtopte(va)->pg_pfnum) | ((int)(va) & PGOFSET)) +#define avtophys(va) (((int) (*avtopte(va))&PG_FRAME) | ((int)(va) & PGOFSET)) + +#ifdef KERNEL +/* + * Routine: pmap_kextract + * Function: + * Extract the physical page address associated + * kernel virtual address. + */ +static inline vm_offset_t +pmap_kextract(va) + vm_offset_t va; +{ + vm_offset_t pa = *(int *)vtopte(va); + pa = (pa & PG_FRAME) | (va & ~PG_FRAME); + return pa; +} +#endif /* * macros to generate page directory/table indicies @@ -252,7 +275,7 @@ extern void pmap_remove(struct pmap *, vm_offset_t, vm_offset_t); extern void pmap_protect(struct pmap *, vm_offset_t, vm_offset_t, vm_prot_t); extern void pmap_enter(pmap_t, vm_offset_t, vm_offset_t, vm_prot_t, boolean_t); extern void pmap_change_wiring(pmap_t, vm_offset_t, boolean_t); -extern inline struct pte *pmap_pte(pmap_t, vm_offset_t); +extern inline pt_entry_t * const pmap_pte(pmap_t, vm_offset_t); extern vm_offset_t pmap_extract(pmap_t, vm_offset_t); extern void pmap_copy(pmap_t, pmap_t, vm_offset_t, vm_size_t, vm_offset_t); extern void pmap_collect(pmap_t); diff --git a/sys/i386/include/psl.h b/sys/i386/include/psl.h index eb15d181b464..c877648ee796 100644 --- a/sys/i386/include/psl.h +++ b/sys/i386/include/psl.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)psl.h 5.2 (Berkeley) 1/18/91 - * $Id: psl.h,v 1.3.2.1 1994/03/07 01:23:56 rgrimes Exp $ + * $Id: psl.h,v 1.5 1994/06/07 23:53:52 phk Exp $ */ #ifndef _MACHINE_PSL_H_ @@ -56,6 +56,10 @@ #define PSL_NT 0x00004000 /* nested task bit */ #define PSL_RF 0x00010000 /* restart flag bit */ #define PSL_VM 0x00020000 /* virtual 8086 mode bit */ +#define PSL_AC 0x00040000 /* alignment checking */ +#define PSL_VIF 0x00080000 /* virtual interrupt enable */ +#define PSL_VIP 0x00100000 /* virtual interrupt pending */ +#define PSL_ID 0x00200000 /* identification bit */ #define PSL_MBZ 0xffc08028 /* must be zero bits */ #define PSL_MBO 0x00000002 /* must be one bits */ diff --git a/sys/i386/include/pte.h b/sys/i386/include/pte.h index ac0cb541de95..4b1f71091e2b 100644 --- a/sys/i386/include/pte.h +++ b/sys/i386/include/pte.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)pte.h 5.5 (Berkeley) 5/9/91 - * $Id: pte.h,v 1.4 1994/01/31 06:52:41 davidg Exp $ + * $Id: pte.h,v 1.5 1994/03/07 11:38:49 davidg Exp $ */ #ifndef _MACHINE_PTE_H_ @@ -114,7 +114,7 @@ unsigned int /* * Pte related macros */ -#define dirty(pte) ((pte)->pg_m) +#define dirty(pte) ((pte) & PG_M) #ifndef LOCORE #ifdef KERNEL diff --git a/sys/i386/include/soundcard.h b/sys/i386/include/soundcard.h index 23f20313d98a..ce28a144242d 100644 --- a/sys/i386/include/soundcard.h +++ b/sys/i386/include/soundcard.h @@ -1,5 +1,5 @@ #ifndef _SOUNDCARD_H_ -#define _SOUNDCARD_H_ 1 +#define _SOUNDCARD_H_ /* * Copyright by Hannu Savolainen 1993 * @@ -30,14 +30,15 @@ /* * If you make modifications to this file, please contact me before * distributing the modified version. There is already enough - * diversity in the world. + * divercity in the world. * * Regards, * Hannu Savolainen - * hsavolai@cs.helsinki.fi + * hannu@voxware.pp.fi, Hannu.Savolainen@helsinki.fi */ -#define SOUND_VERSION 200 +#define SOUND_VERSION 205 +#define VOXWARE #include <sys/ioctl.h> @@ -50,6 +51,8 @@ #define SNDCARD_PAS 3 #define SNDCARD_GUS 4 #define SNDCARD_MPU401 5 +#define SNDCARD_SB16 6 +#define SNDCARD_SB16MIDI 7 /*********************************** * IOCTL Commands for /dev/sequencer @@ -66,9 +69,9 @@ */ /* #define IOCTYPE (0xff<<8) */ #define IOCPARM_MASK 0x7f /* parameters must be < 128 bytes */ -#define IOC_VOID 0x20000000 /* no parameters */ -#define IOC_OUT 0x40000000 /* copy out parameters */ -#define IOC_IN 0x80000000 /* copy in parameters */ +#define IOC_VOID 0x00000000 /* no parameters */ +#define IOC_OUT 0x20000000 /* copy out parameters */ +#define IOC_IN 0x40000000 /* copy in parameters */ #define IOC_INOUT (IOC_IN|IOC_OUT) /* the 0x20000000 is so we can distinguish new ioctl's from old */ #define _IO(x,y) ((int)(IOC_VOID|(x<<8)|y)) @@ -180,7 +183,7 @@ struct patch_info { int volume; int spare[4]; - char data[0]; /* The waveform data starts here */ + char data[1]; /* The waveform data starts here */ }; @@ -307,6 +310,14 @@ struct patmgr_info { /* Note! size must be < 4k since kmalloc() is used */ #define CTRL_EXPRESSION 253 #define CTRL_MAIN_VOLUME 252 #define SEQ_BALANCE 11 +#define SEQ_VOLMODE 12 + +/* + * Volume mode decides how volumes are used + */ + +#define VOL_METHOD_ADAGIO 1 +#define VOL_METHOD_LINEAR 2 /* * Note! SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO are used also as @@ -402,7 +413,8 @@ struct midi_info { char name[30]; int device; /* 0-N. INITIALIZE BEFORE CALLING */ unsigned long capabilities; /* To be defined later */ - int dummies[19]; /* Reserve space */ + int dev_type; + int dummies[18]; /* Reserve space */ }; /******************************************** @@ -418,6 +430,7 @@ struct midi_info { #define SOUND_PCM_WRITE_CHANNELS _IOWR('P', 6, int) #define SOUND_PCM_WRITE_FILTER _IOWR('P', 7, int) #define SNDCTL_DSP_POST _IO ('P', 8) +#define SNDCTL_DSP_SUBDIVIDE _IOWR('P', 9, int) #define SOUND_PCM_READ_RATE _IOR ('P', 2, int) #define SOUND_PCM_READ_CHANNELS _IOR ('P', 6, int) @@ -430,6 +443,7 @@ struct midi_info { #define SOUND_PCM_POST SNDCTL_DSP_POST #define SOUND_PCM_RESET SNDCTL_DSP_RESET #define SOUND_PCM_SYNC SNDCTL_DSP_SYNC +#define SOUND_PCM_SUBDIVIDE SNDCTL_DSP_SUBDIVIDE /********************************************* * IOCTL commands for /dev/mixer @@ -624,7 +638,8 @@ void seqbuf_dump(void); /* This function must be provided by programs */ * } */ -#define SEQ_DEFINEBUF(len) unsigned char _seqbuf[len]; int _seqbuflen = len, _seqbufptr = 0 +#define SEQ_DEFINEBUF(len) unsigned char _seqbuf[len]; int _seqbuflen = len; int _seqbufptr = 0 +#define SEQ_DECLAREBUF() extern unsigned char _seqbuf[]; extern int _seqbuflen;extern int _seqbufptr #define SEQ_PM_DEFINES struct patmgr_info _pm_info #define _SEQ_NEEDBUF(len) if ((_seqbufptr+(len)) > _seqbuflen) seqbuf_dump() #define _SEQ_ADVBUF(len) _seqbufptr += len @@ -638,6 +653,17 @@ void seqbuf_dump(void); /* This function must be provided by programs */ _pm_info.parm1 = bank, _pm_info.parm2 = 128, \ ioctl(seqfd, SNDCTL_PMGR_ACCESS, &_pm_info)) +#define SEQ_VOLUME_MODE(dev, mode) {_SEQ_NEEDBUF(8);\ + _seqbuf[_seqbufptr] = SEQ_EXTENDED;\ + _seqbuf[_seqbufptr+1] = SEQ_VOLMODE;\ + _seqbuf[_seqbufptr+2] = (dev);\ + _seqbuf[_seqbufptr+3] = (mode);\ + _seqbuf[_seqbufptr+4] = 0;\ + _seqbuf[_seqbufptr+5] = 0;\ + _seqbuf[_seqbufptr+6] = 0;\ + _seqbuf[_seqbufptr+7] = 0;\ + _SEQ_ADVBUF(8);} + #define SEQ_START_NOTE(dev, voice, note, vol) {_SEQ_NEEDBUF(8);\ _seqbuf[_seqbufptr] = SEQ_EXTENDED;\ _seqbuf[_seqbufptr+1] = SEQ_NOTEON;\ @@ -728,8 +754,8 @@ void seqbuf_dump(void); /* This function must be provided by programs */ _seqbuf[_seqbufptr+2] = (device);\ _seqbuf[_seqbufptr+3] = 0;\ _SEQ_ADVBUF(4);} -#define SEQ_WRPATCH(patch, len) {if (_seqbufptr) seqbuf_dump();\ - if (write(seqfd, (char*)(patch), len)==-1) \ +#define SEQ_WRPATCH(patchx, len) {if (_seqbufptr) seqbuf_dump();\ + if (write(seqfd, (char*)(patchx), len)==-1) \ perror("Write patch: /dev/sequencer");} #endif diff --git a/sys/i386/include/spl.h b/sys/i386/include/spl.h new file mode 100644 index 000000000000..0be93644a463 --- /dev/null +++ b/sys/i386/include/spl.h @@ -0,0 +1,104 @@ +#ifndef _MACHINE_IPL_H_ +#define _MACHINE_IPL_H_ + +#include "machine/../isa/ipl.h" /* XXX "machine" means cpu for i386 */ + +/* + * Software interrupt bit numbers in priority order. The priority only + * determines which swi will be dispatched next; a higher priority swi + * may be dispatched when a nested h/w interrupt handler returns. + */ +#define SWI_TTY (NHWI + 0) +#define SWI_NET (NHWI + 1) +#define SWI_CLOCK 30 +#define SWI_AST 31 + +/* + * Corresponding interrupt-pending bits for ipending. + */ +#define SWI_TTY_PENDING (1 << SWI_TTY) +#define SWI_NET_PENDING (1 << SWI_NET) +#define SWI_CLOCK_PENDING (1 << SWI_CLOCK) +#define SWI_AST_PENDING (1 << SWI_AST) + +/* + * Corresponding interrupt-disable masks for cpl. The ordering is now by + * inclusion (where each mask is considered as a set of bits). Everything + * except SWI_AST_MASK includes SWI_CLOCK_MASK so that softclock() doesn't + * run while other swi handlers are running and timeout routines can call + * swi handlers. Everything includes SWI_AST_MASK so that AST's are masked + * until just before return to user mode. + */ +#define SWI_TTY_MASK (SWI_TTY_PENDING | SWI_CLOCK_MASK) +#define SWI_NET_MASK (SWI_NET_PENDING | SWI_CLOCK_MASK) +#define SWI_CLOCK_MASK (SWI_CLOCK_PENDING | SWI_AST_MASK) +#define SWI_AST_MASK SWI_AST_PENDING +#define SWI_MASK (~HWI_MASK) + +#ifndef LOCORE + +extern unsigned bio_imask; /* group of interrupts masked with splbio() */ +extern unsigned cpl; /* current priority level mask */ +extern unsigned high_imask; /* group of interrupts masked with splhigh() */ +extern unsigned net_imask; /* group of interrupts masked with splimp() */ +extern volatile unsigned ipending; /* active interrupts masked by cpl */ +extern volatile unsigned netisr; +extern unsigned tty_imask; /* group of interrupts masked with spltty() */ + +/* + * ipending has to be volatile so that it is read every time it is accessed + * in splx() and spl0(), but we don't want it to be read nonatomically when + * it is changed. Pretending that ipending is a plain int happens to give + * suitable atomic code for "ipending |= constant;". + */ +#define setsoftast() (*(unsigned *)&ipending |= SWI_AST_PENDING) +#define setsoftclock() (*(unsigned *)&ipending |= SWI_CLOCK_PENDING) +#define setsoftnet() (*(unsigned *)&ipending |= SWI_NET_PENDING) +#define setsofttty() (*(unsigned *)&ipending |= SWI_TTY_PENDING) + +void unpend_V __P((void)); + +#ifdef __GNUC__ + +void splz __P((void)); + +#define GENSPL(name, set_cpl) \ +static __inline int name(void) \ +{ \ + unsigned x; \ + \ + x = cpl; \ + set_cpl; \ + return (x); \ +} + +GENSPL(splbio, cpl |= bio_imask) +GENSPL(splclock, cpl = HWI_MASK | SWI_MASK) +GENSPL(splhigh, cpl = HWI_MASK | SWI_MASK) +GENSPL(splimp, cpl |= net_imask) +GENSPL(splnet, cpl |= SWI_NET_MASK) +GENSPL(splsoftclock, cpl = SWI_CLOCK_MASK) +GENSPL(splsofttty, cpl |= SWI_TTY_MASK) +GENSPL(spltty, cpl |= tty_imask) + +static __inline void +spl0(void) +{ + cpl = SWI_AST_MASK; + if (ipending & ~SWI_AST_MASK) + splz(); +} + +static __inline void +splx(int ipl) +{ + cpl = ipl; + if (ipending & ~ipl) + splz(); +} + +#endif /* __GNUC__ */ + +#endif /* LOCORE */ + +#endif /* _MACHINE_IPL_H_ */ diff --git a/sys/i386/include/ultrasound.h b/sys/i386/include/ultrasound.h index 9b6e78fbadce..40e2443e6f65 100644 --- a/sys/i386/include/ultrasound.h +++ b/sys/i386/include/ultrasound.h @@ -32,12 +32,6 @@ * and not portable. */ -#ifdef linux -#include <linux/soundcard.h> -#else -#include <machine/soundcard.h> -#endif - /* * Private events for Gravis Ultrasound (GUS) * @@ -90,6 +84,7 @@ #define _GUS_VOICEFADE 0x0d #define _GUS_VOLUME_SCALE 0x0e #define _GUS_VOICEVOL2 0x0f +#define _GUS_VOICE_POS 0x10 /* * GUS API macros @@ -120,5 +115,7 @@ #define GUS_RAMPON(chn, voice, p1) _GUS_CMD(chn, voice, _GUS_RAMPON, (p1), 0) #define GUS_RAMPOFF(chn, voice) _GUS_CMD(chn, voice, _GUS_RAMPOFF, 0, 0) #define GUS_VOLUME_SCALE(chn, voice, p1, p2) _GUS_CMD(chn, voice, _GUS_VOLUME_SCALE, (p1), (p2)) +#define GUS_VOICE_POS(chn, voice, p) _GUS_CMD(chn, voice, _GUS_VOICE_POS, \ + (p) & 0xffff, ((p) >> 16) & 0xffff) #endif diff --git a/sys/i386/include/vmparam.h b/sys/i386/include/vmparam.h index a5b657cd82c2..c5ed04dde346 100644 --- a/sys/i386/include/vmparam.h +++ b/sys/i386/include/vmparam.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * from: @(#)vmparam.h 5.9 (Berkeley) 5/12/91 - * $Id: vmparam.h,v 1.11.2.1 1994/03/24 08:57:03 rgrimes Exp $ + * $Id: vmparam.h,v 1.12 1994/03/21 09:35:24 davidg Exp $ */ |