summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuoqi Chen <luoqi@FreeBSD.org>1999-09-02 20:59:50 +0000
committerLuoqi Chen <luoqi@FreeBSD.org>1999-09-02 20:59:50 +0000
commit7a2bb3b800667397d41ad7324c4d8f2911fb8ebb (patch)
tree58442150ffafe6d59ac1d684d1d18f99075c9471
parent4f2571dd7761822228f08c923a3889f6aed35f73 (diff)
Notes
-rw-r--r--sys/amd64/amd64/sys_machdep.c41
-rw-r--r--sys/amd64/include/sysarch.h17
-rw-r--r--sys/i386/i386/sys_machdep.c41
-rw-r--r--sys/i386/i386/vm86.c1
-rw-r--r--sys/i386/include/sysarch.h17
-rw-r--r--sys/i386/include/vm86.h5
6 files changed, 55 insertions, 67 deletions
diff --git a/sys/amd64/amd64/sys_machdep.c b/sys/amd64/amd64/sys_machdep.c
index 0f5930ca7a0a..54f63ca0f7d1 100644
--- a/sys/amd64/amd64/sys_machdep.c
+++ b/sys/amd64/amd64/sys_machdep.c
@@ -108,7 +108,7 @@ sysarch(p, uap)
error = vm86_sysarch(p, uap->parms);
break;
default:
- error = EINVAL;
+ error = EOPNOTSUPP;
break;
}
return (error);
@@ -163,12 +163,6 @@ i386_extend_pcb(struct proc *p)
return 0;
}
-struct i386_ioperm_args {
- u_int start;
- u_int length;
- int enable;
-};
-
static int
i386_set_ioperm(p, args)
struct proc *p;
@@ -265,12 +259,6 @@ set_user_ldt(struct pcb *pcb)
currentldt = GSEL(GUSERLDT_SEL, SEL_KPL);
}
-struct i386_get_ldt_args {
- int start;
- union descriptor *desc;
- int num;
-};
-
static int
i386_get_ldt(p, args)
struct proc *p;
@@ -281,15 +269,14 @@ i386_get_ldt(p, args)
int nldt, num;
union descriptor *lp;
int s;
- struct i386_get_ldt_args ua;
- struct i386_get_ldt_args *uap = &ua;
+ struct i386_ldt_args ua, *uap = &ua;
- if ((error = copyin(args, uap, sizeof(struct i386_get_ldt_args))) < 0)
+ if ((error = copyin(args, uap, sizeof(struct i386_ldt_args))) < 0)
return(error);
#ifdef DEBUG
printf("i386_get_ldt: start=%d num=%d descs=%p\n",
- uap->start, uap->num, (void *)uap->desc);
+ uap->start, uap->num, (void *)uap->descs);
#endif
/* verify range of LDTs exist */
@@ -312,7 +299,7 @@ i386_get_ldt(p, args)
return(EINVAL);
}
- error = copyout(lp, uap->desc, num * sizeof(union descriptor));
+ error = copyout(lp, uap->descs, num * sizeof(union descriptor));
if (!error)
p->p_retval[0] = num;
@@ -320,12 +307,6 @@ i386_get_ldt(p, args)
return(error);
}
-struct i386_set_ldt_args {
- int start;
- union descriptor *desc;
- int num;
-};
-
static int
i386_set_ldt(p, args)
struct proc *p;
@@ -335,16 +316,14 @@ i386_set_ldt(p, args)
int largest_ld;
struct pcb *pcb = &p->p_addr->u_pcb;
int s;
- struct i386_set_ldt_args ua, *uap;
+ struct i386_ldt_args ua, *uap = &ua;
- if ((error = copyin(args, &ua, sizeof(struct i386_set_ldt_args))) < 0)
+ if ((error = copyin(args, uap, sizeof(struct i386_ldt_args))) < 0)
return(error);
- uap = &ua;
-
#ifdef DEBUG
printf("i386_set_ldt: start=%d num=%d descs=%p\n",
- uap->start, uap->num, (void *)uap->desc);
+ uap->start, uap->num, (void *)uap->descs);
#endif
/* verify range of descriptors to modify */
@@ -381,7 +360,7 @@ i386_set_ldt(p, args)
/* Check descriptors for access violations */
for (i = 0, n = uap->start; i < uap->num; i++, n++) {
union descriptor desc, *dp;
- dp = &uap->desc[i];
+ dp = &uap->descs[i];
error = copyin(dp, &desc, sizeof(union descriptor));
if (error)
return(error);
@@ -446,7 +425,7 @@ i386_set_ldt(p, args)
s = splhigh();
/* Fill in range */
- error = copyin(uap->desc,
+ error = copyin(uap->descs,
&((union descriptor *)(pcb->pcb_ldt))[uap->start],
uap->num * sizeof(union descriptor));
if (!error)
diff --git a/sys/amd64/include/sysarch.h b/sys/amd64/include/sysarch.h
index 009c7810259a..5ea3ee6e8875 100644
--- a/sys/amd64/include/sysarch.h
+++ b/sys/amd64/include/sysarch.h
@@ -47,6 +47,23 @@
/* xxxxx */
#define I386_VM86 6
+struct i386_ldt_args {
+ int start;
+ union descriptor *descs;
+ int num;
+};
+
+struct i386_ioperm_args {
+ unsigned int start;
+ unsigned int length;
+ int enable;
+};
+
+struct i386_vm86_args {
+ int sub_op; /* sub-operation to perform */
+ char *sub_args; /* args */
+};
+
#ifndef KERNEL
#include <sys/cdefs.h>
diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c
index 0f5930ca7a0a..54f63ca0f7d1 100644
--- a/sys/i386/i386/sys_machdep.c
+++ b/sys/i386/i386/sys_machdep.c
@@ -108,7 +108,7 @@ sysarch(p, uap)
error = vm86_sysarch(p, uap->parms);
break;
default:
- error = EINVAL;
+ error = EOPNOTSUPP;
break;
}
return (error);
@@ -163,12 +163,6 @@ i386_extend_pcb(struct proc *p)
return 0;
}
-struct i386_ioperm_args {
- u_int start;
- u_int length;
- int enable;
-};
-
static int
i386_set_ioperm(p, args)
struct proc *p;
@@ -265,12 +259,6 @@ set_user_ldt(struct pcb *pcb)
currentldt = GSEL(GUSERLDT_SEL, SEL_KPL);
}
-struct i386_get_ldt_args {
- int start;
- union descriptor *desc;
- int num;
-};
-
static int
i386_get_ldt(p, args)
struct proc *p;
@@ -281,15 +269,14 @@ i386_get_ldt(p, args)
int nldt, num;
union descriptor *lp;
int s;
- struct i386_get_ldt_args ua;
- struct i386_get_ldt_args *uap = &ua;
+ struct i386_ldt_args ua, *uap = &ua;
- if ((error = copyin(args, uap, sizeof(struct i386_get_ldt_args))) < 0)
+ if ((error = copyin(args, uap, sizeof(struct i386_ldt_args))) < 0)
return(error);
#ifdef DEBUG
printf("i386_get_ldt: start=%d num=%d descs=%p\n",
- uap->start, uap->num, (void *)uap->desc);
+ uap->start, uap->num, (void *)uap->descs);
#endif
/* verify range of LDTs exist */
@@ -312,7 +299,7 @@ i386_get_ldt(p, args)
return(EINVAL);
}
- error = copyout(lp, uap->desc, num * sizeof(union descriptor));
+ error = copyout(lp, uap->descs, num * sizeof(union descriptor));
if (!error)
p->p_retval[0] = num;
@@ -320,12 +307,6 @@ i386_get_ldt(p, args)
return(error);
}
-struct i386_set_ldt_args {
- int start;
- union descriptor *desc;
- int num;
-};
-
static int
i386_set_ldt(p, args)
struct proc *p;
@@ -335,16 +316,14 @@ i386_set_ldt(p, args)
int largest_ld;
struct pcb *pcb = &p->p_addr->u_pcb;
int s;
- struct i386_set_ldt_args ua, *uap;
+ struct i386_ldt_args ua, *uap = &ua;
- if ((error = copyin(args, &ua, sizeof(struct i386_set_ldt_args))) < 0)
+ if ((error = copyin(args, uap, sizeof(struct i386_ldt_args))) < 0)
return(error);
- uap = &ua;
-
#ifdef DEBUG
printf("i386_set_ldt: start=%d num=%d descs=%p\n",
- uap->start, uap->num, (void *)uap->desc);
+ uap->start, uap->num, (void *)uap->descs);
#endif
/* verify range of descriptors to modify */
@@ -381,7 +360,7 @@ i386_set_ldt(p, args)
/* Check descriptors for access violations */
for (i = 0, n = uap->start; i < uap->num; i++, n++) {
union descriptor desc, *dp;
- dp = &uap->desc[i];
+ dp = &uap->descs[i];
error = copyin(dp, &desc, sizeof(union descriptor));
if (error)
return(error);
@@ -446,7 +425,7 @@ i386_set_ldt(p, args)
s = splhigh();
/* Fill in range */
- error = copyin(uap->desc,
+ error = copyin(uap->descs,
&((union descriptor *)(pcb->pcb_ldt))[uap->start],
uap->num * sizeof(union descriptor));
if (!error)
diff --git a/sys/i386/i386/vm86.c b/sys/i386/i386/vm86.c
index b50b6f18d573..c041d3b8e078 100644
--- a/sys/i386/i386/vm86.c
+++ b/sys/i386/i386/vm86.c
@@ -46,6 +46,7 @@
#include <machine/pcb_ext.h> /* pcb.h included via sys/user.h */
#include <machine/psl.h>
#include <machine/specialreg.h>
+#include <machine/sysarch.h>
extern int i386_extend_pcb __P((struct proc *));
extern int vm86pa;
diff --git a/sys/i386/include/sysarch.h b/sys/i386/include/sysarch.h
index 009c7810259a..5ea3ee6e8875 100644
--- a/sys/i386/include/sysarch.h
+++ b/sys/i386/include/sysarch.h
@@ -47,6 +47,23 @@
/* xxxxx */
#define I386_VM86 6
+struct i386_ldt_args {
+ int start;
+ union descriptor *descs;
+ int num;
+};
+
+struct i386_ioperm_args {
+ unsigned int start;
+ unsigned int length;
+ int enable;
+};
+
+struct i386_vm86_args {
+ int sub_op; /* sub-operation to perform */
+ char *sub_args; /* args */
+};
+
#ifndef KERNEL
#include <sys/cdefs.h>
diff --git a/sys/i386/include/vm86.h b/sys/i386/include/vm86.h
index 1231bb20a77f..60c56154a6e0 100644
--- a/sys/i386/include/vm86.h
+++ b/sys/i386/include/vm86.h
@@ -124,11 +124,6 @@ struct vm86_kernel {
caddr_t vm86_sproc; /* address of sproc */
};
-struct i386_vm86_args {
- int sub_op; /* sub-operation to perform */
- char *sub_args; /* args */
-};
-
#define VM86_INIT 1
#define VM86_SET_VME 2
#define VM86_GET_VME 3