diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-04-17 05:19:05 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-04-17 05:19:05 +0000 |
commit | 61c97d6369b446092078e0e99a5541a8ee8b9417 (patch) | |
tree | f6f58885898b4fc441e96f128e264416b145a0df /sys/arch/i386/include | |
parent | bdac2fcb774bc4a57e1815b2a5e730810b3f0c5f (diff) |
Cleanups & fixes from latest NetBSD primarily to run doscmd, etc.
GENERIC added to the compile/.cvsignore (it is used for 'make links'
for example), thus conf/GENERIC should appear magically ...
Diffstat (limited to 'sys/arch/i386/include')
-rw-r--r-- | sys/arch/i386/include/ansi.h | 4 | ||||
-rw-r--r-- | sys/arch/i386/include/cpu.h | 1 | ||||
-rw-r--r-- | sys/arch/i386/include/pio.h | 8 | ||||
-rw-r--r-- | sys/arch/i386/include/vm86.h | 159 |
4 files changed, 141 insertions, 31 deletions
diff --git a/sys/arch/i386/include/ansi.h b/sys/arch/i386/include/ansi.h index 67a7752a0cb..40efacc18e9 100644 --- a/sys/arch/i386/include/ansi.h +++ b/sys/arch/i386/include/ansi.h @@ -1,4 +1,5 @@ -/* $NetBSD: ansi.h,v 1.5 1994/10/27 04:15:54 cgd Exp $ */ +/* $OpenBSD: ansi.h,v 1.2 1996/04/17 05:19:01 mickey Exp $ */ +/* $NetBSD: ansi.h,v 1.6 1996/03/16 01:31:50 jtc Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -69,6 +70,7 @@ * defined for ctype.h. */ #define _BSD_WCHAR_T_ int /* wchar_t */ +#define _BSD_WINT_T_ int /* wint_t */ #define _BSD_RUNE_T_ int /* rune_t */ #endif /* _ANSI_H_ */ diff --git a/sys/arch/i386/include/cpu.h b/sys/arch/i386/include/cpu.h index 6d6c439e6ac..00e3ed0de3c 100644 --- a/sys/arch/i386/include/cpu.h +++ b/sys/arch/i386/include/cpu.h @@ -121,6 +121,7 @@ int want_resched; /* resched() was called */ } \ } while (0) #endif +void delay __P((int)); /* * pull in #defines for kinds of processors diff --git a/sys/arch/i386/include/pio.h b/sys/arch/i386/include/pio.h index 6771ff87829..d3614747cc9 100644 --- a/sys/arch/i386/include/pio.h +++ b/sys/arch/i386/include/pio.h @@ -1,4 +1,5 @@ -/* $NetBSD: pio.h,v 1.12 1995/12/20 07:53:09 mycroft Exp $ */ +/* $OpenBSD: pio.h,v 1.3 1996/04/17 05:19:03 mickey Exp $ */ +/* $NetBSD: pio.h,v 1.13 1996/03/08 20:15:23 cgd Exp $ */ /* * Copyright (c) 1993, 1995 Charles M. Hannum. All rights reserved. @@ -29,6 +30,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef _I386_PIO_H_ +#define _I386_PIO_H_ + /* * Functions to provide access to i386 programmed I/O instructions. * @@ -205,3 +209,5 @@ outsl(int port, void *addr, int cnt) "d" (port), "S" (addr), "c" (cnt) : "%esi", "%ecx"); } + +#endif /* _I386_PIO_H_ */ diff --git a/sys/arch/i386/include/vm86.h b/sys/arch/i386/include/vm86.h index 1f21db3dbdc..a996017ceba 100644 --- a/sys/arch/i386/include/vm86.h +++ b/sys/arch/i386/include/vm86.h @@ -1,37 +1,45 @@ -/* $NetBSD: vm86.h,v 1.1 1996/01/08 13:51:45 mycroft Exp $ */ +/* $OpenBSD: vm86.h,v 1.2 1996/04/17 05:19:04 mickey Exp $ */ +/* $NetBSD: vm86.h,v 1.4 1996/04/11 10:07:25 mycroft Exp $ */ -/* - * Copyright (c) 1995 John T. Kohl - * 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 without 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 +#define VM86_USE_VIF + +/*- + * Copyright (c) 1996 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by John T. Kohl and Charles M. Hannum. + * + * 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. - * */ #define SETFLAGS(targ, new, newmask) (targ) = ((targ) & ~(newmask)) | ((new) & (newmask)) -#define VM86_EFLAGS(p) ((p)->p_addr->u_pcb.vm86_eflags) -#define VM86_FLAGMASK(p) ((p)->p_addr->u_pcb.vm86_flagmask) #define VM86_TYPE(x) ((x) & 0xff) #define VM86_ARG(x) (((x) & 0xff00) >> 8) @@ -41,6 +49,9 @@ #define VM86_SIGNAL 2 #define VM86_UNKNOWN 3 +#define VM86_SETDIRECT (~PSL_USERSTATIC) +#define VM86_GETDIRECT (VM86_SETDIRECT|PSL_MBO|PSL_MBZ) + struct vm86_regs { struct sigcontext vmsc; }; @@ -74,6 +85,96 @@ struct vm86_struct { #ifdef _KERNEL int i386_vm86 __P((struct proc *, char *, register_t *)); void vm86_gpfault __P((struct proc *, int)); +void vm86_return __P((struct proc *, int)); + +static __inline__ void +clr_vif(p) + struct proc *p; +{ + struct pcb *pcb = &p->p_addr->u_pcb; + +#ifndef VM86_USE_VIF + pcb->vm86_eflags &= ~PSL_I; +#else + pcb->vm86_eflags &= ~PSL_VIF; +#endif +} + +static __inline__ void +set_vif(p) + struct proc *p; +{ + struct pcb *pcb = &p->p_addr->u_pcb; + +#ifndef VM86_USE_VIF + pcb->vm86_eflags |= PSL_I; + if ((pcb->vm86_eflags & (PSL_I|PSL_VIP)) == (PSL_I|PSL_VIP)) +#else + pcb->vm86_eflags |= PSL_VIF; + if ((pcb->vm86_eflags & (PSL_VIF|PSL_VIP)) == (PSL_VIF|PSL_VIP)) +#endif + vm86_return(p, VM86_STI); +} + +static __inline__ void +set_vflags(p, flags) + struct proc *p; + int flags; +{ + struct trapframe *tf = p->p_md.md_regs; + struct pcb *pcb = &p->p_addr->u_pcb; + + SETFLAGS(pcb->vm86_eflags, flags, pcb->vm86_flagmask | ~VM86_GETDIRECT); + SETFLAGS(tf->tf_eflags, flags, VM86_SETDIRECT); +#ifndef VM86_USE_VIF + if ((pcb->vm86_eflags & (PSL_I|PSL_VIP)) == (PSL_I|PSL_VIP)) +#else + if ((pcb->vm86_eflags & (PSL_VIF|PSL_VIP)) == (PSL_VIF|PSL_VIP)) +#endif + vm86_return(p, VM86_STI); +} + +static __inline__ int +get_vflags(p) + struct proc *p; +{ + struct trapframe *tf = p->p_md.md_regs; + struct pcb *pcb = &p->p_addr->u_pcb; + int flags = 0; + + SETFLAGS(flags, pcb->vm86_eflags, pcb->vm86_flagmask | ~VM86_GETDIRECT); + SETFLAGS(flags, tf->tf_eflags, VM86_GETDIRECT); + return (flags); +} + +static __inline__ void +set_vflags_short(p, flags) + struct proc *p; + int flags; +{ + struct trapframe *tf = p->p_md.md_regs; + struct pcb *pcb = &p->p_addr->u_pcb; + + SETFLAGS(pcb->vm86_eflags, flags, (pcb->vm86_flagmask | ~VM86_GETDIRECT) & 0xffff); + SETFLAGS(tf->tf_eflags, flags, VM86_SETDIRECT & 0xffff); +#ifndef VM86_USE_VIF + if ((pcb->vm86_eflags & (PSL_I|PSL_VIP)) == (PSL_I|PSL_VIP)) + vm86_return(p, VM86_STI); +#endif +} + +static __inline__ int +get_vflags_short(p) + struct proc *p; +{ + struct trapframe *tf = p->p_md.md_regs; + struct pcb *pcb = &p->p_addr->u_pcb; + int flags = 0; + + SETFLAGS(flags, pcb->vm86_eflags, (pcb->vm86_flagmask | ~VM86_GETDIRECT) & 0xffff); + SETFLAGS(flags, tf->tf_eflags, VM86_GETDIRECT & 0xffff); + return (flags); +} #else int i386_vm86 __P((struct vm86_struct *vmcp)); #endif |