From nobody Mon Nov 09 11:54:20 2026 X-Original-To: dev-commits-src-all@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 4jNSqw61QMz6yMV9 for ; Mon, 09 Nov 2026 11:54:20 +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 4jNSqw51d4z3Kdc for ; Mon, 09 Nov 2026 11:54:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794225260; 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=bRcqzBExxNOFGuKnCsJS1iXW63DDqbqlhvOqGhuFKT0=; b=o8I1XRjmgw4Y8Uoq2y7pibvKUAa3jD/o0Y3XQrJenujweEyf9AC909TeV4bGE/os36qfBI 4t4lFu22rNYkFd+mgOL47NUBdHwdqGegJwaYEgawETPZkSFMviF14kbAF4rIU1PDbo9rpo ENnaaFmZDvySzYEeGyWLb1Jenq+2/UNpssGgn7AIfUqeMypIuWLBxHw7eMvrYP8XiBbZHU Vf5JL+Sb9/tpi8NoN1QoEUgGt5DTzlBJgeHIlwpiuoPk4uCrLrCRLtT9yr+rjpi0org6jt D5vywdN4y4QRcJ3v8mu5cD/9ZOdmw4kJu1C8Gml9kJi14+2SVXt21kC38i8U5g== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794225260; b=GVibOgm5xzzieOOk/87fQJZwrdIQ6gwO+Mj9HwUEZ+gKuDFjTI/zQaGbIrESAOE2x2Kwg0 TOgvQcqtr/MvQ77YHjSIyymm5j3bjW4mmdrtqJ80mbdAbKQWjRy+s75nNCrLmh9JxkVLcA qG/muMb4rVG2NLLOcHCM5wBxZ4demPslZPud/ueybOpsLkOyzsBmz198Gnn1tNVGaw5vtJ HphtT9jGjONWZDv9MjFCpptFbF8UqfcloDqkabKRTFBqsth99ZuJHQIoIWDgXj7XTFj6TA 4crR6wEO/ITAurYTw68gNz7fbOEoIxm/ubvgRzCy+54cBr5ObEoPO7gDjwMayA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794225260; 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=bRcqzBExxNOFGuKnCsJS1iXW63DDqbqlhvOqGhuFKT0=; b=yrGZqBupXX/EkONRUS9omaf1fnIR8jWM7cnS8XowMuT2wTzkfztPZ3HfBhmPLhZCb7gLOF 7we5Q70vaY02P5cexnxflM5zcYsKHNfwicF1/4/DpaVZbpkFbT4QvNsslBgBAh4E7qvGJg xQaICaCoUNSOrUfP3A/xPvlH1mMtC7CedDf55CQHOSmfN+v6yQ4UCd+Ji4VpfEadiJWb4f 7qcz9nVXbt1MnorYc/6b01FYmKSdIfTq5Ko9VZesfRqjP4YUjIzROI3z+Ea0l928EQ4mC7 dKKKbdbaRv6bBsSDXJun8Lbaa+D79RDb5R94Q5c1pCGZJj/aiBVPRbBDCjyIFA== 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 4jNSqw3znSzfNW for ; Mon, 09 Nov 2026 11:54:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 40eb by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 09 Nov 2026 11:54:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: d4775425c16c - main - ffclock: add kern_ interfaces List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches 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: d4775425c16ceb3933c45cfe1a78bbed0a6fdf92 Auto-Submitted: auto-generated Date: Mon, 09 Nov 2026 11:54:20 +0000 Message-Id: <6af1b46c.40eb.34ceed98@gitrepo.freebsd.org> The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=d4775425c16ceb3933c45cfe1a78bbed0a6fdf92 commit d4775425c16ceb3933c45cfe1a78bbed0a6fdf92 Author: Brooks Davis AuthorDate: 2025-11-21 17:22:24 +0000 Commit: Brooks Davis CommitDate: 2026-11-09 11:27:40 +0000 ffclock: add kern_ interfaces Effort: CHERI upstreaming Sponsored by: Innovate UK Pull Request: https://github.com/freebsd/freebsd-src/pull/2284 --- sys/kern/kern_ffclock.c | 28 ++++++++++++++++++++++++---- sys/sys/syscallsubr.h | 7 +++++++ 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_ffclock.c b/sys/kern/kern_ffclock.c index 6e32c82bc0b8..62e4b18f78de 100644 --- a/sys/kern/kern_ffclock.c +++ b/sys/kern/kern_ffclock.c @@ -41,8 +41,9 @@ #include #include #include -#include +#include #include +#include #include #include @@ -385,6 +386,12 @@ struct ffclock_getcounter_args { /* ARGSUSED */ int sys_ffclock_getcounter(struct thread *td, struct ffclock_getcounter_args *uap) +{ + return (kern_ffclock_getcounter(td, uap->ffcount)); +} + +int +kern_ffclock_getcounter(struct thread *td, ffcounter *uffcount) { ffcounter ffcount; int error; @@ -393,7 +400,7 @@ sys_ffclock_getcounter(struct thread *td, struct ffclock_getcounter_args *uap) ffclock_read_counter(&ffcount); if (ffcount == 0) return (EAGAIN); - error = copyout(&ffcount, uap->ffcount, sizeof(ffcounter)); + error = copyout(&ffcount, uffcount, sizeof(ffcounter)); return (error); } @@ -414,6 +421,13 @@ struct ffclock_setestimate_args { /* ARGSUSED */ int sys_ffclock_setestimate(struct thread *td, struct ffclock_setestimate_args *uap) +{ + return (kern_ffclock_setestimate(td, uap->cest)); +} + +int +kern_ffclock_setestimate(struct thread *td, + const struct ffclock_estimate *ucest) { struct ffclock_estimate cest; int error; @@ -422,7 +436,7 @@ sys_ffclock_setestimate(struct thread *td, struct ffclock_setestimate_args *uap) if ((error = priv_check(td, PRIV_CLOCK_SETTIME)) != 0) return (error); - if ((error = copyin(uap->cest, &cest, sizeof(struct ffclock_estimate))) + if ((error = copyin(ucest, &cest, sizeof(struct ffclock_estimate))) != 0) return (error); @@ -446,6 +460,12 @@ struct ffclock_getestimate_args { /* ARGSUSED */ int sys_ffclock_getestimate(struct thread *td, struct ffclock_getestimate_args *uap) +{ + return (kern_ffclock_getestimate(td, uap->cest)); +} + +int +kern_ffclock_getestimate(struct thread *td, struct ffclock_estimate *ucest) { struct ffclock_estimate cest; int error; @@ -453,7 +473,7 @@ sys_ffclock_getestimate(struct thread *td, struct ffclock_getestimate_args *uap) mtx_lock(&ffclock_mtx); memcpy(&cest, &ffclock_estimate, sizeof(struct ffclock_estimate)); mtx_unlock(&ffclock_mtx); - error = copyout(&cest, uap->cest, sizeof(struct ffclock_estimate)); + error = copyout(&cest, ucest, sizeof(struct ffclock_estimate)); return (error); } diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index 1f58fd06cb0b..5f91185729cc 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -39,6 +40,7 @@ struct __wrusage; struct cpuset_copy_cb; +struct ffclock_estimate; struct file; struct filecaps; enum idtype; @@ -216,6 +218,11 @@ int kern_fchownat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, int uid, int gid, int flag); int kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg); int kern_fcntl_freebsd(struct thread *td, int fd, int cmd, intptr_t arg); +int kern_ffclock_getcounter(struct thread *td, ffcounter *ffcountp); +int kern_ffclock_getestimate(struct thread *td, + struct ffclock_estimate *ucest); +int kern_ffclock_setestimate(struct thread *td, + const struct ffclock_estimate *ucest); int kern_fhopen(struct thread *td, const struct fhandle *u_fhp, int flags); int kern_fhstat(struct thread *td, fhandle_t fh, struct stat *buf); int kern_fhstatfs(struct thread *td, fhandle_t fh, struct statfs *buf);