diff options
author | Brooks Davis <brooks@FreeBSD.org> | 2008-07-10 17:45:57 +0000 |
---|---|---|
committer | Brooks Davis <brooks@FreeBSD.org> | 2008-07-10 17:45:57 +0000 |
commit | a8c6d6d0baa2000923870fa694fca1bc4908ff37 (patch) | |
tree | fe960c8d9af7223fd38154e3ae4410aabff22d62 /sys/compat/freebsd32 | |
parent | f55ffb399099f25810b65311f1cc8a9f9174170c (diff) |
id_t is a 64-bit integer and thus is passed as two arguments like off_t is.
As a result, those arguments must be recombined before calling the real
syscal implementation. This change fixes 32-bit compatibility for
cpuset_getid(), cpuset_setid(), cpuset_getaffinity(), and
cpuset_setaffinity().
Notes
Notes:
svn path=/head/; revision=180433
Diffstat (limited to 'sys/compat/freebsd32')
-rw-r--r-- | sys/compat/freebsd32/freebsd32_misc.c | 57 | ||||
-rw-r--r-- | sys/compat/freebsd32/syscalls.master | 20 |
2 files changed, 70 insertions, 7 deletions
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 59bfb052e091..38af6513ca1e 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -2495,6 +2495,63 @@ freebsd32_sigwaitinfo(struct thread *td, struct freebsd32_sigwaitinfo_args *uap) return (error); } +int +freebsd32_cpuset_setid(struct thread *td, + struct freebsd32_cpuset_setid_args *uap) +{ + struct cpuset_setid_args ap; + + ap.which = uap->which; + ap.id = (uap->idlo | ((id_t)uap->idhi << 32)); + ap.setid = uap->setid; + + return cpuset_setid(td, &ap); +} + +int +freebsd32_cpuset_getid(struct thread *td, + struct freebsd32_cpuset_getid_args *uap) +{ + struct cpuset_getid_args ap; + + ap.level = uap->level; + ap.which = uap->which; + ap.id = (uap->idlo | ((id_t)uap->idhi << 32)); + ap.setid = uap->setid; + + return cpuset_getid(td, &ap); +} + +int +freebsd32_cpuset_getaffinity(struct thread *td, + struct freebsd32_cpuset_getaffinity_args *uap) +{ + struct cpuset_getaffinity_args ap; + + ap.level = uap->level; + ap.which = uap->which; + ap.id = (uap->idlo | ((id_t)uap->idhi << 32)); + ap.cpusetsize = uap->cpusetsize; + ap.mask = uap->mask; + + return cpuset_getaffinity(td, &ap); +} + +int +freebsd32_cpuset_setaffinity(struct thread *td, + struct freebsd32_cpuset_setaffinity_args *uap) +{ + struct cpuset_setaffinity_args ap; + + ap.level = uap->level; + ap.which = uap->which; + ap.id = (uap->idlo | ((id_t)uap->idhi << 32)); + ap.cpusetsize = uap->cpusetsize; + ap.mask = uap->mask; + + return cpuset_setaffinity(td, &ap); +} + #if 0 int diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master index 85cb62668f52..5ab7e423f03e 100644 --- a/sys/compat/freebsd32/syscalls.master +++ b/sys/compat/freebsd32/syscalls.master @@ -799,16 +799,22 @@ mode_t mode); } 483 AUE_SHMUNLINK NOPROTO { int shm_unlink(const char *path); } 484 AUE_NULL NOPROTO { int cpuset(cpusetid_t *setid); } -485 AUE_NULL NOPROTO { int cpuset_setid(cpuwhich_t which, id_t id, \ +485 AUE_NULL STD { int freebsd32_cpuset_setid(cpuwhich_t which, \ + uint32_t idlo, uint32_t idhi, \ cpusetid_t setid); } -486 AUE_NULL NOPROTO { int cpuset_getid(cpulevel_t level, \ - cpuwhich_t which, id_t id, \ +486 AUE_NULL STD { int freebsd32_cpuset_getid(cpulevel_t level, \ + cpuwhich_t which, \ + uint32_t idlo, uint32_t idhi, \ cpusetid_t *setid); } -487 AUE_NULL NOPROTO { int cpuset_getaffinity(cpulevel_t level, \ - cpuwhich_t which, id_t id, size_t cpusetsize, \ +487 AUE_NULL STD { int freebsd32_cpuset_getaffinity( \ + cpulevel_t level, cpuwhich_t which, \ + uint32_t idlo, uint32_t idhi, \ + size_t cpusetsize, \ cpuset_t *mask); } -488 AUE_NULL NOPROTO { int cpuset_setaffinity(cpulevel_t level, \ - cpuwhich_t which, id_t id, size_t cpusetsize, \ +488 AUE_NULL STD { int freebsd32_cpuset_setaffinity( \ + cpulevel_t level, cpuwhich_t which, \ + uint32_t idlo, uint32_t idhi, \ + size_t cpusetsize, \ const cpuset_t *mask); } 489 AUE_FACCESSAT NOPROTO { int faccessat(int fd, char *path, int mode, \ int flag); } |