From nobody Wed May 04 10:08:06 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2A55B1AAA14E; Wed, 4 May 2022 10:08:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KtXZt5dGkz4dB3; Wed, 4 May 2022 10:08:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651658887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=06XH5bs3UjmFnb5+xFy85tfsXtTs6QUvk0ViLRiL0Aw=; b=aJWSqhG8Ik9iz6NUbx5W4COih95Vyv5NOvizFfybfDOC/Hv5JWXZZFqVtYQIwpCcxilhQV 0mJ0lZa6qGpAC8IWERWtbnb2xCV7o36o4OeaLj1A3lLn7IDj0dQoRbLLvwKYbl/M8zOWf1 0V8Y1o5cRzvGpuD9/Zb1iVKIZb3zgz4dmV2Rua4Ngbwj9x6bmr/GbMBEybtG+cG3HvQ25w BnhP/WLwvTke7GZy9Ao/YUbHY4ymhBZk7knY7q9Hxs0j4fqVnmO2wkHpqZyD+KWaQcP2U0 J1oDtFd6vMM4b2dQbL7cIL7R0H8QaDcqwmQNIcmL/qRw4xzNI6A94I+/4UF8kA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FCC6110E5; Wed, 4 May 2022 10:08:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 244A861F000283; Wed, 4 May 2022 10:08:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 244A86nn000282; Wed, 4 May 2022 10:08:06 GMT (envelope-from git) Date: Wed, 4 May 2022 10:08:06 GMT Message-Id: <202205041008.244A86nn000282@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 8c84ca657bb3 - main - linux(4): Implement sched_rr_get_interval_time64 syscall. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8c84ca657bb343b73f315520ac3cabc43c5a67ec Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651658887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=06XH5bs3UjmFnb5+xFy85tfsXtTs6QUvk0ViLRiL0Aw=; b=s5B9LzuN7JGDuDhBExsDPJ7DWsL1uJYMMsWjR6uIr9F6aqpCFGpyQMvZX+zOKRYDhpTEZo WdG9g1v7+1Xtd4py7Zrh8Hsq2uD+V1vSgIk+lg/pHQg1I7LdtjJsCEc3uR+1y+ehL+wZEC GbQ7QC4nkxjAjBbSbqtvtuWTs57iG8H0apYusDNXknLiufQWsV1hbEbxbMEuHgi+AL/gYu FZEwiPkQApon2K/ZGlS6DFHdjQIpIoN21AUhfAjyfFSAQl96LtXR7S+2LRvlzMr97Q7+cr 7Sm73XmoekUvpU7LTlrzBCRHIYAxoyowaDkCMj3OnsP+yF/MAfjhhY5tiofRNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651658887; a=rsa-sha256; cv=none; b=sPZvb6Ilic2DR/BQuAUESNoOk6KJksYVKnZfM9qwU9PTaB04FbgYEn3yr83bQhSM2bvsrw FI7+JOo0j6X/+PhUVVpJjga9DQPKMn09jJenQ9kmObl9Y1jNS9+q3gU8PhIZvrusQHMWdU gP01DamByFVNQifnrIc3btU+0/2pZAHmn2+qPUxa+eTuHg2L8mU9GdO4txi7xTdNAUYDXi 5uJXXUVd7EWh0zLAm9onS6ec27r0jPO5uS9XCYtnwM90TtHhREfvSrtY3hD1zi+4z7nW5l PO9diaTlmphyJuoWJ/xYVCYCB3P484Ny11Eu0FmIHQXWeh998qYX26koqFzPsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=8c84ca657bb343b73f315520ac3cabc43c5a67ec commit 8c84ca657bb343b73f315520ac3cabc43c5a67ec Author: Dmitry Chagin AuthorDate: 2022-05-04 10:06:47 +0000 Commit: Dmitry Chagin CommitDate: 2022-05-04 10:06:47 +0000 linux(4): Implement sched_rr_get_interval_time64 syscall. MFC after: 2 weeks --- sys/amd64/linux32/linux32_dummy_machdep.c | 1 - sys/compat/linux/linux_misc.c | 45 +++++++++++++++++++++++++------ sys/i386/linux/linux_dummy_machdep.c | 1 - 3 files changed, 37 insertions(+), 10 deletions(-) diff --git a/sys/amd64/linux32/linux32_dummy_machdep.c b/sys/amd64/linux32/linux32_dummy_machdep.c index fb7c88629af7..e14da5b74733 100644 --- a/sys/amd64/linux32/linux32_dummy_machdep.c +++ b/sys/amd64/linux32/linux32_dummy_machdep.c @@ -77,4 +77,3 @@ DUMMY(recvmmsg_time64); DUMMY(mq_timedsend_time64); DUMMY(mq_timedreceive_time64); DUMMY(semtimedop_time64); -DUMMY(sched_rr_get_interval_time64); diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 8a9e34d6cae3..118318d9bae1 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -2658,12 +2658,10 @@ linux_pollout(struct thread *td, struct pollfd *fds, struct pollfd *ufds, u_int return (0); } -int -linux_sched_rr_get_interval(struct thread *td, - struct linux_sched_rr_get_interval_args *uap) +static int +linux_sched_rr_get_interval_common(struct thread *td, pid_t pid, + struct timespec *ts) { - struct timespec ts; - struct l_timespec lts; struct thread *tdt; int error; @@ -2671,15 +2669,27 @@ linux_sched_rr_get_interval(struct thread *td, * According to man in case the invalid pid specified * EINVAL should be returned. */ - if (uap->pid < 0) + if (pid < 0) return (EINVAL); - tdt = linux_tdfind(td, uap->pid, -1); + tdt = linux_tdfind(td, pid, -1); if (tdt == NULL) return (ESRCH); - error = kern_sched_rr_get_interval_td(td, tdt, &ts); + error = kern_sched_rr_get_interval_td(td, tdt, ts); PROC_UNLOCK(tdt->td_proc); + return (error); +} + +int +linux_sched_rr_get_interval(struct thread *td, + struct linux_sched_rr_get_interval_args *uap) +{ + struct timespec ts; + struct l_timespec lts; + int error; + + error = linux_sched_rr_get_interval_common(td, uap->pid, &ts); if (error != 0) return (error); error = native_to_linux_timespec(<s, &ts); @@ -2688,6 +2698,25 @@ linux_sched_rr_get_interval(struct thread *td, return (copyout(<s, uap->interval, sizeof(lts))); } +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) +int +linux_sched_rr_get_interval_time64(struct thread *td, + struct linux_sched_rr_get_interval_time64_args *uap) +{ + struct timespec ts; + struct l_timespec64 lts; + int error; + + error = linux_sched_rr_get_interval_common(td, uap->pid, &ts); + if (error != 0) + return (error); + error = native_to_linux_timespec64(<s, &ts); + if (error != 0) + return (error); + return (copyout(<s, uap->interval, sizeof(lts))); +} +#endif + /* * In case when the Linux thread is the initial thread in * the thread group thread id is equal to the process id. diff --git a/sys/i386/linux/linux_dummy_machdep.c b/sys/i386/linux/linux_dummy_machdep.c index 071f5fff6f47..cbe945e00635 100644 --- a/sys/i386/linux/linux_dummy_machdep.c +++ b/sys/i386/linux/linux_dummy_machdep.c @@ -79,4 +79,3 @@ DUMMY(recvmmsg_time64); DUMMY(mq_timedsend_time64); DUMMY(mq_timedreceive_time64); DUMMY(semtimedop_time64); -DUMMY(sched_rr_get_interval_time64);