diff options
Diffstat (limited to 'static/netbsd/man9/curproc.9 3.html')
| -rw-r--r-- | static/netbsd/man9/curproc.9 3.html | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/static/netbsd/man9/curproc.9 3.html b/static/netbsd/man9/curproc.9 3.html deleted file mode 100644 index 17d4ed8c..00000000 --- a/static/netbsd/man9/curproc.9 3.html +++ /dev/null @@ -1,100 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">CURPROC(9)</td> - <td class="head-vol">Kernel Developer's Manual</td> - <td class="head-rtitle">CURPROC(9)</td> - </tr> -</table> -<div class="manual-text"> -<section class="Sh"> -<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> -<p class="Pp"><code class="Nm">curcpu</code>, <code class="Nm">curlwp</code>, - <code class="Nm">curproc</code> — <span class="Nd">current processor, - thread, and process</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1> -<p class="Pp"><code class="In">#include - <<a class="In">sys/proc.h</a>></code></p> -<p class="Pp"><var class="Ft">struct cpu_info *</var> - <br/> - <code class="Fn">curcpu</code>(<var class="Fa" style="white-space: nowrap;">void</var>);</p> -<p class="Pp"><var class="Vt">struct proc *curproc</var>; - <br/> - <var class="Vt">struct lwp *curlwp</var>;</p> -<p class="Pp"><code class="In">#include - <<a class="In">sys/cpu.h</a>></code></p> -<p class="Pp"><var class="Ft">bool</var> - <br/> - <code class="Fn">curcpu_stable</code>(<var class="Fa" style="white-space: nowrap;">void</var>);</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp">The following retrieve the current CPU, process, and thread - (lightweight process, or LWP), respectively:</p> -<dl class="Bl-tag"> - <dt id="curcpu"><a class="permalink" href="#curcpu"><code class="Fn">curcpu</code></a>()</dt> - <dd>Returns a pointer to the <var class="Vt">struct cpu_info</var> structure - representing the CPU that the code calling it is running on. - <p class="Pp" id="curcpu~2">The value of - <a class="permalink" href="#curcpu~2"><code class="Fn">curcpu</code></a>() - is unstable and may be stale as soon as it is read unless the caller - prevents preemption by raising the IPL (<a class="Xr">spl(9)</a>, - <a class="Xr">mutex(9)</a>), by disabling preemption - (<a class="Xr">kpreempt_disable(9)</a>), or by binding the thread to its - CPU (<a class="Xr">curlwp_bind(9)</a>).</p> - <p class="Pp" id="curcpu_stable">The function - <a class="permalink" href="#curcpu_stable"><code class="Fn">curcpu_stable</code></a>() - can be used in assertions (<a class="Xr">KASSERT(9)</a>) to verify that - <code class="Fn">curcpu</code>() is stable in the current context. - <code class="Fn">curcpu_stable</code>() MUST NOT be used to make dynamic - decisions about whether to query <code class="Fn">curcpu</code>().</p> - </dd> - <dt id="curproc"><a class="permalink" href="#curproc"><code class="Dv">curproc</code></a></dt> - <dd>Yields a pointer to the <var class="Vt">struct proc</var> structure - representing the currently running process. - <p class="Pp">The value of <code class="Dv">curproc</code> is stable and - does not change during execution except in machine-dependent logic to - perform context switches, so it works like a global constant, not like a - stateful procedure.</p> - </dd> - <dt id="curlwp"><a class="permalink" href="#curlwp"><code class="Dv">curlwp</code></a></dt> - <dd>Yields a pointer to the <var class="Vt">struct lwp</var> structure - representing the currently running thread. - <p class="Pp">The value of <code class="Dv">curlwp</code> is stable and does - not change during execution except in machine-dependent logic to perform - context switches, so it works like a global constant, not like a - stateful procedure.</p> - </dd> -</dl> -</section> -<section class="Sh"> -<h1 class="Sh" id="SOURCE_REFERENCES"><a class="permalink" href="#SOURCE_REFERENCES">SOURCE - REFERENCES</a></h1> -<p class="Pp">The - <a class="permalink" href="#curcpu~3"><code class="Fn" id="curcpu~3">curcpu</code></a>() - macro is defined in the machine-independent - <span class="Pa">machine/cpu.h</span>.</p> -<p class="Pp">The <code class="Dv">curproc</code> macro is defined in - <span class="Pa">sys/lwp.h</span>.</p> -<p class="Pp">The <code class="Dv">curlwp</code> macro has a machine-independent - definition in <span class="Pa">sys/lwp.h</span>, but it may be overridden by - <span class="Pa">machine/cpu.h</span>, and must be overridden on - architectures supporting multiprocessing and kernel preemption.</p> -<p class="Pp" id="curcpu_stable~2">The - <a class="permalink" href="#curcpu_stable~2"><code class="Fn">curcpu_stable</code></a>() - function is defined in <span class="Pa">kern/subr_cpu.c</span>.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE - ALSO</a></h1> -<p class="Pp"><a class="Xr">cpu_number(9)</a>, - <a class="Xr">proc_find(9)</a></p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">July 8, 2023</td> - <td class="foot-os">NetBSD 10.1</td> - </tr> -</table> |
