aboutsummaryrefslogtreecommitdiff
path: root/sys/i386/linux
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2014-09-18 08:36:45 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2014-09-18 08:36:45 +0000
commit0a041f3b473b7155dcf80be6906550ea46d9b0e7 (patch)
tree61eb5bb3f31f81fe5a1bfacf9258573e6ba1c63a /sys/i386/linux
parent5d99eb5926d63948e4cacd8898ba9de34bf7e0b1 (diff)
downloadsrc-0a041f3b473b7155dcf80be6906550ea46d9b0e7.tar.gz
src-0a041f3b473b7155dcf80be6906550ea46d9b0e7.zip
Implement most of timer_{create,settime,gettime,getoverrun,delete}
for amd64/linux32. Fix the entirely bogus (untested) version from r161310 for i386/linux using the same shared code in compat/linux. It is unclear to me if we could support more clock mappings but the current set allows me to successfully run commercial 32bit linux software under linuxolator on amd64. Reviewed by: jhb Differential Revision: D784 MFC after: 3 days Sponsored by: DARPA, AFRL
Notes
Notes: svn path=/head/; revision=271743
Diffstat (limited to 'sys/i386/linux')
-rw-r--r--sys/i386/linux/linux.h5
-rw-r--r--sys/i386/linux/linux_machdep.c31
-rw-r--r--sys/i386/linux/syscalls.master2
3 files changed, 6 insertions, 32 deletions
diff --git a/sys/i386/linux/linux.h b/sys/i386/linux/linux.h
index 87d419f76dcc..27eff3255c15 100644
--- a/sys/i386/linux/linux.h
+++ b/sys/i386/linux/linux.h
@@ -54,6 +54,11 @@ MALLOC_DECLARE(M_LINUX);
#define PTRIN(v) (void *)(v)
#define PTROUT(v) (l_uintptr_t)(v)
+#define CP(src,dst,fld) do { (dst).fld = (src).fld; } while (0)
+#define CP2(src,dst,sfld,dfld) do { (dst).dfld = (src).sfld; } while (0)
+#define PTRIN_CP(src,dst,fld) \
+ do { (dst).fld = PTRIN((src).fld); } while (0)
+
/*
* Provide a separate set of types for the Linux types.
*/
diff --git a/sys/i386/linux/linux_machdep.c b/sys/i386/linux/linux_machdep.c
index 5d6972906336..d9c28d9483da 100644
--- a/sys/i386/linux/linux_machdep.c
+++ b/sys/i386/linux/linux_machdep.c
@@ -980,37 +980,6 @@ linux_get_thread_area(struct thread *td, struct linux_get_thread_area_args *args
return (0);
}
-/* copied from kern/kern_time.c */
-int
-linux_timer_create(struct thread *td, struct linux_timer_create_args *args)
-{
- return sys_ktimer_create(td, (struct ktimer_create_args *) args);
-}
-
-int
-linux_timer_settime(struct thread *td, struct linux_timer_settime_args *args)
-{
- return sys_ktimer_settime(td, (struct ktimer_settime_args *) args);
-}
-
-int
-linux_timer_gettime(struct thread *td, struct linux_timer_gettime_args *args)
-{
- return sys_ktimer_gettime(td, (struct ktimer_gettime_args *) args);
-}
-
-int
-linux_timer_getoverrun(struct thread *td, struct linux_timer_getoverrun_args *args)
-{
- return sys_ktimer_getoverrun(td, (struct ktimer_getoverrun_args *) args);
-}
-
-int
-linux_timer_delete(struct thread *td, struct linux_timer_delete_args *args)
-{
- return sys_ktimer_delete(td, (struct ktimer_delete_args *) args);
-}
-
/* XXX: this wont work with module - convert it */
int
linux_mq_open(struct thread *td, struct linux_mq_open_args *args)
diff --git a/sys/i386/linux/syscalls.master b/sys/i386/linux/syscalls.master
index bb1716638639..0b119bf5620b 100644
--- a/sys/i386/linux/syscalls.master
+++ b/sys/i386/linux/syscalls.master
@@ -439,7 +439,7 @@
258 AUE_NULL STD { int linux_set_tid_address(int *tidptr); }
259 AUE_NULL STD { int linux_timer_create(clockid_t clock_id, \
struct sigevent *evp, l_timer_t *timerid); }
-260 AUE_NULL STD { int linux_timer_settime(l_timer_t timerid, \
+260 AUE_NULL STD { int linux_timer_settime(l_timer_t timerid, l_int flags, \
const struct itimerspec *new, struct itimerspec *old); }
261 AUE_NULL STD { int linux_timer_gettime(l_timer_t timerid, struct itimerspec *setting); }
262 AUE_NULL STD { int linux_timer_getoverrun(l_timer_t timerid); }