summaryrefslogtreecommitdiff
path: root/sys/compat
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2007-06-18 22:44:59 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2007-06-18 22:44:59 +0000
commit8beaa41f3752ba1cc4616b14b3d6e74dbfecae0c (patch)
tree4cc65e43cd828ea875804d7799e0f13bb28b239d /sys/compat
parent41c947f49dd85428cfbd249e2084e7c85cf7fcde (diff)
Notes
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/freebsd32/freebsd32.h13
-rw-r--r--sys/compat/freebsd32/freebsd32_misc.c54
-rw-r--r--sys/compat/freebsd32/syscalls.master18
3 files changed, 78 insertions, 7 deletions
diff --git a/sys/compat/freebsd32/freebsd32.h b/sys/compat/freebsd32/freebsd32.h
index 806b2ffc6d94..f37338b4c435 100644
--- a/sys/compat/freebsd32/freebsd32.h
+++ b/sys/compat/freebsd32/freebsd32.h
@@ -103,4 +103,17 @@ struct statfs32 {
int32_t f_spare[2];
};
+struct thr_param32 {
+ uint32_t start_func;
+ uint32_t arg;
+ uint32_t stack_base;
+ uint32_t stack_size;
+ uint32_t tls_base;
+ uint32_t tls_size;
+ uint32_t child_tid;
+ uint32_t parent_tid;
+ int32_t flags;
+ uint32_t spare[4];
+};
+
#endif /* !_COMPAT_FREEBSD32_FREEBSD32_H_ */
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c
index 398d779828c2..becb9b9c3f27 100644
--- a/sys/compat/freebsd32/freebsd32_misc.c
+++ b/sys/compat/freebsd32/freebsd32_misc.c
@@ -2115,6 +2115,60 @@ freebsd32_clock_getres(struct thread *td,
return (error);
}
+int
+freebsd32_thr_new(struct thread *td,
+ struct freebsd32_thr_new_args *uap)
+{
+ struct thr_param32 param32;
+ struct thr_param param;
+ int error;
+
+ if (uap->param_size < 0 ||
+ uap->param_size > sizeof(struct thr_param32))
+ return (EINVAL);
+ bzero(&param, sizeof(struct thr_param));
+ bzero(&param32, sizeof(struct thr_param32));
+ error = copyin(uap->param, &param32, uap->param_size);
+ if (error != 0)
+ return (error);
+ param.start_func = PTRIN(param32.start_func);
+ param.arg = PTRIN(param32.arg);
+ param.stack_base = PTRIN(param32.stack_base);
+ param.stack_size = param32.stack_size;
+ param.tls_base = PTRIN(param32.tls_base);
+ param.tls_size = param32.tls_size;
+ param.child_tid = PTRIN(param32.child_tid);
+ param.parent_tid = PTRIN(param32.parent_tid);
+ param.flags = param32.flags;
+ param.spare[0] = PTRIN(param32.spare[0]);
+ param.spare[1] = PTRIN(param32.spare[1]);
+ param.spare[2] = PTRIN(param32.spare[2]);
+ param.spare[3] = PTRIN(param32.spare[3]);
+
+ return (kern_thr_new(td, &param));
+}
+
+int
+freebsd32_thr_suspend(struct thread *td, struct freebsd32_thr_suspend_args *uap)
+{
+ struct timespec32 ts32;
+ struct timespec ts, *tsp;
+ int error;
+
+ error = 0;
+ tsp = NULL;
+ if (uap->timeout != NULL) {
+ error = copyin((const void *)uap->timeout, (void *)&ts32,
+ sizeof(struct timespec32));
+ if (error != 0)
+ return (error);
+ ts.tv_sec = ts32.tv_sec;
+ ts.tv_nsec = ts32.tv_nsec;
+ tsp = &ts;
+ }
+ return (kern_thr_suspend(td, tsp));
+}
+
#if 0
int
diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master
index 61a4ec8a7418..dff103cca51f 100644
--- a/sys/compat/freebsd32/syscalls.master
+++ b/sys/compat/freebsd32/syscalls.master
@@ -718,21 +718,20 @@
428 AUE_NULL UNIMPL __acl_aclcheck_link
; XXX implement
429 AUE_SIGWAIT UNIMPL sigwait
-430 AUE_NULL MNOPROTO { int thr_create(ucontext_t *ctx, long *id, \
- int flag s); }
+430 AUE_NULL UNIMPL thr_create
431 AUE_NULL MNOPROTO { void thr_exit(long *state); }
432 AUE_NULL MNOPROTO { int thr_self(long *id); }
433 AUE_NULL MNOPROTO { int thr_kill(long id, int sig); }
-434 AUE_NULL MNOPROTO { int _umtx_lock(struct umtx *umtx); }
-435 AUE_NULL MNOPROTO { int _umtx_unlock(struct umtx *umtx); }
+434 AUE_NULL MSTD { int freebsd32_umtx_lock(struct umtx *umtx); }
+435 AUE_NULL MSTD { int freebsd32_umtx_unlock(struct umtx *umtx); }
436 AUE_NULL MNOPROTO { int jail_attach(int jid); }
437 AUE_EXTATTR_LIST_FD UNIMPL extattr_list_fd
438 AUE_EXTATTR_LIST_FILE UNIMPL extattr_list_file
439 AUE_EXTATTR_LIST_LINK UNIMPL extattr_list_link
440 AUE_NULL UNIMPL kse_switchin
441 AUE_NULL UNIMPL ksem_timedwait
-442 AUE_NULL MNOPROTO { int thr_suspend( \
- const struct timespec *timeout); }
+442 AUE_NULL MSTD { int freebsd32_thr_suspend( \
+ const struct timespec32 *timeout); }
443 AUE_NULL MNOPROTO { int thr_wake(long id); }
444 AUE_MODUNLOAD MNOPROTO { int kldunloadf(int fileid, int flags); }
445 AUE_AUDIT MNOPROTO { int audit(const void *record, \
@@ -750,4 +749,9 @@
struct auditinfo_addr *auditinfo_addr, \
u_int length); }
453 AUE_AUDITCTL MNOPROTO { int auditctl(char *path); }
-454 AUE_NULL UNIMPL _umtx_op
+454 AUE_NULL MSTD { int freebsd32_umtx_op(struct umtx *umtx, \
+ int op, long id, void *uaddr, \
+ void *uaddr2); }
+455 AUE_NULL MSTD { int freebsd32_thr_new( \
+ struct thr_param32 *param, \
+ int param_size); }