- Push down Giant into the sysarch() calls that still need Giant.

- Standardize on EINVAL rather than EOPNOTSUPP if the sysarch op value is
  invalid.
This commit is contained in:
John Baldwin 2003-04-25 20:04:02 +00:00
parent 17b8a8a77a
commit 7ff022c485
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=114029
6 changed files with 15 additions and 8 deletions

View File

@ -77,7 +77,7 @@ sysarch(td, uap)
struct thread *td;
register struct sysarch_args *uap;
{
int error = 0;
int error;
switch(uap->op) {
case ALPHA_SETHAE:

View File

@ -88,8 +88,9 @@ sysarch(td, uap)
struct thread *td;
register struct sysarch_args *uap;
{
int error = 0;
int error;
mtx_lock(&Giant);
switch(uap->op) {
case I386_GET_LDT:
error = i386_get_ldt(td, uap->parms);
@ -108,9 +109,10 @@ sysarch(td, uap)
error = vm86_sysarch(td, uap->parms);
break;
default:
error = EOPNOTSUPP;
error = EINVAL;
break;
}
mtx_unlock(&Giant);
return (error);
}

View File

@ -88,8 +88,9 @@ sysarch(td, uap)
struct thread *td;
register struct sysarch_args *uap;
{
int error = 0;
int error;
mtx_lock(&Giant);
switch(uap->op) {
case I386_GET_LDT:
error = i386_get_ldt(td, uap->parms);
@ -108,9 +109,10 @@ sysarch(td, uap)
error = vm86_sysarch(td, uap->parms);
break;
default:
error = EOPNOTSUPP;
error = EINVAL;
break;
}
mtx_unlock(&Giant);
return (error);
}

View File

@ -68,7 +68,7 @@ sysarch(td, uap)
struct thread *td;
register struct sysarch_args *uap;
{
int error = 0;
int error;
switch(uap->op) {
default:

View File

@ -35,5 +35,5 @@ int
sysarch(struct thread *td, struct sysarch_args *uap)
{
return (EOPNOTSUPP);
return (EINVAL);
}

View File

@ -28,7 +28,9 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/sysproto.h>
@ -50,7 +52,7 @@ sysarch(struct thread *td, struct sysarch_args *uap)
{
int error;
error = 0;
mtx_lock(&Giant);
switch (uap->op) {
case SPARC_SIGTRAMP_INSTALL:
error = sparc_sigtramp_install(td, uap->parms);
@ -62,6 +64,7 @@ sysarch(struct thread *td, struct sysarch_args *uap)
error = EINVAL;
break;
}
mtx_unlock(&Giant);
return (error);
}