Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F165315688
D48360.id148880.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D48360.id148880.diff
View Options
Index: share/man/man9/Makefile
===================================================================
--- share/man/man9/Makefile
+++ share/man/man9/Makefile
@@ -1594,8 +1594,6 @@
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 \
Index: share/man/man9/mi_switch.9
===================================================================
--- share/man/man9/mi_switch.9
+++ share/man/man9/mi_switch.9
@@ -35,19 +35,13 @@
.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 @@
.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 ,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Aug 8, 2:45 PM (21 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36235181
Default Alt Text
D48360.id148880.diff (2 KB)
Attached To
Mode
D48360: mi_switch.9: Remove cpu_switch, cpu_throw
Attached
Detach File
Event Timeline
Log In to Comment