Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Sep 2014 09:41:23 -0600 (MDT)
From:      Warren Block <wblock@wonkity.com>
To:        =?ISO-8859-15?Q?Dag-Erling_Sm=F8rgrav?= <des@des.no>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warren Block <wblock@FreeBSD.org>
Subject:   Re: svn commit: r271434 - head/etc
Message-ID:  <alpine.BSF.2.11.1409230928340.71831@wonkity.com>
In-Reply-To: <86bnq6ssdv.fsf@nine.des.no>
References:  <201409111824.s8BIOGOE078057@svn.freebsd.org> <86bnq6ssdv.fsf@nine.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 23 Sep 2014, Dag-Erling Smørgrav wrote:

> Warren Block <wblock@FreeBSD.org> writes:
>> +Security advisories and errata: https://www.FreeBSD.org/releases/
>> +Handbook:     https://www.FreeBSD.org/handbook/
>> +FAQ:          https://www.FreeBSD.org/faq/
>> +Mailing list: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/
>> +Forums:       https://forums.FreeBSD.org/
>
> Non-bikesheddy: the first line is wrong.

Could you be more specific about that?  It is an abbreviated form of 
"Links to security advisories and errata are available at".  Maybe you 
mean that it does not link directly to the security advisories?

>  The fourth line is only half true.

An abbreviated form of "the mailing list for asking general questions".

> Bikesheddy: the rest of the file should be replaced with a link to a
> "getting started" article.

This was discussed a bit in the threads on -arch.
From owner-svn-src-all@FreeBSD.ORG  Tue Sep 23 16:04:01 2014
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E2497722;
 Tue, 23 Sep 2014 16:04:01 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C1C3C202;
 Tue, 23 Sep 2014 16:04:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NG41fX065992;
 Tue, 23 Sep 2014 16:04:01 GMT (envelope-from bz@FreeBSD.org)
Received: (from bz@localhost)
 by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NG3wVK065938;
 Tue, 23 Sep 2014 16:03:58 GMT (envelope-from bz@FreeBSD.org)
Message-Id: <201409231603.s8NG3wVK065938@svn.freebsd.org>
X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org
 using -f
From: "Bjoern A. Zeeb" <bz@FreeBSD.org>
Date: Tue, 23 Sep 2014 16:03:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r272029 - in stable/9/sys: amd64/linux32 compat/linux
 conf i386/linux kern modules/linux sys
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.18-1
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>;
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 23 Sep 2014 16:04:02 -0000

Author: bz
Date: Tue Sep 23 16:03:57 2014
New Revision: 272029
URL: http://svnweb.freebsd.org/changeset/base/272029

Log:
  MFC r269669,271743:
  
   Split up sys_ktimer_getoverrun() into a sys_ and a kern_ variant
   and export the kern_ version needed by an upcoming linuxolator change.
  
   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.
  
   Reviewed by:		jhb
   Differential Revision:	D784
  Sponsored by:	DARPA/AFRL

Added:
  stable/9/sys/compat/linux/linux_timer.c
     - copied unchanged from r271743, head/sys/compat/linux/linux_timer.c
  stable/9/sys/compat/linux/linux_timer.h
     - copied unchanged from r271743, head/sys/compat/linux/linux_timer.h
Modified:
  stable/9/sys/amd64/linux32/linux.h
  stable/9/sys/amd64/linux32/linux32_dummy.c
  stable/9/sys/amd64/linux32/syscalls.master
  stable/9/sys/conf/files.amd64
  stable/9/sys/conf/files.i386
  stable/9/sys/conf/files.pc98
  stable/9/sys/i386/linux/linux.h
  stable/9/sys/i386/linux/linux_machdep.c
  stable/9/sys/i386/linux/syscalls.master
  stable/9/sys/kern/kern_time.c
  stable/9/sys/modules/linux/Makefile
  stable/9/sys/sys/syscallsubr.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/modules/   (props changed)
  stable/9/sys/sys/   (props changed)

Modified: stable/9/sys/amd64/linux32/linux.h
==============================================================================
--- stable/9/sys/amd64/linux32/linux.h	Tue Sep 23 13:58:39 2014	(r272028)
+++ stable/9/sys/amd64/linux32/linux.h	Tue Sep 23 16:03:57 2014	(r272029)
@@ -61,6 +61,11 @@ MALLOC_DECLARE(M_LINUX);
 #define	PTRIN(v)	(void *)(uintptr_t)(v)
 #define	PTROUT(v)	(l_uintptr_t)(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.
  */

