mirror of
https://github.com/rcore-os/rCore-Tutorial-v3.git
synced 2024-11-24 10:26:25 +04:00
deploy: 7c785f8bbf
This commit is contained in:
parent
9a52c0f148
commit
e88c823020
@ -4,6 +4,6 @@
|
||||
</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><div class="sidebar-elems"><h2 class="location"><a href="index.html">In os::mm</a></h2><div id="sidebar-vars" data-name="init" data-ty="fn" 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">Function <a href="../index.html">os</a>::<wbr><a href="index.html">mm</a>::<wbr><a class="fn" href="#">init</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/mm/mod.rs.html#25-29">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn init()</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>initiate heap allocator, frame allocator and kernel space</p>
|
||||
<h1 class="fqn"><span class="in-band">Function <a href="../index.html">os</a>::<wbr><a href="index.html">mm</a>::<wbr><a class="fn" href="#">init</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/mm/mod.rs.html#24-28">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn init()</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>initiate heap allocator, frame allocator and kernel space</p>
|
||||
</div></details></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>
|
||||
</body></html>
|
@ -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 mm</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#modules">Modules</a></li><li><a href="#functions">Functions</a></li></ul></div></section><div id="sidebar-vars" data-name="mm" 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 class="mod" href="#">mm</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/mm/mod.rs.html#1-29">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Memory management implementation</p>
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../index.html">os</a>::<wbr><a class="mod" href="#">mm</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/mm/mod.rs.html#1-28">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Memory management implementation</p>
|
||||
<p>SV39 page-based virtual-memory architecture for RV64 systems, and
|
||||
everything about memory management, like frame allocator, page table,
|
||||
map area and memory set, is implemented here.</p>
|
||||
|
@ -4,5 +4,5 @@
|
||||
</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><div class="sidebar-elems"><h2 class="location"><a href="index.html">In os::mm::memory_set</a></h2><div id="sidebar-vars" data-name="remap_test" data-ty="fn" 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">Function <a href="../../index.html">os</a>::<wbr><a href="../index.html">mm</a>::<wbr><a href="index.html">memory_set</a>::<wbr><a class="fn" href="#">remap_test</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/mm/memory_set.rs.html#322-349">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn remap_test()</code></pre></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>
|
||||
<h1 class="fqn"><span class="in-band">Function <a href="../../index.html">os</a>::<wbr><a href="../index.html">mm</a>::<wbr><a href="index.html">memory_set</a>::<wbr><a class="fn" href="#">remap_test</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/mm/memory_set.rs.html#322-343">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn remap_test()</code></pre></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>
|
||||
</body></html>
|
@ -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 memory_set</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><li><a href="#functions">Functions</a></li></ul></div></section><div id="sidebar-vars" data-name="memory_set" 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">mm</a>::<wbr><a class="mod" href="#">memory_set</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/mm/memory_set.rs.html#1-349">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</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.MapArea.html" title="MapArea"><code>MapArea</code></a> and <a href="struct.MemorySet.html" title="MemorySet"><code>MemorySet</code></a>.</p>
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../../index.html">os</a>::<wbr><a href="../index.html">mm</a>::<wbr><a class="mod" href="#">memory_set</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/mm/memory_set.rs.html#1-343">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</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.MapArea.html" title="MapArea"><code>MapArea</code></a> and <a href="struct.MemorySet.html" title="MemorySet"><code>MemorySet</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.KERNEL_SPACE.html" title="os::mm::memory_set::KERNEL_SPACE struct">KERNEL_SPACE</a></div><div class="item-right docblock-short"><p>a memory set instance through lazy_static! managing kernel space</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.MapArea.html" title="os::mm::memory_set::MapArea struct">MapArea</a></div><div class="item-right docblock-short"><p>map area structure, controls a contiguous piece of virtual memory</p>
|
||||
|
@ -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><div class="sidebar-elems"><h2 class="location"><a href="index.html">In os::trap</a></h2><div id="sidebar-vars" data-name="trap_from_kernel" data-ty="fn" 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">Function <a href="../index.html">os</a>::<wbr><a href="index.html">trap</a>::<wbr><a class="fn" href="#">trap_from_kernel</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/trap/mod.rs.html#119-121">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>#[no_mangle]
|
||||
<h1 class="fqn"><span class="in-band">Function <a href="../index.html">os</a>::<wbr><a href="index.html">trap</a>::<wbr><a class="fn" href="#">trap_from_kernel</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/trap/mod.rs.html#121-123">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>#[no_mangle]
|
||||
pub fn trap_from_kernel() -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.never.html">!</a></code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Unimplement: traps/interrupts/exceptions from kernel mode
|
||||
Todo: Chapter 9: I/O device</p>
|
||||
</div></details></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>
|
||||
|
@ -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><div class="sidebar-elems"><h2 class="location"><a href="index.html">In os::trap</a></h2><div id="sidebar-vars" data-name="trap_handler" data-ty="fn" 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">Function <a href="../index.html">os</a>::<wbr><a href="index.html">trap</a>::<wbr><a class="fn" href="#">trap_handler</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/trap/mod.rs.html#57-89">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>#[no_mangle]
|
||||
<h1 class="fqn"><span class="in-band">Function <a href="../index.html">os</a>::<wbr><a href="index.html">trap</a>::<wbr><a class="fn" href="#">trap_handler</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/trap/mod.rs.html#57-91">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>#[no_mangle]
|
||||
pub fn trap_handler() -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.never.html">!</a></code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>handle an interrupt, exception, or system call from user space</p>
|
||||
</div></details></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>
|
||||
</body></html>
|
@ -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><div class="sidebar-elems"><h2 class="location"><a href="index.html">In os::trap</a></h2><div id="sidebar-vars" data-name="trap_return" data-ty="fn" 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">Function <a href="../index.html">os</a>::<wbr><a href="index.html">trap</a>::<wbr><a class="fn" href="#">trap_return</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/trap/mod.rs.html#95-114">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>#[no_mangle]
|
||||
<h1 class="fqn"><span class="in-band">Function <a href="../index.html">os</a>::<wbr><a href="index.html">trap</a>::<wbr><a class="fn" href="#">trap_return</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/trap/mod.rs.html#97-116">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>#[no_mangle]
|
||||
pub fn trap_return() -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.never.html">!</a></code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>set the new addr of __restore asm function in TRAMPOLINE page,
|
||||
set the reg a0 = trap_cx_ptr, reg a1 = phy addr of usr page table,
|
||||
finally, jump to new addr of __restore asm function</p>
|
||||
|
@ -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 trap</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li></ul></div></section><div id="sidebar-vars" data-name="trap" 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 class="mod" href="#">trap</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/trap/mod.rs.html#1-123">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Trap handling functionality</p>
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../index.html">os</a>::<wbr><a class="mod" href="#">trap</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/trap/mod.rs.html#1-125">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Trap handling functionality</p>
|
||||
<p>For rCore, we have a single trap entry point, namely <code>__alltraps</code>. At
|
||||
initialization in <a href="fn.init.html" title="init()"><code>init()</code></a>, we set the <code>stvec</code> CSR to point to it.</p>
|
||||
<p>All traps go through <code>__alltraps</code>, which is defined in <code>trap.S</code>. The
|
||||
|
@ -346,12 +346,6 @@
|
||||
<span id="341">341</span>
|
||||
<span id="342">342</span>
|
||||
<span id="343">343</span>
|
||||
<span id="344">344</span>
|
||||
<span id="345">345</span>
|
||||
<span id="346">346</span>
|
||||
<span id="347">347</span>
|
||||
<span id="348">348</span>
|
||||
<span id="349">349</span>
|
||||
</pre><pre class="rust"><code><span class="doccomment">//! Implementation of [`MapArea`] and [`MemorySet`].</span>
|
||||
|
||||
<span class="kw">use</span> <span class="kw">super</span>::{<span class="ident">frame_alloc</span>, <span class="ident">FrameTracker</span>};
|
||||
@ -678,27 +672,21 @@
|
||||
<span class="kw">let</span> <span class="ident">mid_text</span>: <span class="ident">VirtAddr</span> <span class="op">=</span> ((<span class="ident">stext</span> <span class="kw">as</span> <span class="ident">usize</span> <span class="op">+</span> <span class="ident">etext</span> <span class="kw">as</span> <span class="ident">usize</span>) <span class="op">/</span> <span class="number">2</span>).<span class="ident">into</span>();
|
||||
<span class="kw">let</span> <span class="ident">mid_rodata</span>: <span class="ident">VirtAddr</span> <span class="op">=</span> ((<span class="ident">srodata</span> <span class="kw">as</span> <span class="ident">usize</span> <span class="op">+</span> <span class="ident">erodata</span> <span class="kw">as</span> <span class="ident">usize</span>) <span class="op">/</span> <span class="number">2</span>).<span class="ident">into</span>();
|
||||
<span class="kw">let</span> <span class="ident">mid_data</span>: <span class="ident">VirtAddr</span> <span class="op">=</span> ((<span class="ident">sdata</span> <span class="kw">as</span> <span class="ident">usize</span> <span class="op">+</span> <span class="ident">edata</span> <span class="kw">as</span> <span class="ident">usize</span>) <span class="op">/</span> <span class="number">2</span>).<span class="ident">into</span>();
|
||||
<span class="macro">assert!</span>(
|
||||
<span class="op">!</span><span class="ident">kernel_space</span>
|
||||
<span class="macro">assert!</span>(<span class="op">!</span><span class="ident">kernel_space</span>
|
||||
.<span class="ident">page_table</span>
|
||||
.<span class="ident">translate</span>(<span class="ident">mid_text</span>.<span class="ident">floor</span>())
|
||||
.<span class="ident">unwrap</span>()
|
||||
.<span class="ident">writable</span>(),
|
||||
);
|
||||
<span class="macro">assert!</span>(
|
||||
<span class="op">!</span><span class="ident">kernel_space</span>
|
||||
.<span class="ident">writable</span>(),);
|
||||
<span class="macro">assert!</span>(<span class="op">!</span><span class="ident">kernel_space</span>
|
||||
.<span class="ident">page_table</span>
|
||||
.<span class="ident">translate</span>(<span class="ident">mid_rodata</span>.<span class="ident">floor</span>())
|
||||
.<span class="ident">unwrap</span>()
|
||||
.<span class="ident">writable</span>(),
|
||||
);
|
||||
<span class="macro">assert!</span>(
|
||||
<span class="op">!</span><span class="ident">kernel_space</span>
|
||||
.<span class="ident">writable</span>(),);
|
||||
<span class="macro">assert!</span>(<span class="op">!</span><span class="ident">kernel_space</span>
|
||||
.<span class="ident">page_table</span>
|
||||
.<span class="ident">translate</span>(<span class="ident">mid_data</span>.<span class="ident">floor</span>())
|
||||
.<span class="ident">unwrap</span>()
|
||||
.<span class="ident">executable</span>(),
|
||||
);
|
||||
.<span class="ident">executable</span>(),);
|
||||
<span class="macro">println!</span>(<span class="string">"remap_test passed!"</span>);
|
||||
}
|
||||
</code></pre></div>
|
||||
|
@ -31,7 +31,6 @@
|
||||
<span id="26">26</span>
|
||||
<span id="27">27</span>
|
||||
<span id="28">28</span>
|
||||
<span id="29">29</span>
|
||||
</pre><pre class="rust"><code><span class="doccomment">//! Memory management implementation</span>
|
||||
<span class="doccomment">//!</span>
|
||||
<span class="doccomment">//! SV39 page-based virtual-memory architecture for RV64 systems, and</span>
|
||||
@ -40,7 +39,6 @@
|
||||
<span class="doccomment">//!</span>
|
||||
<span class="doccomment">//! Every task or process has a memory_set to control its virtual memory.</span>
|
||||
|
||||
|
||||
<span class="kw">mod</span> <span class="ident">address</span>;
|
||||
<span class="kw">mod</span> <span class="ident">frame_allocator</span>;
|
||||
<span class="kw">mod</span> <span class="ident">heap_allocator</span>;
|
||||
|
@ -126,6 +126,8 @@
|
||||
<span id="121">121</span>
|
||||
<span id="122">122</span>
|
||||
<span id="123">123</span>
|
||||
<span id="124">124</span>
|
||||
<span id="125">125</span>
|
||||
</pre><pre class="rust"><code><span class="doccomment">//! Trap handling functionality</span>
|
||||
<span class="doccomment">//!</span>
|
||||
<span class="doccomment">//! For rCore, we have a single trap entry point, namely `__alltraps`. At</span>
|
||||
@ -192,8 +194,10 @@
|
||||
<span class="ident">cx</span>.<span class="ident">sepc</span> <span class="op">+</span><span class="op">=</span> <span class="number">4</span>;
|
||||
<span class="ident">cx</span>.<span class="ident">x</span>[<span class="number">10</span>] <span class="op">=</span> <span class="ident">syscall</span>(<span class="ident">cx</span>.<span class="ident">x</span>[<span class="number">17</span>], [<span class="ident">cx</span>.<span class="ident">x</span>[<span class="number">10</span>], <span class="ident">cx</span>.<span class="ident">x</span>[<span class="number">11</span>], <span class="ident">cx</span>.<span class="ident">x</span>[<span class="number">12</span>]]) <span class="kw">as</span> <span class="ident">usize</span>;
|
||||
}
|
||||
<span class="ident">Trap::Exception</span>(<span class="ident">Exception::StoreFault</span>) <span class="op">|</span> <span class="ident">Trap::Exception</span>(<span class="ident">Exception::StorePageFault</span>) <span class="op">|</span>
|
||||
<span class="ident">Trap::Exception</span>(<span class="ident">Exception::LoadFault</span>) <span class="op">|</span> <span class="ident">Trap::Exception</span>(<span class="ident">Exception::LoadPageFault</span>) => {
|
||||
<span class="ident">Trap::Exception</span>(<span class="ident">Exception::StoreFault</span>)
|
||||
<span class="op">|</span> <span class="ident">Trap::Exception</span>(<span class="ident">Exception::StorePageFault</span>)
|
||||
<span class="op">|</span> <span class="ident">Trap::Exception</span>(<span class="ident">Exception::LoadFault</span>)
|
||||
<span class="op">|</span> <span class="ident">Trap::Exception</span>(<span class="ident">Exception::LoadPageFault</span>) => {
|
||||
<span class="macro">println!</span>(<span class="string">"[kernel] PageFault in application, bad addr = {:#x}, bad instruction = {:#x}, kernel killed it."</span>, <span class="ident">stval</span>, <span class="ident">cx</span>.<span class="ident">sepc</span>);
|
||||
<span class="ident">exit_current_and_run_next</span>();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user