From nobody Tue Jan 07 16:25:02 2025 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 4YSGbz0BNJz5knRD; Tue, 07 Jan 2025 16:25:03 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSGby6h1Nz4YFD; Tue, 7 Jan 2025 16:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736267103; 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=wh45R/wBuVjszt1XOUXYH1/ny8fsnyge3m4aicHvWls=; b=t7CXb/n3jnE00imlQP9m7QNGxr1Q3hH2I1SnGOVBjXIh3YMKIfotkFweTRdkk1p3u5+DIY yISLpyeepbD4X1MokgOX5g2eiUK+xk3g5n84KwF11022KfzLzec7yR/bYNWs4e4RYgiliS cjrC9ifJbUgsVKN87TYh7gfL4z3oZ3NTd0raUymZ5ffr3mAczdZuPSK60vz54KaSlK17FX TdyJ3ySTzEqKnWr7JgYkXvC4ELYtP2+R6aqL5Likagb3z7bmRXtRWuHpb96T2H/Nco5rm2 egv88UiEUpm7l+P5RZoOxg6OrK1jaqzB5Soo8TWWulT35QWHbA87uAs0C78fjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736267103; 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=wh45R/wBuVjszt1XOUXYH1/ny8fsnyge3m4aicHvWls=; b=ga4Lf0XQ/MV4sO6OyN96UXs3RsMbdfVggti/SnoKS5ZhXAKZhO5FwFuQh7PeT89OluuEh1 d32K/eHJpu/fCZJlHNOkEsq2CgNbr4JDHn6GnXc5CXYH56ZoBh5JaMfEjhDsgp9xWlRct9 RVKtNDsaD4A1NPmxX0hZdJEP51ML1q2+zu/Ri4DgWieWtTHNCeUy/+Ky3x3adtG4yCBh4Z /wy3HhzqwfuegxbEMIJPLRBvalDHTYGkBuJzHSvS5nCc5KX49gbuvJSalWPFUDjgLrG3xV PX3xEJNX1fvMNRcd9OGrigYkudi7MQw8A1V89y3gu65a2wDaFbcD3TnjE1aWcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736267103; a=rsa-sha256; cv=none; b=A+W6boAcFt6V24bUM9wTUA3DSScD8XO/bdQ3h4zcOsfhBz007oWKqsUGjRL/1mMEr3qgAS Apou7MyVCuhwxvATnfu0BG42LVLe2O6ailL/1iV4ZEAasF7isc7lOvPJAP7dGiXuWhKkYU IpdsbACln/nn5Yy3pXeDHRBtav2K+skHw9BvmXtrGXxqIgXyc8OCssOERGva8lynjw9v73 cMZVv3c5iVmAwRBU3aT4/9b/v4ztEhE8iFW3RB4N0S/HfYoiBr8rFD7Ou5+L7Jmoy1HmFj XTUMl05R4a3GDKIYVz2rSZikECdBmNq26dfB8PCJSVZymjhPzF6WXA0RYaaSCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YSGby5vHlz2Tb; Tue, 07 Jan 2025 16:25:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507GP2I6023099; Tue, 7 Jan 2025 16:25:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507GP2tU023096; Tue, 7 Jan 2025 16:25:02 GMT (envelope-from git) Date: Tue, 7 Jan 2025 16:25:02 GMT Message-Id: <202501071625.507GP2tU023096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: f73c9b5da190 - main - mi_switch.9: Remove cpu_switch, cpu_throw List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f73c9b5da190954a81e9e70e2caa8e9168623bfd Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f73c9b5da190954a81e9e70e2caa8e9168623bfd commit f73c9b5da190954a81e9e70e2caa8e9168623bfd Author: Ed Maste AuthorDate: 2025-01-07 16:04:00 +0000 Commit: Ed Maste CommitDate: 2025-01-07 16:24:25 +0000 mi_switch.9: Remove cpu_switch, cpu_throw cpu_machdep.9 was added to document cpu_*, but cpu_switch and cpu_throw were already documented in mi_switch.9, and MLINKed. cpu_machdep.9 seems like the correct place for this, so remove them from mi_switch.9. Some of the removed text was stale, although there are few notes that ought to be added to cpu_machdep.9 in a future commit. Reported by: tools/pkgbase/metalog_reader.lua Reviewed by: jhb Sponsored by: The FreeBSD Foundation Fixes: 9c87cbbcaaed ("cpu_machdep.9: New manpage describing the semantics of several cpu_*") Differential Revision: https://reviews.freebsd.org/D48360 --- share/man/man9/Makefile | 2 -- share/man/man9/mi_switch.9 | 68 +++------------------------------------------- 2 files changed, 4 insertions(+), 66 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 91a7bbe294fa..c09d3aa554a1 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1594,8 +1594,6 @@ MLINKS+=microuptime.9 binuptime.9 \ microuptime.9 getsbinuptime.9 \ microuptime.9 nanouptime.9 \ microuptime.9 sbinuptime.9 -MLINKS+=mi_switch.9 cpu_switch.9 \ - mi_switch.9 cpu_throw.9 MLINKS+=mod_cc.9 CCV.9 \ mod_cc.9 DECLARE_CC_MODULE.9 MLINKS+=mtx_pool.9 mtx_pool_alloc.9 \ diff --git a/share/man/man9/mi_switch.9 b/share/man/man9/mi_switch.9 index 549ec497434c..e04c2ee35ace 100644 --- a/share/man/man9/mi_switch.9 +++ b/share/man/man9/mi_switch.9 @@ -31,23 +31,17 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 9, 2023 +.Dd January 7, 2025 .Dt MI_SWITCH 9 .Os .Sh NAME -.Nm mi_switch , -.Nm cpu_switch , -.Nm cpu_throw +.Nm mi_switch .Nd switch to another thread context .Sh SYNOPSIS .In sys/param.h .In sys/proc.h .Ft void .Fn mi_switch "int flags" -.Ft void -.Fn cpu_switch "struct thread *oldtd" "struct thread *newtd" "struct mtx *lock" -.Ft void -.Fn cpu_throw "struct thread *oldtd" "struct thread *newtd" .Sh DESCRIPTION The .Fn mi_switch @@ -168,63 +162,9 @@ running thread .Fa oldtd to the chosen thread .Fa newtd . -First, it saves the context of -.Fa oldtd -to its Process Control Block -.Po -PCB, -.Vt struct pcb -.Pc , -pointed at by -.Va oldtd->td_pcb . -The function then updates important per-CPU state such as the -.Dv curthread -variable, and activates -.Fa newtd\&'s -virtual address space using its associated -.Xr pmap 9 -structure. -Finally, it reads in the saved context from -.Fa newtd\&'s -PCB. -CPU instruction flow continues in the new thread context, on -.Fa newtd\&'s -kernel stack. -The return from -.Fn cpu_switch -can be understood as a completion of the function call initiated by -.Fa newtd -when it was previously switched out, at some point in the distant (relative to -CPU time) past. -.Pp -The -.Fa mtx -argument to -.Fn cpu_switch -is used to pass the mutex which will be stored as -.Fa oldtd\&'s -thread lock at the moment that -.Fa oldtd -is completely switched out. -This is an implementation detail of -.Fn sched_switch . -.Pp -.Fn cpu_throw -is similar to -.Fn cpu_switch -except that it does not save the context of the old thread. -This function is useful when the kernel does not have an old thread -context to save, such as when CPUs other than the boot CPU perform their -first task switch, or when the kernel does not care about the state of the -old thread, such as in -.Xr thread_exit 9 -when the kernel terminates the current thread and switches into a new -thread, -.Fa newtd . -The -.Fa oldtd -argument is unused. .Sh SEE ALSO +.Xr cpu_switch 9 , +.Xr cpu_throw 9 , .Xr critical_exit 9 , .Xr issignal 9 , .Xr kern_yield 9 ,