summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/machdep.c18
-rw-r--r--sys/arch/i386/i386/sys_machdep.c48
-rw-r--r--sys/arch/i386/include/pcb.h12
-rw-r--r--sys/arch/i386/include/sysarch.h14
4 files changed, 7 insertions, 85 deletions
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index cb66e9d4a66..c7a8caa6b42 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.582 2016/03/15 03:17:51 guenther Exp $ */
+/* $OpenBSD: machdep.c,v 1.583 2016/03/24 04:56:08 guenther Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -459,17 +459,11 @@ cpu_startup(void)
void
i386_proc0_tss_init(void)
{
- int x;
struct pcb *pcb;
curpcb = pcb = &proc0.p_addr->u_pcb;
- pcb->pcb_tss.tss_ioopt =
- ((caddr_t)pcb->pcb_iomap - (caddr_t)&pcb->pcb_tss) << 16;
- for (x = 0; x < sizeof(pcb->pcb_iomap) / 4; x++)
- pcb->pcb_iomap[x] = 0xffffffff;
- pcb->pcb_iomap_pad = 0xff;
-
+ pcb->pcb_tss.tss_ioopt = sizeof(pcb->pcb_tss) << 16;
pcb->pcb_cr0 = rcr0();
pcb->pcb_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL);
pcb->pcb_tss.tss_esp0 = (int)proc0.p_addr + USPACE - 16;
@@ -484,15 +478,9 @@ i386_proc0_tss_init(void)
void
i386_init_pcb_tss(struct cpu_info *ci)
{
- int x;
struct pcb *pcb = ci->ci_idle_pcb;
- pcb->pcb_tss.tss_ioopt =
- ((caddr_t)pcb->pcb_iomap - (caddr_t)&pcb->pcb_tss) << 16;
- for (x = 0; x < sizeof(pcb->pcb_iomap) / 4; x++)
- pcb->pcb_iomap[x] = 0xffffffff;
- pcb->pcb_iomap_pad = 0xff;
-
+ pcb->pcb_tss.tss_ioopt = sizeof(pcb->pcb_tss) << 16;
pcb->pcb_cr0 = rcr0();
ci->ci_idle_tss_sel = tss_alloc(pcb);
}
diff --git a/sys/arch/i386/i386/sys_machdep.c b/sys/arch/i386/i386/sys_machdep.c
index 285b7f2ce9f..723c5ba81d5 100644
--- a/sys/arch/i386/i386/sys_machdep.c
+++ b/sys/arch/i386/i386/sys_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_machdep.c,v 1.36 2016/03/03 12:41:30 naddy Exp $ */
+/* $OpenBSD: sys_machdep.c,v 1.37 2016/03/24 04:56:08 guenther Exp $ */
/* $NetBSD: sys_machdep.c,v 1.28 1996/05/03 19:42:29 christos Exp $ */
/*-
@@ -70,8 +70,6 @@
extern struct vm_map *kernel_map;
int i386_iopl(struct proc *, void *, register_t *);
-int i386_get_ioperm(struct proc *, void *, register_t *);
-int i386_set_ioperm(struct proc *, void *, register_t *);
#ifdef APERTURE
extern int allowaperture;
@@ -105,42 +103,6 @@ i386_iopl(struct proc *p, void *args, register_t *retval)
return 0;
}
-int
-i386_get_ioperm(struct proc *p, void *args, register_t *retval)
-{
- int error;
- struct pcb *pcb = &p->p_addr->u_pcb;
- struct i386_get_ioperm_args ua;
-
- if ((error = copyin(args, &ua, sizeof(ua))) != 0)
- return (error);
-
- return copyout(pcb->pcb_iomap, ua.iomap, sizeof(pcb->pcb_iomap));
-}
-
-int
-i386_set_ioperm(struct proc *p, void *args, register_t *retval)
-{
- int error;
- struct pcb *pcb = &p->p_addr->u_pcb;
- struct i386_set_ioperm_args ua;
-
- if ((error = suser(p, 0)) != 0)
- return error;
-
-#ifdef APERTURE
- if (!allowaperture && securelevel > 0)
- return EPERM;
-#else
- if (securelevel > 0)
- return EPERM;
-#endif
- if ((error = copyin(args, &ua, sizeof(ua))) != 0)
- return (error);
-
- return copyin(ua.iomap, pcb->pcb_iomap, sizeof(pcb->pcb_iomap));
-}
-
uint32_t
i386_get_threadbase(struct proc *p, int which)
{
@@ -187,14 +149,6 @@ sys_sysarch(struct proc *p, void *v, register_t *retval)
error = i386_iopl(p, SCARG(uap, parms), retval);
break;
- case I386_GET_IOPERM:
- error = i386_get_ioperm(p, SCARG(uap, parms), retval);
- break;
-
- case I386_SET_IOPERM:
- error = i386_set_ioperm(p, SCARG(uap, parms), retval);
- break;
-
#ifdef VM86
case I386_VM86:
error = i386_vm86(p, SCARG(uap, parms), retval);
diff --git a/sys/arch/i386/include/pcb.h b/sys/arch/i386/include/pcb.h
index 62fafde53f4..6e6f5a578e7 100644
--- a/sys/arch/i386/include/pcb.h
+++ b/sys/arch/i386/include/pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcb.h,v 1.19 2016/03/15 03:17:51 guenther Exp $ */
+/* $OpenBSD: pcb.h,v 1.20 2016/03/24 04:56:08 guenther Exp $ */
/* $NetBSD: pcb.h,v 1.21 1996/01/08 13:51:42 mycroft Exp $ */
/*-
@@ -50,8 +50,6 @@
#include <machine/npx.h>
#include <machine/sysarch.h>
-#define NIOPORTS 1024 /* # of ports we allow to be mapped */
-
struct pcb {
struct i386tss pcb_tss;
#define pcb_cr3 pcb_tss.tss_cr3
@@ -59,21 +57,15 @@ struct pcb {
#define pcb_ebp pcb_tss.tss_ebp
#define pcb_cs pcb_tss.tss_cs
int pcb_cr0; /* saved image of CR0 */
- int __pcb_padding; /* for 16-byte align of pcb_savefpu */
+ caddr_t pcb_onfault; /* copyin/out fault recovery */
union savefpu pcb_savefpu; /* floating point state for FPU */
struct segment_descriptor pcb_threadsegs[2];
/* per-thread descriptors */
-/*
- * Software pcb (extension)
- */
- caddr_t pcb_onfault; /* copyin/out fault recovery */
int vm86_eflags; /* virtual eflags for vm86 mode */
int vm86_flagmask; /* flag mask for vm86 mode */
void *vm86_userp; /* XXX performance hack */
struct pmap *pcb_pmap; /* back pointer to our pmap */
struct cpu_info *pcb_fpcpu; /* cpu holding our fpu state */
- u_long pcb_iomap[NIOPORTS/32]; /* I/O bitmap */
- u_char pcb_iomap_pad; /* required; must be 0xff, says intel */
int pcb_flags;
#define PCB_SAVECTX 0x00000001
};
diff --git a/sys/arch/i386/include/sysarch.h b/sys/arch/i386/include/sysarch.h
index fae1affb4f8..1f71a8b8256 100644
--- a/sys/arch/i386/include/sysarch.h
+++ b/sys/arch/i386/include/sysarch.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysarch.h,v 1.13 2016/03/03 12:41:30 naddy Exp $ */
+/* $OpenBSD: sysarch.h,v 1.14 2016/03/24 04:56:08 guenther Exp $ */
/* $NetBSD: sysarch.h,v 1.8 1996/01/08 13:51:44 mycroft Exp $ */
#ifndef _MACHINE_SYSARCH_H_
@@ -8,8 +8,6 @@
* Architecture specific syscalls (i386)
*/
#define I386_IOPL 2
-#define I386_GET_IOPERM 3
-#define I386_SET_IOPERM 4
#define I386_VM86 5
#define I386_GET_FSBASE 6
#define I386_SET_FSBASE 7
@@ -20,14 +18,6 @@ struct i386_iopl_args {
int iopl;
};
-struct i386_get_ioperm_args {
- u_long *iomap;
-};
-
-struct i386_set_ioperm_args {
- u_long *iomap;
-};
-
#ifdef _KERNEL
uint32_t i386_get_threadbase(struct proc *, int);
int i386_set_threadbase(struct proc *, uint32_t, int);
@@ -37,8 +27,6 @@ int i386_set_threadbase(struct proc *, uint32_t, int);
__BEGIN_DECLS
int i386_iopl(int);
-int i386_get_ioperm(u_long *);
-int i386_set_ioperm(u_long *);
int i386_get_fsbase(void **);
int i386_set_fsbase(void *);
int i386_get_gsbase(void **);