This commit is contained in:
chyyuu 2022-07-20 01:36:15 +00:00
parent a6848c66f5
commit d4fce7a47b
9 changed files with 13 additions and 17 deletions

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.new_kernel" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/os/mm/memory_set.rs.html#91-166">source</a></span><a href="#method.new_kernel" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.new_kernel" class="fnname">new_kernel</a>() -&gt; Self</h4></section></summary><div class="docblock"><p>Without kernel stacks.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_elf" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/os/mm/memory_set.rs.html#169-234">source</a></span><a href="#method.from_elf" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.from_elf" class="fnname">from_elf</a>(elf_data: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">(</a>Self, <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">)</a></h4></section></summary><div class="docblock"><p>Include sections in elf and trampoline and TrapContext and user stack,
also returns user_sp and entry point.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_existed_user" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/os/mm/memory_set.rs.html#236-254">source</a></span><a href="#method.from_existed_user" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.from_existed_user" class="fnname">from_existed_user</a>(user_space: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&amp;</a>Self) -&gt; Self</h4></section></summary><div class="docblock"><p>Clone a same <code>MemorySet</code></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_existed_user" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/os/mm/memory_set.rs.html#236-254">source</a></span><a href="#method.from_existed_user" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.from_existed_user" class="fnname">from_existed_user</a>(user_space: &amp;<a class="struct" href="struct.MemorySet.html" title="struct os::mm::memory_set::MemorySet">MemorySet</a>) -&gt; <a class="struct" href="struct.MemorySet.html" title="struct os::mm::memory_set::MemorySet">MemorySet</a></h4></section></summary><div class="docblock"><p>Clone a same <code>MemorySet</code></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.activate" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/os/mm/memory_set.rs.html#256-262">source</a></span><a href="#method.activate" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.activate" class="fnname">activate</a>(&amp;self)</h4></section></summary><div class="docblock"><p>Refresh TLB with <code>sfence.vma</code></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.translate" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/os/mm/memory_set.rs.html#264-266">source</a></span><a href="#method.translate" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.translate" class="fnname">translate</a>(&amp;self, vpn: <a class="struct" href="../address/struct.VirtPageNum.html" title="struct os::mm::address::VirtPageNum">VirtPageNum</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../page_table/struct.PageTableEntry.html" title="struct os::mm::page_table::PageTableEntry">PageTableEntry</a>&gt;</h4></section></summary><div class="docblock"><p>Translate throuth pagetable</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.recycle_data_pages" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../../src/os/mm/memory_set.rs.html#268-271">source</a></span><a href="#method.recycle_data_pages" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.recycle_data_pages" class="fnname">recycle_data_pages</a>(&amp;mut self)</h4></section></summary><div class="docblock"><p>Remove all <code>MapArea</code></p>

View File

@ -16,7 +16,7 @@
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.new_kernel" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/os/mm/memory_set.rs.html#91-166">source</a></span><a href="#method.new_kernel" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.new_kernel" class="fnname">new_kernel</a>() -&gt; Self</h4></section></summary><div class="docblock"><p>Without kernel stacks.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_elf" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/os/mm/memory_set.rs.html#169-234">source</a></span><a href="#method.from_elf" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.from_elf" class="fnname">from_elf</a>(elf_data: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">(</a>Self, <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">)</a></h4></section></summary><div class="docblock"><p>Include sections in elf and trampoline and TrapContext and user stack,
also returns user_sp and entry point.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_existed_user" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/os/mm/memory_set.rs.html#236-254">source</a></span><a href="#method.from_existed_user" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.from_existed_user" class="fnname">from_existed_user</a>(user_space: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&amp;</a>Self) -&gt; Self</h4></section></summary><div class="docblock"><p>Clone a same <code>MemorySet</code></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_existed_user" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/os/mm/memory_set.rs.html#236-254">source</a></span><a href="#method.from_existed_user" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.from_existed_user" class="fnname">from_existed_user</a>(user_space: &amp;<a class="struct" href="memory_set/struct.MemorySet.html" title="struct os::mm::memory_set::MemorySet">MemorySet</a>) -&gt; <a class="struct" href="memory_set/struct.MemorySet.html" title="struct os::mm::memory_set::MemorySet">MemorySet</a></h4></section></summary><div class="docblock"><p>Clone a same <code>MemorySet</code></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.activate" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/os/mm/memory_set.rs.html#256-262">source</a></span><a href="#method.activate" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.activate" class="fnname">activate</a>(&amp;self)</h4></section></summary><div class="docblock"><p>Refresh TLB with <code>sfence.vma</code></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.translate" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/os/mm/memory_set.rs.html#264-266">source</a></span><a href="#method.translate" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.translate" class="fnname">translate</a>(&amp;self, vpn: <a class="struct" href="address/struct.VirtPageNum.html" title="struct os::mm::address::VirtPageNum">VirtPageNum</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="page_table/struct.PageTableEntry.html" title="struct os::mm::page_table::PageTableEntry">PageTableEntry</a>&gt;</h4></section></summary><div class="docblock"><p>Translate throuth pagetable</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.recycle_data_pages" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/os/mm/memory_set.rs.html#268-271">source</a></span><a href="#method.recycle_data_pages" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.recycle_data_pages" class="fnname">recycle_data_pages</a>(&amp;mut self)</h4></section></summary><div class="docblock"><p>Remove all <code>MapArea</code></p>

