Implement linux_ioperm() syscall. Fix linux_iopl() to use the level argument.
SVGAlib should now work. Reviewed by: marcel
This commit is contained in:
parent
a66435652d
commit
2323686abc
@ -69,7 +69,6 @@ DUMMY(mpx);
|
||||
DUMMY(ulimit);
|
||||
DUMMY(olduname);
|
||||
DUMMY(ustat);
|
||||
DUMMY(ioperm);
|
||||
DUMMY(ksyslog);
|
||||
DUMMY(uname);
|
||||
DUMMY(vhangup);
|
||||
|
@ -150,8 +150,8 @@
|
||||
struct linux_statfs_buf *buf); }
|
||||
100 STD LINUX { int linux_fstatfs(int fd, \
|
||||
struct linux_statfs_buf *buf); }
|
||||
101 STD LINUX { int linux_ioperm(unsigned int lo, \
|
||||
unsigned int hi, int val); }
|
||||
101 STD LINUX { int linux_ioperm(unsigned int start, \
|
||||
unsigned int length, int enable); }
|
||||
102 STD LINUX { int linux_socketcall(int what, void *args); }
|
||||
103 STD LINUX { int linux_ksyslog(int what); }
|
||||
104 STD LINUX { int linux_setitimer(u_int which, \
|
||||
|
@ -1121,18 +1121,37 @@ linux_getitimer(struct proc *p, struct linux_getitimer_args *args)
|
||||
return getitimer(p, &bsa);
|
||||
}
|
||||
|
||||
int
|
||||
linux_ioperm(struct proc *p, struct linux_ioperm_args *args)
|
||||
{
|
||||
struct sysarch_args sa;
|
||||
struct i386_ioperm_args *iia;
|
||||
caddr_t sg;
|
||||
|
||||
sg = stackgap_init();
|
||||
iia = stackgap_alloc(&sg, sizeof(struct i386_ioperm_args));
|
||||
iia->start = args->start;
|
||||
iia->length = args->length;
|
||||
iia->enable = args->enable;
|
||||
sa.op = I386_SET_IOPERM;
|
||||
sa.parms = (char *)iia;
|
||||
return sysarch(p, &sa);
|
||||
}
|
||||
|
||||
int
|
||||
linux_iopl(struct proc *p, struct linux_iopl_args *args)
|
||||
{
|
||||
int error;
|
||||
|
||||
error = suser(p);
|
||||
if (error != 0)
|
||||
return error;
|
||||
if (args->level < 0 || args->level > 3)
|
||||
return (EINVAL);
|
||||
if ((error = suser(p)) != 0)
|
||||
return (error);
|
||||
if (securelevel > 0)
|
||||
return EPERM;
|
||||
p->p_md.md_regs->tf_eflags |= PSL_IOPL;
|
||||
return 0;
|
||||
return (EPERM);
|
||||
p->p_md.md_regs->tf_eflags = (p->p_md.md_regs->tf_eflags & ~PSL_IOPL) |
|
||||
(args->level * (PSL_IOPL / 3));
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -69,7 +69,6 @@ DUMMY(mpx);
|
||||
DUMMY(ulimit);
|
||||
DUMMY(olduname);
|
||||
DUMMY(ustat);
|
||||
DUMMY(ioperm);
|
||||
DUMMY(ksyslog);
|
||||
DUMMY(uname);
|
||||
DUMMY(vhangup);
|
||||
|
@ -1121,18 +1121,37 @@ linux_getitimer(struct proc *p, struct linux_getitimer_args *args)
|
||||
return getitimer(p, &bsa);
|
||||
}
|
||||
|
||||
int
|
||||
linux_ioperm(struct proc *p, struct linux_ioperm_args *args)
|
||||
{
|
||||
struct sysarch_args sa;
|
||||
struct i386_ioperm_args *iia;
|
||||
caddr_t sg;
|
||||
|
||||
sg = stackgap_init();
|
||||
iia = stackgap_alloc(&sg, sizeof(struct i386_ioperm_args));
|
||||
iia->start = args->start;
|
||||
iia->length = args->length;
|
||||
iia->enable = args->enable;
|
||||
sa.op = I386_SET_IOPERM;
|
||||
sa.parms = (char *)iia;
|
||||
return sysarch(p, &sa);
|
||||
}
|
||||
|
||||
int
|
||||
linux_iopl(struct proc *p, struct linux_iopl_args *args)
|
||||
{
|
||||
int error;
|
||||
|
||||
error = suser(p);
|
||||
if (error != 0)
|
||||
return error;
|
||||
if (args->level < 0 || args->level > 3)
|
||||
return (EINVAL);
|
||||
if ((error = suser(p)) != 0)
|
||||
return (error);
|
||||
if (securelevel > 0)
|
||||
return EPERM;
|
||||
p->p_md.md_regs->tf_eflags |= PSL_IOPL;
|
||||
return 0;
|
||||
return (EPERM);
|
||||
p->p_md.md_regs->tf_eflags = (p->p_md.md_regs->tf_eflags & ~PSL_IOPL) |
|
||||
(args->level * (PSL_IOPL / 3));
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -150,8 +150,8 @@
|
||||
struct linux_statfs_buf *buf); }
|
||||
100 STD LINUX { int linux_fstatfs(int fd, \
|
||||
struct linux_statfs_buf *buf); }
|
||||
101 STD LINUX { int linux_ioperm(unsigned int lo, \
|
||||
unsigned int hi, int val); }
|
||||
101 STD LINUX { int linux_ioperm(unsigned int start, \
|
||||
unsigned int length, int enable); }
|
||||
102 STD LINUX { int linux_socketcall(int what, void *args); }
|
||||
103 STD LINUX { int linux_ksyslog(int what); }
|
||||
104 STD LINUX { int linux_setitimer(u_int which, \
|
||||
|
Loading…
x
Reference in New Issue
Block a user