From nobody Tue Nov 10 12:33:04 2026 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 4jP5f8755rz6yMXd for ; Tue, 10 Nov 2026 12:33:04 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jP5f83fT8z4sQB for ; Tue, 10 Nov 2026 12:33:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794313984; 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=lnTEcaTTAx1fxruotsQWG+4wOmbsq2LP2niLcrH1vxQ=; b=TOCKaJHgl6bzUCukHowLdTPseTA7sw4Q2NnxbwioVcm25lm94iYQoRGYH9QjZ9stIeUsW1 CZoJCFQ+Y/4cxPiEs2CT4AOsS/zlbVodbCnkkWLaXLMvmL7kkZzPFRLGtd42tBrSSEy5/4 pHCh01NYDqhUcFSLCt30hiNGrYz27pwzScOwlRBIJR1V8heJV4kwUQbdTHlEnEdxKatYK1 /bpcwNGpKOlIX+xkeaiLukkgJAdkuKUSTQw9Wkb0tc3R3eMtyvjbd4vkBdGDeyDOFIqSWO 8SJYsuxbv7Y892t1qfZDfCk5x81Gv5kAH9Dj1upCMYU0LzFF/Cc/UodPND+UgQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794313984; b=WzrOICizqAoJUtZBHCZpdKAXIU8Gn4I5o6MuwNuilfHHRc5H0TtVAEldRiMHA1KSEVk7wI U7KUzLfXZwPhP4SzjlJdcR14I45wXl4lk5+XVbCZ62D7kRlrn7GvuZSgbq7ga4BJc+XNaF 412uXDBqb+p70R6yB1ZGJA+eGhUfQEFHA2+qNlGjO1A+xqdWLH+DPr211brTqWFJOwdLtf QbMmiNqtvL3ovIpiSiK7e1OrIaZk1YunG7Fs5BVcag9sJG8t/mzHuLqBhhraeR4UGlEjEV wzZNaTPay87ri2+THZX/FEkFsE45VJjwJQJ0lCJwveOKQkNwnGpe6NoAz+ea2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794313984; 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=lnTEcaTTAx1fxruotsQWG+4wOmbsq2LP2niLcrH1vxQ=; b=ilzkxjN9ProqSJU5MzxNLKCOc78WuAGVnA6PxI6jm52bq9OBjm/gTZfmoimKSYm+SfVa3W AhcplbnV3pvoeX5rT+MAQ0OYuFX9YJQqb/iuQHxEYIgoIfdaIrGU9+osIm/EwHNk65v2z8 43u5/2F50Em0eyqUNuHFQBn7hptxuR9ilCHfJgPI92G5ufCEXGmelzLjwO/3TKUS0WlWpi 2XfKpxTJwZSzHxoosNrWsrh3XD/MvqdRTQBgPBiHBl/bhdVqJtrc1WxWDtsYmjgw7kDO8d XHs8txFDg0YGtaVUxv+k/zynbnQ4r/RQliKq6xXWAT+RJ9WpopF/SioRSTfaWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jP5f83JzzzS1J for ; Tue, 10 Nov 2026 12:33:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 137d5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 10 Nov 2026 12:33:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 985faddcb6ed - main - rtprio*(2): add kern_ implementations List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main X-BeenThere: dev-commits-src-main@freebsd.org List-Id: Commit messages for the main branch of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 985faddcb6edf7263202bd982a9204c1db66ac91 Auto-Submitted: auto-generated Date: Tue, 10 Nov 2026 12:33:04 +0000 Message-Id: <6af30f00.137d5.54f9de9@gitrepo.freebsd.org> The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=985faddcb6edf7263202bd982a9204c1db66ac91 commit 985faddcb6edf7263202bd982a9204c1db66ac91 Author: Brooks Davis AuthorDate: 2026-11-10 11:49:21 +0000 Commit: Brooks Davis CommitDate: 2026-11-10 11:49:21 +0000 rtprio*(2): add kern_ implementations Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284 --- sys/kern/kern_resource.c | 41 +++++++++++++++++++++++++++-------------- sys/sys/syscallsubr.h | 5 +++++ 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 044e95fa64a0..f7f07d4253d5 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -313,6 +313,13 @@ struct rtprio_thread_args { #endif int sys_rtprio_thread(struct thread *td, struct rtprio_thread_args *uap) +{ + return (kern_rtprio_thread(td, uap->function, uap->lwpid, uap->rtp)); +} + +int +kern_rtprio_thread(struct thread *td, int function, lwpid_t lwpid, + struct rtprio *urtp) { struct proc *p; struct rtprio rtp; @@ -320,29 +327,29 @@ sys_rtprio_thread(struct thread *td, struct rtprio_thread_args *uap) int cierror, error; /* Perform copyin before acquiring locks if needed. */ - if (uap->function == RTP_SET) - cierror = copyin(uap->rtp, &rtp, sizeof(struct rtprio)); + if (function == RTP_SET) + cierror = copyin(urtp, &rtp, sizeof(struct rtprio)); else cierror = 0; - if (uap->lwpid == 0 || uap->lwpid == td->td_tid) { + if (lwpid == 0 || lwpid == td->td_tid) { p = td->td_proc; td1 = td; PROC_LOCK(p); } else { - td1 = tdfind(uap->lwpid, -1); + td1 = tdfind(lwpid, -1); if (td1 == NULL) return (ESRCH); p = td1->td_proc; } - switch (uap->function) { + switch (function) { case RTP_LOOKUP: if ((error = p_cansee(td, p))) break; pri_to_rtp(td1, &rtp); PROC_UNLOCK(p); - return (copyout(&rtp, uap->rtp, sizeof(struct rtprio))); + return (copyout(&rtp, urtp, sizeof(struct rtprio))); case RTP_SET: if ((error = p_cansched(td, p)) || (error = cierror)) break; @@ -394,6 +401,12 @@ struct rtprio_args { #endif int sys_rtprio(struct thread *td, struct rtprio_args *uap) +{ + return (kern_rtprio(td, uap->function, uap->pid, uap->rtp)); +} + +int +kern_rtprio(struct thread *td, int function, pid_t pid, struct rtprio *urtp) { struct proc *p; struct thread *tdp; @@ -401,21 +414,21 @@ sys_rtprio(struct thread *td, struct rtprio_args *uap) int cierror, error; /* Perform copyin before acquiring locks if needed. */ - if (uap->function == RTP_SET) - cierror = copyin(uap->rtp, &rtp, sizeof(struct rtprio)); + if (function == RTP_SET) + cierror = copyin(urtp, &rtp, sizeof(struct rtprio)); else cierror = 0; - if (uap->pid == 0) { + if (pid == 0) { p = td->td_proc; PROC_LOCK(p); } else { - p = pfind(uap->pid); + p = pfind(pid); if (p == NULL) return (ESRCH); } - switch (uap->function) { + switch (function) { case RTP_LOOKUP: if ((error = p_cansee(td, p))) break; @@ -427,7 +440,7 @@ sys_rtprio(struct thread *td, struct rtprio_args *uap) * Note: specifying our own pid is not the same * as leaving it zero. */ - if (uap->pid == 0) { + if (pid == 0) { pri_to_rtp(td, &rtp); } else { struct rtprio rtp2; @@ -445,7 +458,7 @@ sys_rtprio(struct thread *td, struct rtprio_args *uap) } } PROC_UNLOCK(p); - return (copyout(&rtp, uap->rtp, sizeof(struct rtprio))); + return (copyout(&rtp, urtp, sizeof(struct rtprio))); case RTP_SET: if ((error = p_cansched(td, p)) || (error = cierror)) break; @@ -469,7 +482,7 @@ sys_rtprio(struct thread *td, struct rtprio_args *uap) * do all the threads on that process. If we * specify our own pid we do the latter. */ - if (uap->pid == 0) { + if (pid == 0) { error = rtp_to_pri(&rtp, td); } else { FOREACH_THREAD_IN_PROC(p, td) { diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index 41c1407b7ca4..95e563ccbca8 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -60,6 +60,7 @@ struct pollfd; struct ogetdirentries_args; struct rlimit; struct rusage; +struct rtprio; struct sched_param; struct sembuf; union semun; @@ -409,6 +410,10 @@ int kern_recvit(struct thread *td, int s, struct msghdr *mp, enum uio_seg fromseg, struct mbuf **controlp); int kern_renameat(struct thread *td, int fromfd, const char *from, int tofd, const char *to, enum uio_seg pathseg, u_int flags); +int kern_rtprio(struct thread *td, int function, pid_t pid, + struct rtprio *urtp); +int kern_rtprio_thread(struct thread *td, int function, lwpid_t lwpid, + struct rtprio *urtp); int kern_sched_getparam(struct thread *td, struct thread *targettd, struct sched_param *param); int kern_sched_getscheduler(struct thread *td, struct thread *targettd,