Modified: stable/9/sys/amd64/linux32/linux32_dummy.c
==============================================================================
--- stable/9/sys/amd64/linux32/linux32_dummy.c	Tue Sep 23 13:58:39 2014	(r272028)
+++ stable/9/sys/amd64/linux32/linux32_dummy.c	Tue Sep 23 16:03:57 2014	(r272029)
@@ -74,11 +74,6 @@ DUMMY(epoll_create);
 DUMMY(epoll_ctl);
 DUMMY(epoll_wait);
 DUMMY(remap_file_pages);
-DUMMY(timer_create);
-DUMMY(timer_settime);
-DUMMY(timer_gettime);
-DUMMY(timer_getoverrun);
-DUMMY(timer_delete);
 DUMMY(fstatfs64);
 DUMMY(mbind);
 DUMMY(get_mempolicy);

Modified: stable/9/sys/amd64/linux32/syscalls.master
==============================================================================
--- stable/9/sys/amd64/linux32/syscalls.master	Tue Sep 23 13:58:39 2014	(r272028)
+++ stable/9/sys/amd64/linux32/syscalls.master	Tue Sep 23 16:03:57 2014	(r272029)
@@ -435,11 +435,13 @@
 256	AUE_NULL	STD	{ int linux_epoll_wait(void); }
 257	AUE_NULL	STD	{ int linux_remap_file_pages(void); }
 258	AUE_NULL	STD	{ int linux_set_tid_address(int *tidptr); }
-259	AUE_NULL	STD	{ int linux_timer_create(void); }
-260	AUE_NULL	STD	{ int linux_timer_settime(void); }
-261	AUE_NULL	STD	{ int linux_timer_gettime(void); }
-262	AUE_NULL	STD	{ int linux_timer_getoverrun(void); }
-263	AUE_NULL	STD	{ int linux_timer_delete(void); }
+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, 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); }
+263	AUE_NULL	STD	{ int linux_timer_delete(l_timer_t timerid); }
 264	AUE_CLOCK_SETTIME	STD	{ int linux_clock_settime(clockid_t which, struct l_timespec *tp); }
 265	AUE_NULL	STD	{ int linux_clock_gettime(clockid_t which, struct l_timespec *tp); }
 266	AUE_NULL	STD	{ int linux_clock_getres(clockid_t which, struct l_timespec *tp); }

