version 1.28, 1996/04/18 08:36:22 |
version 1.29, 1996/05/03 19:42:11 |
|
|
#include <compat/linux/linux_signal.h> |
#include <compat/linux/linux_signal.h> |
#include <compat/linux/linux_syscallargs.h> |
#include <compat/linux/linux_syscallargs.h> |
#include <compat/linux/linux_util.h> |
#include <compat/linux/linux_util.h> |
|
#include <compat/linux/linux_ioctl.h> |
|
|
#include <machine/cpu.h> |
#include <machine/cpu.h> |
#include <machine/cpufunc.h> |
#include <machine/cpufunc.h> |
|
|
#include <arch/i386/isa/pcvt/pcvt_ioctl.h> |
#include <arch/i386/isa/pcvt/pcvt_ioctl.h> |
#endif |
#endif |
|
|
|
#ifdef USER_LDT |
|
#include <machine/cpu.h> |
|
int linux_read_ldt __P((struct proc *, struct linux_sys_modify_ldt_args *, |
|
register_t *)); |
|
int linux_write_ldt __P((struct proc *, struct linux_sys_modify_ldt_args *, |
|
register_t *)); |
|
#endif |
|
|
/* |
/* |
* Deal with some i386-specific things in the Linux emulation code. |
* Deal with some i386-specific things in the Linux emulation code. |
* This means just signals for now, will include stuff like |
* This means just signals for now, will include stuff like |
Line 284 linux_read_ldt(p, uap, retval) |
|
Line 293 linux_read_ldt(p, uap, retval) |
|
|
|
parms = stackgap_alloc(&sg, sizeof(gl)); |
parms = stackgap_alloc(&sg, sizeof(gl)); |
|
|
if (error = copyout(&gl, parms, sizeof(gl))) |
if ((error = copyout(&gl, parms, sizeof(gl))) != 0) |
return (error); |
return (error); |
|
|
if (error = i386_get_ldt(p, parms, retval)) |
if ((error = i386_get_ldt(p, parms, retval)) != 0) |
return (error); |
return (error); |
|
|
*retval *= sizeof(union descriptor); |
*retval *= sizeof(union descriptor); |
Line 324 linux_write_ldt(p, uap, retval) |
|
Line 333 linux_write_ldt(p, uap, retval) |
|
|
|
if (SCARG(uap, bytecount) != sizeof(ldt_info)) |
if (SCARG(uap, bytecount) != sizeof(ldt_info)) |
return (EINVAL); |
return (EINVAL); |
if (error = copyin(SCARG(uap, ptr), &ldt_info, sizeof(ldt_info))) |
if ((error = copyin(SCARG(uap, ptr), &ldt_info, sizeof(ldt_info))) != 0) |
return error; |
return error; |
if (ldt_info.contents == 3) |
if (ldt_info.contents == 3) |
return (EINVAL); |
return (EINVAL); |
Line 353 linux_write_ldt(p, uap, retval) |
|
Line 362 linux_write_ldt(p, uap, retval) |
|
|
|
parms = stackgap_alloc(&sg, sizeof(sl)); |
parms = stackgap_alloc(&sg, sizeof(sl)); |
|
|
if (error = copyout(&sd, sl.desc, sizeof(sd))) |
if ((error = copyout(&sd, sl.desc, sizeof(sd))) != 0) |
return (error); |
return (error); |
if (error = copyout(&sl, parms, sizeof(sl))) |
if ((error = copyout(&sl, parms, sizeof(sl))) != 0) |
return (error); |
return (error); |
|
|
if (error = i386_set_ldt(p, parms, retval)) |
if ((error = i386_set_ldt(p, parms, retval)) != 0) |
return (error); |
return (error); |
|
|
*retval = 0; |
*retval = 0; |
Line 423 linux_machdepioctl(p, v, retval) |
|
Line 432 linux_machdepioctl(p, v, retval) |
|
syscallarg(u_long) com; |
syscallarg(u_long) com; |
syscallarg(caddr_t) data; |
syscallarg(caddr_t) data; |
} */ *uap = v; |
} */ *uap = v; |
struct sys_ioctl_args bia, tmparg; |
struct sys_ioctl_args bia; |
u_long com; |
u_long com; |
#if NVT > 0 |
#if NVT > 0 |
int error, mode; |
int error; |
struct vt_mode lvt; |
struct vt_mode lvt; |
caddr_t bvtp, sg; |
caddr_t bvtp, sg; |
u_int fd; |
|
struct file *fp; |
|
struct filedesc *fdp; |
|
#endif |
#endif |
|
|
SCARG(&bia, fd) = SCARG(uap, fd); |
SCARG(&bia, fd) = SCARG(uap, fd); |
Line 506 linux_machdepioctl(p, v, retval) |
|
Line 512 linux_machdepioctl(p, v, retval) |
|
break; |
break; |
#endif |
#endif |
default: |
default: |
printf("linux_machdepioctl: invalid ioctl %08x\n", com); |
printf("linux_machdepioctl: invalid ioctl %08lx\n", com); |
return EINVAL; |
return EINVAL; |
} |
} |
SCARG(&bia, com) = com; |
SCARG(&bia, com) = com; |
Line 524 linux_sys_iopl(p, v, retval) |
|
Line 530 linux_sys_iopl(p, v, retval) |
|
void *v; |
void *v; |
register_t *retval; |
register_t *retval; |
{ |
{ |
|
#if 0 |
struct linux_sys_iopl_args /* { |
struct linux_sys_iopl_args /* { |
syscallarg(int) level; |
syscallarg(int) level; |
} */ *uap = v; |
} */ *uap = v; |
|
#endif |
struct trapframe *fp = p->p_md.md_regs; |
struct trapframe *fp = p->p_md.md_regs; |
|
|
if (suser(p->p_ucred, &p->p_acflag) != 0) |
if (suser(p->p_ucred, &p->p_acflag) != 0) |