View File

@ -4,16 +4,16 @@
</nav>
<nav class="sidebar"><a class="sidebar-logo" href="../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
</a><h2 class="location"><a href="#">TaskStatus</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#variants">Variants</a></h3><ul><li><a href="#variant.Ready">Ready</a></li><li><a href="#variant.Running">Running</a></li><li><a href="#variant.Zombie">Zombie</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><ul><li><a href="#impl-Clone">Clone</a></li><li><a href="#impl-Copy">Copy</a></li><li><a href="#impl-PartialEq%3CTaskStatus%3E">PartialEq&lt;TaskStatus&gt;</a></li><li><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul><li><a href="#impl-RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send">Send</a></li><li><a href="#impl-Sync">Sync</a></li><li><a href="#impl-Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe">UnwindSafe</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><ul><li><a href="#impl-Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a></li><li><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a></li><li><a href="#impl-From%3CT%3E">From&lt;T&gt;</a></li><li><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a></li><li><a href="#impl-ToOwned">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a></li><li><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></li></ul></div></section><h2 class="location"><a href="index.html">In os::task::task</a></h2><div id="sidebar-vars" data-name="TaskStatus" data-ty="enum" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../os/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
<h1 class="fqn"><span class="in-band">Enum <a href="../../index.html">os</a>::<wbr><a href="../index.html">task</a>::<wbr><a href="index.html">task</a>::<wbr><a class="enum" href="#">TaskStatus</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/os/task/task.rs.html#167-171">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust enum"><code>pub enum TaskStatus {
<h1 class="fqn"><span class="in-band">Enum <a href="../../index.html">os</a>::<wbr><a href="../index.html">task</a>::<wbr><a href="index.html">task</a>::<wbr><a class="enum" href="#">TaskStatus</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/os/task/task.rs.html#165-169">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust enum"><code>pub enum TaskStatus {
Ready,
Running,
Zombie,
}</code></pre></div><h2 id="variants" class="variants small-section-header">Variants<a href="#variants" class="anchor"></a></h2><h3 id="variant.Ready" class="variant small-section-header"><a href="#variant.Ready" class="anchor field"></a><code>Ready</code></h3><h3 id="variant.Running" class="variant small-section-header"><a href="#variant.Running" class="anchor field"></a><code>Running</code></h3><h3 id="variant.Zombie" class="variant small-section-header"><a href="#variant.Zombie" class="anchor field"></a><code>Zombie</code></h3><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Clone" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/os/task/task.rs.html#166">source</a></span><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/os/task/task.rs.html#166">source</a></span><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a></h4></section></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
}</code></pre></div><h2 id="variants" class="variants small-section-header">Variants<a href="#variants" class="anchor"></a></h2><h3 id="variant.Ready" class="variant small-section-header"><a href="#variant.Ready" class="anchor field"></a><code>Ready</code></h3><h3 id="variant.Running" class="variant small-section-header"><a href="#variant.Running" class="anchor field"></a><code>Running</code></h3><h3 id="variant.Zombie" class="variant small-section-header"><a href="#variant.Zombie" class="anchor field"></a><code>Zombie</code></h3><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Clone" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/os/task/task.rs.html#164">source</a></span><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/os/task/task.rs.html#164">source</a></span><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a></h4></section></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#133-135">source</a></span><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&amp;</a>Self)</h4></section></summary><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CTaskStatus%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/os/task/task.rs.html#166">source</a></span><a href="#impl-PartialEq%3CTaskStatus%3E" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;<a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a>&gt; for <a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.eq" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/os/task/task.rs.html#166">source</a></span><a href="#method.eq" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fnname">eq</a>(&amp;self, other: &amp;<a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CTaskStatus%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/os/task/task.rs.html#164">source</a></span><a href="#impl-PartialEq%3CTaskStatus%3E" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;<a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a>&gt; for <a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.eq" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/os/task/task.rs.html#164">source</a></span><a href="#method.eq" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fnname">eq</a>(&amp;self, other: &amp;<a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.ne" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#230">source</a></span><a href="#method.ne" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fnname">ne</a>(&amp;self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&amp;</a>Rhs) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a></h4></section></summary><div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></details></div></details><section id="impl-Copy" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/os/task/task.rs.html#166">source</a></span><a href="#impl-Copy" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a></h3></section><section id="impl-StructuralPartialEq" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/os/task/task.rs.html#166">source</a></span><a href="#impl-StructuralPartialEq" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a></h3></section></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><section id="impl-RefUnwindSafe" class="impl has-srclink"><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a></h3></section><section id="impl-Send" class="impl has-srclink"><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a></h3></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a></h3></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a></h3></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136">source</a></span><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133">source</a></span><a href="#method.type_id" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><section id="impl-Copy" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/os/task/task.rs.html#164">source</a></span><a href="#impl-Copy" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a></h3></section><section id="impl-StructuralPartialEq" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/os/task/task.rs.html#164">source</a></span><a href="#impl-StructuralPartialEq" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a></h3></section></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><section id="impl-RefUnwindSafe" class="impl has-srclink"><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a></h3></section><section id="impl-Send" class="impl has-srclink"><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a></h3></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a></h3></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a></h3></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="enum" href="enum.TaskStatus.html" title="enum os::task::task::TaskStatus">TaskStatus</a></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136">source</a></span><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133">source</a></span><a href="#method.type_id" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214">source</a></span><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a></span><a href="#method.borrow" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&amp;</a>T</h4></section></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222">source</a></span><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219">source</a></span><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&amp;mut </a>T</h4></section></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-562">source</a></span><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559">source</a></span><a href="#method.from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>