Copied: stable/9/sys/compat/linux/linux_timer.c (from r271743, head/sys/compat/linux/linux_timer.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/9/sys/compat/linux/linux_timer.c	Tue Sep 23 16:03:57 2014	(r272029, copy of r271743, head/sys/compat/linux/linux_timer.c)
@@ -0,0 +1,182 @@
+/*-
+ * Copyright (c) 2014 Bjoern A. Zeeb
+ * All rights reserved.
+ *
+ * This software was developed by SRI International and the University of
+ * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-11-C-0249
+ * ("MRC2"), as part of the DARPA MRC research programme.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "opt_compat.h"
+
+#include <sys/param.h>
+#include <sys/errno.h>
+#include <sys/signal.h>
+#include <sys/syscallsubr.h>
+#include <sys/systm.h>
+#include <sys/time.h>
+#include <sys/types.h>
+
+#ifdef COMPAT_LINUX32
+#include <machine/../linux32/linux.h>
+#include <machine/../linux32/linux32_proto.h>
+#else
+#include <machine/../linux/linux.h>
+#include <machine/../linux/linux_proto.h>
+#endif
+#include <compat/linux/linux_timer.h>
+
+static int
+linux_convert_l_clockid(clockid_t *clock_id)
+{
+
+	switch (*clock_id) {
+	case LINUX_CLOCK_REALTIME:
+		*clock_id = CLOCK_REALTIME;
+		break;
+	case LINUX_CLOCK_MONOTONIC:
+		*clock_id = CLOCK_MONOTONIC;
+		break;
+	default:
+		return (EINVAL);
+	}
+
+	return (0);
+}
+
+static int
+linux_convert_l_sigevent(struct l_sigevent *l_sig, struct sigevent *sig)
+{
+
+	CP(*l_sig, *sig, sigev_notify);
+	switch (l_sig->sigev_notify) {
+	case L_SIGEV_SIGNAL:
+		sig->sigev_notify = SIGEV_SIGNAL;
+		CP(*l_sig, *sig, sigev_signo);
+		PTRIN_CP(*l_sig, *sig, sigev_value.sival_ptr);
+		break;
+	case L_SIGEV_NONE:
+		sig->sigev_notify = SIGEV_NONE;
+		break;
+	case L_SIGEV_THREAD:
+#if 0
+		/* Seems to not be used anywhere (anymore)? */
+		sig->sigev_notify = SIGEV_THREAD;
+		return (ENOSYS);
+#else
+		return (EINVAL);
+#endif
+	case L_SIGEV_THREAD_ID:
+		sig->sigev_notify = SIGEV_THREAD_ID;
+		CP2(*l_sig, *sig, _l_sigev_un._tid, sigev_notify_thread_id);
+		CP(*l_sig, *sig, sigev_signo);
+		PTRIN_CP(*l_sig, *sig, sigev_value.sival_ptr);
+		break;
+	default:
+		return (EINVAL);
+	}
+	return (0);
+}
+
+int
+linux_timer_create(struct thread *td, struct linux_timer_create_args *uap)
+{
+	struct l_sigevent l_ev;
+	struct sigevent ev, *evp;
+	int error, id;
+
+	if (uap->evp == NULL) {
+		evp = NULL;
+	} else {
+		error = copyin(uap->evp, &l_ev, sizeof(l_ev));
+		if (error != 0)
+			return (error);
+		error = linux_convert_l_sigevent(&l_ev, &ev);
+		if (error != 0)
+			return (error);
+		evp = &ev;
+	}
+	error = linux_convert_l_clockid(&uap->clock_id);
+	if (error != 0)
+		return (error);
+	error = kern_ktimer_create(td, uap->clock_id, evp, &id, -1);
+	if (error == 0) {
+		error = copyout(&id, uap->timerid, sizeof(int));
+		if (error != 0)
+			kern_ktimer_delete(td, id);
+	}
+	return (error);
+}
+
+int
+linux_timer_settime(struct thread *td, struct linux_timer_settime_args *uap)
+{
+	struct l_itimerspec l_val, l_oval;
+	struct itimerspec val, oval, *ovalp;
+	int error;
+
+	error = copyin(uap->new, &l_val, sizeof(l_val));
+	if (error != 0)
+		return (error);
+	ITS_CP(l_val, val);
+	ovalp = uap->old != NULL ? &oval : NULL;
+	error = kern_ktimer_settime(td, uap->timerid, uap->flags, &val, ovalp);
+	if (error == 0 && uap->old != NULL) {
+		ITS_CP(oval, l_oval);
+		error = copyout(&l_oval, uap->old, sizeof(l_oval));
+	}
+	return (error);
+}
+
+int
+linux_timer_gettime(struct thread *td, struct linux_timer_gettime_args *uap)
+{
+	struct l_itimerspec l_val;
+	struct itimerspec val;
+	int error;
+
+	error = kern_ktimer_gettime(td, uap->timerid, &val);
+	if (error == 0) {
+		ITS_CP(val, l_val);
+		error = copyout(&l_val, uap->setting, sizeof(l_val));
+	}
+	return (error);
+}
+
+int
+linux_timer_getoverrun(struct thread *td, struct linux_timer_getoverrun_args *uap)
+{
+
+	return (kern_ktimer_getoverrun(td, uap->timerid));
+}
+
+int
+linux_timer_delete(struct thread *td, struct linux_timer_delete_args *uap)
+{
+
+	return (kern_ktimer_delete(td, uap->timerid));
+}
+

