summaryrefslogtreecommitdiffstats
path: root/sys/i386/include
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1997-08-09 00:04:06 +0000
committerdyson <dyson@FreeBSD.org>1997-08-09 00:04:06 +0000
commitad0649e2b977efaa77b68c699a1f44b12e7429d1 (patch)
tree925573ddb83b4a0cf21a7d136de8f44817243b6c /sys/i386/include
parent56b351207af0157d77bdd770e72c7ff038d57164 (diff)
downloadFreeBSD-src-ad0649e2b977efaa77b68c699a1f44b12e7429d1.zip
FreeBSD-src-ad0649e2b977efaa77b68c699a1f44b12e7429d1.tar.gz
VM86 kernel support.
Work done by BSDI, Jonathan Lemon <jlemon@americantv.com>, Mike Smith <msmith@gsoft.com.au>, Sean Eric Fagan <sef@kithrup.com>, and probably alot of others. Submitted by: Jnathan Lemon <jlemon@americantv.com>
Diffstat (limited to 'sys/i386/include')
-rw-r--r--sys/i386/include/cpu.h7
-rw-r--r--sys/i386/include/frame.h31
-rw-r--r--sys/i386/include/md_var.h3
-rw-r--r--sys/i386/include/param.h3
-rw-r--r--sys/i386/include/pcb.h10
-rw-r--r--sys/i386/include/signal.h7
-rw-r--r--sys/i386/include/sysarch.h7
7 files changed, 54 insertions, 14 deletions
diff --git a/sys/i386/include/cpu.h b/sys/i386/include/cpu.h
index d28079a..0aedc2a 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.28 1997/02/22 09:34:04 peter Exp $
+ * $Id: cpu.h,v 1.29 1997/04/07 07:15:58 peter Exp $
*/
#ifndef _MACHINE_CPU_H_
@@ -43,6 +43,7 @@
/*
* Definitions unique to i386 cpu support.
*/
+#include <machine/psl.h>
#include <machine/frame.h>
#include <machine/segments.h>
@@ -57,7 +58,9 @@
#define cpu_setstack(p, ap) ((p)->p_md.md_regs[SP] = (ap))
#define cpu_set_init_frame(p, fp) ((p)->p_md.md_regs = (fp))
-#define CLKF_USERMODE(framep) (ISPL((framep)->cf_cs) == SEL_UPL)
+#define CLKF_USERMODE(framep) \
+ ((ISPL((framep)->cf_cs) == SEL_UPL) || (framep->cf_eflags & PSL_VM))
+
#define CLKF_INTR(framep) (intr_nesting_level >= 2)
#if 0
/*
diff --git a/sys/i386/include/frame.h b/sys/i386/include/frame.h
index 43201f2..05092c2 100644
--- a/sys/i386/include/frame.h
+++ b/sys/i386/include/frame.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)frame.h 5.2 (Berkeley) 1/18/91
- * $Id$
+ * $Id: frame.h,v 1.14 1997/02/22 09:34:38 peter Exp $
*/
#ifndef _MACHINE_FRAME_H_
@@ -72,6 +72,35 @@ struct trapframe {
int tf_ss;
};
+/* Superset of trap frame, for traps from virtual-8086 mode */
+
+struct trapframe_vm86 {
+ int tf_es;
+ int tf_ds;
+ int tf_edi;
+ int tf_esi;
+ int tf_ebp;
+ int tf_isp;
+ int tf_ebx;
+ int tf_edx;
+ int tf_ecx;
+ int tf_eax;
+ int tf_trapno;
+ /* below portion defined in 386 hardware */
+ int tf_err;
+ int tf_eip;
+ int tf_cs;
+ int tf_eflags;
+ /* below only when crossing rings (e.g. user to kernel) */
+ int tf_esp;
+ int tf_ss;
+ /* below only when switching out of VM86 mode */
+ int tf_vm86_es;
+ int tf_vm86_ds;
+ int tf_vm86_fs;
+ int tf_vm86_gs;
+};
+
/* Interrupt stack frame */
struct intrframe {
diff --git a/sys/i386/include/md_var.h b/sys/i386/include/md_var.h
index 337c0c4..b5f6625 100644
--- a/sys/i386/include/md_var.h
+++ b/sys/i386/include/md_var.h
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: md_var.h,v 1.14 1997/06/07 04:36:05 bde Exp $
+ * $Id: md_var.h,v 1.15 1997/06/15 02:02:55 wollman Exp $
*/
#ifndef _MACHINE_MD_VAR_H_
@@ -68,7 +68,6 @@ void doreti_popl_es __P((void)) __asm(__STRING(doreti_popl_es));
void doreti_popl_es_fault __P((void)) __asm(__STRING(doreti_popl_es_fault));
int fill_regs __P((struct proc *p, struct reg *regs));
void fillw __P((int /*u_short*/ pat, void *base, size_t cnt));
-int fusword __P((void *base));
u_long kvtop __P((void *addr));
void setidt __P((int idx, alias_for_inthand_t *func, int typ, int dpl,
int selec));
diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h
index 1015164..4a7d19e 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.31 1997/08/04 19:14:47 fsmp Exp $
+ * $Id: param.h,v 1.32 1997/08/07 05:15:52 dyson Exp $
*/
#ifndef _MACHINE_PARAM_H_
@@ -72,6 +72,7 @@
#define BLKDEV_IOSIZE 2048
#define MAXPHYS (64 * 1024) /* max raw I/O transfer size */
+#define IOPAGES 2 /* pages of i/o permission bitmap */
#define UPAGES 2 /* pages of u-area */
#define UPAGES_HOLE 2 /* pages of "hole" at top of user space where */
/* the upages used to be. DO NOT CHANGE! */
diff --git a/sys/i386/include/pcb.h b/sys/i386/include/pcb.h
index 18a9af1..26acab9 100644
--- a/sys/i386/include/pcb.h
+++ b/sys/i386/include/pcb.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)pcb.h 5.10 (Berkeley) 5/12/91
- * $Id: pcb.h,v 1.22 1997/06/07 04:36:05 bde Exp $
+ * $Id: pcb.h,v 1.23 1997/06/22 16:03:51 peter Exp $
*/
#ifndef _I386_PCB_H_
@@ -45,6 +45,7 @@
*/
#include <machine/tss.h>
#include <machine/npx.h>
+#include <machine/pcb_ext.h>
struct pcb {
int pcb_cr3;
@@ -63,11 +64,8 @@ struct pcb {
u_long pcb_mpnest;
int pcb_fs;
int pcb_gs;
- u_long __pcb_spare[5]; /* adjust to avoid core dump size changes */
-#if 0 /* some day we may switch between procs that have their own i386tss */
- struct i386tss pcb_tss;
- u_char pcb_iomap[NPORT/sizeof(u_char)]; /* i/o port bitmap */
-#endif
+ struct pcb_ext *pcb_ext; /* optional pcb extension */
+ u_long __pcb_spare[1]; /* adjust to avoid core dump size changes */
};
/*
diff --git a/sys/i386/include/signal.h b/sys/i386/include/signal.h
index 0e860ba..51dc196 100644
--- a/sys/i386/include/signal.h
+++ b/sys/i386/include/signal.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)signal.h 8.1 (Berkeley) 6/11/93
- * $Id$
+ * $Id: signal.h,v 1.7 1997/02/22 09:35:12 peter Exp $
*/
#ifndef _MACHINE_SIGNAL_H_
@@ -72,10 +72,15 @@ struct sigcontext {
int sc_edx;
int sc_ecx;
int sc_eax;
+ int sc_gs;
+ int sc_fs;
# define sc_sp sc_esp
# define sc_fp sc_ebp
# define sc_pc sc_eip
# define sc_ps sc_efl
+# define sc_eflags sc_efl
+ int sc_trapno;
+ int sc_err;
};
#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
diff --git a/sys/i386/include/sysarch.h b/sys/i386/include/sysarch.h
index 746cef1..80694a4 100644
--- a/sys/i386/include/sysarch.h
+++ b/sys/i386/include/sysarch.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: sysarch.h,v 1.6 1997/02/22 09:35:18 peter Exp $
*/
/*
@@ -43,6 +43,11 @@
#define I386_GET_LDT 0
#define I386_SET_LDT 1
+ /* I386_IOPL */
+#define I386_GET_IOPERM 3
+#define I386_SET_IOPERM 4
+ /* xxxxx */
+#define I386_VM86 6
#ifdef KERNEL
/* nothing here yet... */
OpenPOWER on IntegriCloud