View File

@ -4,7 +4,7 @@
</nav>
<nav class="sidebar"><a class="sidebar-logo" href="../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
</a><h2 class="location"><a href="#">Module task</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></div></section><div id="sidebar-vars" data-name="task" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../os/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
<h1 class="fqn"><span class="in-band">Module <a href="../../index.html">os</a>::<wbr><a href="../index.html">task</a>::<wbr><a class="mod" href="#">task</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/os/task/task.rs.html#1-171">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Implementation of <a href="struct.TaskControlBlock.html" title="TaskControlBlock"><code>TaskControlBlock</code></a></p>
<h1 class="fqn"><span class="in-band">Module <a href="../../index.html">os</a>::<wbr><a href="../index.html">task</a>::<wbr><a class="mod" href="#">task</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/os/task/task.rs.html#1-169">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Implementation of <a href="struct.TaskControlBlock.html" title="TaskControlBlock"><code>TaskControlBlock</code></a></p>
</div></details><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TaskControlBlock.html" title="os::task::task::TaskControlBlock struct">TaskControlBlock</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TaskControlBlockInner.html" title="os::task::task::TaskControlBlockInner struct">TaskControlBlockInner</a></div><div class="item-right docblock-short"></div></div></div><h2 id="enums" class="small-section-header"><a href="#enums">Enums</a></h2>
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.TaskStatus.html" title="os::task::task::TaskStatus enum">TaskStatus</a></div><div class="item-right docblock-short"></div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -642,7 +642,7 @@
)
}
<span class="doccomment">///Clone a same `MemorySet`</span>
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">from_existed_user</span>(<span class="ident">user_space</span>: <span class="kw-2">&amp;</span><span class="self">Self</span>) -&gt; <span class="self">Self</span> {
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">from_existed_user</span>(<span class="ident">user_space</span>: <span class="kw-2">&amp;</span><span class="ident">MemorySet</span>) -&gt; <span class="ident">MemorySet</span> {
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">memory_set</span> <span class="op">=</span> <span class="ident"><span class="self">Self</span>::new_bare</span>();
<span class="comment">// map trampoline</span>
<span class="ident">memory_set</span>.<span class="ident">map_trampoline</span>();
@ -703,7 +703,7 @@
<span class="ident">map_perm</span>,
}
}
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">from_another</span>(<span class="ident">another</span>: <span class="kw-2">&amp;</span><span class="self">Self</span>) -&gt; <span class="self">Self</span> {
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">from_another</span>(<span class="ident">another</span>: <span class="kw-2">&amp;</span><span class="ident">MapArea</span>) -&gt; <span class="self">Self</span> {
<span class="self">Self</span> {
<span class="ident">vpn_range</span>: <span class="ident">VPNRange::new</span>(<span class="ident">another</span>.<span class="ident">vpn_range</span>.<span class="ident">get_start</span>(), <span class="ident">another</span>.<span class="ident">vpn_range</span>.<span class="ident">get_end</span>()),
<span class="ident">data_frames</span>: <span class="ident">BTreeMap::new</span>(),

View File

@ -172,8 +172,6 @@
<span id="167">167</span>
<span id="168">168</span>
<span id="169">169</span>
<span id="170">170</span>
<span id="171">171</span>
</pre><pre class="rust"><code><span class="doccomment">//!Implementation of [`TaskControlBlock`]</span>
<span class="kw">use</span> <span class="ident"><span class="kw">super</span>::TaskContext</span>;
<span class="kw">use</span> <span class="kw">super</span>::{<span class="ident">pid_alloc</span>, <span class="ident">KernelStack</span>, <span class="ident">PidHandle</span>};
@ -281,8 +279,6 @@
<span class="ident">inner</span>.<span class="ident">memory_set</span> <span class="op">=</span> <span class="ident">memory_set</span>;
<span class="comment">// update trap_cx ppn</span>
<span class="ident">inner</span>.<span class="ident">trap_cx_ppn</span> <span class="op">=</span> <span class="ident">trap_cx_ppn</span>;
<span class="comment">// initialize base_size</span>
<span class="ident">inner</span>.<span class="ident">base_size</span> <span class="op">=</span> <span class="ident">user_sp</span>;
<span class="comment">// initialize trap_cx</span>
<span class="kw">let</span> <span class="ident">trap_cx</span> <span class="op">=</span> <span class="ident">inner</span>.<span class="ident">get_trap_cx</span>();
<span class="kw-2">*</span><span class="ident">trap_cx</span> <span class="op">=</span> <span class="ident">TrapContext::app_init_context</span>(
@ -294,7 +290,7 @@
);
<span class="comment">// **** release inner automatically</span>
}
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">fork</span>(<span class="self">self</span>: <span class="kw-2">&amp;</span><span class="ident">Arc</span><span class="op">&lt;</span><span class="self">Self</span><span class="op">&gt;</span>) -&gt; <span class="ident">Arc</span><span class="op">&lt;</span><span class="self">Self</span><span class="op">&gt;</span> {
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">fork</span>(<span class="self">self</span>: <span class="kw-2">&amp;</span><span class="ident">Arc</span><span class="op">&lt;</span><span class="ident">TaskControlBlock</span><span class="op">&gt;</span>) -&gt; <span class="ident">Arc</span><span class="op">&lt;</span><span class="ident">TaskControlBlock</span><span class="op">&gt;</span> {
<span class="comment">// ---- access parent PCB exclusively</span>
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">parent_inner</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">inner_exclusive_access</span>();
<span class="comment">// copy user space(include trap context)</span>