Copied: stable/9/sys/compat/linux/linux_timer.h (from r271743, head/sys/compat/linux/linux_timer.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/9/sys/compat/linux/linux_timer.h	Tue Sep 23 16:03:57 2014	(r272029, copy of r271743, head/sys/compat/linux/linux_timer.h)
@@ -0,0 +1,97 @@
+/*-
+ * Copyright (c) 2014 Bjoern A. Zeeb
+ * All rights reserved.
+ *
+ * This software was developed by SRI International and the University of
+ * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-11-C-0249
+ * ("MRC2"), as part of the DARPA MRC research programme.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef	_LINUX_TIMER_H
+#define	_LINUX_TIMER_H
+
+#ifndef	__LINUX_ARCH_SIGEV_PREAMBLE_SIZE
+#define	__LINUX_ARCH_SIGEV_PREAMBLE_SIZE	\
+	(sizeof(l_int) * 2 + sizeof(l_sigval_t))
+#endif
+
+#define	LINUX_SIGEV_MAX_SIZE			64
+#define	LINUX_SIGEV_PAD_SIZE			\
+	((LINUX_SIGEV_MAX_SIZE - __LINUX_ARCH_SIGEV_PREAMBLE_SIZE) / \
+	sizeof(l_int))
+
+#define	LINUX_CLOCK_REALTIME			0
+#define	LINUX_CLOCK_MONOTONIC			1
+#define	LINUX_CLOCK_PROCESS_CPUTIME_ID		2
+#define	LINUX_CLOCK_THREAD_CPUTIME_ID		3
+#define	LINUX_CLOCK_MONOTONIC_RAW		4
+#define	LINUX_CLOCK_REALTIME_COARSE		5
+#define	LINUX_CLOCK_MONOTONIC_COARSE		6
+#define	LINUX_CLOCK_BOOTTIME			7
+#define	LINUX_CLOCK_REALTIME_ALARM		8
+#define	LINUX_CLOCK_BOOTTIME_ALARM		9
+#define	LINUX_CLOCK_SGI_CYCLE			10
+#define	LINUX_CLOCK_TAI				11
+
+#define	L_SIGEV_SIGNAL				0
+#define	L_SIGEV_NONE				1
+#define	L_SIGEV_THREAD				2
+#define	L_SIGEV_THREAD_ID			4
+
+#define	TS_CP(src,dst,fld) do {			\
+	CP((src).fld,(dst).fld,tv_sec);		\
+	CP((src).fld,(dst).fld,tv_nsec);	\
+} while (0)
+
+#define	ITS_CP(src, dst) do {			\
+	TS_CP((src), (dst), it_interval);	\
+	TS_CP((src), (dst), it_value);		\
+} while (0)
+
+struct l_sigevent {
+	l_sigval_t sigev_value;
+	l_int sigev_signo;
+	l_int sigev_notify;
+	union {
+		l_int _pad[LINUX_SIGEV_PAD_SIZE];
+		l_int _tid;
+		struct {
+			l_uintptr_t _function;
+			l_uintptr_t _attribute;
+		} _l_sigev_thread;
+	} _l_sigev_un;
+}
+#if defined(__amd64__) && defined(COMPAT_LINUX32)
+__packed
+#endif
+;
+
+struct l_itimerspec {
+	struct l_timespec it_interval;
+	struct l_timespec it_value;
+};
+
+#endif	/* _LINUX_TIMER_H */

Modified: stable/9/sys/conf/files.amd64
==============================================================================
--- stable/9/sys/conf/files.amd64	Tue Sep 23 13:58:39 2014	(r272028)
+++ stable/9/sys/conf/files.amd64	Tue Sep 23 16:03:57 2014	(r272029)
@@ -477,6 +477,7 @@ compat/linux/linux_socket.c	optional	com
 compat/linux/linux_stats.c	optional	compat_linux32
 compat/linux/linux_sysctl.c	optional	compat_linux32
 compat/linux/linux_time.c	optional	compat_linux32
+compat/linux/linux_timer.c	optional	compat_linux32
 compat/linux/linux_uid16.c	optional	compat_linux32
 compat/linux/linux_util.c	optional	compat_linux32
 dev/amr/amr_linux.c		optional	compat_linux32 amr

Modified: stable/9/sys/conf/files.i386
==============================================================================
--- stable/9/sys/conf/files.i386	Tue Sep 23 13:58:39 2014	(r272028)
+++ stable/9/sys/conf/files.i386	Tue Sep 23 16:03:57 2014	(r272029)
@@ -93,6 +93,7 @@ compat/linux/linux_socket.c	optional com
 compat/linux/linux_stats.c	optional compat_linux
 compat/linux/linux_sysctl.c	optional compat_linux
 compat/linux/linux_time.c	optional compat_linux
+compat/linux/linux_timer.c	optional compat_linux
 compat/linux/linux_uid16.c	optional compat_linux
 compat/linux/linux_util.c	optional compat_linux
 compat/ndis/kern_ndis.c		optional ndisapi pci

Modified: stable/9/sys/conf/files.pc98
==============================================================================
--- stable/9/sys/conf/files.pc98	Tue Sep 23 13:58:39 2014	(r272028)
+++ stable/9/sys/conf/files.pc98	Tue Sep 23 16:03:57 2014	(r272029)
@@ -54,6 +54,7 @@ compat/linux/linux_socket.c	optional com
 compat/linux/linux_stats.c	optional compat_linux
 compat/linux/linux_sysctl.c	optional compat_linux
 compat/linux/linux_time.c	optional compat_linux
+compat/linux/linux_timer.c	optional compat_linux
 compat/linux/linux_uid16.c	optional compat_linux
 compat/linux/linux_util.c	optional compat_linux
 compat/svr4/imgact_svr4.c	optional compat_svr4

Modified: stable/9/sys/i386/linux/linux.h
==============================================================================
--- stable/9/sys/i386/linux/linux.h	Tue Sep 23 13:58:39 2014	(r272028)
+++ stable/9/sys/i386/linux/linux.h	Tue Sep 23 16:03:57 2014	(r272029)
@@ -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.
  */

Modified: stable/9/sys/i386/linux/linux_machdep.c
==============================================================================
--- stable/9/sys/i386/linux/linux_machdep.c	Tue Sep 23 13:58:39 2014	(r272028)
+++ stable/9/sys/i386/linux/linux_machdep.c	Tue Sep 23 16:03:57 2014	(r272029)
@@ -977,37 +977,6 @@ linux_get_thread_area(struct thread *td,
 	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)

Modified: stable/9/sys/i386/linux/syscalls.master
==============================================================================
--- stable/9/sys/i386/linux/syscalls.master	Tue Sep 23 13:58:39 2014	(r272028)
+++ stable/9/sys/i386/linux/syscalls.master	Tue Sep 23 16:03:57 2014	(r272029)
@@ -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); }

Modified: stable/9/sys/kern/kern_time.c
==============================================================================
--- stable/9/sys/kern/kern_time.c	Tue Sep 23 13:58:39 2014	(r272028)
+++ stable/9/sys/kern/kern_time.c	Tue Sep 23 16:03:57 2014	(r272029)
@@ -1340,13 +1340,20 @@ struct timer_getoverrun_args {
 int
 sys_ktimer_getoverrun(struct thread *td, struct ktimer_getoverrun_args *uap)
 {
+
+	return (kern_ktimer_getoverrun(td, uap->timerid));
+}
+
+int
+kern_ktimer_getoverrun(struct thread *td, int timer_id)
+{
 	struct proc *p = td->td_proc;
 	struct itimer *it;
 	int error ;
 
 	PROC_LOCK(p);
-	if (uap->timerid < 3 ||
-	    (it = itimer_find(p, uap->timerid)) == NULL) {
+	if (timer_id < 3 ||
+	    (it = itimer_find(p, timer_id)) == NULL) {
 		PROC_UNLOCK(p);
 		error = EINVAL;
 	} else {

Modified: stable/9/sys/modules/linux/Makefile
==============================================================================
--- stable/9/sys/modules/linux/Makefile	Tue Sep 23 13:58:39 2014	(r272028)
+++ stable/9/sys/modules/linux/Makefile	Tue Sep 23 16:03:57 2014	(r272029)
@@ -13,6 +13,7 @@ SRCS=	linux_fork.c linux${SFX}_dummy.c l
 	linux${SFX}_machdep.c linux_mib.c linux_misc.c linux_signal.c \
 	linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \
 	linux${SFX}_sysvec.c linux_uid16.c linux_util.c linux_time.c \
+	linux_timer.c \
 	opt_inet6.h opt_compat.h opt_kdtrace.h opt_posix.h opt_usb.h \
 	vnode_if.h device_if.h bus_if.h assym.s
 

Modified: stable/9/sys/sys/syscallsubr.h
==============================================================================
--- stable/9/sys/sys/syscallsubr.h	Tue Sep 23 13:58:39 2014	(r272028)
+++ stable/9/sys/sys/syscallsubr.h	Tue Sep 23 16:03:57 2014	(r272029)
@@ -233,6 +233,7 @@ int	kern_ktimer_settime(struct thread *t
 	    struct itimerspec *val, struct itimerspec *oval);
 int	kern_ktimer_gettime(struct thread *td, int timer_id,
 	    struct itimerspec *val);
+int	kern_ktimer_getoverrun(struct thread *td, int timer_id);
 int	kern_thr_new(struct thread *td, struct thr_param *param);
 int	kern_thr_suspend(struct thread *td, struct timespec *tsp);
 int	kern_truncate(struct thread *td, char *path, enum uio_seg pathseg,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.11.1409230928340.71831>