diff --git a/ch9-gui-dev/.lock b/ch9-gui-dev/.lock new file mode 100755 index 00000000..e69de29b diff --git a/ch9-gui-dev/COPYRIGHT.txt b/ch9-gui-dev/COPYRIGHT.txt new file mode 100644 index 00000000..34e48134 --- /dev/null +++ b/ch9-gui-dev/COPYRIGHT.txt @@ -0,0 +1,46 @@ +These documentation pages include resources by third parties. This copyright +file applies only to those resources. The following third party resources are +included, and carry their own copyright notices and license terms: + +* Fira Sans (FiraSans-Regular.woff2, FiraSans-Medium.woff2): + + Copyright (c) 2014, Mozilla Foundation https://mozilla.org/ + with Reserved Font Name Fira Sans. + + Copyright (c) 2014, Telefonica S.A. + + Licensed under the SIL Open Font License, Version 1.1. + See FiraSans-LICENSE.txt. + +* rustdoc.css, main.js, and playpen.js: + + Copyright 2015 The Rust Developers. + Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or + the MIT license (LICENSE-MIT.txt) at your option. + +* normalize.css: + + Copyright (c) Nicolas Gallagher and Jonathan Neal. + Licensed under the MIT license (see LICENSE-MIT.txt). + +* Source Code Pro (SourceCodePro-Regular.ttf.woff2, + SourceCodePro-Semibold.ttf.woff2, SourceCodePro-It.ttf.woff2): + + Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), + with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark + of Adobe Systems Incorporated in the United States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceCodePro-LICENSE.txt. + +* Source Serif 4 (SourceSerif4-Regular.ttf.woff2, SourceSerif4-Bold.ttf.woff2, + SourceSerif4-It.ttf.woff2): + + Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name + 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United + States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceSerif4-LICENSE.md. + +This copyright file is intended to be distributed with rustdoc output. diff --git a/ch9-gui-dev/FiraSans-LICENSE.txt b/ch9-gui-dev/FiraSans-LICENSE.txt new file mode 100644 index 00000000..ff9afab0 --- /dev/null +++ b/ch9-gui-dev/FiraSans-LICENSE.txt @@ -0,0 +1,94 @@ +Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A. +with Reserved Font Name < Fira >, + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/ch9-gui-dev/FiraSans-Medium.woff2 b/ch9-gui-dev/FiraSans-Medium.woff2 new file mode 100644 index 00000000..7a1e5fc5 Binary files /dev/null and b/ch9-gui-dev/FiraSans-Medium.woff2 differ diff --git a/ch9-gui-dev/FiraSans-Regular.woff2 b/ch9-gui-dev/FiraSans-Regular.woff2 new file mode 100644 index 00000000..e766e06c Binary files /dev/null and b/ch9-gui-dev/FiraSans-Regular.woff2 differ diff --git a/ch9-gui-dev/LICENSE-APACHE.txt b/ch9-gui-dev/LICENSE-APACHE.txt new file mode 100644 index 00000000..16fe87b0 --- /dev/null +++ b/ch9-gui-dev/LICENSE-APACHE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/ch9-gui-dev/LICENSE-MIT.txt b/ch9-gui-dev/LICENSE-MIT.txt new file mode 100644 index 00000000..31aa7938 --- /dev/null +++ b/ch9-gui-dev/LICENSE-MIT.txt @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/ch9-gui-dev/NanumBarunGothic-LICENSE.txt b/ch9-gui-dev/NanumBarunGothic-LICENSE.txt new file mode 100644 index 00000000..0bf46682 --- /dev/null +++ b/ch9-gui-dev/NanumBarunGothic-LICENSE.txt @@ -0,0 +1,99 @@ +Copyright (c) 2010, NAVER Corporation (https://www.navercorp.com/), + +with Reserved Font Name Nanum, Naver Nanum, NanumGothic, Naver NanumGothic, +NanumMyeongjo, Naver NanumMyeongjo, NanumBrush, Naver NanumBrush, NanumPen, +Naver NanumPen, Naver NanumGothicEco, NanumGothicEco, Naver NanumMyeongjoEco, +NanumMyeongjoEco, Naver NanumGothicLight, NanumGothicLight, NanumBarunGothic, +Naver NanumBarunGothic, NanumSquareRound, NanumBarunPen, MaruBuri + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/ch9-gui-dev/NanumBarunGothic.ttf.woff2 b/ch9-gui-dev/NanumBarunGothic.ttf.woff2 new file mode 100644 index 00000000..1866ad4b Binary files /dev/null and b/ch9-gui-dev/NanumBarunGothic.ttf.woff2 differ diff --git a/ch9-gui-dev/SourceCodePro-It.ttf.woff2 b/ch9-gui-dev/SourceCodePro-It.ttf.woff2 new file mode 100644 index 00000000..462c34ef Binary files /dev/null and b/ch9-gui-dev/SourceCodePro-It.ttf.woff2 differ diff --git a/ch9-gui-dev/SourceCodePro-LICENSE.txt b/ch9-gui-dev/SourceCodePro-LICENSE.txt new file mode 100644 index 00000000..07542572 --- /dev/null +++ b/ch9-gui-dev/SourceCodePro-LICENSE.txt @@ -0,0 +1,93 @@ +Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/ch9-gui-dev/SourceCodePro-Regular.ttf.woff2 b/ch9-gui-dev/SourceCodePro-Regular.ttf.woff2 new file mode 100644 index 00000000..10b558e0 Binary files /dev/null and b/ch9-gui-dev/SourceCodePro-Regular.ttf.woff2 differ diff --git a/ch9-gui-dev/SourceCodePro-Semibold.ttf.woff2 b/ch9-gui-dev/SourceCodePro-Semibold.ttf.woff2 new file mode 100644 index 00000000..5ec64eef Binary files /dev/null and b/ch9-gui-dev/SourceCodePro-Semibold.ttf.woff2 differ diff --git a/ch9-gui-dev/SourceSerif4-Bold.ttf.woff2 b/ch9-gui-dev/SourceSerif4-Bold.ttf.woff2 new file mode 100644 index 00000000..db57d214 Binary files /dev/null and b/ch9-gui-dev/SourceSerif4-Bold.ttf.woff2 differ diff --git a/ch9-gui-dev/SourceSerif4-It.ttf.woff2 b/ch9-gui-dev/SourceSerif4-It.ttf.woff2 new file mode 100644 index 00000000..1cbc021a Binary files /dev/null and b/ch9-gui-dev/SourceSerif4-It.ttf.woff2 differ diff --git a/ch9-gui-dev/SourceSerif4-LICENSE.md b/ch9-gui-dev/SourceSerif4-LICENSE.md new file mode 100644 index 00000000..68ea1892 --- /dev/null +++ b/ch9-gui-dev/SourceSerif4-LICENSE.md @@ -0,0 +1,93 @@ +Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/ch9-gui-dev/SourceSerif4-Regular.ttf.woff2 b/ch9-gui-dev/SourceSerif4-Regular.ttf.woff2 new file mode 100644 index 00000000..2db73fe2 Binary files /dev/null and b/ch9-gui-dev/SourceSerif4-Regular.ttf.woff2 differ diff --git a/ch9-gui-dev/ayu.css b/ch9-gui-dev/ayu.css new file mode 100644 index 00000000..f98b3417 --- /dev/null +++ b/ch9-gui-dev/ayu.css @@ -0,0 +1 @@ + :root{--main-background-color:#0f1419;--main-color:#c5c5c5;--settings-input-color:#ffb454;--sidebar-background-color:#14191f;--sidebar-background-color-hover:rgba(70,70,70,0.33);--code-block-background-color:#191f26;--scrollbar-track-background-color:transparent;--scrollbar-thumb-background-color:#5c6773;--scrollbar-color:#5c6773 #24292f;--headings-border-bottom-color:#5c6773;}.slider{background-color:#ccc;}.slider:before{background-color:white;}input:focus+.slider{box-shadow:0 0 0 2px #0a84ff,0 0 0 6px rgba(10,132,255,0.3);}h1,h2,h3,h4{color:white;}h1.fqn a{color:#fff;}h4{border:none;}.in-band{background-color:#0f1419;}.docblock code{color:#ffb454;}.code-header{color:#e6e1cf;}.docblock pre>code,pre>code{color:#e6e1cf;}span code{color:#e6e1cf;}.docblock a>code{color:#39AFD7 !important;}pre,.rustdoc.source .example-wrap{color:#e6e1cf;}.rust-logo{filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);}.sidebar .current,.sidebar a:hover{background-color:transparent;color:#ffb44c;}.sidebar-elems .location{color:#ff7733;}.line-numbers span{color:#5c6773;}.line-numbers .line-highlighted{color:#708090;background-color:rgba(255,236,164,0.06);padding-right:4px;border-right:1px solid #ffb44c;}.docblock table td,.docblock table th{border-color:#5c6773;}.search-results a:hover{background-color:#777;}.search-results a:focus{color:#000 !important;background-color:#c6afb3;}.search-results a{color:#0096cf;}.search-results a div.desc{color:#c5c5c5;}.content .item-info::before{color:#ccc;}.content span.foreigntype,.content a.foreigntype{color:#ffa0a5;}.content span.union,.content a.union{color:#ffa0a5;}.content span.constant,.content a.constant,.content span.static,.content a.static{color:#39AFD7;}.content span.primitive,.content a.primitive{color:#ffa0a5;}.content span.traitalias,.content a.traitalias{color:#39AFD7;}.content span.keyword,.content a.keyword{color:#39AFD7;}.content span.externcrate,.content span.mod,.content a.mod{color:#39AFD7;}.content span.struct,.content a.struct{color:#ffa0a5;}.content span.enum,.content a.enum{color:#ffa0a5;}.content span.trait,.content a.trait{color:#39AFD7;}.content span.type,.content a.type{color:#39AFD7;}.content span.type,.content a.type,.block a.current.type{color:#39AFD7;}.content span.associatedtype,.content a.associatedtype,.block a.current.associatedtype{color:#39AFD7;}.content span.fn,.content a.fn,.content span.method,.content a.method,.content span.tymethod,.content a.tymethod,.content .fnname{color:#fdd687;}.content span.attr,.content a.attr,.content span.derive,.content a.derive,.content span.macro,.content a.macro{color:#a37acc;}.sidebar a{color:#53b1db;}.sidebar a.current.type{color:#53b1db;}.sidebar a.current.associatedtype{color:#53b1db;}pre.rust .comment{color:#788797;}pre.rust .doccomment{color:#a1ac88;}nav.main .current{border-top-color:#5c6773;border-bottom-color:#5c6773;}nav.main .separator{border:1px solid #5c6773;}a{color:#39AFD7;}.sidebar h2 a,.sidebar h3 a{color:white;}.search-results a{color:#0096cf;}body.source .example-wrap pre.rust a{background:#333;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before{color:#999;}details.rustdoc-toggle>summary::before{filter:invert(100%);}#crate-search,.search-input{background-color:#141920;border-color:#424c57;}#crate-search{border-color:#424c57 !important;}.search-input{color:#ffffff;}.module-item .stab,.import-item .stab{color:#000;}.stab.empty-impl{}.stab.must_implement{}.stab.unstable,.stab.deprecated,.stab.portability,.stab.empty-impl,.stab.must_implement{color:#c5c5c5;background:#314559 !important;border-style:none !important;border-radius:4px;padding:3px 6px 3px 6px;}.stab.portability>code{color:#e6e1cf;background:none;}.rightside,.out-of-band{color:grey;}.result-name .primitive>i,.result-name .keyword>i{color:#788797;}.line-numbers :target{background-color:transparent;}pre.rust .number,pre.rust .string{color:#b8cc52;}pre.rust .kw,pre.rust .kw-2,pre.rust .prelude-ty,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .op,pre.rust .lifetime{color:#ff7733;}pre.rust .macro,pre.rust .macro-nonterminal{color:#a37acc;}pre.rust .question-mark{color:#ff9011;}pre.rust .self{color:#36a3d9;font-style:italic;}pre.rust .attribute{color:#e6e1cf;}pre.rust .attribute .ident,pre.rust .attribute .op{color:#e6e1cf;}.example-wrap>pre.line-number{color:#5c67736e;border:none;}a.test-arrow{font-size:100%;color:#788797;border-radius:4px;background-color:rgba(57,175,215,0.09);}a.test-arrow:hover{background-color:rgba(57,175,215,0.368);color:#c5c5c5;}.toggle-label,.code-attribute{color:#999;}:target{background:rgba(255,236,164,0.06);border-right:3px solid rgba(255,180,76,0.85);}pre.compile_fail{border-left:2px solid rgba(255,0,0,.4);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.4);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.5);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.5);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#39AFD7;}.tooltip::after{background-color:#314559;color:#c5c5c5;border:1px solid #5c6773;}.tooltip::before{border-color:transparent #314559 transparent transparent;}.notable-traits-tooltiptext{background-color:#314559;border-color:#5c6773;}.notable-traits-tooltiptext .notable{border-bottom-color:#5c6773;}#titles>button.selected{background-color:#141920 !important;border-bottom:1px solid #ffb44c !important;border-top:none;}#titles>button:not(.selected){background-color:transparent !important;border:none;}#titles>button:hover{border-bottom:1px solid rgba(242,151,24,0.3);}#titles>button>div.count{color:#888;}.search-input:focus{}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{}.content span.struct,.content a.struct,.block a.current.struct{}#titles>button:hover,#titles>button.selected{}.content span.typedef,.content a.typedef,.block a.current.typedef{}.content span.union,.content a.union,.block a.current.union{}pre.rust .lifetime{}.stab.unstable{}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){}.content span.enum,.content a.enum,.block a.current.enum{}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{}.content span.keyword,.content a.keyword,.block a.current.keyword{}pre.rust .comment{}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{}pre.rust .kw{}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{}pre.rust .doccomment{}.stab.deprecated{}.content a.attr,.content a.derive,.content a.macro{}.stab.portability{}.content span.primitive,.content a.primitive,.block a.current.primitive{}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{}pre.rust .kw-2,pre.rust .prelude-ty{}.content span.trait,.content a.trait,.block a.current.trait{}.search-results a:focus span{}a.result-trait:focus{}a.result-traitalias:focus{}a.result-mod:focus,a.result-externcrate:focus{}a.result-mod:focus{}a.result-externcrate:focus{}a.result-enum:focus{}a.result-struct:focus{}a.result-union:focus{}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{}a.result-type:focus{}a.result-associatedtype:focus{}a.result-foreigntype:focus{}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{}a.result-constant:focus,a.result-static:focus{}a.result-primitive:focus{}a.result-keyword:focus{}.sidebar a.current.enum{}.sidebar a.current.struct{}.sidebar a.current.foreigntype{}.sidebar a.current.attr,.sidebar a.current.derive,.sidebar a.current.macro{}.sidebar a.current.union{}.sidebar a.current.constant .sidebar a.current.static{}.sidebar a.current.primitive{}.sidebar a.current.externcrate .sidebar a.current.mod{}.sidebar a.current.trait{}.sidebar a.current.traitalias{}.sidebar a.current.fn,.sidebar a.current.method,.sidebar a.current.tymethod{}.sidebar a.current.keyword{}@media (max-width:700px){.sidebar-elems{border-right-color:#5c6773;}}kbd{color:#c5c5c5;background-color:#314559;border-color:#5c6773;border-bottom-color:#5c6773;box-shadow:inset 0 -1px 0 #5c6773;}#settings-menu>a,#help-button>button{border-color:#5c6773;background-color:#0f1419;color:#fff;}#settings-menu>a img{filter:invert(100);}.popover,.popover::before,#help-button span.top,#help-button span.bottom{border-color:#5c6773;}#copy-path{color:#fff;}#copy-path>img{filter:invert(70%);}#copy-path:hover>img{filter:invert(100%);}#settings-menu>a:hover,#settings-menu>a:focus,#help-button>button:hover,#help-button>button:focus{border-color:#e0e0e0;}#theme-choices{border-color:#5c6773;background-color:#0f1419;}#theme-choices>button:not(:first-child){border-top-color:#5c6773;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:rgba(110,110,110,0.33);}.search-results .result-name span.alias{color:#c5c5c5;}.search-results .result-name span.grey{color:#999;}#source-sidebar>.title{color:#fff;border-bottom-color:#5c6773;}#source-sidebar div.files>a:hover,details.dir-entry summary:hover,#source-sidebar div.files>a:focus,details.dir-entry summary:focus{background-color:#14191f;color:#ffb44c;}#source-sidebar div.files>a.selected{background-color:#14191f;color:#ffb44c;}.scraped-example-list .scrape-help{border-color:#aaa;color:#eee;}.scraped-example-list .scrape-help:hover{border-color:white;color:white;}.more-examples-toggle summary,.more-examples-toggle .hide-more{color:#999;}.scraped-example .example-wrap .rust span.highlight{background:rgb(91,59,1);}.scraped-example .example-wrap .rust span.highlight.focus{background:rgb(124,75,15);}.scraped-example:not(.expanded) .code-wrapper:before{background:linear-gradient(to bottom,rgba(15,20,25,1),rgba(15,20,25,0));}.scraped-example:not(.expanded) .code-wrapper:after{background:linear-gradient(to top,rgba(15,20,25,1),rgba(15,20,25,0));}.toggle-line-inner{background:#999;}.toggle-line:hover .toggle-line-inner{background:#c5c5c5;} \ No newline at end of file diff --git a/ch9-gui-dev/clipboard.svg b/ch9-gui-dev/clipboard.svg new file mode 100644 index 00000000..8adbd996 --- /dev/null +++ b/ch9-gui-dev/clipboard.svg @@ -0,0 +1 @@ + diff --git a/ch9-gui-dev/crates.js b/ch9-gui-dev/crates.js new file mode 100644 index 00000000..58e198fb --- /dev/null +++ b/ch9-gui-dev/crates.js @@ -0,0 +1 @@ +window.ALL_CRATES = ["os"]; \ No newline at end of file diff --git a/ch9-gui-dev/dark.css b/ch9-gui-dev/dark.css new file mode 100644 index 00000000..242423d0 --- /dev/null +++ b/ch9-gui-dev/dark.css @@ -0,0 +1 @@ +:root{--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--sidebar-background-color:#505050;--sidebar-background-color-hover:#676767;--code-block-background-color:#2A2A2A;--scrollbar-track-background-color:#717171;--scrollbar-thumb-background-color:rgba(32,34,37,.6);--scrollbar-color:rgba(32,34,37,.6) #5a5a5a;--headings-border-bottom-color:#d2d2d2;}.slider{background-color:#ccc;}.slider:before{background-color:white;}input:focus+.slider{box-shadow:0 0 0 2px #0a84ff,0 0 0 6px rgba(10,132,255,0.3);}.in-band{background-color:#353535;}.rust-logo{filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff)}.sidebar .current,.sidebar a:hover{background:#444;}.line-numbers span{color:#3B91E2;}.line-numbers .line-highlighted{background-color:#0a042f !important;}.docblock table td,.docblock table th{border-color:#ddd;}.search-results a:hover{background-color:#777;}.search-results a:focus{color:#eee !important;background-color:#616161;}.search-results a:focus span{color:#eee !important;}a.result-trait:focus{background-color:#013191;}a.result-traitalias:focus{background-color:#013191;}a.result-mod:focus,a.result-externcrate:focus{background-color:#884719;}a.result-enum:focus{background-color:#194e9f;}a.result-struct:focus{background-color:#194e9f;}a.result-union:focus{background-color:#194e9f;}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{background-color:#4950ed;}a.result-type:focus{background-color:#194e9f;}a.result-associatedtype:focus{background-color:#884719;}a.result-foreigntype:focus{background-color:#194e9f;}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{background-color:#217d1c;}a.result-constant:focus,a.result-static:focus{background-color:#884719;}a.result-primitive:focus{background-color:#194e9f;}a.result-keyword:focus{background-color:#884719;}.content .item-info::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#2dbfb8;}.content span.struct,.content a.struct,.block a.current.struct{color:#2dbfb8;}.content span.type,.content a.type,.block a.current.type{color:#2dbfb8;}.content span.associatedtype,.content a.associatedtype,.block a.current.associatedtype{color:#D2991D;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#2dbfb8;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#09bd00;}.content span.union,.content a.union,.block a.current.union{color:#2dbfb8;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#D2991D;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#2dbfb8;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#D2991D;}.content span.trait,.content a.trait,.block a.current.trait{color:#b78cf2;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#b78cf2;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#2BAB63;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#D2991D;}.sidebar a{color:#fdbf35;}.sidebar a.current.enum{color:#12ece2;}.sidebar a.current.struct{color:#12ece2;}.sidebar a.current.type{color:#12ece2;}.sidebar a.current.associatedtype{color:#fdbf35;}.sidebar a.current.foreigntype{color:#12ece2;}.sidebar a.current.attr,.sidebar a.current.derive,.sidebar a.current.macro{color:#0be900;}.sidebar a.current.union{color:#12ece2;}.sidebar a.current.constant .sidebar a.current.static{color:#fdbf35;}.sidebar a.current.primitive{color:#12ece2;}.sidebar a.current.externcrate .sidebar a.current.mod{color:#fdbf35;}.sidebar a.current.trait{color:#cca7ff;}.sidebar a.current.traitalias{color:#cca7ff;}.sidebar a.current.fn,.sidebar a.current.method,.sidebar a.current.tymethod{color:#32d479;}.sidebar a.current.keyword{color:#fdbf35;}pre.rust .comment{color:#8d8d8b;}pre.rust .doccomment{color:#8ca375;}nav.main .current{border-top-color:#eee;border-bottom-color:#eee;}nav.main .separator{border-color:#eee;}a{color:#D2991D;}body.source .example-wrap pre.rust a{background:#333;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before{color:#999;}details.rustdoc-toggle>summary::before{filter:invert(100%);}#crate-search,.search-input{color:#111;background-color:#f0f0f0;border-color:#f0f0f0;}#crate-search{border-color:#f0f0f0 !important;}.search-input{border-color:#e0e0e0;}.search-input:focus{border-color:#008dfd;}.stab.empty-impl{background:#FFF5D6;border-color:#FFC600;color:#2f2f2f;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;color:#2f2f2f;}.stab.deprecated{background:#ffc4c4;border-color:#db7b7b;color:#2f2f2f;}.stab.must_implement{background:#F3DFFF;border-color:#b07bdb;color:#2f2f2f;}.stab.portability{background:#F3DFFF;border-color:#b07bdb;color:#2f2f2f;}.stab.portability>code{background:none;}.rightside,.out-of-band{color:grey;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#ab8ac1;}pre.rust .kw-2,pre.rust .prelude-ty{color:#769acb;}pre.rust .number,pre.rust .string{color:#83a300;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#ee6868;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#d97f26;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#4a4949;}a.test-arrow{color:#dedede;background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label,.code-attribute{color:#999;}:target{background-color:#494a3d;border-right:3px solid #bb7410;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.8);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.8);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.8);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.8);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#0089ff;}.tooltip::after{background-color:#000;color:#fff;border-color:#000;}.tooltip::before{border-color:transparent black transparent transparent;}.notable-traits-tooltiptext{background-color:#111;border-color:#777;}.notable-traits-tooltiptext .notable{border-bottom-color:#d2d2d2;}#titles>button:not(.selected){background-color:#252525;border-top-color:#252525;}#titles>button:hover,#titles>button.selected{border-top-color:#0089ff;background-color:#353535;}#titles>button>div.count{color:#888;}@media (max-width:700px){.sidebar-elems{border-right-color:#000;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow:inset 0 -1px 0 #c6cbd1;}#settings-menu>a,#help-button>button{border-color:#e0e0e0;background:#f0f0f0;color:#000;}#settings-menu>a:hover,#settings-menu>a:focus,#help-button>button:hover,#help-button>button:focus{border-color:#ffb900;}.popover,.popover::before,#help-button span.top,#help-button span.bottom{border-color:#d2d2d2;}#copy-path{color:#999;}#copy-path>img{filter:invert(50%);}#copy-path:hover>img{filter:invert(65%);}#theme-choices{border-color:#e0e0e0;background-color:#353535;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#4e4e4e;}.search-results .result-name span.alias{color:#fff;}.search-results .result-name span.grey{color:#ccc;}#source-sidebar>.title{border-bottom-color:#ccc;}#source-sidebar div.files>a:hover,details.dir-entry summary:hover,#source-sidebar div.files>a:focus,details.dir-entry summary:focus{background-color:#444;}#source-sidebar div.files>a.selected{background-color:#333;}.scraped-example-list .scrape-help{border-color:#aaa;color:#eee;}.scraped-example-list .scrape-help:hover{border-color:white;color:white;}.more-examples-toggle summary,.more-examples-toggle .hide-more{color:#999;}.scraped-example .example-wrap .rust span.highlight{background:rgb(91,59,1);}.scraped-example .example-wrap .rust span.highlight.focus{background:rgb(124,75,15);}.scraped-example:not(.expanded) .code-wrapper:before{background:linear-gradient(to bottom,rgba(53,53,53,1),rgba(53,53,53,0));}.scraped-example:not(.expanded) .code-wrapper:after{background:linear-gradient(to top,rgba(53,53,53,1),rgba(53,53,53,0));}.toggle-line-inner{background:#999;}.toggle-line:hover .toggle-line-inner{background:#c5c5c5;} \ No newline at end of file diff --git a/ch9-gui-dev/down-arrow.svg b/ch9-gui-dev/down-arrow.svg new file mode 100644 index 00000000..35437e77 --- /dev/null +++ b/ch9-gui-dev/down-arrow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ch9-gui-dev/favicon-16x16.png b/ch9-gui-dev/favicon-16x16.png new file mode 100644 index 00000000..ea4b45ca Binary files /dev/null and b/ch9-gui-dev/favicon-16x16.png differ diff --git a/ch9-gui-dev/favicon-32x32.png b/ch9-gui-dev/favicon-32x32.png new file mode 100644 index 00000000..69b8613c Binary files /dev/null and b/ch9-gui-dev/favicon-32x32.png differ diff --git a/ch9-gui-dev/favicon.svg b/ch9-gui-dev/favicon.svg new file mode 100644 index 00000000..8b34b511 --- /dev/null +++ b/ch9-gui-dev/favicon.svg @@ -0,0 +1,24 @@ + + + + + diff --git a/ch9-gui-dev/implementors/core/clone/trait.Clone.js b/ch9-gui-dev/implementors/core/clone/trait.Clone.js new file mode 100644 index 00000000..cbe4f03e --- /dev/null +++ b/ch9-gui-dev/implementors/core/clone/trait.Clone.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl Clone for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl Clone for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl Clone for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl Clone for IntrTargetPriority","synthetic":false,"types":["os::drivers::plic::IntrTargetPriority"]},{"text":"impl Clone for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl Clone for RingBufferStatus","synthetic":false,"types":["os::fs::pipe::RingBufferStatus"]},{"text":"impl Clone for Graphics","synthetic":false,"types":["os::gui::graphic::Graphics"]},{"text":"impl Clone for PhysAddr","synthetic":false,"types":["os::mm::address::PhysAddr"]},{"text":"impl Clone for VirtAddr","synthetic":false,"types":["os::mm::address::VirtAddr"]},{"text":"impl Clone for PhysPageNum","synthetic":false,"types":["os::mm::address::PhysPageNum"]},{"text":"impl Clone for VirtPageNum","synthetic":false,"types":["os::mm::address::VirtPageNum"]},{"text":"impl<T: Clone> Clone for SimpleRange<T> where
    T: StepByOne + Copy + PartialEq + PartialOrd + Debug
","synthetic":false,"types":["os::mm::address::SimpleRange"]},{"text":"impl Clone for MapType","synthetic":false,"types":["os::mm::memory_set::MapType"]},{"text":"impl Clone for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl Clone for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl Clone for PageTableEntry","synthetic":false,"types":["os::mm::page_table::PageTableEntry"]},{"text":"impl Clone for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]},{"text":"impl Clone for TaskStatus","synthetic":false,"types":["os::task::task::TaskStatus"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/cmp/trait.Eq.js b/ch9-gui-dev/implementors/core/cmp/trait.Eq.js new file mode 100644 index 00000000..3408ed40 --- /dev/null +++ b/ch9-gui-dev/implementors/core/cmp/trait.Eq.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl Eq for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl Eq for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl Eq for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl Eq for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl Eq for PhysAddr","synthetic":false,"types":["os::mm::address::PhysAddr"]},{"text":"impl Eq for VirtAddr","synthetic":false,"types":["os::mm::address::VirtAddr"]},{"text":"impl Eq for PhysPageNum","synthetic":false,"types":["os::mm::address::PhysPageNum"]},{"text":"impl Eq for VirtPageNum","synthetic":false,"types":["os::mm::address::VirtPageNum"]},{"text":"impl Eq for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl Eq for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl Eq for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]},{"text":"impl Eq for TimerCondVar","synthetic":false,"types":["os::timer::TimerCondVar"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/cmp/trait.Ord.js b/ch9-gui-dev/implementors/core/cmp/trait.Ord.js new file mode 100644 index 00000000..5598db00 --- /dev/null +++ b/ch9-gui-dev/implementors/core/cmp/trait.Ord.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl Ord for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl Ord for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl Ord for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl Ord for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl Ord for PhysAddr","synthetic":false,"types":["os::mm::address::PhysAddr"]},{"text":"impl Ord for VirtAddr","synthetic":false,"types":["os::mm::address::VirtAddr"]},{"text":"impl Ord for PhysPageNum","synthetic":false,"types":["os::mm::address::PhysPageNum"]},{"text":"impl Ord for VirtPageNum","synthetic":false,"types":["os::mm::address::VirtPageNum"]},{"text":"impl Ord for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl Ord for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl Ord for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]},{"text":"impl Ord for TimerCondVar","synthetic":false,"types":["os::timer::TimerCondVar"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/cmp/trait.PartialEq.js b/ch9-gui-dev/implementors/core/cmp/trait.PartialEq.js new file mode 100644 index 00000000..e7c60fab --- /dev/null +++ b/ch9-gui-dev/implementors/core/cmp/trait.PartialEq.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl PartialEq<IER> for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl PartialEq<LSR> for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl PartialEq<MCR> for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl PartialEq<OpenFlags> for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl PartialEq<RingBufferStatus> for RingBufferStatus","synthetic":false,"types":["os::fs::pipe::RingBufferStatus"]},{"text":"impl PartialEq<PhysAddr> for PhysAddr","synthetic":false,"types":["os::mm::address::PhysAddr"]},{"text":"impl PartialEq<VirtAddr> for VirtAddr","synthetic":false,"types":["os::mm::address::VirtAddr"]},{"text":"impl PartialEq<PhysPageNum> for PhysPageNum","synthetic":false,"types":["os::mm::address::PhysPageNum"]},{"text":"impl PartialEq<VirtPageNum> for VirtPageNum","synthetic":false,"types":["os::mm::address::VirtPageNum"]},{"text":"impl PartialEq<MapType> for MapType","synthetic":false,"types":["os::mm::memory_set::MapType"]},{"text":"impl PartialEq<MapPermission> for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl PartialEq<PTEFlags> for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl PartialEq<SignalFlags> for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]},{"text":"impl PartialEq<TaskStatus> for TaskStatus","synthetic":false,"types":["os::task::task::TaskStatus"]},{"text":"impl PartialEq<TimerCondVar> for TimerCondVar","synthetic":false,"types":["os::timer::TimerCondVar"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/cmp/trait.PartialOrd.js b/ch9-gui-dev/implementors/core/cmp/trait.PartialOrd.js new file mode 100644 index 00000000..57c85ba4 --- /dev/null +++ b/ch9-gui-dev/implementors/core/cmp/trait.PartialOrd.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl PartialOrd<IER> for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl PartialOrd<LSR> for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl PartialOrd<MCR> for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl PartialOrd<OpenFlags> for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl PartialOrd<PhysAddr> for PhysAddr","synthetic":false,"types":["os::mm::address::PhysAddr"]},{"text":"impl PartialOrd<VirtAddr> for VirtAddr","synthetic":false,"types":["os::mm::address::VirtAddr"]},{"text":"impl PartialOrd<PhysPageNum> for PhysPageNum","synthetic":false,"types":["os::mm::address::PhysPageNum"]},{"text":"impl PartialOrd<VirtPageNum> for VirtPageNum","synthetic":false,"types":["os::mm::address::VirtPageNum"]},{"text":"impl PartialOrd<MapPermission> for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl PartialOrd<PTEFlags> for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl PartialOrd<SignalFlags> for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]},{"text":"impl PartialOrd<TimerCondVar> for TimerCondVar","synthetic":false,"types":["os::timer::TimerCondVar"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/convert/trait.From.js b/ch9-gui-dev/implementors/core/convert/trait.From.js new file mode 100644 index 00000000..d2fbb8c0 --- /dev/null +++ b/ch9-gui-dev/implementors/core/convert/trait.From.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl From<usize> for PhysAddr","synthetic":false,"types":["os::mm::address::PhysAddr"]},{"text":"impl From<usize> for PhysPageNum","synthetic":false,"types":["os::mm::address::PhysPageNum"]},{"text":"impl From<usize> for VirtAddr","synthetic":false,"types":["os::mm::address::VirtAddr"]},{"text":"impl From<usize> for VirtPageNum","synthetic":false,"types":["os::mm::address::VirtPageNum"]},{"text":"impl From<PhysAddr> for usize","synthetic":false,"types":[]},{"text":"impl From<PhysPageNum> for usize","synthetic":false,"types":[]},{"text":"impl From<VirtAddr> for usize","synthetic":false,"types":[]},{"text":"impl From<VirtPageNum> for usize","synthetic":false,"types":[]},{"text":"impl From<VirtAddr> for VirtPageNum","synthetic":false,"types":["os::mm::address::VirtPageNum"]},{"text":"impl From<VirtPageNum> for VirtAddr","synthetic":false,"types":["os::mm::address::VirtAddr"]},{"text":"impl From<PhysAddr> for PhysPageNum","synthetic":false,"types":["os::mm::address::PhysPageNum"]},{"text":"impl From<PhysPageNum> for PhysAddr","synthetic":false,"types":["os::mm::address::PhysAddr"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/fmt/trait.Binary.js b/ch9-gui-dev/implementors/core/fmt/trait.Binary.js new file mode 100644 index 00000000..9bc9019c --- /dev/null +++ b/ch9-gui-dev/implementors/core/fmt/trait.Binary.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl Binary for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl Binary for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl Binary for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl Binary for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl Binary for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl Binary for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl Binary for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/fmt/trait.Debug.js b/ch9-gui-dev/implementors/core/fmt/trait.Debug.js new file mode 100644 index 00000000..2fa7be35 --- /dev/null +++ b/ch9-gui-dev/implementors/core/fmt/trait.Debug.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl Debug for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl Debug for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl Debug for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl Debug for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl Debug for VirtAddr","synthetic":false,"types":["os::mm::address::VirtAddr"]},{"text":"impl Debug for VirtPageNum","synthetic":false,"types":["os::mm::address::VirtPageNum"]},{"text":"impl Debug for PhysAddr","synthetic":false,"types":["os::mm::address::PhysAddr"]},{"text":"impl Debug for PhysPageNum","synthetic":false,"types":["os::mm::address::PhysPageNum"]},{"text":"impl Debug for FrameTracker","synthetic":false,"types":["os::mm::frame_allocator::FrameTracker"]},{"text":"impl Debug for MapType","synthetic":false,"types":["os::mm::memory_set::MapType"]},{"text":"impl Debug for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl Debug for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl Debug for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]},{"text":"impl Debug for TrapContext","synthetic":false,"types":["os::trap::context::TrapContext"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/fmt/trait.LowerHex.js b/ch9-gui-dev/implementors/core/fmt/trait.LowerHex.js new file mode 100644 index 00000000..dea4c392 --- /dev/null +++ b/ch9-gui-dev/implementors/core/fmt/trait.LowerHex.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl LowerHex for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl LowerHex for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl LowerHex for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl LowerHex for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl LowerHex for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl LowerHex for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl LowerHex for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/fmt/trait.Octal.js b/ch9-gui-dev/implementors/core/fmt/trait.Octal.js new file mode 100644 index 00000000..7eb3d070 --- /dev/null +++ b/ch9-gui-dev/implementors/core/fmt/trait.Octal.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl Octal for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl Octal for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl Octal for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl Octal for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl Octal for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl Octal for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl Octal for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/fmt/trait.UpperHex.js b/ch9-gui-dev/implementors/core/fmt/trait.UpperHex.js new file mode 100644 index 00000000..24ca25cc --- /dev/null +++ b/ch9-gui-dev/implementors/core/fmt/trait.UpperHex.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl UpperHex for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl UpperHex for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl UpperHex for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl UpperHex for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl UpperHex for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl UpperHex for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl UpperHex for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/fmt/trait.Write.js b/ch9-gui-dev/implementors/core/fmt/trait.Write.js new file mode 100644 index 00000000..0d40b97a --- /dev/null +++ b/ch9-gui-dev/implementors/core/fmt/trait.Write.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl Write for Stdout","synthetic":false,"types":["os::console::Stdout"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/hash/trait.Hash.js b/ch9-gui-dev/implementors/core/hash/trait.Hash.js new file mode 100644 index 00000000..416f505d --- /dev/null +++ b/ch9-gui-dev/implementors/core/hash/trait.Hash.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl Hash for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl Hash for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl Hash for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl Hash for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl Hash for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl Hash for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl Hash for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/iter/traits/collect/trait.Extend.js b/ch9-gui-dev/implementors/core/iter/traits/collect/trait.Extend.js new file mode 100644 index 00000000..2f283f04 --- /dev/null +++ b/ch9-gui-dev/implementors/core/iter/traits/collect/trait.Extend.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl Extend<IER> for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl Extend<LSR> for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl Extend<MCR> for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl Extend<OpenFlags> for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl Extend<MapPermission> for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl Extend<PTEFlags> for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl Extend<SignalFlags> for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/iter/traits/collect/trait.FromIterator.js b/ch9-gui-dev/implementors/core/iter/traits/collect/trait.FromIterator.js new file mode 100644 index 00000000..bd004f10 --- /dev/null +++ b/ch9-gui-dev/implementors/core/iter/traits/collect/trait.FromIterator.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl FromIterator<IER> for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl FromIterator<LSR> for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl FromIterator<MCR> for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl FromIterator<OpenFlags> for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl FromIterator<MapPermission> for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl FromIterator<PTEFlags> for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl FromIterator<SignalFlags> for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/iter/traits/collect/trait.IntoIterator.js b/ch9-gui-dev/implementors/core/iter/traits/collect/trait.IntoIterator.js new file mode 100644 index 00000000..7a056c59 --- /dev/null +++ b/ch9-gui-dev/implementors/core/iter/traits/collect/trait.IntoIterator.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl<T> IntoIterator for SimpleRange<T> where
    T: StepByOne + Copy + PartialEq + PartialOrd + Debug
","synthetic":false,"types":["os::mm::address::SimpleRange"]},{"text":"impl IntoIterator for UserBuffer","synthetic":false,"types":["os::mm::page_table::UserBuffer"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/iter/traits/iterator/trait.Iterator.js b/ch9-gui-dev/implementors/core/iter/traits/iterator/trait.Iterator.js new file mode 100644 index 00000000..ede026ae --- /dev/null +++ b/ch9-gui-dev/implementors/core/iter/traits/iterator/trait.Iterator.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl<T> Iterator for SimpleRangeIterator<T> where
    T: StepByOne + Copy + PartialEq + PartialOrd + Debug
","synthetic":false,"types":["os::mm::address::SimpleRangeIterator"]},{"text":"impl Iterator for UserBufferIterator","synthetic":false,"types":["os::mm::page_table::UserBufferIterator"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/marker/trait.Copy.js b/ch9-gui-dev/implementors/core/marker/trait.Copy.js new file mode 100644 index 00000000..fff81ba0 --- /dev/null +++ b/ch9-gui-dev/implementors/core/marker/trait.Copy.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl Copy for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl Copy for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl Copy for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl Copy for IntrTargetPriority","synthetic":false,"types":["os::drivers::plic::IntrTargetPriority"]},{"text":"impl Copy for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl Copy for RingBufferStatus","synthetic":false,"types":["os::fs::pipe::RingBufferStatus"]},{"text":"impl Copy for PhysAddr","synthetic":false,"types":["os::mm::address::PhysAddr"]},{"text":"impl Copy for VirtAddr","synthetic":false,"types":["os::mm::address::VirtAddr"]},{"text":"impl Copy for PhysPageNum","synthetic":false,"types":["os::mm::address::PhysPageNum"]},{"text":"impl Copy for VirtPageNum","synthetic":false,"types":["os::mm::address::VirtPageNum"]},{"text":"impl<T: Copy> Copy for SimpleRange<T> where
    T: StepByOne + Copy + PartialEq + PartialOrd + Debug
","synthetic":false,"types":["os::mm::address::SimpleRange"]},{"text":"impl Copy for MapType","synthetic":false,"types":["os::mm::memory_set::MapType"]},{"text":"impl Copy for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl Copy for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl Copy for PageTableEntry","synthetic":false,"types":["os::mm::page_table::PageTableEntry"]},{"text":"impl Copy for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]},{"text":"impl Copy for TaskStatus","synthetic":false,"types":["os::task::task::TaskStatus"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/marker/trait.Freeze.js b/ch9-gui-dev/implementors/core/marker/trait.Freeze.js new file mode 100644 index 00000000..187d65d0 --- /dev/null +++ b/ch9-gui-dev/implementors/core/marker/trait.Freeze.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl Freeze for RISCV64","synthetic":true,"types":["os::board::RISCV64"]},{"text":"impl Freeze for Stdout","synthetic":true,"types":["os::console::Stdout"]},{"text":"impl !Freeze for VirtIOBlock","synthetic":true,"types":["os::drivers::block::virtio_blk::VirtIOBlock"]},{"text":"impl Freeze for BLOCK_DEVICE","synthetic":true,"types":["os::drivers::block::BLOCK_DEVICE"]},{"text":"impl Freeze for QUEUE_FRAMES","synthetic":true,"types":["os::drivers::bus::virtio::QUEUE_FRAMES"]},{"text":"impl Freeze for VirtioHal","synthetic":true,"types":["os::drivers::bus::virtio::VirtioHal"]},{"text":"impl Freeze for IER","synthetic":true,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl Freeze for LSR","synthetic":true,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl Freeze for MCR","synthetic":true,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl Freeze for ReadWithoutDLAB","synthetic":true,"types":["os::drivers::chardev::ns16550a::ReadWithoutDLAB"]},{"text":"impl Freeze for WriteWithoutDLAB","synthetic":true,"types":["os::drivers::chardev::ns16550a::WriteWithoutDLAB"]},{"text":"impl Freeze for NS16550aRaw","synthetic":true,"types":["os::drivers::chardev::ns16550a::NS16550aRaw"]},{"text":"impl Freeze for NS16550aInner","synthetic":true,"types":["os::drivers::chardev::ns16550a::NS16550aInner"]},{"text":"impl<const BASE_ADDR: usize> !Freeze for NS16550a<BASE_ADDR>","synthetic":true,"types":["os::drivers::chardev::ns16550a::NS16550a"]},{"text":"impl Freeze for UART","synthetic":true,"types":["os::drivers::chardev::UART"]},{"text":"impl Freeze for GPU_DEVICE","synthetic":true,"types":["os::drivers::gpu::GPU_DEVICE"]},{"text":"impl !Freeze for VirtIOGpuWrapper","synthetic":true,"types":["os::drivers::gpu::VirtIOGpuWrapper"]},{"text":"impl !Freeze for VirtIOInputWrapper","synthetic":true,"types":["os::drivers::input::VirtIOInputWrapper"]},{"text":"impl Freeze for KEYBOARD_DEVICE","synthetic":true,"types":["os::drivers::input::KEYBOARD_DEVICE"]},{"text":"impl Freeze for MOUSE_DEVICE","synthetic":true,"types":["os::drivers::input::MOUSE_DEVICE"]},{"text":"impl Freeze for PLIC","synthetic":true,"types":["os::drivers::plic::PLIC"]},{"text":"impl Freeze for IntrTargetPriority","synthetic":true,"types":["os::drivers::plic::IntrTargetPriority"]},{"text":"impl !Freeze for OSInode","synthetic":true,"types":["os::fs::inode::OSInode"]},{"text":"impl Freeze for OSInodeInner","synthetic":true,"types":["os::fs::inode::OSInodeInner"]},{"text":"impl Freeze for ROOT_INODE","synthetic":true,"types":["os::fs::inode::ROOT_INODE"]},{"text":"impl Freeze for OpenFlags","synthetic":true,"types":["os::fs::inode::OpenFlags"]},{"text":"impl Freeze for Pipe","synthetic":true,"types":["os::fs::pipe::Pipe"]},{"text":"impl Freeze for RingBufferStatus","synthetic":true,"types":["os::fs::pipe::RingBufferStatus"]},{"text":"impl Freeze for PipeRingBuffer","synthetic":true,"types":["os::fs::pipe::PipeRingBuffer"]},{"text":"impl Freeze for Stdin","synthetic":true,"types":["os::fs::stdio::Stdin"]},{"text":"impl Freeze for Stdout","synthetic":true,"types":["os::fs::stdio::Stdout"]},{"text":"impl Freeze for Graphics","synthetic":true,"types":["os::gui::graphic::Graphics"]},{"text":"impl Freeze for DrawingBoard","synthetic":true,"types":["os::gui::paint::DrawingBoard"]},{"text":"impl Freeze for DRAWING_BOARD","synthetic":true,"types":["os::gui::paint::DRAWING_BOARD"]},{"text":"impl Freeze for PhysAddr","synthetic":true,"types":["os::mm::address::PhysAddr"]},{"text":"impl Freeze for VirtAddr","synthetic":true,"types":["os::mm::address::VirtAddr"]},{"text":"impl Freeze for PhysPageNum","synthetic":true,"types":["os::mm::address::PhysPageNum"]},{"text":"impl Freeze for VirtPageNum","synthetic":true,"types":["os::mm::address::VirtPageNum"]},{"text":"impl<T> Freeze for SimpleRange<T> where
    T: Freeze
","synthetic":true,"types":["os::mm::address::SimpleRange"]},{"text":"impl<T> Freeze for SimpleRangeIterator<T> where
    T: Freeze
","synthetic":true,"types":["os::mm::address::SimpleRangeIterator"]},{"text":"impl Freeze for FrameTracker","synthetic":true,"types":["os::mm::frame_allocator::FrameTracker"]},{"text":"impl Freeze for StackFrameAllocator","synthetic":true,"types":["os::mm::frame_allocator::StackFrameAllocator"]},{"text":"impl Freeze for FRAME_ALLOCATOR","synthetic":true,"types":["os::mm::frame_allocator::FRAME_ALLOCATOR"]},{"text":"impl Freeze for KERNEL_SPACE","synthetic":true,"types":["os::mm::memory_set::KERNEL_SPACE"]},{"text":"impl Freeze for MemorySet","synthetic":true,"types":["os::mm::memory_set::MemorySet"]},{"text":"impl Freeze for MapArea","synthetic":true,"types":["os::mm::memory_set::MapArea"]},{"text":"impl Freeze for MapType","synthetic":true,"types":["os::mm::memory_set::MapType"]},{"text":"impl Freeze for MapPermission","synthetic":true,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl Freeze for PTEFlags","synthetic":true,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl Freeze for PageTableEntry","synthetic":true,"types":["os::mm::page_table::PageTableEntry"]},{"text":"impl Freeze for PageTable","synthetic":true,"types":["os::mm::page_table::PageTable"]},{"text":"impl Freeze for UserBuffer","synthetic":true,"types":["os::mm::page_table::UserBuffer"]},{"text":"impl Freeze for UserBufferIterator","synthetic":true,"types":["os::mm::page_table::UserBufferIterator"]},{"text":"impl !Freeze for Condvar","synthetic":true,"types":["os::sync::condvar::Condvar"]},{"text":"impl Freeze for CondvarInner","synthetic":true,"types":["os::sync::condvar::CondvarInner"]},{"text":"impl !Freeze for MutexSpin","synthetic":true,"types":["os::sync::mutex::MutexSpin"]},{"text":"impl !Freeze for MutexBlocking","synthetic":true,"types":["os::sync::mutex::MutexBlocking"]},{"text":"impl Freeze for MutexBlockingInner","synthetic":true,"types":["os::sync::mutex::MutexBlockingInner"]},{"text":"impl !Freeze for Semaphore","synthetic":true,"types":["os::sync::semaphore::Semaphore"]},{"text":"impl Freeze for SemaphoreInner","synthetic":true,"types":["os::sync::semaphore::SemaphoreInner"]},{"text":"impl<T> !Freeze for UPSafeCellRaw<T>","synthetic":true,"types":["os::sync::up::UPSafeCellRaw"]},{"text":"impl Freeze for IntrMaskingInfo","synthetic":true,"types":["os::sync::up::IntrMaskingInfo"]},{"text":"impl Freeze for INTR_MASKING_INFO","synthetic":true,"types":["os::sync::up::INTR_MASKING_INFO"]},{"text":"impl<T> !Freeze for UPIntrFreeCell<T>","synthetic":true,"types":["os::sync::up::UPIntrFreeCell"]},{"text":"impl<'a, T> Freeze for UPIntrRefMut<'a, T>","synthetic":true,"types":["os::sync::up::UPIntrRefMut"]},{"text":"impl Freeze for TaskContext","synthetic":true,"types":["os::task::context::TaskContext"]},{"text":"impl Freeze for RecycleAllocator","synthetic":true,"types":["os::task::id::RecycleAllocator"]},{"text":"impl Freeze for PID_ALLOCATOR","synthetic":true,"types":["os::task::id::PID_ALLOCATOR"]},{"text":"impl Freeze for KSTACK_ALLOCATOR","synthetic":true,"types":["os::task::id::KSTACK_ALLOCATOR"]},{"text":"impl Freeze for PidHandle","synthetic":true,"types":["os::task::id::PidHandle"]},{"text":"impl Freeze for KernelStack","synthetic":true,"types":["os::task::id::KernelStack"]},{"text":"impl Freeze for TaskUserRes","synthetic":true,"types":["os::task::id::TaskUserRes"]},{"text":"impl Freeze for TaskManager","synthetic":true,"types":["os::task::manager::TaskManager"]},{"text":"impl Freeze for TASK_MANAGER","synthetic":true,"types":["os::task::manager::TASK_MANAGER"]},{"text":"impl Freeze for PID2PCB","synthetic":true,"types":["os::task::manager::PID2PCB"]},{"text":"impl !Freeze for ProcessControlBlock","synthetic":true,"types":["os::task::process::ProcessControlBlock"]},{"text":"impl Freeze for ProcessControlBlockInner","synthetic":true,"types":["os::task::process::ProcessControlBlockInner"]},{"text":"impl Freeze for Processor","synthetic":true,"types":["os::task::processor::Processor"]},{"text":"impl Freeze for PROCESSOR","synthetic":true,"types":["os::task::processor::PROCESSOR"]},{"text":"impl Freeze for SignalFlags","synthetic":true,"types":["os::task::signal::SignalFlags"]},{"text":"impl !Freeze for TaskControlBlock","synthetic":true,"types":["os::task::task::TaskControlBlock"]},{"text":"impl Freeze for TaskControlBlockInner","synthetic":true,"types":["os::task::task::TaskControlBlockInner"]},{"text":"impl Freeze for TaskStatus","synthetic":true,"types":["os::task::task::TaskStatus"]},{"text":"impl Freeze for INITPROC","synthetic":true,"types":["os::task::INITPROC"]},{"text":"impl Freeze for TimerCondVar","synthetic":true,"types":["os::timer::TimerCondVar"]},{"text":"impl Freeze for TIMERS","synthetic":true,"types":["os::timer::TIMERS"]},{"text":"impl Freeze for TrapContext","synthetic":true,"types":["os::trap::context::TrapContext"]},{"text":"impl Freeze for DEV_NON_BLOCKING_ACCESS","synthetic":true,"types":["os::DEV_NON_BLOCKING_ACCESS"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/marker/trait.Send.js b/ch9-gui-dev/implementors/core/marker/trait.Send.js new file mode 100644 index 00000000..edae312c --- /dev/null +++ b/ch9-gui-dev/implementors/core/marker/trait.Send.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl Send for RISCV64","synthetic":true,"types":["os::board::RISCV64"]},{"text":"impl Send for Stdout","synthetic":true,"types":["os::console::Stdout"]},{"text":"impl Send for VirtIOBlock","synthetic":true,"types":["os::drivers::block::virtio_blk::VirtIOBlock"]},{"text":"impl Send for BLOCK_DEVICE","synthetic":true,"types":["os::drivers::block::BLOCK_DEVICE"]},{"text":"impl Send for QUEUE_FRAMES","synthetic":true,"types":["os::drivers::bus::virtio::QUEUE_FRAMES"]},{"text":"impl Send for VirtioHal","synthetic":true,"types":["os::drivers::bus::virtio::VirtioHal"]},{"text":"impl Send for IER","synthetic":true,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl Send for LSR","synthetic":true,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl Send for MCR","synthetic":true,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl Send for ReadWithoutDLAB","synthetic":true,"types":["os::drivers::chardev::ns16550a::ReadWithoutDLAB"]},{"text":"impl Send for WriteWithoutDLAB","synthetic":true,"types":["os::drivers::chardev::ns16550a::WriteWithoutDLAB"]},{"text":"impl Send for NS16550aRaw","synthetic":true,"types":["os::drivers::chardev::ns16550a::NS16550aRaw"]},{"text":"impl Send for NS16550aInner","synthetic":true,"types":["os::drivers::chardev::ns16550a::NS16550aInner"]},{"text":"impl<const BASE_ADDR: usize> Send for NS16550a<BASE_ADDR>","synthetic":true,"types":["os::drivers::chardev::ns16550a::NS16550a"]},{"text":"impl Send for UART","synthetic":true,"types":["os::drivers::chardev::UART"]},{"text":"impl Send for GPU_DEVICE","synthetic":true,"types":["os::drivers::gpu::GPU_DEVICE"]},{"text":"impl Send for VirtIOGpuWrapper","synthetic":true,"types":["os::drivers::gpu::VirtIOGpuWrapper"]},{"text":"impl Send for VirtIOInputWrapper","synthetic":true,"types":["os::drivers::input::VirtIOInputWrapper"]},{"text":"impl Send for KEYBOARD_DEVICE","synthetic":true,"types":["os::drivers::input::KEYBOARD_DEVICE"]},{"text":"impl Send for MOUSE_DEVICE","synthetic":true,"types":["os::drivers::input::MOUSE_DEVICE"]},{"text":"impl Send for PLIC","synthetic":true,"types":["os::drivers::plic::PLIC"]},{"text":"impl Send for IntrTargetPriority","synthetic":true,"types":["os::drivers::plic::IntrTargetPriority"]},{"text":"impl Send for OSInode","synthetic":true,"types":["os::fs::inode::OSInode"]},{"text":"impl Send for OSInodeInner","synthetic":true,"types":["os::fs::inode::OSInodeInner"]},{"text":"impl Send for ROOT_INODE","synthetic":true,"types":["os::fs::inode::ROOT_INODE"]},{"text":"impl Send for OpenFlags","synthetic":true,"types":["os::fs::inode::OpenFlags"]},{"text":"impl Send for Pipe","synthetic":true,"types":["os::fs::pipe::Pipe"]},{"text":"impl Send for RingBufferStatus","synthetic":true,"types":["os::fs::pipe::RingBufferStatus"]},{"text":"impl Send for PipeRingBuffer","synthetic":true,"types":["os::fs::pipe::PipeRingBuffer"]},{"text":"impl Send for Stdin","synthetic":true,"types":["os::fs::stdio::Stdin"]},{"text":"impl Send for Stdout","synthetic":true,"types":["os::fs::stdio::Stdout"]},{"text":"impl Send for Graphics","synthetic":true,"types":["os::gui::graphic::Graphics"]},{"text":"impl Send for DrawingBoard","synthetic":true,"types":["os::gui::paint::DrawingBoard"]},{"text":"impl Send for DRAWING_BOARD","synthetic":true,"types":["os::gui::paint::DRAWING_BOARD"]},{"text":"impl Send for PhysAddr","synthetic":true,"types":["os::mm::address::PhysAddr"]},{"text":"impl Send for VirtAddr","synthetic":true,"types":["os::mm::address::VirtAddr"]},{"text":"impl Send for PhysPageNum","synthetic":true,"types":["os::mm::address::PhysPageNum"]},{"text":"impl Send for VirtPageNum","synthetic":true,"types":["os::mm::address::VirtPageNum"]},{"text":"impl<T> Send for SimpleRange<T> where
    T: Send
","synthetic":true,"types":["os::mm::address::SimpleRange"]},{"text":"impl<T> Send for SimpleRangeIterator<T> where
    T: Send
","synthetic":true,"types":["os::mm::address::SimpleRangeIterator"]},{"text":"impl Send for FrameTracker","synthetic":true,"types":["os::mm::frame_allocator::FrameTracker"]},{"text":"impl Send for StackFrameAllocator","synthetic":true,"types":["os::mm::frame_allocator::StackFrameAllocator"]},{"text":"impl Send for FRAME_ALLOCATOR","synthetic":true,"types":["os::mm::frame_allocator::FRAME_ALLOCATOR"]},{"text":"impl Send for KERNEL_SPACE","synthetic":true,"types":["os::mm::memory_set::KERNEL_SPACE"]},{"text":"impl Send for MemorySet","synthetic":true,"types":["os::mm::memory_set::MemorySet"]},{"text":"impl Send for MapArea","synthetic":true,"types":["os::mm::memory_set::MapArea"]},{"text":"impl Send for MapType","synthetic":true,"types":["os::mm::memory_set::MapType"]},{"text":"impl Send for MapPermission","synthetic":true,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl Send for PTEFlags","synthetic":true,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl Send for PageTableEntry","synthetic":true,"types":["os::mm::page_table::PageTableEntry"]},{"text":"impl Send for PageTable","synthetic":true,"types":["os::mm::page_table::PageTable"]},{"text":"impl Send for UserBuffer","synthetic":true,"types":["os::mm::page_table::UserBuffer"]},{"text":"impl Send for UserBufferIterator","synthetic":true,"types":["os::mm::page_table::UserBufferIterator"]},{"text":"impl Send for Condvar","synthetic":true,"types":["os::sync::condvar::Condvar"]},{"text":"impl Send for CondvarInner","synthetic":true,"types":["os::sync::condvar::CondvarInner"]},{"text":"impl Send for MutexSpin","synthetic":true,"types":["os::sync::mutex::MutexSpin"]},{"text":"impl Send for MutexBlocking","synthetic":true,"types":["os::sync::mutex::MutexBlocking"]},{"text":"impl Send for MutexBlockingInner","synthetic":true,"types":["os::sync::mutex::MutexBlockingInner"]},{"text":"impl Send for Semaphore","synthetic":true,"types":["os::sync::semaphore::Semaphore"]},{"text":"impl Send for SemaphoreInner","synthetic":true,"types":["os::sync::semaphore::SemaphoreInner"]},{"text":"impl<T> Send for UPSafeCellRaw<T> where
    T: Send
","synthetic":true,"types":["os::sync::up::UPSafeCellRaw"]},{"text":"impl Send for IntrMaskingInfo","synthetic":true,"types":["os::sync::up::IntrMaskingInfo"]},{"text":"impl Send for INTR_MASKING_INFO","synthetic":true,"types":["os::sync::up::INTR_MASKING_INFO"]},{"text":"impl<T> Send for UPIntrFreeCell<T> where
    T: Send
","synthetic":true,"types":["os::sync::up::UPIntrFreeCell"]},{"text":"impl<'a, T> !Send for UPIntrRefMut<'a, T>","synthetic":true,"types":["os::sync::up::UPIntrRefMut"]},{"text":"impl Send for TaskContext","synthetic":true,"types":["os::task::context::TaskContext"]},{"text":"impl Send for RecycleAllocator","synthetic":true,"types":["os::task::id::RecycleAllocator"]},{"text":"impl Send for PID_ALLOCATOR","synthetic":true,"types":["os::task::id::PID_ALLOCATOR"]},{"text":"impl Send for KSTACK_ALLOCATOR","synthetic":true,"types":["os::task::id::KSTACK_ALLOCATOR"]},{"text":"impl Send for PidHandle","synthetic":true,"types":["os::task::id::PidHandle"]},{"text":"impl Send for KernelStack","synthetic":true,"types":["os::task::id::KernelStack"]},{"text":"impl Send for TaskUserRes","synthetic":true,"types":["os::task::id::TaskUserRes"]},{"text":"impl Send for TaskManager","synthetic":true,"types":["os::task::manager::TaskManager"]},{"text":"impl Send for TASK_MANAGER","synthetic":true,"types":["os::task::manager::TASK_MANAGER"]},{"text":"impl Send for PID2PCB","synthetic":true,"types":["os::task::manager::PID2PCB"]},{"text":"impl Send for ProcessControlBlock","synthetic":true,"types":["os::task::process::ProcessControlBlock"]},{"text":"impl Send for ProcessControlBlockInner","synthetic":true,"types":["os::task::process::ProcessControlBlockInner"]},{"text":"impl Send for Processor","synthetic":true,"types":["os::task::processor::Processor"]},{"text":"impl Send for PROCESSOR","synthetic":true,"types":["os::task::processor::PROCESSOR"]},{"text":"impl Send for SignalFlags","synthetic":true,"types":["os::task::signal::SignalFlags"]},{"text":"impl Send for TaskControlBlock","synthetic":true,"types":["os::task::task::TaskControlBlock"]},{"text":"impl Send for TaskControlBlockInner","synthetic":true,"types":["os::task::task::TaskControlBlockInner"]},{"text":"impl Send for TaskStatus","synthetic":true,"types":["os::task::task::TaskStatus"]},{"text":"impl Send for INITPROC","synthetic":true,"types":["os::task::INITPROC"]},{"text":"impl Send for TimerCondVar","synthetic":true,"types":["os::timer::TimerCondVar"]},{"text":"impl Send for TIMERS","synthetic":true,"types":["os::timer::TIMERS"]},{"text":"impl Send for TrapContext","synthetic":true,"types":["os::trap::context::TrapContext"]},{"text":"impl Send for DEV_NON_BLOCKING_ACCESS","synthetic":true,"types":["os::DEV_NON_BLOCKING_ACCESS"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/marker/trait.StructuralEq.js b/ch9-gui-dev/implementors/core/marker/trait.StructuralEq.js new file mode 100644 index 00000000..57250fbc --- /dev/null +++ b/ch9-gui-dev/implementors/core/marker/trait.StructuralEq.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl StructuralEq for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl StructuralEq for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl StructuralEq for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl StructuralEq for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl StructuralEq for PhysAddr","synthetic":false,"types":["os::mm::address::PhysAddr"]},{"text":"impl StructuralEq for VirtAddr","synthetic":false,"types":["os::mm::address::VirtAddr"]},{"text":"impl StructuralEq for PhysPageNum","synthetic":false,"types":["os::mm::address::PhysPageNum"]},{"text":"impl StructuralEq for VirtPageNum","synthetic":false,"types":["os::mm::address::VirtPageNum"]},{"text":"impl StructuralEq for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl StructuralEq for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl StructuralEq for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/marker/trait.StructuralPartialEq.js b/ch9-gui-dev/implementors/core/marker/trait.StructuralPartialEq.js new file mode 100644 index 00000000..aa165a9f --- /dev/null +++ b/ch9-gui-dev/implementors/core/marker/trait.StructuralPartialEq.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl StructuralPartialEq for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl StructuralPartialEq for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl StructuralPartialEq for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl StructuralPartialEq for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl StructuralPartialEq for RingBufferStatus","synthetic":false,"types":["os::fs::pipe::RingBufferStatus"]},{"text":"impl StructuralPartialEq for PhysAddr","synthetic":false,"types":["os::mm::address::PhysAddr"]},{"text":"impl StructuralPartialEq for VirtAddr","synthetic":false,"types":["os::mm::address::VirtAddr"]},{"text":"impl StructuralPartialEq for PhysPageNum","synthetic":false,"types":["os::mm::address::PhysPageNum"]},{"text":"impl StructuralPartialEq for VirtPageNum","synthetic":false,"types":["os::mm::address::VirtPageNum"]},{"text":"impl StructuralPartialEq for MapType","synthetic":false,"types":["os::mm::memory_set::MapType"]},{"text":"impl StructuralPartialEq for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl StructuralPartialEq for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl StructuralPartialEq for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]},{"text":"impl StructuralPartialEq for TaskStatus","synthetic":false,"types":["os::task::task::TaskStatus"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/marker/trait.Sync.js b/ch9-gui-dev/implementors/core/marker/trait.Sync.js new file mode 100644 index 00000000..17e79fa7 --- /dev/null +++ b/ch9-gui-dev/implementors/core/marker/trait.Sync.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl Sync for RISCV64","synthetic":true,"types":["os::board::RISCV64"]},{"text":"impl Sync for Stdout","synthetic":true,"types":["os::console::Stdout"]},{"text":"impl Sync for VirtIOBlock","synthetic":true,"types":["os::drivers::block::virtio_blk::VirtIOBlock"]},{"text":"impl Sync for BLOCK_DEVICE","synthetic":true,"types":["os::drivers::block::BLOCK_DEVICE"]},{"text":"impl Sync for QUEUE_FRAMES","synthetic":true,"types":["os::drivers::bus::virtio::QUEUE_FRAMES"]},{"text":"impl Sync for VirtioHal","synthetic":true,"types":["os::drivers::bus::virtio::VirtioHal"]},{"text":"impl Sync for IER","synthetic":true,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl Sync for LSR","synthetic":true,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl Sync for MCR","synthetic":true,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl Sync for ReadWithoutDLAB","synthetic":true,"types":["os::drivers::chardev::ns16550a::ReadWithoutDLAB"]},{"text":"impl Sync for WriteWithoutDLAB","synthetic":true,"types":["os::drivers::chardev::ns16550a::WriteWithoutDLAB"]},{"text":"impl Sync for NS16550aRaw","synthetic":true,"types":["os::drivers::chardev::ns16550a::NS16550aRaw"]},{"text":"impl Sync for NS16550aInner","synthetic":true,"types":["os::drivers::chardev::ns16550a::NS16550aInner"]},{"text":"impl<const BASE_ADDR: usize> Sync for NS16550a<BASE_ADDR>","synthetic":true,"types":["os::drivers::chardev::ns16550a::NS16550a"]},{"text":"impl Sync for UART","synthetic":true,"types":["os::drivers::chardev::UART"]},{"text":"impl Sync for GPU_DEVICE","synthetic":true,"types":["os::drivers::gpu::GPU_DEVICE"]},{"text":"impl Sync for VirtIOGpuWrapper","synthetic":true,"types":["os::drivers::gpu::VirtIOGpuWrapper"]},{"text":"impl Sync for VirtIOInputWrapper","synthetic":true,"types":["os::drivers::input::VirtIOInputWrapper"]},{"text":"impl Sync for KEYBOARD_DEVICE","synthetic":true,"types":["os::drivers::input::KEYBOARD_DEVICE"]},{"text":"impl Sync for MOUSE_DEVICE","synthetic":true,"types":["os::drivers::input::MOUSE_DEVICE"]},{"text":"impl Sync for PLIC","synthetic":true,"types":["os::drivers::plic::PLIC"]},{"text":"impl Sync for IntrTargetPriority","synthetic":true,"types":["os::drivers::plic::IntrTargetPriority"]},{"text":"impl Sync for OSInode","synthetic":true,"types":["os::fs::inode::OSInode"]},{"text":"impl Sync for OSInodeInner","synthetic":true,"types":["os::fs::inode::OSInodeInner"]},{"text":"impl Sync for ROOT_INODE","synthetic":true,"types":["os::fs::inode::ROOT_INODE"]},{"text":"impl Sync for OpenFlags","synthetic":true,"types":["os::fs::inode::OpenFlags"]},{"text":"impl Sync for Pipe","synthetic":true,"types":["os::fs::pipe::Pipe"]},{"text":"impl Sync for RingBufferStatus","synthetic":true,"types":["os::fs::pipe::RingBufferStatus"]},{"text":"impl Sync for PipeRingBuffer","synthetic":true,"types":["os::fs::pipe::PipeRingBuffer"]},{"text":"impl Sync for Stdin","synthetic":true,"types":["os::fs::stdio::Stdin"]},{"text":"impl Sync for Stdout","synthetic":true,"types":["os::fs::stdio::Stdout"]},{"text":"impl Sync for Graphics","synthetic":true,"types":["os::gui::graphic::Graphics"]},{"text":"impl Sync for DrawingBoard","synthetic":true,"types":["os::gui::paint::DrawingBoard"]},{"text":"impl Sync for DRAWING_BOARD","synthetic":true,"types":["os::gui::paint::DRAWING_BOARD"]},{"text":"impl Sync for PhysAddr","synthetic":true,"types":["os::mm::address::PhysAddr"]},{"text":"impl Sync for VirtAddr","synthetic":true,"types":["os::mm::address::VirtAddr"]},{"text":"impl Sync for PhysPageNum","synthetic":true,"types":["os::mm::address::PhysPageNum"]},{"text":"impl Sync for VirtPageNum","synthetic":true,"types":["os::mm::address::VirtPageNum"]},{"text":"impl<T> Sync for SimpleRange<T> where
    T: Sync
","synthetic":true,"types":["os::mm::address::SimpleRange"]},{"text":"impl<T> Sync for SimpleRangeIterator<T> where
    T: Sync
","synthetic":true,"types":["os::mm::address::SimpleRangeIterator"]},{"text":"impl Sync for FrameTracker","synthetic":true,"types":["os::mm::frame_allocator::FrameTracker"]},{"text":"impl Sync for StackFrameAllocator","synthetic":true,"types":["os::mm::frame_allocator::StackFrameAllocator"]},{"text":"impl Sync for FRAME_ALLOCATOR","synthetic":true,"types":["os::mm::frame_allocator::FRAME_ALLOCATOR"]},{"text":"impl Sync for KERNEL_SPACE","synthetic":true,"types":["os::mm::memory_set::KERNEL_SPACE"]},{"text":"impl Sync for MemorySet","synthetic":true,"types":["os::mm::memory_set::MemorySet"]},{"text":"impl Sync for MapArea","synthetic":true,"types":["os::mm::memory_set::MapArea"]},{"text":"impl Sync for MapType","synthetic":true,"types":["os::mm::memory_set::MapType"]},{"text":"impl Sync for MapPermission","synthetic":true,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl Sync for PTEFlags","synthetic":true,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl Sync for PageTableEntry","synthetic":true,"types":["os::mm::page_table::PageTableEntry"]},{"text":"impl Sync for PageTable","synthetic":true,"types":["os::mm::page_table::PageTable"]},{"text":"impl Sync for UserBuffer","synthetic":true,"types":["os::mm::page_table::UserBuffer"]},{"text":"impl Sync for UserBufferIterator","synthetic":true,"types":["os::mm::page_table::UserBufferIterator"]},{"text":"impl Sync for Condvar","synthetic":true,"types":["os::sync::condvar::Condvar"]},{"text":"impl Sync for CondvarInner","synthetic":true,"types":["os::sync::condvar::CondvarInner"]},{"text":"impl Sync for MutexSpin","synthetic":true,"types":["os::sync::mutex::MutexSpin"]},{"text":"impl Sync for MutexBlocking","synthetic":true,"types":["os::sync::mutex::MutexBlocking"]},{"text":"impl Sync for MutexBlockingInner","synthetic":true,"types":["os::sync::mutex::MutexBlockingInner"]},{"text":"impl Sync for Semaphore","synthetic":true,"types":["os::sync::semaphore::Semaphore"]},{"text":"impl Sync for SemaphoreInner","synthetic":true,"types":["os::sync::semaphore::SemaphoreInner"]},{"text":"impl Sync for IntrMaskingInfo","synthetic":true,"types":["os::sync::up::IntrMaskingInfo"]},{"text":"impl Sync for INTR_MASKING_INFO","synthetic":true,"types":["os::sync::up::INTR_MASKING_INFO"]},{"text":"impl<'a, T> !Sync for UPIntrRefMut<'a, T>","synthetic":true,"types":["os::sync::up::UPIntrRefMut"]},{"text":"impl Sync for TaskContext","synthetic":true,"types":["os::task::context::TaskContext"]},{"text":"impl Sync for RecycleAllocator","synthetic":true,"types":["os::task::id::RecycleAllocator"]},{"text":"impl Sync for PID_ALLOCATOR","synthetic":true,"types":["os::task::id::PID_ALLOCATOR"]},{"text":"impl Sync for KSTACK_ALLOCATOR","synthetic":true,"types":["os::task::id::KSTACK_ALLOCATOR"]},{"text":"impl Sync for PidHandle","synthetic":true,"types":["os::task::id::PidHandle"]},{"text":"impl Sync for KernelStack","synthetic":true,"types":["os::task::id::KernelStack"]},{"text":"impl Sync for TaskUserRes","synthetic":true,"types":["os::task::id::TaskUserRes"]},{"text":"impl Sync for TaskManager","synthetic":true,"types":["os::task::manager::TaskManager"]},{"text":"impl Sync for TASK_MANAGER","synthetic":true,"types":["os::task::manager::TASK_MANAGER"]},{"text":"impl Sync for PID2PCB","synthetic":true,"types":["os::task::manager::PID2PCB"]},{"text":"impl Sync for ProcessControlBlock","synthetic":true,"types":["os::task::process::ProcessControlBlock"]},{"text":"impl Sync for ProcessControlBlockInner","synthetic":true,"types":["os::task::process::ProcessControlBlockInner"]},{"text":"impl Sync for Processor","synthetic":true,"types":["os::task::processor::Processor"]},{"text":"impl Sync for PROCESSOR","synthetic":true,"types":["os::task::processor::PROCESSOR"]},{"text":"impl Sync for SignalFlags","synthetic":true,"types":["os::task::signal::SignalFlags"]},{"text":"impl Sync for TaskControlBlock","synthetic":true,"types":["os::task::task::TaskControlBlock"]},{"text":"impl Sync for TaskControlBlockInner","synthetic":true,"types":["os::task::task::TaskControlBlockInner"]},{"text":"impl Sync for TaskStatus","synthetic":true,"types":["os::task::task::TaskStatus"]},{"text":"impl Sync for INITPROC","synthetic":true,"types":["os::task::INITPROC"]},{"text":"impl Sync for TimerCondVar","synthetic":true,"types":["os::timer::TimerCondVar"]},{"text":"impl Sync for TIMERS","synthetic":true,"types":["os::timer::TIMERS"]},{"text":"impl Sync for TrapContext","synthetic":true,"types":["os::trap::context::TrapContext"]},{"text":"impl Sync for DEV_NON_BLOCKING_ACCESS","synthetic":true,"types":["os::DEV_NON_BLOCKING_ACCESS"]},{"text":"impl<T> Sync for UPSafeCellRaw<T>","synthetic":false,"types":["os::sync::up::UPSafeCellRaw"]},{"text":"impl<T> Sync for UPIntrFreeCell<T>","synthetic":false,"types":["os::sync::up::UPIntrFreeCell"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/marker/trait.Unpin.js b/ch9-gui-dev/implementors/core/marker/trait.Unpin.js new file mode 100644 index 00000000..78597b51 --- /dev/null +++ b/ch9-gui-dev/implementors/core/marker/trait.Unpin.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl Unpin for RISCV64","synthetic":true,"types":["os::board::RISCV64"]},{"text":"impl Unpin for Stdout","synthetic":true,"types":["os::console::Stdout"]},{"text":"impl Unpin for VirtIOBlock","synthetic":true,"types":["os::drivers::block::virtio_blk::VirtIOBlock"]},{"text":"impl Unpin for BLOCK_DEVICE","synthetic":true,"types":["os::drivers::block::BLOCK_DEVICE"]},{"text":"impl Unpin for QUEUE_FRAMES","synthetic":true,"types":["os::drivers::bus::virtio::QUEUE_FRAMES"]},{"text":"impl Unpin for VirtioHal","synthetic":true,"types":["os::drivers::bus::virtio::VirtioHal"]},{"text":"impl Unpin for IER","synthetic":true,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl Unpin for LSR","synthetic":true,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl Unpin for MCR","synthetic":true,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl Unpin for ReadWithoutDLAB","synthetic":true,"types":["os::drivers::chardev::ns16550a::ReadWithoutDLAB"]},{"text":"impl Unpin for WriteWithoutDLAB","synthetic":true,"types":["os::drivers::chardev::ns16550a::WriteWithoutDLAB"]},{"text":"impl Unpin for NS16550aRaw","synthetic":true,"types":["os::drivers::chardev::ns16550a::NS16550aRaw"]},{"text":"impl Unpin for NS16550aInner","synthetic":true,"types":["os::drivers::chardev::ns16550a::NS16550aInner"]},{"text":"impl<const BASE_ADDR: usize> Unpin for NS16550a<BASE_ADDR>","synthetic":true,"types":["os::drivers::chardev::ns16550a::NS16550a"]},{"text":"impl Unpin for UART","synthetic":true,"types":["os::drivers::chardev::UART"]},{"text":"impl Unpin for GPU_DEVICE","synthetic":true,"types":["os::drivers::gpu::GPU_DEVICE"]},{"text":"impl Unpin for VirtIOGpuWrapper","synthetic":true,"types":["os::drivers::gpu::VirtIOGpuWrapper"]},{"text":"impl Unpin for VirtIOInputWrapper","synthetic":true,"types":["os::drivers::input::VirtIOInputWrapper"]},{"text":"impl Unpin for KEYBOARD_DEVICE","synthetic":true,"types":["os::drivers::input::KEYBOARD_DEVICE"]},{"text":"impl Unpin for MOUSE_DEVICE","synthetic":true,"types":["os::drivers::input::MOUSE_DEVICE"]},{"text":"impl Unpin for PLIC","synthetic":true,"types":["os::drivers::plic::PLIC"]},{"text":"impl Unpin for IntrTargetPriority","synthetic":true,"types":["os::drivers::plic::IntrTargetPriority"]},{"text":"impl Unpin for OSInode","synthetic":true,"types":["os::fs::inode::OSInode"]},{"text":"impl Unpin for OSInodeInner","synthetic":true,"types":["os::fs::inode::OSInodeInner"]},{"text":"impl Unpin for ROOT_INODE","synthetic":true,"types":["os::fs::inode::ROOT_INODE"]},{"text":"impl Unpin for OpenFlags","synthetic":true,"types":["os::fs::inode::OpenFlags"]},{"text":"impl Unpin for Pipe","synthetic":true,"types":["os::fs::pipe::Pipe"]},{"text":"impl Unpin for RingBufferStatus","synthetic":true,"types":["os::fs::pipe::RingBufferStatus"]},{"text":"impl Unpin for PipeRingBuffer","synthetic":true,"types":["os::fs::pipe::PipeRingBuffer"]},{"text":"impl Unpin for Stdin","synthetic":true,"types":["os::fs::stdio::Stdin"]},{"text":"impl Unpin for Stdout","synthetic":true,"types":["os::fs::stdio::Stdout"]},{"text":"impl Unpin for Graphics","synthetic":true,"types":["os::gui::graphic::Graphics"]},{"text":"impl Unpin for DrawingBoard","synthetic":true,"types":["os::gui::paint::DrawingBoard"]},{"text":"impl Unpin for DRAWING_BOARD","synthetic":true,"types":["os::gui::paint::DRAWING_BOARD"]},{"text":"impl Unpin for PhysAddr","synthetic":true,"types":["os::mm::address::PhysAddr"]},{"text":"impl Unpin for VirtAddr","synthetic":true,"types":["os::mm::address::VirtAddr"]},{"text":"impl Unpin for PhysPageNum","synthetic":true,"types":["os::mm::address::PhysPageNum"]},{"text":"impl Unpin for VirtPageNum","synthetic":true,"types":["os::mm::address::VirtPageNum"]},{"text":"impl<T> Unpin for SimpleRange<T> where
    T: Unpin
","synthetic":true,"types":["os::mm::address::SimpleRange"]},{"text":"impl<T> Unpin for SimpleRangeIterator<T> where
    T: Unpin
","synthetic":true,"types":["os::mm::address::SimpleRangeIterator"]},{"text":"impl Unpin for FrameTracker","synthetic":true,"types":["os::mm::frame_allocator::FrameTracker"]},{"text":"impl Unpin for StackFrameAllocator","synthetic":true,"types":["os::mm::frame_allocator::StackFrameAllocator"]},{"text":"impl Unpin for FRAME_ALLOCATOR","synthetic":true,"types":["os::mm::frame_allocator::FRAME_ALLOCATOR"]},{"text":"impl Unpin for KERNEL_SPACE","synthetic":true,"types":["os::mm::memory_set::KERNEL_SPACE"]},{"text":"impl Unpin for MemorySet","synthetic":true,"types":["os::mm::memory_set::MemorySet"]},{"text":"impl Unpin for MapArea","synthetic":true,"types":["os::mm::memory_set::MapArea"]},{"text":"impl Unpin for MapType","synthetic":true,"types":["os::mm::memory_set::MapType"]},{"text":"impl Unpin for MapPermission","synthetic":true,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl Unpin for PTEFlags","synthetic":true,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl Unpin for PageTableEntry","synthetic":true,"types":["os::mm::page_table::PageTableEntry"]},{"text":"impl Unpin for PageTable","synthetic":true,"types":["os::mm::page_table::PageTable"]},{"text":"impl Unpin for UserBuffer","synthetic":true,"types":["os::mm::page_table::UserBuffer"]},{"text":"impl Unpin for UserBufferIterator","synthetic":true,"types":["os::mm::page_table::UserBufferIterator"]},{"text":"impl Unpin for Condvar","synthetic":true,"types":["os::sync::condvar::Condvar"]},{"text":"impl Unpin for CondvarInner","synthetic":true,"types":["os::sync::condvar::CondvarInner"]},{"text":"impl Unpin for MutexSpin","synthetic":true,"types":["os::sync::mutex::MutexSpin"]},{"text":"impl Unpin for MutexBlocking","synthetic":true,"types":["os::sync::mutex::MutexBlocking"]},{"text":"impl Unpin for MutexBlockingInner","synthetic":true,"types":["os::sync::mutex::MutexBlockingInner"]},{"text":"impl Unpin for Semaphore","synthetic":true,"types":["os::sync::semaphore::Semaphore"]},{"text":"impl Unpin for SemaphoreInner","synthetic":true,"types":["os::sync::semaphore::SemaphoreInner"]},{"text":"impl<T> Unpin for UPSafeCellRaw<T> where
    T: Unpin
","synthetic":true,"types":["os::sync::up::UPSafeCellRaw"]},{"text":"impl Unpin for IntrMaskingInfo","synthetic":true,"types":["os::sync::up::IntrMaskingInfo"]},{"text":"impl Unpin for INTR_MASKING_INFO","synthetic":true,"types":["os::sync::up::INTR_MASKING_INFO"]},{"text":"impl<T> Unpin for UPIntrFreeCell<T> where
    T: Unpin
","synthetic":true,"types":["os::sync::up::UPIntrFreeCell"]},{"text":"impl<'a, T> Unpin for UPIntrRefMut<'a, T>","synthetic":true,"types":["os::sync::up::UPIntrRefMut"]},{"text":"impl Unpin for TaskContext","synthetic":true,"types":["os::task::context::TaskContext"]},{"text":"impl Unpin for RecycleAllocator","synthetic":true,"types":["os::task::id::RecycleAllocator"]},{"text":"impl Unpin for PID_ALLOCATOR","synthetic":true,"types":["os::task::id::PID_ALLOCATOR"]},{"text":"impl Unpin for KSTACK_ALLOCATOR","synthetic":true,"types":["os::task::id::KSTACK_ALLOCATOR"]},{"text":"impl Unpin for PidHandle","synthetic":true,"types":["os::task::id::PidHandle"]},{"text":"impl Unpin for KernelStack","synthetic":true,"types":["os::task::id::KernelStack"]},{"text":"impl Unpin for TaskUserRes","synthetic":true,"types":["os::task::id::TaskUserRes"]},{"text":"impl Unpin for TaskManager","synthetic":true,"types":["os::task::manager::TaskManager"]},{"text":"impl Unpin for TASK_MANAGER","synthetic":true,"types":["os::task::manager::TASK_MANAGER"]},{"text":"impl Unpin for PID2PCB","synthetic":true,"types":["os::task::manager::PID2PCB"]},{"text":"impl Unpin for ProcessControlBlock","synthetic":true,"types":["os::task::process::ProcessControlBlock"]},{"text":"impl Unpin for ProcessControlBlockInner","synthetic":true,"types":["os::task::process::ProcessControlBlockInner"]},{"text":"impl Unpin for Processor","synthetic":true,"types":["os::task::processor::Processor"]},{"text":"impl Unpin for PROCESSOR","synthetic":true,"types":["os::task::processor::PROCESSOR"]},{"text":"impl Unpin for SignalFlags","synthetic":true,"types":["os::task::signal::SignalFlags"]},{"text":"impl Unpin for TaskControlBlock","synthetic":true,"types":["os::task::task::TaskControlBlock"]},{"text":"impl Unpin for TaskControlBlockInner","synthetic":true,"types":["os::task::task::TaskControlBlockInner"]},{"text":"impl Unpin for TaskStatus","synthetic":true,"types":["os::task::task::TaskStatus"]},{"text":"impl Unpin for INITPROC","synthetic":true,"types":["os::task::INITPROC"]},{"text":"impl Unpin for TimerCondVar","synthetic":true,"types":["os::timer::TimerCondVar"]},{"text":"impl Unpin for TIMERS","synthetic":true,"types":["os::timer::TIMERS"]},{"text":"impl Unpin for TrapContext","synthetic":true,"types":["os::trap::context::TrapContext"]},{"text":"impl Unpin for DEV_NON_BLOCKING_ACCESS","synthetic":true,"types":["os::DEV_NON_BLOCKING_ACCESS"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/ops/arith/trait.Sub.js b/ch9-gui-dev/implementors/core/ops/arith/trait.Sub.js new file mode 100644 index 00000000..e31a7592 --- /dev/null +++ b/ch9-gui-dev/implementors/core/ops/arith/trait.Sub.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl Sub<IER> for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl Sub<LSR> for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl Sub<MCR> for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl Sub<OpenFlags> for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl Sub<MapPermission> for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl Sub<PTEFlags> for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl Sub<SignalFlags> for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/ops/arith/trait.SubAssign.js b/ch9-gui-dev/implementors/core/ops/arith/trait.SubAssign.js new file mode 100644 index 00000000..c60075bc --- /dev/null +++ b/ch9-gui-dev/implementors/core/ops/arith/trait.SubAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl SubAssign<IER> for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl SubAssign<LSR> for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl SubAssign<MCR> for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl SubAssign<OpenFlags> for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl SubAssign<MapPermission> for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl SubAssign<PTEFlags> for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl SubAssign<SignalFlags> for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/ops/bit/trait.BitAnd.js b/ch9-gui-dev/implementors/core/ops/bit/trait.BitAnd.js new file mode 100644 index 00000000..f0ac382d --- /dev/null +++ b/ch9-gui-dev/implementors/core/ops/bit/trait.BitAnd.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl BitAnd<IER> for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl BitAnd<LSR> for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl BitAnd<MCR> for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl BitAnd<OpenFlags> for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl BitAnd<MapPermission> for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl BitAnd<PTEFlags> for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl BitAnd<SignalFlags> for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/ops/bit/trait.BitAndAssign.js b/ch9-gui-dev/implementors/core/ops/bit/trait.BitAndAssign.js new file mode 100644 index 00000000..08fa4fdf --- /dev/null +++ b/ch9-gui-dev/implementors/core/ops/bit/trait.BitAndAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl BitAndAssign<IER> for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl BitAndAssign<LSR> for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl BitAndAssign<MCR> for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl BitAndAssign<OpenFlags> for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl BitAndAssign<MapPermission> for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl BitAndAssign<PTEFlags> for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl BitAndAssign<SignalFlags> for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/ops/bit/trait.BitOr.js b/ch9-gui-dev/implementors/core/ops/bit/trait.BitOr.js new file mode 100644 index 00000000..dd64936b --- /dev/null +++ b/ch9-gui-dev/implementors/core/ops/bit/trait.BitOr.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl BitOr<IER> for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl BitOr<LSR> for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl BitOr<MCR> for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl BitOr<OpenFlags> for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl BitOr<MapPermission> for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl BitOr<PTEFlags> for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl BitOr<SignalFlags> for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/ops/bit/trait.BitOrAssign.js b/ch9-gui-dev/implementors/core/ops/bit/trait.BitOrAssign.js new file mode 100644 index 00000000..fca08d52 --- /dev/null +++ b/ch9-gui-dev/implementors/core/ops/bit/trait.BitOrAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl BitOrAssign<IER> for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl BitOrAssign<LSR> for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl BitOrAssign<MCR> for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl BitOrAssign<OpenFlags> for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl BitOrAssign<MapPermission> for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl BitOrAssign<PTEFlags> for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl BitOrAssign<SignalFlags> for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/ops/bit/trait.BitXor.js b/ch9-gui-dev/implementors/core/ops/bit/trait.BitXor.js new file mode 100644 index 00000000..aee7be0c --- /dev/null +++ b/ch9-gui-dev/implementors/core/ops/bit/trait.BitXor.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl BitXor<IER> for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl BitXor<LSR> for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl BitXor<MCR> for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl BitXor<OpenFlags> for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl BitXor<MapPermission> for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl BitXor<PTEFlags> for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl BitXor<SignalFlags> for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/ops/bit/trait.BitXorAssign.js b/ch9-gui-dev/implementors/core/ops/bit/trait.BitXorAssign.js new file mode 100644 index 00000000..b6561ab0 --- /dev/null +++ b/ch9-gui-dev/implementors/core/ops/bit/trait.BitXorAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl BitXorAssign<IER> for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl BitXorAssign<LSR> for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl BitXorAssign<MCR> for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl BitXorAssign<OpenFlags> for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl BitXorAssign<MapPermission> for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl BitXorAssign<PTEFlags> for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl BitXorAssign<SignalFlags> for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/ops/bit/trait.Not.js b/ch9-gui-dev/implementors/core/ops/bit/trait.Not.js new file mode 100644 index 00000000..cb671047 --- /dev/null +++ b/ch9-gui-dev/implementors/core/ops/bit/trait.Not.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl Not for IER","synthetic":false,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl Not for LSR","synthetic":false,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl Not for MCR","synthetic":false,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl Not for OpenFlags","synthetic":false,"types":["os::fs::inode::OpenFlags"]},{"text":"impl Not for MapPermission","synthetic":false,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl Not for PTEFlags","synthetic":false,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl Not for SignalFlags","synthetic":false,"types":["os::task::signal::SignalFlags"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/ops/deref/trait.Deref.js b/ch9-gui-dev/implementors/core/ops/deref/trait.Deref.js new file mode 100644 index 00000000..f5de2b03 --- /dev/null +++ b/ch9-gui-dev/implementors/core/ops/deref/trait.Deref.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl Deref for BLOCK_DEVICE","synthetic":false,"types":["os::drivers::block::BLOCK_DEVICE"]},{"text":"impl Deref for QUEUE_FRAMES","synthetic":false,"types":["os::drivers::bus::virtio::QUEUE_FRAMES"]},{"text":"impl Deref for UART","synthetic":false,"types":["os::drivers::chardev::UART"]},{"text":"impl Deref for GPU_DEVICE","synthetic":false,"types":["os::drivers::gpu::GPU_DEVICE"]},{"text":"impl Deref for KEYBOARD_DEVICE","synthetic":false,"types":["os::drivers::input::KEYBOARD_DEVICE"]},{"text":"impl Deref for MOUSE_DEVICE","synthetic":false,"types":["os::drivers::input::MOUSE_DEVICE"]},{"text":"impl Deref for ROOT_INODE","synthetic":false,"types":["os::fs::inode::ROOT_INODE"]},{"text":"impl Deref for DRAWING_BOARD","synthetic":false,"types":["os::gui::paint::DRAWING_BOARD"]},{"text":"impl Deref for FRAME_ALLOCATOR","synthetic":false,"types":["os::mm::frame_allocator::FRAME_ALLOCATOR"]},{"text":"impl Deref for KERNEL_SPACE","synthetic":false,"types":["os::mm::memory_set::KERNEL_SPACE"]},{"text":"impl Deref for INTR_MASKING_INFO","synthetic":false,"types":["os::sync::up::INTR_MASKING_INFO"]},{"text":"impl<'a, T> Deref for UPIntrRefMut<'a, T>","synthetic":false,"types":["os::sync::up::UPIntrRefMut"]},{"text":"impl Deref for PID_ALLOCATOR","synthetic":false,"types":["os::task::id::PID_ALLOCATOR"]},{"text":"impl Deref for KSTACK_ALLOCATOR","synthetic":false,"types":["os::task::id::KSTACK_ALLOCATOR"]},{"text":"impl Deref for TASK_MANAGER","synthetic":false,"types":["os::task::manager::TASK_MANAGER"]},{"text":"impl Deref for PID2PCB","synthetic":false,"types":["os::task::manager::PID2PCB"]},{"text":"impl Deref for PROCESSOR","synthetic":false,"types":["os::task::processor::PROCESSOR"]},{"text":"impl Deref for INITPROC","synthetic":false,"types":["os::task::INITPROC"]},{"text":"impl Deref for TIMERS","synthetic":false,"types":["os::timer::TIMERS"]},{"text":"impl Deref for DEV_NON_BLOCKING_ACCESS","synthetic":false,"types":["os::DEV_NON_BLOCKING_ACCESS"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/ops/deref/trait.DerefMut.js b/ch9-gui-dev/implementors/core/ops/deref/trait.DerefMut.js new file mode 100644 index 00000000..764822db --- /dev/null +++ b/ch9-gui-dev/implementors/core/ops/deref/trait.DerefMut.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl<'a, T> DerefMut for UPIntrRefMut<'a, T>","synthetic":false,"types":["os::sync::up::UPIntrRefMut"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/ops/drop/trait.Drop.js b/ch9-gui-dev/implementors/core/ops/drop/trait.Drop.js new file mode 100644 index 00000000..27321f26 --- /dev/null +++ b/ch9-gui-dev/implementors/core/ops/drop/trait.Drop.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl Drop for FrameTracker","synthetic":false,"types":["os::mm::frame_allocator::FrameTracker"]},{"text":"impl<'a, T> Drop for UPIntrRefMut<'a, T>","synthetic":false,"types":["os::sync::up::UPIntrRefMut"]},{"text":"impl Drop for PidHandle","synthetic":false,"types":["os::task::id::PidHandle"]},{"text":"impl Drop for KernelStack","synthetic":false,"types":["os::task::id::KernelStack"]},{"text":"impl Drop for TaskUserRes","synthetic":false,"types":["os::task::id::TaskUserRes"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js b/ch9-gui-dev/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js new file mode 100644 index 00000000..f63d14c1 --- /dev/null +++ b/ch9-gui-dev/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl RefUnwindSafe for RISCV64","synthetic":true,"types":["os::board::RISCV64"]},{"text":"impl RefUnwindSafe for Stdout","synthetic":true,"types":["os::console::Stdout"]},{"text":"impl !RefUnwindSafe for VirtIOBlock","synthetic":true,"types":["os::drivers::block::virtio_blk::VirtIOBlock"]},{"text":"impl RefUnwindSafe for BLOCK_DEVICE","synthetic":true,"types":["os::drivers::block::BLOCK_DEVICE"]},{"text":"impl RefUnwindSafe for QUEUE_FRAMES","synthetic":true,"types":["os::drivers::bus::virtio::QUEUE_FRAMES"]},{"text":"impl RefUnwindSafe for VirtioHal","synthetic":true,"types":["os::drivers::bus::virtio::VirtioHal"]},{"text":"impl RefUnwindSafe for IER","synthetic":true,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl RefUnwindSafe for LSR","synthetic":true,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl RefUnwindSafe for MCR","synthetic":true,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl RefUnwindSafe for ReadWithoutDLAB","synthetic":true,"types":["os::drivers::chardev::ns16550a::ReadWithoutDLAB"]},{"text":"impl RefUnwindSafe for WriteWithoutDLAB","synthetic":true,"types":["os::drivers::chardev::ns16550a::WriteWithoutDLAB"]},{"text":"impl RefUnwindSafe for NS16550aRaw","synthetic":true,"types":["os::drivers::chardev::ns16550a::NS16550aRaw"]},{"text":"impl RefUnwindSafe for NS16550aInner","synthetic":true,"types":["os::drivers::chardev::ns16550a::NS16550aInner"]},{"text":"impl<const BASE_ADDR: usize> !RefUnwindSafe for NS16550a<BASE_ADDR>","synthetic":true,"types":["os::drivers::chardev::ns16550a::NS16550a"]},{"text":"impl RefUnwindSafe for UART","synthetic":true,"types":["os::drivers::chardev::UART"]},{"text":"impl RefUnwindSafe for GPU_DEVICE","synthetic":true,"types":["os::drivers::gpu::GPU_DEVICE"]},{"text":"impl !RefUnwindSafe for VirtIOGpuWrapper","synthetic":true,"types":["os::drivers::gpu::VirtIOGpuWrapper"]},{"text":"impl !RefUnwindSafe for VirtIOInputWrapper","synthetic":true,"types":["os::drivers::input::VirtIOInputWrapper"]},{"text":"impl RefUnwindSafe for KEYBOARD_DEVICE","synthetic":true,"types":["os::drivers::input::KEYBOARD_DEVICE"]},{"text":"impl RefUnwindSafe for MOUSE_DEVICE","synthetic":true,"types":["os::drivers::input::MOUSE_DEVICE"]},{"text":"impl RefUnwindSafe for PLIC","synthetic":true,"types":["os::drivers::plic::PLIC"]},{"text":"impl RefUnwindSafe for IntrTargetPriority","synthetic":true,"types":["os::drivers::plic::IntrTargetPriority"]},{"text":"impl !RefUnwindSafe for OSInode","synthetic":true,"types":["os::fs::inode::OSInode"]},{"text":"impl !RefUnwindSafe for OSInodeInner","synthetic":true,"types":["os::fs::inode::OSInodeInner"]},{"text":"impl RefUnwindSafe for ROOT_INODE","synthetic":true,"types":["os::fs::inode::ROOT_INODE"]},{"text":"impl RefUnwindSafe for OpenFlags","synthetic":true,"types":["os::fs::inode::OpenFlags"]},{"text":"impl !RefUnwindSafe for Pipe","synthetic":true,"types":["os::fs::pipe::Pipe"]},{"text":"impl RefUnwindSafe for RingBufferStatus","synthetic":true,"types":["os::fs::pipe::RingBufferStatus"]},{"text":"impl !RefUnwindSafe for PipeRingBuffer","synthetic":true,"types":["os::fs::pipe::PipeRingBuffer"]},{"text":"impl RefUnwindSafe for Stdin","synthetic":true,"types":["os::fs::stdio::Stdin"]},{"text":"impl RefUnwindSafe for Stdout","synthetic":true,"types":["os::fs::stdio::Stdout"]},{"text":"impl !RefUnwindSafe for Graphics","synthetic":true,"types":["os::gui::graphic::Graphics"]},{"text":"impl !RefUnwindSafe for DrawingBoard","synthetic":true,"types":["os::gui::paint::DrawingBoard"]},{"text":"impl RefUnwindSafe for DRAWING_BOARD","synthetic":true,"types":["os::gui::paint::DRAWING_BOARD"]},{"text":"impl RefUnwindSafe for PhysAddr","synthetic":true,"types":["os::mm::address::PhysAddr"]},{"text":"impl RefUnwindSafe for VirtAddr","synthetic":true,"types":["os::mm::address::VirtAddr"]},{"text":"impl RefUnwindSafe for PhysPageNum","synthetic":true,"types":["os::mm::address::PhysPageNum"]},{"text":"impl RefUnwindSafe for VirtPageNum","synthetic":true,"types":["os::mm::address::VirtPageNum"]},{"text":"impl<T> RefUnwindSafe for SimpleRange<T> where
    T: RefUnwindSafe
","synthetic":true,"types":["os::mm::address::SimpleRange"]},{"text":"impl<T> RefUnwindSafe for SimpleRangeIterator<T> where
    T: RefUnwindSafe
","synthetic":true,"types":["os::mm::address::SimpleRangeIterator"]},{"text":"impl RefUnwindSafe for FrameTracker","synthetic":true,"types":["os::mm::frame_allocator::FrameTracker"]},{"text":"impl RefUnwindSafe for StackFrameAllocator","synthetic":true,"types":["os::mm::frame_allocator::StackFrameAllocator"]},{"text":"impl RefUnwindSafe for FRAME_ALLOCATOR","synthetic":true,"types":["os::mm::frame_allocator::FRAME_ALLOCATOR"]},{"text":"impl RefUnwindSafe for KERNEL_SPACE","synthetic":true,"types":["os::mm::memory_set::KERNEL_SPACE"]},{"text":"impl RefUnwindSafe for MemorySet","synthetic":true,"types":["os::mm::memory_set::MemorySet"]},{"text":"impl RefUnwindSafe for MapArea","synthetic":true,"types":["os::mm::memory_set::MapArea"]},{"text":"impl RefUnwindSafe for MapType","synthetic":true,"types":["os::mm::memory_set::MapType"]},{"text":"impl RefUnwindSafe for MapPermission","synthetic":true,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl RefUnwindSafe for PTEFlags","synthetic":true,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl RefUnwindSafe for PageTableEntry","synthetic":true,"types":["os::mm::page_table::PageTableEntry"]},{"text":"impl RefUnwindSafe for PageTable","synthetic":true,"types":["os::mm::page_table::PageTable"]},{"text":"impl RefUnwindSafe for UserBuffer","synthetic":true,"types":["os::mm::page_table::UserBuffer"]},{"text":"impl RefUnwindSafe for UserBufferIterator","synthetic":true,"types":["os::mm::page_table::UserBufferIterator"]},{"text":"impl !RefUnwindSafe for Condvar","synthetic":true,"types":["os::sync::condvar::Condvar"]},{"text":"impl !RefUnwindSafe for CondvarInner","synthetic":true,"types":["os::sync::condvar::CondvarInner"]},{"text":"impl !RefUnwindSafe for MutexSpin","synthetic":true,"types":["os::sync::mutex::MutexSpin"]},{"text":"impl !RefUnwindSafe for MutexBlocking","synthetic":true,"types":["os::sync::mutex::MutexBlocking"]},{"text":"impl !RefUnwindSafe for MutexBlockingInner","synthetic":true,"types":["os::sync::mutex::MutexBlockingInner"]},{"text":"impl !RefUnwindSafe for Semaphore","synthetic":true,"types":["os::sync::semaphore::Semaphore"]},{"text":"impl !RefUnwindSafe for SemaphoreInner","synthetic":true,"types":["os::sync::semaphore::SemaphoreInner"]},{"text":"impl<T> !RefUnwindSafe for UPSafeCellRaw<T>","synthetic":true,"types":["os::sync::up::UPSafeCellRaw"]},{"text":"impl RefUnwindSafe for IntrMaskingInfo","synthetic":true,"types":["os::sync::up::IntrMaskingInfo"]},{"text":"impl RefUnwindSafe for INTR_MASKING_INFO","synthetic":true,"types":["os::sync::up::INTR_MASKING_INFO"]},{"text":"impl<T> !RefUnwindSafe for UPIntrFreeCell<T>","synthetic":true,"types":["os::sync::up::UPIntrFreeCell"]},{"text":"impl<'a, T> !RefUnwindSafe for UPIntrRefMut<'a, T>","synthetic":true,"types":["os::sync::up::UPIntrRefMut"]},{"text":"impl RefUnwindSafe for TaskContext","synthetic":true,"types":["os::task::context::TaskContext"]},{"text":"impl RefUnwindSafe for RecycleAllocator","synthetic":true,"types":["os::task::id::RecycleAllocator"]},{"text":"impl RefUnwindSafe for PID_ALLOCATOR","synthetic":true,"types":["os::task::id::PID_ALLOCATOR"]},{"text":"impl RefUnwindSafe for KSTACK_ALLOCATOR","synthetic":true,"types":["os::task::id::KSTACK_ALLOCATOR"]},{"text":"impl RefUnwindSafe for PidHandle","synthetic":true,"types":["os::task::id::PidHandle"]},{"text":"impl RefUnwindSafe for KernelStack","synthetic":true,"types":["os::task::id::KernelStack"]},{"text":"impl !RefUnwindSafe for TaskUserRes","synthetic":true,"types":["os::task::id::TaskUserRes"]},{"text":"impl !RefUnwindSafe for TaskManager","synthetic":true,"types":["os::task::manager::TaskManager"]},{"text":"impl RefUnwindSafe for TASK_MANAGER","synthetic":true,"types":["os::task::manager::TASK_MANAGER"]},{"text":"impl RefUnwindSafe for PID2PCB","synthetic":true,"types":["os::task::manager::PID2PCB"]},{"text":"impl !RefUnwindSafe for ProcessControlBlock","synthetic":true,"types":["os::task::process::ProcessControlBlock"]},{"text":"impl !RefUnwindSafe for ProcessControlBlockInner","synthetic":true,"types":["os::task::process::ProcessControlBlockInner"]},{"text":"impl !RefUnwindSafe for Processor","synthetic":true,"types":["os::task::processor::Processor"]},{"text":"impl RefUnwindSafe for PROCESSOR","synthetic":true,"types":["os::task::processor::PROCESSOR"]},{"text":"impl RefUnwindSafe for SignalFlags","synthetic":true,"types":["os::task::signal::SignalFlags"]},{"text":"impl !RefUnwindSafe for TaskControlBlock","synthetic":true,"types":["os::task::task::TaskControlBlock"]},{"text":"impl !RefUnwindSafe for TaskControlBlockInner","synthetic":true,"types":["os::task::task::TaskControlBlockInner"]},{"text":"impl RefUnwindSafe for TaskStatus","synthetic":true,"types":["os::task::task::TaskStatus"]},{"text":"impl RefUnwindSafe for INITPROC","synthetic":true,"types":["os::task::INITPROC"]},{"text":"impl !RefUnwindSafe for TimerCondVar","synthetic":true,"types":["os::timer::TimerCondVar"]},{"text":"impl RefUnwindSafe for TIMERS","synthetic":true,"types":["os::timer::TIMERS"]},{"text":"impl RefUnwindSafe for TrapContext","synthetic":true,"types":["os::trap::context::TrapContext"]},{"text":"impl RefUnwindSafe for DEV_NON_BLOCKING_ACCESS","synthetic":true,"types":["os::DEV_NON_BLOCKING_ACCESS"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/core/panic/unwind_safe/trait.UnwindSafe.js b/ch9-gui-dev/implementors/core/panic/unwind_safe/trait.UnwindSafe.js new file mode 100644 index 00000000..7200426b --- /dev/null +++ b/ch9-gui-dev/implementors/core/panic/unwind_safe/trait.UnwindSafe.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl UnwindSafe for RISCV64","synthetic":true,"types":["os::board::RISCV64"]},{"text":"impl UnwindSafe for Stdout","synthetic":true,"types":["os::console::Stdout"]},{"text":"impl !UnwindSafe for VirtIOBlock","synthetic":true,"types":["os::drivers::block::virtio_blk::VirtIOBlock"]},{"text":"impl UnwindSafe for BLOCK_DEVICE","synthetic":true,"types":["os::drivers::block::BLOCK_DEVICE"]},{"text":"impl UnwindSafe for QUEUE_FRAMES","synthetic":true,"types":["os::drivers::bus::virtio::QUEUE_FRAMES"]},{"text":"impl UnwindSafe for VirtioHal","synthetic":true,"types":["os::drivers::bus::virtio::VirtioHal"]},{"text":"impl UnwindSafe for IER","synthetic":true,"types":["os::drivers::chardev::ns16550a::IER"]},{"text":"impl UnwindSafe for LSR","synthetic":true,"types":["os::drivers::chardev::ns16550a::LSR"]},{"text":"impl UnwindSafe for MCR","synthetic":true,"types":["os::drivers::chardev::ns16550a::MCR"]},{"text":"impl UnwindSafe for ReadWithoutDLAB","synthetic":true,"types":["os::drivers::chardev::ns16550a::ReadWithoutDLAB"]},{"text":"impl UnwindSafe for WriteWithoutDLAB","synthetic":true,"types":["os::drivers::chardev::ns16550a::WriteWithoutDLAB"]},{"text":"impl UnwindSafe for NS16550aRaw","synthetic":true,"types":["os::drivers::chardev::ns16550a::NS16550aRaw"]},{"text":"impl UnwindSafe for NS16550aInner","synthetic":true,"types":["os::drivers::chardev::ns16550a::NS16550aInner"]},{"text":"impl<const BASE_ADDR: usize> !UnwindSafe for NS16550a<BASE_ADDR>","synthetic":true,"types":["os::drivers::chardev::ns16550a::NS16550a"]},{"text":"impl UnwindSafe for UART","synthetic":true,"types":["os::drivers::chardev::UART"]},{"text":"impl UnwindSafe for GPU_DEVICE","synthetic":true,"types":["os::drivers::gpu::GPU_DEVICE"]},{"text":"impl !UnwindSafe for VirtIOGpuWrapper","synthetic":true,"types":["os::drivers::gpu::VirtIOGpuWrapper"]},{"text":"impl !UnwindSafe for VirtIOInputWrapper","synthetic":true,"types":["os::drivers::input::VirtIOInputWrapper"]},{"text":"impl UnwindSafe for KEYBOARD_DEVICE","synthetic":true,"types":["os::drivers::input::KEYBOARD_DEVICE"]},{"text":"impl UnwindSafe for MOUSE_DEVICE","synthetic":true,"types":["os::drivers::input::MOUSE_DEVICE"]},{"text":"impl UnwindSafe for PLIC","synthetic":true,"types":["os::drivers::plic::PLIC"]},{"text":"impl UnwindSafe for IntrTargetPriority","synthetic":true,"types":["os::drivers::plic::IntrTargetPriority"]},{"text":"impl !UnwindSafe for OSInode","synthetic":true,"types":["os::fs::inode::OSInode"]},{"text":"impl !UnwindSafe for OSInodeInner","synthetic":true,"types":["os::fs::inode::OSInodeInner"]},{"text":"impl UnwindSafe for ROOT_INODE","synthetic":true,"types":["os::fs::inode::ROOT_INODE"]},{"text":"impl UnwindSafe for OpenFlags","synthetic":true,"types":["os::fs::inode::OpenFlags"]},{"text":"impl !UnwindSafe for Pipe","synthetic":true,"types":["os::fs::pipe::Pipe"]},{"text":"impl UnwindSafe for RingBufferStatus","synthetic":true,"types":["os::fs::pipe::RingBufferStatus"]},{"text":"impl !UnwindSafe for PipeRingBuffer","synthetic":true,"types":["os::fs::pipe::PipeRingBuffer"]},{"text":"impl UnwindSafe for Stdin","synthetic":true,"types":["os::fs::stdio::Stdin"]},{"text":"impl UnwindSafe for Stdout","synthetic":true,"types":["os::fs::stdio::Stdout"]},{"text":"impl !UnwindSafe for Graphics","synthetic":true,"types":["os::gui::graphic::Graphics"]},{"text":"impl !UnwindSafe for DrawingBoard","synthetic":true,"types":["os::gui::paint::DrawingBoard"]},{"text":"impl UnwindSafe for DRAWING_BOARD","synthetic":true,"types":["os::gui::paint::DRAWING_BOARD"]},{"text":"impl UnwindSafe for PhysAddr","synthetic":true,"types":["os::mm::address::PhysAddr"]},{"text":"impl UnwindSafe for VirtAddr","synthetic":true,"types":["os::mm::address::VirtAddr"]},{"text":"impl UnwindSafe for PhysPageNum","synthetic":true,"types":["os::mm::address::PhysPageNum"]},{"text":"impl UnwindSafe for VirtPageNum","synthetic":true,"types":["os::mm::address::VirtPageNum"]},{"text":"impl<T> UnwindSafe for SimpleRange<T> where
    T: UnwindSafe
","synthetic":true,"types":["os::mm::address::SimpleRange"]},{"text":"impl<T> UnwindSafe for SimpleRangeIterator<T> where
    T: UnwindSafe
","synthetic":true,"types":["os::mm::address::SimpleRangeIterator"]},{"text":"impl UnwindSafe for FrameTracker","synthetic":true,"types":["os::mm::frame_allocator::FrameTracker"]},{"text":"impl UnwindSafe for StackFrameAllocator","synthetic":true,"types":["os::mm::frame_allocator::StackFrameAllocator"]},{"text":"impl UnwindSafe for FRAME_ALLOCATOR","synthetic":true,"types":["os::mm::frame_allocator::FRAME_ALLOCATOR"]},{"text":"impl UnwindSafe for KERNEL_SPACE","synthetic":true,"types":["os::mm::memory_set::KERNEL_SPACE"]},{"text":"impl UnwindSafe for MemorySet","synthetic":true,"types":["os::mm::memory_set::MemorySet"]},{"text":"impl UnwindSafe for MapArea","synthetic":true,"types":["os::mm::memory_set::MapArea"]},{"text":"impl UnwindSafe for MapType","synthetic":true,"types":["os::mm::memory_set::MapType"]},{"text":"impl UnwindSafe for MapPermission","synthetic":true,"types":["os::mm::memory_set::MapPermission"]},{"text":"impl UnwindSafe for PTEFlags","synthetic":true,"types":["os::mm::page_table::PTEFlags"]},{"text":"impl UnwindSafe for PageTableEntry","synthetic":true,"types":["os::mm::page_table::PageTableEntry"]},{"text":"impl UnwindSafe for PageTable","synthetic":true,"types":["os::mm::page_table::PageTable"]},{"text":"impl !UnwindSafe for UserBuffer","synthetic":true,"types":["os::mm::page_table::UserBuffer"]},{"text":"impl !UnwindSafe for UserBufferIterator","synthetic":true,"types":["os::mm::page_table::UserBufferIterator"]},{"text":"impl !UnwindSafe for Condvar","synthetic":true,"types":["os::sync::condvar::Condvar"]},{"text":"impl !UnwindSafe for CondvarInner","synthetic":true,"types":["os::sync::condvar::CondvarInner"]},{"text":"impl UnwindSafe for MutexSpin","synthetic":true,"types":["os::sync::mutex::MutexSpin"]},{"text":"impl !UnwindSafe for MutexBlocking","synthetic":true,"types":["os::sync::mutex::MutexBlocking"]},{"text":"impl !UnwindSafe for MutexBlockingInner","synthetic":true,"types":["os::sync::mutex::MutexBlockingInner"]},{"text":"impl !UnwindSafe for Semaphore","synthetic":true,"types":["os::sync::semaphore::Semaphore"]},{"text":"impl !UnwindSafe for SemaphoreInner","synthetic":true,"types":["os::sync::semaphore::SemaphoreInner"]},{"text":"impl<T> UnwindSafe for UPSafeCellRaw<T> where
    T: UnwindSafe
","synthetic":true,"types":["os::sync::up::UPSafeCellRaw"]},{"text":"impl UnwindSafe for IntrMaskingInfo","synthetic":true,"types":["os::sync::up::IntrMaskingInfo"]},{"text":"impl UnwindSafe for INTR_MASKING_INFO","synthetic":true,"types":["os::sync::up::INTR_MASKING_INFO"]},{"text":"impl<T> UnwindSafe for UPIntrFreeCell<T> where
    T: UnwindSafe
","synthetic":true,"types":["os::sync::up::UPIntrFreeCell"]},{"text":"impl<'a, T> !UnwindSafe for UPIntrRefMut<'a, T>","synthetic":true,"types":["os::sync::up::UPIntrRefMut"]},{"text":"impl UnwindSafe for TaskContext","synthetic":true,"types":["os::task::context::TaskContext"]},{"text":"impl UnwindSafe for RecycleAllocator","synthetic":true,"types":["os::task::id::RecycleAllocator"]},{"text":"impl UnwindSafe for PID_ALLOCATOR","synthetic":true,"types":["os::task::id::PID_ALLOCATOR"]},{"text":"impl UnwindSafe for KSTACK_ALLOCATOR","synthetic":true,"types":["os::task::id::KSTACK_ALLOCATOR"]},{"text":"impl UnwindSafe for PidHandle","synthetic":true,"types":["os::task::id::PidHandle"]},{"text":"impl UnwindSafe for KernelStack","synthetic":true,"types":["os::task::id::KernelStack"]},{"text":"impl !UnwindSafe for TaskUserRes","synthetic":true,"types":["os::task::id::TaskUserRes"]},{"text":"impl !UnwindSafe for TaskManager","synthetic":true,"types":["os::task::manager::TaskManager"]},{"text":"impl UnwindSafe for TASK_MANAGER","synthetic":true,"types":["os::task::manager::TASK_MANAGER"]},{"text":"impl UnwindSafe for PID2PCB","synthetic":true,"types":["os::task::manager::PID2PCB"]},{"text":"impl !UnwindSafe for ProcessControlBlock","synthetic":true,"types":["os::task::process::ProcessControlBlock"]},{"text":"impl !UnwindSafe for ProcessControlBlockInner","synthetic":true,"types":["os::task::process::ProcessControlBlockInner"]},{"text":"impl !UnwindSafe for Processor","synthetic":true,"types":["os::task::processor::Processor"]},{"text":"impl UnwindSafe for PROCESSOR","synthetic":true,"types":["os::task::processor::PROCESSOR"]},{"text":"impl UnwindSafe for SignalFlags","synthetic":true,"types":["os::task::signal::SignalFlags"]},{"text":"impl !UnwindSafe for TaskControlBlock","synthetic":true,"types":["os::task::task::TaskControlBlock"]},{"text":"impl !UnwindSafe for TaskControlBlockInner","synthetic":true,"types":["os::task::task::TaskControlBlockInner"]},{"text":"impl UnwindSafe for TaskStatus","synthetic":true,"types":["os::task::task::TaskStatus"]},{"text":"impl UnwindSafe for INITPROC","synthetic":true,"types":["os::task::INITPROC"]},{"text":"impl !UnwindSafe for TimerCondVar","synthetic":true,"types":["os::timer::TimerCondVar"]},{"text":"impl UnwindSafe for TIMERS","synthetic":true,"types":["os::timer::TIMERS"]},{"text":"impl UnwindSafe for TrapContext","synthetic":true,"types":["os::trap::context::TrapContext"]},{"text":"impl UnwindSafe for DEV_NON_BLOCKING_ACCESS","synthetic":true,"types":["os::DEV_NON_BLOCKING_ACCESS"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/easy_fs/block_dev/trait.BlockDevice.js b/ch9-gui-dev/implementors/easy_fs/block_dev/trait.BlockDevice.js new file mode 100644 index 00000000..41803dde --- /dev/null +++ b/ch9-gui-dev/implementors/easy_fs/block_dev/trait.BlockDevice.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl BlockDevice for VirtIOBlock","synthetic":false,"types":["os::drivers::block::virtio_blk::VirtIOBlock"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/embedded_graphics_core/draw_target/trait.DrawTarget.js b/ch9-gui-dev/implementors/embedded_graphics_core/draw_target/trait.DrawTarget.js new file mode 100644 index 00000000..26ad63b8 --- /dev/null +++ b/ch9-gui-dev/implementors/embedded_graphics_core/draw_target/trait.DrawTarget.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl DrawTarget for Graphics","synthetic":false,"types":["os::gui::graphic::Graphics"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/embedded_graphics_core/geometry/trait.OriginDimensions.js b/ch9-gui-dev/implementors/embedded_graphics_core/geometry/trait.OriginDimensions.js new file mode 100644 index 00000000..d5ab3f1d --- /dev/null +++ b/ch9-gui-dev/implementors/embedded_graphics_core/geometry/trait.OriginDimensions.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl OriginDimensions for Graphics","synthetic":false,"types":["os::gui::graphic::Graphics"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/lazy_static/trait.LazyStatic.js b/ch9-gui-dev/implementors/lazy_static/trait.LazyStatic.js new file mode 100644 index 00000000..a87f9a36 --- /dev/null +++ b/ch9-gui-dev/implementors/lazy_static/trait.LazyStatic.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl LazyStatic for BLOCK_DEVICE","synthetic":false,"types":["os::drivers::block::BLOCK_DEVICE"]},{"text":"impl LazyStatic for QUEUE_FRAMES","synthetic":false,"types":["os::drivers::bus::virtio::QUEUE_FRAMES"]},{"text":"impl LazyStatic for UART","synthetic":false,"types":["os::drivers::chardev::UART"]},{"text":"impl LazyStatic for GPU_DEVICE","synthetic":false,"types":["os::drivers::gpu::GPU_DEVICE"]},{"text":"impl LazyStatic for KEYBOARD_DEVICE","synthetic":false,"types":["os::drivers::input::KEYBOARD_DEVICE"]},{"text":"impl LazyStatic for MOUSE_DEVICE","synthetic":false,"types":["os::drivers::input::MOUSE_DEVICE"]},{"text":"impl LazyStatic for ROOT_INODE","synthetic":false,"types":["os::fs::inode::ROOT_INODE"]},{"text":"impl LazyStatic for DRAWING_BOARD","synthetic":false,"types":["os::gui::paint::DRAWING_BOARD"]},{"text":"impl LazyStatic for FRAME_ALLOCATOR","synthetic":false,"types":["os::mm::frame_allocator::FRAME_ALLOCATOR"]},{"text":"impl LazyStatic for KERNEL_SPACE","synthetic":false,"types":["os::mm::memory_set::KERNEL_SPACE"]},{"text":"impl LazyStatic for INTR_MASKING_INFO","synthetic":false,"types":["os::sync::up::INTR_MASKING_INFO"]},{"text":"impl LazyStatic for PID_ALLOCATOR","synthetic":false,"types":["os::task::id::PID_ALLOCATOR"]},{"text":"impl LazyStatic for KSTACK_ALLOCATOR","synthetic":false,"types":["os::task::id::KSTACK_ALLOCATOR"]},{"text":"impl LazyStatic for TASK_MANAGER","synthetic":false,"types":["os::task::manager::TASK_MANAGER"]},{"text":"impl LazyStatic for PID2PCB","synthetic":false,"types":["os::task::manager::PID2PCB"]},{"text":"impl LazyStatic for PROCESSOR","synthetic":false,"types":["os::task::processor::PROCESSOR"]},{"text":"impl LazyStatic for INITPROC","synthetic":false,"types":["os::task::INITPROC"]},{"text":"impl LazyStatic for TIMERS","synthetic":false,"types":["os::timer::TIMERS"]},{"text":"impl LazyStatic for DEV_NON_BLOCKING_ACCESS","synthetic":false,"types":["os::DEV_NON_BLOCKING_ACCESS"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/os/board/trait.QEMUExit.js b/ch9-gui-dev/implementors/os/board/trait.QEMUExit.js new file mode 100644 index 00000000..34fffcbd --- /dev/null +++ b/ch9-gui-dev/implementors/os/board/trait.QEMUExit.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/os/drivers/chardev/trait.CharDevice.js b/ch9-gui-dev/implementors/os/drivers/chardev/trait.CharDevice.js new file mode 100644 index 00000000..34fffcbd --- /dev/null +++ b/ch9-gui-dev/implementors/os/drivers/chardev/trait.CharDevice.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/os/drivers/gpu/trait.GpuDevice.js b/ch9-gui-dev/implementors/os/drivers/gpu/trait.GpuDevice.js new file mode 100644 index 00000000..34fffcbd --- /dev/null +++ b/ch9-gui-dev/implementors/os/drivers/gpu/trait.GpuDevice.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/os/drivers/input/trait.InputDevice.js b/ch9-gui-dev/implementors/os/drivers/input/trait.InputDevice.js new file mode 100644 index 00000000..34fffcbd --- /dev/null +++ b/ch9-gui-dev/implementors/os/drivers/input/trait.InputDevice.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/os/fs/trait.File.js b/ch9-gui-dev/implementors/os/fs/trait.File.js new file mode 100644 index 00000000..34fffcbd --- /dev/null +++ b/ch9-gui-dev/implementors/os/fs/trait.File.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/os/mm/address/trait.StepByOne.js b/ch9-gui-dev/implementors/os/mm/address/trait.StepByOne.js new file mode 100644 index 00000000..34fffcbd --- /dev/null +++ b/ch9-gui-dev/implementors/os/mm/address/trait.StepByOne.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/os/mm/frame_allocator/trait.FrameAllocator.js b/ch9-gui-dev/implementors/os/mm/frame_allocator/trait.FrameAllocator.js new file mode 100644 index 00000000..34fffcbd --- /dev/null +++ b/ch9-gui-dev/implementors/os/mm/frame_allocator/trait.FrameAllocator.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/os/sync/mutex/trait.Mutex.js b/ch9-gui-dev/implementors/os/sync/mutex/trait.Mutex.js new file mode 100644 index 00000000..34fffcbd --- /dev/null +++ b/ch9-gui-dev/implementors/os/sync/mutex/trait.Mutex.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/implementors/virtio_drivers/hal/trait.Hal.js b/ch9-gui-dev/implementors/virtio_drivers/hal/trait.Hal.js new file mode 100644 index 00000000..bb1cd804 --- /dev/null +++ b/ch9-gui-dev/implementors/virtio_drivers/hal/trait.Hal.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["os"] = [{"text":"impl Hal for VirtioHal","synthetic":false,"types":["os::drivers::bus::virtio::VirtioHal"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch9-gui-dev/light.css b/ch9-gui-dev/light.css new file mode 100644 index 00000000..a71085b0 --- /dev/null +++ b/ch9-gui-dev/light.css @@ -0,0 +1 @@ +:root{--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--sidebar-background-color:#F5F5F5;--sidebar-background-color-hover:#E0E0E0;--code-block-background-color:#F5F5F5;--scrollbar-track-background-color:#dcdcdc;--scrollbar-thumb-background-color:rgba(36,37,39,0.6);--scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;--headings-border-bottom-color:#ddd;}.slider{background-color:#ccc;}.slider:before{background-color:white;}input:focus+.slider{box-shadow:0 0 0 2px #0a84ff,0 0 0 6px rgba(10,132,255,0.3);}.in-band{background-color:white;}.rust-logo{}.sidebar .current,.sidebar a:hover{background-color:#fff;}.line-numbers span{color:#c67e2d;}.line-numbers .line-highlighted{background-color:#FDFFD3 !important;}.docblock table td,.docblock table th{border-color:#ddd;}.search-results a:hover{background-color:#ddd;}.search-results a:focus{color:#000 !important;background-color:#ccc;}.search-results a:focus span{color:#000 !important;}a.result-trait:focus{background-color:#c7b6ff;}a.result-traitalias:focus{background-color:#c7b6ff;}a.result-mod:focus,a.result-externcrate:focus{background-color:#afc6e4;}a.result-enum:focus{background-color:#e7b1a0;}a.result-struct:focus{background-color:#e7b1a0;}a.result-union:focus{background-color:#e7b1a0;}a.result-fn:focus,a.result-method:focus,a.result-tymethod:focus{background-color:#c6afb3;}a.result-type:focus{background-color:#e7b1a0;}a.result-associatedtype:focus{background-color:#afc6e4;}a.result-foreigntype:focus{background-color:#e7b1a0;}a.result-attr:focus,a.result-derive:focus,a.result-macro:focus{background-color:#8ce488;}a.result-constant:focus,a.result-static:focus{background-color:#afc6e4;}a.result-primitive:focus{background-color:#e7b1a0;}a.result-keyword:focus{background-color:#afc6e4;}.content .item-info::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#AD378A;}.content span.struct,.content a.struct,.block a.current.struct{color:#AD378A;}.content span.type,.content a.type,.block a.current.type{color:#AD378A;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#3873AD;}.content span.associatedtype,.content a.associatedtype,.block a.current.associatedtype{color:#3873AD;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#068000;}.content span.union,.content a.union,.block a.current.union{color:#AD378A;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#3873AD;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#AD378A;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#3873AD;}.content span.trait,.content a.trait,.block a.current.trait{color:#6E4FC9;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#5137AD;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#AD7C37;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#3873AD;}.sidebar a{color:#356da4;}.sidebar a.current.enum{color:#a63283;}.sidebar a.current.struct{color:#a63283;}.sidebar a.current.type{color:#a63283;}.sidebar a.current.associatedtype{color:#356da4;}.sidebar a.current.foreigntype{color:#356da4;}.sidebar a.current.attr,.sidebar a.current.derive,.sidebar a.current.macro{color:#067901;}.sidebar a.current.union{color:#a63283;}.sidebar a.current.constant .sidebar a.current.static{color:#356da4;}.sidebar a.current.primitive{color:#a63283;}.sidebar a.current.externcrate .sidebar a.current.mod{color:#356da4;}.sidebar a.current.trait{color:#6849c3;}.sidebar a.current.traitalias{color:#4b349e;}.sidebar a.current.fn,.sidebar a.current.method,.sidebar a.current.tymethod{color:#a67736;}.sidebar a.current.keyword{color:#356da4;}nav.main .current{border-top-color:#000;border-bottom-color:#000;}nav.main .separator{border:1px solid #000;}a{color:#3873AD;}body.source .example-wrap pre.rust a{background:#eee;}details.rustdoc-toggle>summary.hideme>span,details.rustdoc-toggle>summary::before{color:#999;}#crate-search,.search-input{background-color:white;border-color:#e0e0e0;}#crate-search{border-color:#e0e0e0 !important;}.search-input:focus{border-color:#66afe9;}.stab.empty-impl{background:#FFF5D6;border-color:#FFC600;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;}.stab.deprecated{background:#ffc4c4;border-color:#db7b7b;}.stab.must_implement{background:#F3DFFF;border-color:#b07bdb;}.stab.portability{background:#F3DFFF;border-color:#b07bdb;}.stab.portability>code{background:none;}.rightside,.out-of-band{color:grey;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#8959A8;}pre.rust .kw-2,pre.rust .prelude-ty{color:#4271AE;}pre.rust .number,pre.rust .string{color:#718C00;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#C82829;}pre.rust .comment{color:#8E908C;}pre.rust .doccomment{color:#4D4D4C;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#B76514;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#c7c7c7;}a.test-arrow{color:#f5f5f5;background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label,.code-attribute{color:#999;}:target{background:#FDFFD3;border-right:3px solid #AD7C37;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.5);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.should_panic{border-left:2px solid rgba(255,0,0,.5);}pre.should_panic:hover,.information:hover+pre.should_panic{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.5);}.information>.compile_fail:hover{color:#f00;}.tooltip.should_panic{color:rgba(255,0,0,.5);}.information>.should_panic:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:#ff9200;}.search-failed a{color:#3873AD;}.tooltip::after{background-color:#000;color:#fff;}.tooltip::before{border-color:transparent black transparent transparent;}.notable-traits-tooltiptext{background-color:#eee;border-color:#999;}.notable-traits-tooltiptext .notable{border-bottom-color:#DDDDDD;}#titles>button:not(.selected){background-color:#e6e6e6;border-top-color:#e6e6e6;}#titles>button:hover,#titles>button.selected{background-color:#ffffff;border-top-color:#0089ff;}#titles>button>div.count{color:#888;}@media (max-width:700px){.sidebar-elems{border-right-color:#000;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow:inset 0 -1px 0 #c6cbd1;}#settings-menu>a,#help-button>button{border-color:#e0e0e0;background-color:#fff;}#settings-menu>a:hover,#settings-menu>a:focus,#help-button>button:hover,#help-button>button:focus{border-color:#717171;}.popover,.popover::before,#help-button span.top,#help-button span.bottom{border-color:#DDDDDD;}#copy-path{color:#999;}#copy-path>img{filter:invert(50%);}#copy-path:hover>img{filter:invert(35%);}#theme-choices{border-color:#ccc;background-color:#fff;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#eee;}.search-results .result-name span.alias{color:#000;}.search-results .result-name span.grey{color:#999;}#source-sidebar>.title{border-bottom-color:#ccc;}#source-sidebar div.files>a:hover,details.dir-entry summary:hover,#source-sidebar div.files>a:focus,details.dir-entry summary:focus{background-color:#E0E0E0;}#source-sidebar div.files>a.selected{background-color:#fff;}.scraped-example-list .scrape-help{border-color:#555;color:#333;}.scraped-example-list .scrape-help:hover{border-color:black;color:black;}.more-examples-toggle summary,.more-examples-toggle .hide-more{color:#999;}.scraped-example .example-wrap .rust span.highlight{background:#fcffd6;}.scraped-example .example-wrap .rust span.highlight.focus{background:#f6fdb0;}.scraped-example:not(.expanded) .code-wrapper:before{background:linear-gradient(to bottom,rgba(255,255,255,1),rgba(255,255,255,0));}.scraped-example:not(.expanded) .code-wrapper:after{background:linear-gradient(to top,rgba(255,255,255,1),rgba(255,255,255,0));}.toggle-line-inner{background:#ccc;}.toggle-line:hover .toggle-line-inner{background:#999;} \ No newline at end of file diff --git a/ch9-gui-dev/main.js b/ch9-gui-dev/main.js new file mode 100644 index 00000000..c2141ac5 --- /dev/null +++ b/ch9-gui-dev/main.js @@ -0,0 +1,8 @@ +"use strict";function getVar(name){const el=document.getElementById("rustdoc-vars");if(el){return el.attributes["data-"+name].value}else{return null}}function resourcePath(basename,extension){return getVar("root-path")+basename+getVar("resource-suffix")+extension}function hideMain(){addClass(document.getElementById(MAIN_ID),"hidden")}function showMain(){removeClass(document.getElementById(MAIN_ID),"hidden")}function elemIsInParent(elem,parent){while(elem&&elem!==document.body){if(elem===parent){return true}elem=elem.parentElement}return false}function blurHandler(event,parentElem,hideCallback){if(!elemIsInParent(document.activeElement,parentElem)&&!elemIsInParent(event.relatedTarget,parentElem)){hideCallback()}}(function(){window.rootPath=getVar("root-path");window.currentCrate=getVar("current-crate")}());function setMobileTopbar(){const mobileLocationTitle=document.querySelector(".mobile-topbar h2.location");const locationTitle=document.querySelector(".sidebar h2.location");if(mobileLocationTitle&&locationTitle){mobileLocationTitle.innerHTML=locationTitle.innerHTML}}function getVirtualKey(ev){if("key"in ev&&typeof ev.key!=="undefined"){return ev.key}const c=ev.charCode||ev.keyCode;if(c===27){return"Escape"}return String.fromCharCode(c)}const MAIN_ID="main-content";const SETTINGS_BUTTON_ID="settings-menu";const ALTERNATIVE_DISPLAY_ID="alternative-display";const NOT_DISPLAYED_ID="not-displayed";const HELP_BUTTON_ID="help-button";function getSettingsButton(){return document.getElementById(SETTINGS_BUTTON_ID)}function getHelpButton(){return document.getElementById(HELP_BUTTON_ID)}function getNakedUrl(){return window.location.href.split("?")[0].split("#")[0]}function insertAfter(newNode,referenceNode){referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling)}function getOrCreateSection(id,classes){let el=document.getElementById(id);if(!el){el=document.createElement("section");el.id=id;el.className=classes;insertAfter(el,document.getElementById(MAIN_ID))}return el}function getAlternativeDisplayElem(){return getOrCreateSection(ALTERNATIVE_DISPLAY_ID,"content hidden")}function getNotDisplayedElem(){return getOrCreateSection(NOT_DISPLAYED_ID,"hidden")}function switchDisplayedElement(elemToDisplay){const el=getAlternativeDisplayElem();if(el.children.length>0){getNotDisplayedElem().appendChild(el.firstElementChild)}if(elemToDisplay===null){addClass(el,"hidden");showMain();return}el.appendChild(elemToDisplay);hideMain();removeClass(el,"hidden")}function browserSupportsHistoryApi(){return window.history&&typeof window.history.pushState==="function"}function loadCss(cssFileName){const link=document.createElement("link");link.href=resourcePath(cssFileName,".css");link.type="text/css";link.rel="stylesheet";document.getElementsByTagName("head")[0].appendChild(link)}(function(){function loadScript(url){const script=document.createElement("script");script.src=url;document.head.append(script)}getSettingsButton().onclick=event=>{addClass(getSettingsButton(),"rotate");event.preventDefault();loadCss("settings");loadScript(resourcePath("settings",".js"))};window.searchState={loadingText:"Loading search results...",input:document.getElementsByClassName("search-input")[0],outputElement:()=>{let el=document.getElementById("search");if(!el){el=document.createElement("section");el.id="search";getNotDisplayedElem().appendChild(el)}return el},title:document.title,titleBeforeSearch:document.title,timeout:null,currentTab:0,focusedByTab:[null,null,null],clearInputTimeout:()=>{if(searchState.timeout!==null){clearTimeout(searchState.timeout);searchState.timeout=null}},isDisplayed:()=>searchState.outputElement().parentElement.id===ALTERNATIVE_DISPLAY_ID,focus:()=>{searchState.input.focus()},defocus:()=>{searchState.input.blur()},showResults:search=>{if(search===null||typeof search==="undefined"){search=searchState.outputElement()}switchDisplayedElement(search);searchState.mouseMovedAfterSearch=false;document.title=searchState.title},hideResults:()=>{switchDisplayedElement(null);document.title=searchState.titleBeforeSearch;if(browserSupportsHistoryApi()){history.replaceState(null,window.currentCrate+" - Rust",getNakedUrl()+window.location.hash)}},getQueryStringParams:()=>{const params={};window.location.search.substring(1).split("&").map(s=>{const pair=s.split("=");params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params},setup:()=>{const search_input=searchState.input;if(!searchState.input){return}let searchLoaded=false;function loadSearch(){if(!searchLoaded){searchLoaded=true;loadScript(resourcePath("search",".js"));loadScript(resourcePath("search-index",".js"))}}search_input.addEventListener("focus",()=>{search_input.origPlaceholder=search_input.placeholder;search_input.placeholder="Type your search here.";loadSearch()});if(search_input.value!==""){loadSearch()}const params=searchState.getQueryStringParams();if(params.search!==undefined){const search=searchState.outputElement();search.innerHTML="

"+searchState.loadingText+"

";searchState.showResults(search);loadSearch()}},};function getPageId(){if(window.location.hash){const tmp=window.location.hash.replace(/^#/,"");if(tmp.length>0){return tmp}}return null}const toggleAllDocsId="toggle-all-docs";let savedHash="";function handleHashes(ev){if(ev!==null&&searchState.isDisplayed()&&ev.newURL){switchDisplayedElement(null);const hash=ev.newURL.slice(ev.newURL.indexOf("#")+1);if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.search+"#"+hash)}const elem=document.getElementById(hash);if(elem){elem.scrollIntoView()}}if(savedHash!==window.location.hash){savedHash=window.location.hash;if(savedHash.length===0){return}expandSection(savedHash.slice(1))}}function onHashChange(ev){const sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"shown");handleHashes(ev)}function openParentDetails(elem){while(elem){if(elem.tagName==="DETAILS"){elem.open=true}elem=elem.parentNode}}function expandSection(id){openParentDetails(document.getElementById(id))}function handleEscape(ev){searchState.clearInputTimeout();switchDisplayedElement(null);if(browserSupportsHistoryApi()){history.replaceState(null,window.currentCrate+" - Rust",getNakedUrl()+window.location.hash)}ev.preventDefault();searchState.defocus();window.hidePopoverMenus()}function handleShortcut(ev){const disableShortcuts=getSettingValue("disable-shortcuts")==="true";if(ev.ctrlKey||ev.altKey||ev.metaKey||disableShortcuts){return}if(document.activeElement.tagName==="INPUT"&&document.activeElement.type!=="checkbox"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":ev.preventDefault();searchState.focus();break;case"+":case"-":ev.preventDefault();toggleAllDocs();break;case"?":showHelp();break;default:break}}}document.addEventListener("keypress",handleShortcut);document.addEventListener("keydown",handleShortcut);function addSidebarItems(){if(!window.SIDEBAR_ITEMS){return}const sidebar=document.getElementsByClassName("sidebar-elems")[0];function block(shortty,id,longty){const filtered=window.SIDEBAR_ITEMS[shortty];if(!filtered){return}const div=document.createElement("div");div.className="block "+shortty;const h3=document.createElement("h3");h3.innerHTML=`${longty}`;div.appendChild(h3);const ul=document.createElement("ul");for(const item of filtered){const name=item[0];const desc=item[1];let klass=shortty;let path;if(shortty==="mod"){path=name+"/index.html"}else{path=shortty+"."+name+".html"}const current_page=document.location.href.split("/").pop();if(path===current_page){klass+=" current"}const link=document.createElement("a");link.href=path;link.title=desc;link.className=klass;link.textContent=name;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}div.appendChild(ul);sidebar.appendChild(div)}if(sidebar){block("primitive","primitives","Primitive Types");block("mod","modules","Modules");block("macro","macros","Macros");block("struct","structs","Structs");block("enum","enums","Enums");block("union","unions","Unions");block("constant","constants","Constants");block("static","static","Statics");block("trait","traits","Traits");block("fn","functions","Functions");block("type","types","Type Definitions");block("foreigntype","foreign-types","Foreign Types");block("keyword","keywords","Keywords");block("traitalias","trait-aliases","Trait Aliases")}}window.register_implementors=imp=>{const implementors=document.getElementById("implementors-list");const synthetic_implementors=document.getElementById("synthetic-implementors-list");const inlined_types=new Set();if(synthetic_implementors){onEachLazy(synthetic_implementors.getElementsByClassName("impl"),el=>{const aliases=el.getAttribute("data-aliases");if(!aliases){return}aliases.split(",").forEach(alias=>{inlined_types.add(alias)})})}let currentNbImpls=implementors.getElementsByClassName("impl").length;const traitName=document.querySelector("h1.fqn > .in-band > .trait").textContent;const baseIdName="impl-"+traitName+"-";const libs=Object.getOwnPropertyNames(imp);const ignoreExternCrates=document.querySelector("script[data-ignore-extern-crates]").getAttribute("data-ignore-extern-crates");for(const lib of libs){if(lib===window.currentCrate||ignoreExternCrates.indexOf(lib)!==-1){continue}const structs=imp[lib];struct_loop:for(const struct of structs){const list=struct.synthetic?synthetic_implementors:implementors;if(struct.synthetic){for(const struct_type of struct.types){if(inlined_types.has(struct_type)){continue struct_loop}inlined_types.add(struct_type)}}const code=document.createElement("h3");code.innerHTML=struct.text;addClass(code,"code-header");addClass(code,"in-band");onEachLazy(code.getElementsByTagName("a"),elem=>{const href=elem.getAttribute("href");if(href&&href.indexOf("http")!==0){elem.setAttribute("href",window.rootPath+href)}});const currentId=baseIdName+currentNbImpls;const anchor=document.createElement("a");anchor.href="#"+currentId;addClass(anchor,"anchor");const display=document.createElement("div");display.id=currentId;addClass(display,"impl");display.appendChild(anchor);display.appendChild(code);list.appendChild(display);currentNbImpls+=1}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors)}function addSidebarCrates(){if(!window.ALL_CRATES){return}const sidebarElems=document.getElementsByClassName("sidebar-elems")[0];if(!sidebarElems){return}const div=document.createElement("div");div.className="block crate";div.innerHTML="

Crates

";const ul=document.createElement("ul");div.appendChild(ul);for(const crate of window.ALL_CRATES){let klass="crate";if(window.rootPath!=="./"&&crate===window.currentCrate){klass+=" current"}const link=document.createElement("a");link.href=window.rootPath+crate+"/index.html";link.className=klass;link.textContent=crate;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebarElems.appendChild(div)}function labelForToggleButton(sectionIsCollapsed){if(sectionIsCollapsed){return"+"}return"\u2212"}function toggleAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);if(!innerToggle){return}let sectionIsCollapsed=false;if(hasClass(innerToggle,"will-expand")){removeClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("rustdoc-toggle"),e=>{if(!hasClass(e,"type-contents-toggle")){e.open=true}});innerToggle.title="collapse all docs"}else{addClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("rustdoc-toggle"),e=>{if(e.parentNode.id!=="implementations-list"||(!hasClass(e,"implementors-toggle")&&!hasClass(e,"type-contents-toggle"))){e.open=false}});sectionIsCollapsed=true;innerToggle.title="expand all docs"}innerToggle.children[0].innerText=labelForToggleButton(sectionIsCollapsed)}(function(){const toggles=document.getElementById(toggleAllDocsId);if(toggles){toggles.onclick=toggleAllDocs}const hideMethodDocs=getSettingValue("auto-hide-method-docs")==="true";const hideImplementations=getSettingValue("auto-hide-trait-implementations")==="true";const hideLargeItemContents=getSettingValue("auto-hide-large-items")!=="false";function setImplementorsTogglesOpen(id,open){const list=document.getElementById(id);if(list!==null){onEachLazy(list.getElementsByClassName("implementors-toggle"),e=>{e.open=open})}}if(hideImplementations){setImplementorsTogglesOpen("trait-implementations-list",false);setImplementorsTogglesOpen("blanket-implementations-list",false)}onEachLazy(document.getElementsByClassName("rustdoc-toggle"),e=>{if(!hideLargeItemContents&&hasClass(e,"type-contents-toggle")){e.open=true}if(hideMethodDocs&&hasClass(e,"method-toggle")){e.open=false}});const pageId=getPageId();if(pageId!==null){expandSection(pageId)}}());(function(){let lineNumbersFunc=()=>{};if(getSettingValue("line-numbers")==="true"){lineNumbersFunc=x=>{const count=x.textContent.split("\n").length;const elems=[];for(let i=0;i{if(hasClass(e,"compile_fail")){e.addEventListener("mouseover",function(){this.parentElement.previousElementSibling.childNodes[0].style.color="#f00"});e.addEventListener("mouseout",function(){this.parentElement.previousElementSibling.childNodes[0].style.color=""})}else if(hasClass(e,"ignore")){e.addEventListener("mouseover",function(){this.parentElement.previousElementSibling.childNodes[0].style.color="#ff9200"});e.addEventListener("mouseout",function(){this.parentElement.previousElementSibling.childNodes[0].style.color=""})}lineNumbersFunc(e)})}());function hideSidebar(){const sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"shown")}function handleClick(id,f){const elem=document.getElementById(id);if(elem){elem.addEventListener("click",f)}}handleClick(MAIN_ID,()=>{hideSidebar()});onEachLazy(document.getElementsByTagName("a"),el=>{if(el.hash){el.addEventListener("click",()=>{expandSection(el.hash.slice(1));hideSidebar()})}});onEachLazy(document.querySelectorAll(".rustdoc-toggle > summary:not(.hideme)"),el=>{el.addEventListener("click",e=>{if(e.target.tagName!=="SUMMARY"&&e.target.tagName!=="A"){e.preventDefault()}})});onEachLazy(document.getElementsByClassName("notable-traits"),e=>{e.onclick=function(){this.getElementsByClassName("notable-traits-tooltiptext")[0].classList.toggle("force-tooltip")}});const sidebar_menu_toggle=document.getElementsByClassName("sidebar-menu-toggle")[0];if(sidebar_menu_toggle){sidebar_menu_toggle.addEventListener("click",()=>{const sidebar=document.getElementsByClassName("sidebar")[0];if(!hasClass(sidebar,"shown")){addClass(sidebar,"shown")}else{removeClass(sidebar,"shown")}})}function helpBlurHandler(event){blurHandler(event,getHelpButton(),window.hidePopoverMenus)}function buildHelpMenu(){const book_info=document.createElement("span");book_info.className="top";book_info.innerHTML="You can find more information in \ + the rustdoc book.";const shortcuts=[["?","Show this help dialog"],["S","Focus the search field"],["↑","Move up in search results"],["↓","Move down in search results"],["← / →","Switch result tab (when results focused)"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(x=>"
"+x[0].split(" ").map((y,index)=>((index&1)===0?""+y+"":" "+y+" ")).join("")+"
"+x[1]+"
").join("");const div_shortcuts=document.createElement("div");addClass(div_shortcuts,"shortcuts");div_shortcuts.innerHTML="

Keyboard Shortcuts

"+shortcuts+"
";const infos=["Prefix searches with a type followed by a colon (e.g., fn:) to \ + restrict the search to a given item kind.","Accepted kinds are: fn, mod, struct, \ + enum, trait, type, macro, \ + and const.","Search functions by type signature (e.g., vec -> usize or \ + -> vec)","Search multiple things at once by splitting your query with comma (e.g., \ + str,u8 or String,struct:Vec,test)","You can look for items with an exact name by putting double quotes around \ + your request: \"string\"","Look for items inside another one by searching for a path: vec::Vec",].map(x=>"

"+x+"

").join("");const div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="

Search Tricks

"+infos;const rustdoc_version=document.createElement("span");rustdoc_version.className="bottom";const rustdoc_version_code=document.createElement("code");rustdoc_version_code.innerText="rustdoc "+getVar("rustdoc-version");rustdoc_version.appendChild(rustdoc_version_code);const container=document.createElement("div");container.className="popover";container.style.display="none";const side_by_side=document.createElement("div");side_by_side.className="side-by-side";side_by_side.appendChild(div_shortcuts);side_by_side.appendChild(div_infos);container.appendChild(book_info);container.appendChild(side_by_side);container.appendChild(rustdoc_version);const help_button=getHelpButton();help_button.appendChild(container);container.onblur=helpBlurHandler;container.onclick=event=>{event.preventDefault()};help_button.onblur=helpBlurHandler;help_button.children[0].onblur=helpBlurHandler;return container}window.hidePopoverMenus=function(){onEachLazy(document.querySelectorAll(".search-container .popover"),elem=>{elem.style.display="none"})};function getHelpMenu(buildNeeded){let menu=getHelpButton().querySelector(".popover");if(!menu&&buildNeeded){menu=buildHelpMenu()}return menu}function showHelp(){const menu=getHelpMenu(true);if(menu.style.display==="none"){window.hidePopoverMenus();menu.style.display=""}}document.querySelector(`#${HELP_BUTTON_ID} > button`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="BUTTON"||target.parentElement.id!==HELP_BUTTON_ID){return}const menu=getHelpMenu(true);const shouldShowHelp=menu.style.display==="none";if(shouldShowHelp){showHelp()}else{window.hidePopoverMenus()}});setMobileTopbar();addSidebarItems();addSidebarCrates();onHashChange(null);window.addEventListener("hashchange",onHashChange);searchState.setup()}());(function(){let reset_button_timeout=null;window.copy_path=but=>{const parent=but.parentElement;const path=[];onEach(parent.childNodes,child=>{if(child.tagName==="A"){path.push(child.textContent)}});const el=document.createElement("textarea");el.value=path.join("::");el.setAttribute("readonly","");el.style.position="absolute";el.style.left="-9999px";document.body.appendChild(el);el.select();document.execCommand("copy");document.body.removeChild(el);but.children[0].style.display="none";let tmp;if(but.childNodes.length<2){tmp=document.createTextNode("✓");but.appendChild(tmp)}else{onEachLazy(but.childNodes,e=>{if(e.nodeType===Node.TEXT_NODE){tmp=e;return true}});tmp.textContent="✓"}if(reset_button_timeout!==null){window.clearTimeout(reset_button_timeout)}function reset_button(){tmp.textContent="";reset_button_timeout=null;but.children[0].style.display=""}reset_button_timeout=window.setTimeout(reset_button,1000)}}()) \ No newline at end of file diff --git a/ch9-gui-dev/normalize.css b/ch9-gui-dev/normalize.css new file mode 100644 index 00000000..469959f1 --- /dev/null +++ b/ch9-gui-dev/normalize.css @@ -0,0 +1,2 @@ + /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ +html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type="button"],[type="reset"],[type="submit"],button{-webkit-appearance:button}[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} \ No newline at end of file diff --git a/ch9-gui-dev/noscript.css b/ch9-gui-dev/noscript.css new file mode 100644 index 00000000..d850bb38 --- /dev/null +++ b/ch9-gui-dev/noscript.css @@ -0,0 +1 @@ + #main-content .attributes{margin-left:0 !important;}#copy-path{display:none;}.sub{display:none;} \ No newline at end of file diff --git a/ch9-gui-dev/os/all.html b/ch9-gui-dev/os/all.html new file mode 100644 index 00000000..b54aedb8 --- /dev/null +++ b/ch9-gui-dev/os/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Traits

Macros

Functions

Typedefs

Statics

Constants

\ No newline at end of file diff --git a/ch9-gui-dev/os/board/constant.CLOCK_FREQ.html b/ch9-gui-dev/os/board/constant.CLOCK_FREQ.html new file mode 100644 index 00000000..a68a583e --- /dev/null +++ b/ch9-gui-dev/os/board/constant.CLOCK_FREQ.html @@ -0,0 +1 @@ +CLOCK_FREQ in os::board - Rust
pub const CLOCK_FREQ: usize = 12500000;
\ No newline at end of file diff --git a/ch9-gui-dev/os/board/constant.EXIT_FAILURE.html b/ch9-gui-dev/os/board/constant.EXIT_FAILURE.html new file mode 100644 index 00000000..7ffe5beb --- /dev/null +++ b/ch9-gui-dev/os/board/constant.EXIT_FAILURE.html @@ -0,0 +1 @@ +EXIT_FAILURE in os::board - Rust
const EXIT_FAILURE: u32 = _; // 78_643u32
\ No newline at end of file diff --git a/ch9-gui-dev/os/board/constant.EXIT_FAILURE_FLAG.html b/ch9-gui-dev/os/board/constant.EXIT_FAILURE_FLAG.html new file mode 100644 index 00000000..5a9821cf --- /dev/null +++ b/ch9-gui-dev/os/board/constant.EXIT_FAILURE_FLAG.html @@ -0,0 +1 @@ +EXIT_FAILURE_FLAG in os::board - Rust
const EXIT_FAILURE_FLAG: u32 = 0x3333;
\ No newline at end of file diff --git a/ch9-gui-dev/os/board/constant.EXIT_RESET.html b/ch9-gui-dev/os/board/constant.EXIT_RESET.html new file mode 100644 index 00000000..f4a2d499 --- /dev/null +++ b/ch9-gui-dev/os/board/constant.EXIT_RESET.html @@ -0,0 +1 @@ +EXIT_RESET in os::board - Rust
const EXIT_RESET: u32 = 0x7777;
\ No newline at end of file diff --git a/ch9-gui-dev/os/board/constant.EXIT_SUCCESS.html b/ch9-gui-dev/os/board/constant.EXIT_SUCCESS.html new file mode 100644 index 00000000..4ff3206f --- /dev/null +++ b/ch9-gui-dev/os/board/constant.EXIT_SUCCESS.html @@ -0,0 +1 @@ +EXIT_SUCCESS in os::board - Rust
const EXIT_SUCCESS: u32 = 0x5555;
\ No newline at end of file diff --git a/ch9-gui-dev/os/board/constant.MMIO.html b/ch9-gui-dev/os/board/constant.MMIO.html new file mode 100644 index 00000000..362661b9 --- /dev/null +++ b/ch9-gui-dev/os/board/constant.MMIO.html @@ -0,0 +1 @@ +MMIO in os::board - Rust

Constant os::board::MMIO

source · []
pub const MMIO: &'static [(usize, usize)];
\ No newline at end of file diff --git a/ch9-gui-dev/os/board/constant.QEMU_EXIT_HANDLE.html b/ch9-gui-dev/os/board/constant.QEMU_EXIT_HANDLE.html new file mode 100644 index 00000000..93dd4610 --- /dev/null +++ b/ch9-gui-dev/os/board/constant.QEMU_EXIT_HANDLE.html @@ -0,0 +1 @@ +QEMU_EXIT_HANDLE in os::board - Rust
pub const QEMU_EXIT_HANDLE: RISCV64;
\ No newline at end of file diff --git a/ch9-gui-dev/os/board/constant.VIRTGPU_XRES.html b/ch9-gui-dev/os/board/constant.VIRTGPU_XRES.html new file mode 100644 index 00000000..eb07afa0 --- /dev/null +++ b/ch9-gui-dev/os/board/constant.VIRTGPU_XRES.html @@ -0,0 +1 @@ +VIRTGPU_XRES in os::board - Rust
pub const VIRTGPU_XRES: u32 = 1280;
\ No newline at end of file diff --git a/ch9-gui-dev/os/board/constant.VIRTGPU_YRES.html b/ch9-gui-dev/os/board/constant.VIRTGPU_YRES.html new file mode 100644 index 00000000..5b20e024 --- /dev/null +++ b/ch9-gui-dev/os/board/constant.VIRTGPU_YRES.html @@ -0,0 +1 @@ +VIRTGPU_YRES in os::board - Rust
pub const VIRTGPU_YRES: u32 = 800;
\ No newline at end of file diff --git a/ch9-gui-dev/os/board/constant.VIRT_PLIC.html b/ch9-gui-dev/os/board/constant.VIRT_PLIC.html new file mode 100644 index 00000000..c80abcfd --- /dev/null +++ b/ch9-gui-dev/os/board/constant.VIRT_PLIC.html @@ -0,0 +1 @@ +VIRT_PLIC in os::board - Rust
pub const VIRT_PLIC: usize = 0xC00_0000;
\ No newline at end of file diff --git a/ch9-gui-dev/os/board/constant.VIRT_TEST.html b/ch9-gui-dev/os/board/constant.VIRT_TEST.html new file mode 100644 index 00000000..14c2756b --- /dev/null +++ b/ch9-gui-dev/os/board/constant.VIRT_TEST.html @@ -0,0 +1 @@ +VIRT_TEST in os::board - Rust
const VIRT_TEST: u64 = 0x100000;
\ No newline at end of file diff --git a/ch9-gui-dev/os/board/constant.VIRT_UART.html b/ch9-gui-dev/os/board/constant.VIRT_UART.html new file mode 100644 index 00000000..16db01b9 --- /dev/null +++ b/ch9-gui-dev/os/board/constant.VIRT_UART.html @@ -0,0 +1 @@ +VIRT_UART in os::board - Rust
pub const VIRT_UART: usize = 0x1000_0000;
\ No newline at end of file diff --git a/ch9-gui-dev/os/board/fn.device_init.html b/ch9-gui-dev/os/board/fn.device_init.html new file mode 100644 index 00000000..de22acf6 --- /dev/null +++ b/ch9-gui-dev/os/board/fn.device_init.html @@ -0,0 +1 @@ +device_init in os::board - Rust
pub fn device_init()
\ No newline at end of file diff --git a/ch9-gui-dev/os/board/fn.exit_code_encode.html b/ch9-gui-dev/os/board/fn.exit_code_encode.html new file mode 100644 index 00000000..b200152a --- /dev/null +++ b/ch9-gui-dev/os/board/fn.exit_code_encode.html @@ -0,0 +1,2 @@ +exit_code_encode in os::board - Rust
const fn exit_code_encode(code: u32) -> u32
Expand description

Encode the exit code using EXIT_FAILURE_FLAG.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/board/fn.irq_handler.html b/ch9-gui-dev/os/board/fn.irq_handler.html new file mode 100644 index 00000000..9c417a4b --- /dev/null +++ b/ch9-gui-dev/os/board/fn.irq_handler.html @@ -0,0 +1 @@ +irq_handler in os::board - Rust
pub fn irq_handler()
\ No newline at end of file diff --git a/ch9-gui-dev/os/board/index.html b/ch9-gui-dev/os/board/index.html new file mode 100644 index 00000000..5c68c784 --- /dev/null +++ b/ch9-gui-dev/os/board/index.html @@ -0,0 +1,3 @@ +os::board - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/board/sidebar-items.js b/ch9-gui-dev/os/board/sidebar-items.js new file mode 100644 index 00000000..1b8ac768 --- /dev/null +++ b/ch9-gui-dev/os/board/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":[["CLOCK_FREQ",""],["EXIT_FAILURE",""],["EXIT_FAILURE_FLAG",""],["EXIT_RESET",""],["EXIT_SUCCESS",""],["MMIO",""],["QEMU_EXIT_HANDLE",""],["VIRTGPU_XRES",""],["VIRTGPU_YRES",""],["VIRT_PLIC",""],["VIRT_TEST",""],["VIRT_UART",""]],"fn":[["device_init",""],["exit_code_encode","Encode the exit code using EXIT_FAILURE_FLAG."],["irq_handler",""]],"struct":[["RISCV64","RISCV64 configuration"]],"trait":[["QEMUExit",""]],"type":[["BlockDeviceImpl",""],["CharDeviceImpl",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/board/struct.RISCV64.html b/ch9-gui-dev/os/board/struct.RISCV64.html new file mode 100644 index 00000000..2b97301e --- /dev/null +++ b/ch9-gui-dev/os/board/struct.RISCV64.html @@ -0,0 +1,32 @@ +RISCV64 in os::board - Rust
pub struct RISCV64 {
+    addr: u64,
+}
Expand description

RISCV64 configuration

+

Fields

addr: u64

Address of the sifive_test mapped device.

+

Implementations

Create an instance.

+

Trait Implementations

Exit qemu with specified exit code.

+

Exit QEMU using EXIT_SUCCESS, aka 0, if possible. Read more

+

Exit QEMU using EXIT_FAILURE, aka 1.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/board/trait.QEMUExit.html b/ch9-gui-dev/os/board/trait.QEMUExit.html new file mode 100644 index 00000000..df57d840 --- /dev/null +++ b/ch9-gui-dev/os/board/trait.QEMUExit.html @@ -0,0 +1,10 @@ +QEMUExit in os::board - Rust
pub trait QEMUExit {
+    fn exit(&self, code: u32) -> !;
+    fn exit_success(&self) -> !;
+    fn exit_failure(&self) -> !;
+}

Required Methods

Exit with specified return code.

+

Note: For X86, code is binary-OR’ed with 0x1 inside QEMU.

+

Exit QEMU using EXIT_SUCCESS, aka 0, if possible.

+

Note: Not possible for X86.

+

Exit QEMU using EXIT_FAILURE, aka 1.

+

Implementors

\ No newline at end of file diff --git a/ch9-gui-dev/os/board/type.BlockDeviceImpl.html b/ch9-gui-dev/os/board/type.BlockDeviceImpl.html new file mode 100644 index 00000000..9d278a0b --- /dev/null +++ b/ch9-gui-dev/os/board/type.BlockDeviceImpl.html @@ -0,0 +1 @@ +BlockDeviceImpl in os::board - Rust

Type Definition os::board::BlockDeviceImpl

source · []
pub type BlockDeviceImpl = VirtIOBlock;
\ No newline at end of file diff --git a/ch9-gui-dev/os/board/type.CharDeviceImpl.html b/ch9-gui-dev/os/board/type.CharDeviceImpl.html new file mode 100644 index 00000000..eeb8d1ba --- /dev/null +++ b/ch9-gui-dev/os/board/type.CharDeviceImpl.html @@ -0,0 +1 @@ +CharDeviceImpl in os::board - Rust

Type Definition os::board::CharDeviceImpl

source · []
pub type CharDeviceImpl = NS16550a<VIRT_UART>;
\ No newline at end of file diff --git a/ch9-gui-dev/os/config/constant.KERNEL_HEAP_SIZE.html b/ch9-gui-dev/os/config/constant.KERNEL_HEAP_SIZE.html new file mode 100644 index 00000000..1464f8d0 --- /dev/null +++ b/ch9-gui-dev/os/config/constant.KERNEL_HEAP_SIZE.html @@ -0,0 +1 @@ +KERNEL_HEAP_SIZE in os::config - Rust
pub const KERNEL_HEAP_SIZE: usize = 0x100_0000;
\ No newline at end of file diff --git a/ch9-gui-dev/os/config/constant.KERNEL_STACK_SIZE.html b/ch9-gui-dev/os/config/constant.KERNEL_STACK_SIZE.html new file mode 100644 index 00000000..1b904b59 --- /dev/null +++ b/ch9-gui-dev/os/config/constant.KERNEL_STACK_SIZE.html @@ -0,0 +1 @@ +KERNEL_STACK_SIZE in os::config - Rust
pub const KERNEL_STACK_SIZE: usize = _; // 8_192usize
\ No newline at end of file diff --git a/ch9-gui-dev/os/config/constant.MEMORY_END.html b/ch9-gui-dev/os/config/constant.MEMORY_END.html new file mode 100644 index 00000000..788d6b6f --- /dev/null +++ b/ch9-gui-dev/os/config/constant.MEMORY_END.html @@ -0,0 +1 @@ +MEMORY_END in os::config - Rust
pub const MEMORY_END: usize = 0x88000000;
\ No newline at end of file diff --git a/ch9-gui-dev/os/config/constant.PAGE_SIZE.html b/ch9-gui-dev/os/config/constant.PAGE_SIZE.html new file mode 100644 index 00000000..2cde57e7 --- /dev/null +++ b/ch9-gui-dev/os/config/constant.PAGE_SIZE.html @@ -0,0 +1 @@ +PAGE_SIZE in os::config - Rust
pub const PAGE_SIZE: usize = 0x1000;
\ No newline at end of file diff --git a/ch9-gui-dev/os/config/constant.PAGE_SIZE_BITS.html b/ch9-gui-dev/os/config/constant.PAGE_SIZE_BITS.html new file mode 100644 index 00000000..344521b7 --- /dev/null +++ b/ch9-gui-dev/os/config/constant.PAGE_SIZE_BITS.html @@ -0,0 +1 @@ +PAGE_SIZE_BITS in os::config - Rust
pub const PAGE_SIZE_BITS: usize = 0xc;
\ No newline at end of file diff --git a/ch9-gui-dev/os/config/constant.TRAMPOLINE.html b/ch9-gui-dev/os/config/constant.TRAMPOLINE.html new file mode 100644 index 00000000..e8ad9b28 --- /dev/null +++ b/ch9-gui-dev/os/config/constant.TRAMPOLINE.html @@ -0,0 +1 @@ +TRAMPOLINE in os::config - Rust
pub const TRAMPOLINE: usize = _; // 18_446_744_073_709_547_520usize
\ No newline at end of file diff --git a/ch9-gui-dev/os/config/constant.TRAP_CONTEXT_BASE.html b/ch9-gui-dev/os/config/constant.TRAP_CONTEXT_BASE.html new file mode 100644 index 00000000..b1099f59 --- /dev/null +++ b/ch9-gui-dev/os/config/constant.TRAP_CONTEXT_BASE.html @@ -0,0 +1 @@ +TRAP_CONTEXT_BASE in os::config - Rust
pub const TRAP_CONTEXT_BASE: usize = _; // 18_446_744_073_709_543_424usize
\ No newline at end of file diff --git a/ch9-gui-dev/os/config/constant.USER_STACK_SIZE.html b/ch9-gui-dev/os/config/constant.USER_STACK_SIZE.html new file mode 100644 index 00000000..cc3a1f09 --- /dev/null +++ b/ch9-gui-dev/os/config/constant.USER_STACK_SIZE.html @@ -0,0 +1 @@ +USER_STACK_SIZE in os::config - Rust
pub const USER_STACK_SIZE: usize = _; // 8_192usize
\ No newline at end of file diff --git a/ch9-gui-dev/os/config/index.html b/ch9-gui-dev/os/config/index.html new file mode 100644 index 00000000..4867799f --- /dev/null +++ b/ch9-gui-dev/os/config/index.html @@ -0,0 +1 @@ +os::config - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/config/sidebar-items.js b/ch9-gui-dev/os/config/sidebar-items.js new file mode 100644 index 00000000..b049b220 --- /dev/null +++ b/ch9-gui-dev/os/config/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":[["KERNEL_HEAP_SIZE",""],["KERNEL_STACK_SIZE",""],["MEMORY_END",""],["PAGE_SIZE",""],["PAGE_SIZE_BITS",""],["TRAMPOLINE",""],["TRAP_CONTEXT_BASE",""],["USER_STACK_SIZE",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/console/fn.print.html b/ch9-gui-dev/os/console/fn.print.html new file mode 100644 index 00000000..4229c073 --- /dev/null +++ b/ch9-gui-dev/os/console/fn.print.html @@ -0,0 +1 @@ +print in os::console - Rust

Function os::console::print

source · []
pub fn print(args: Arguments<'_>)
\ No newline at end of file diff --git a/ch9-gui-dev/os/console/index.html b/ch9-gui-dev/os/console/index.html new file mode 100644 index 00000000..6c0bc3ad --- /dev/null +++ b/ch9-gui-dev/os/console/index.html @@ -0,0 +1 @@ +os::console - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/console/sidebar-items.js b/ch9-gui-dev/os/console/sidebar-items.js new file mode 100644 index 00000000..cf66d5eb --- /dev/null +++ b/ch9-gui-dev/os/console/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":[["print",""]],"struct":[["Stdout",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/console/struct.Stdout.html b/ch9-gui-dev/os/console/struct.Stdout.html new file mode 100644 index 00000000..06b45cfd --- /dev/null +++ b/ch9-gui-dev/os/console/struct.Stdout.html @@ -0,0 +1,28 @@ +Stdout in os::console - Rust
struct Stdout;

Trait Implementations

Writes a string slice into this writer, returning whether the write +succeeded. Read more

+

Writes a char into this writer, returning whether the write succeeded. Read more

+

Glue for usage of the write! macro with implementors of this trait. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/block/fn.block_device_test.html b/ch9-gui-dev/os/drivers/block/fn.block_device_test.html new file mode 100644 index 00000000..36801f89 --- /dev/null +++ b/ch9-gui-dev/os/drivers/block/fn.block_device_test.html @@ -0,0 +1 @@ +block_device_test in os::drivers::block - Rust
pub fn block_device_test()
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/block/index.html b/ch9-gui-dev/os/drivers/block/index.html new file mode 100644 index 00000000..3b2d5f19 --- /dev/null +++ b/ch9-gui-dev/os/drivers/block/index.html @@ -0,0 +1 @@ +os::drivers::block - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/block/sidebar-items.js b/ch9-gui-dev/os/drivers/block/sidebar-items.js new file mode 100644 index 00000000..f3e2f375 --- /dev/null +++ b/ch9-gui-dev/os/drivers/block/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":[["block_device_test",""]],"mod":[["virtio_blk",""]],"struct":[["BLOCK_DEVICE",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/block/struct.BLOCK_DEVICE.html b/ch9-gui-dev/os/drivers/block/struct.BLOCK_DEVICE.html new file mode 100644 index 00000000..34a90e39 --- /dev/null +++ b/ch9-gui-dev/os/drivers/block/struct.BLOCK_DEVICE.html @@ -0,0 +1,28 @@ +BLOCK_DEVICE in os::drivers::block - Rust
pub struct BLOCK_DEVICE {
+    __private_field: (),
+}

Fields

__private_field: ()

Trait Implementations

The resulting type after dereferencing.

+

Dereferences the value.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/block/virtio_blk/constant.VIRTIO0.html b/ch9-gui-dev/os/drivers/block/virtio_blk/constant.VIRTIO0.html new file mode 100644 index 00000000..0b8af443 --- /dev/null +++ b/ch9-gui-dev/os/drivers/block/virtio_blk/constant.VIRTIO0.html @@ -0,0 +1 @@ +VIRTIO0 in os::drivers::block::virtio_blk - Rust
const VIRTIO0: usize = 0x10008000;
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/block/virtio_blk/index.html b/ch9-gui-dev/os/drivers/block/virtio_blk/index.html new file mode 100644 index 00000000..64cc44eb --- /dev/null +++ b/ch9-gui-dev/os/drivers/block/virtio_blk/index.html @@ -0,0 +1 @@ +os::drivers::block::virtio_blk - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/block/virtio_blk/sidebar-items.js b/ch9-gui-dev/os/drivers/block/virtio_blk/sidebar-items.js new file mode 100644 index 00000000..c4683407 --- /dev/null +++ b/ch9-gui-dev/os/drivers/block/virtio_blk/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":[["VIRTIO0",""]],"struct":[["VirtIOBlock",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/block/virtio_blk/struct.VirtIOBlock.html b/ch9-gui-dev/os/drivers/block/virtio_blk/struct.VirtIOBlock.html new file mode 100644 index 00000000..e1735da4 --- /dev/null +++ b/ch9-gui-dev/os/drivers/block/virtio_blk/struct.VirtIOBlock.html @@ -0,0 +1,27 @@ +VirtIOBlock in os::drivers::block::virtio_blk - Rust
pub struct VirtIOBlock {
+    virtio_blk: UPIntrFreeCell<VirtIOBlk<'static, VirtioHal>>,
+    condvars: BTreeMap<u16, Condvar>,
+}

Fields

virtio_blk: UPIntrFreeCell<VirtIOBlk<'static, VirtioHal>>condvars: BTreeMap<u16, Condvar>

Implementations

Trait Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/bus/index.html b/ch9-gui-dev/os/drivers/bus/index.html new file mode 100644 index 00000000..88aeb662 --- /dev/null +++ b/ch9-gui-dev/os/drivers/bus/index.html @@ -0,0 +1 @@ +os::drivers::bus - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/bus/sidebar-items.js b/ch9-gui-dev/os/drivers/bus/sidebar-items.js new file mode 100644 index 00000000..85f51a2a --- /dev/null +++ b/ch9-gui-dev/os/drivers/bus/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":[["virtio",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/bus/virtio/index.html b/ch9-gui-dev/os/drivers/bus/virtio/index.html new file mode 100644 index 00000000..c705b72c --- /dev/null +++ b/ch9-gui-dev/os/drivers/bus/virtio/index.html @@ -0,0 +1 @@ +os::drivers::bus::virtio - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/bus/virtio/sidebar-items.js b/ch9-gui-dev/os/drivers/bus/virtio/sidebar-items.js new file mode 100644 index 00000000..252dcdd2 --- /dev/null +++ b/ch9-gui-dev/os/drivers/bus/virtio/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":[["QUEUE_FRAMES",""],["VirtioHal",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/bus/virtio/struct.QUEUE_FRAMES.html b/ch9-gui-dev/os/drivers/bus/virtio/struct.QUEUE_FRAMES.html new file mode 100644 index 00000000..1186ed44 --- /dev/null +++ b/ch9-gui-dev/os/drivers/bus/virtio/struct.QUEUE_FRAMES.html @@ -0,0 +1,29 @@ +QUEUE_FRAMES in os::drivers::bus::virtio - Rust
struct QUEUE_FRAMES {
+    __private_field: (),
+}

Fields

__private_field: ()

Methods from Deref<Target = UPIntrFreeCell<Vec<FrameTracker>>>

Panic if the data has been borrowed.

+

Trait Implementations

The resulting type after dereferencing.

+

Dereferences the value.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/bus/virtio/struct.VirtioHal.html b/ch9-gui-dev/os/drivers/bus/virtio/struct.VirtioHal.html new file mode 100644 index 00000000..2568154f --- /dev/null +++ b/ch9-gui-dev/os/drivers/bus/virtio/struct.VirtioHal.html @@ -0,0 +1,30 @@ +VirtioHal in os::drivers::bus::virtio - Rust
pub struct VirtioHal;

Trait Implementations

Allocates the given number of contiguous physical pages of DMA memory for virtio use.

+

Deallocates the given contiguous physical DMA memory pages.

+

Converts a physical address used for virtio to a virtual address which the program can +access. Read more

+

Converts a virtual address which the program can access to the corresponding physical +address to use for virtio. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/chardev/index.html b/ch9-gui-dev/os/drivers/chardev/index.html new file mode 100644 index 00000000..9fea8160 --- /dev/null +++ b/ch9-gui-dev/os/drivers/chardev/index.html @@ -0,0 +1 @@ +os::drivers::chardev - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/chardev/ns16550a/index.html b/ch9-gui-dev/os/drivers/chardev/ns16550a/index.html new file mode 100644 index 00000000..33286237 --- /dev/null +++ b/ch9-gui-dev/os/drivers/chardev/ns16550a/index.html @@ -0,0 +1,4 @@ +os::drivers::chardev::ns16550a - Rust

Structs

InterruptEnableRegister

+

LineStatusRegister

+

Model Control Register

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/chardev/ns16550a/sidebar-items.js b/ch9-gui-dev/os/drivers/chardev/ns16550a/sidebar-items.js new file mode 100644 index 00000000..18808bc3 --- /dev/null +++ b/ch9-gui-dev/os/drivers/chardev/ns16550a/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":[["IER","InterruptEnableRegister"],["LSR","LineStatusRegister"],["MCR","Model Control Register"],["NS16550a",""],["NS16550aInner",""],["NS16550aRaw",""],["ReadWithoutDLAB",""],["WriteWithoutDLAB",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.IER.html b/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.IER.html new file mode 100644 index 00000000..38740157 --- /dev/null +++ b/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.IER.html @@ -0,0 +1,129 @@ +IER in os::drivers::chardev::ns16550a - Rust
pub struct IER {
+    bits: u8,
+}
Expand description

InterruptEnableRegister

+

Fields

bits: u8

Implementations

Returns an empty set of flags.

+

Returns the set containing all flags.

+

Returns the raw value of the flags currently stored.

+

Convert from underlying bit representation, unless that +representation contains bits that do not correspond to a flag.

+

Convert from underlying bit representation, dropping any bits +that do not correspond to flags.

+

Convert from underlying bit representation, preserving all +bits (even those not corresponding to a defined flag).

+
Safety
+

The caller of the bitflags! macro can chose to allow or +disallow extra bits for their bitflags type.

+

The caller of from_bits_unchecked() has to ensure that +all bits correspond to a defined flag or that extra bits +are valid for this bitflags type.

+

Returns true if no flags are currently stored.

+

Returns true if all flags are currently set.

+

Returns true if there are flags common to both self and other.

+

Returns true if all of the flags in other are contained within self.

+

Inserts the specified flags in-place.

+

Removes the specified flags in-place.

+

Toggles the specified flags in-place.

+

Inserts or removes the specified flags depending on the passed value.

+

Returns the intersection between the flags in self and +other.

+

Specifically, the returned set contains only the flags which are +present in both self and other.

+

This is equivalent to using the & operator (e.g. +ops::BitAnd), as in flags & other.

+

Returns the union of between the flags in self and other.

+

Specifically, the returned set contains all flags which are +present in either self or other, including any which are +present in both (see Self::symmetric_difference if that +is undesirable).

+

This is equivalent to using the | operator (e.g. +ops::BitOr), as in flags | other.

+

Returns the difference between the flags in self and other.

+

Specifically, the returned set contains all flags present in +self, except for the ones present in other.

+

It is also conceptually equivalent to the “bit-clear” operation: +flags & !other (and this syntax is also supported).

+

This is equivalent to using the - operator (e.g. +ops::Sub), as in flags - other.

+

Returns the symmetric difference between the flags +in self and other.

+

Specifically, the returned set contains the flags present which +are present in self or other, but that are not present in +both. Equivalently, it contains the flags present in exactly +one of the sets self and other.

+

This is equivalent to using the ^ operator (e.g. +ops::BitXor), as in flags ^ other.

+

Returns the complement of this set of flags.

+

Specifically, the returned set contains all the flags which are +not set in self, but which are allowed for this type.

+

Alternatively, it can be thought of as the set difference +between Self::all() and self (e.g. Self::all() - self)

+

This is equivalent to using the ! operator (e.g. +ops::Not), as in !flags.

+

Trait Implementations

Formats the value using the given formatter.

+

Returns the intersection between the two sets of flags.

+

The resulting type after applying the & operator.

+

Disables all flags disabled in the set.

+

Returns the union of the two sets of flags.

+

The resulting type after applying the | operator.

+

Adds the set of flags.

+

Returns the left flags, but with all the right flags toggled.

+

The resulting type after applying the ^ operator.

+

Toggles the set of flags.

+

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Extends a collection with the contents of an iterator. Read more

+
🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

+
🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

+

Creates a value from an iterator. Read more

+

Feeds this value into the given Hasher. Read more

+

Feeds a slice of this type into the given Hasher. Read more

+

Formats the value using the given formatter.

+

Returns the complement of this set of flags.

+

The resulting type after applying the ! operator.

+

Formats the value using the given formatter.

+

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

Restrict a value to a certain interval. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more

+

Returns the set difference of the two sets of flags.

+

The resulting type after applying the - operator.

+

Disables all flags enabled in the set.

+

Formats the value using the given formatter.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.LSR.html b/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.LSR.html new file mode 100644 index 00000000..ddd46098 --- /dev/null +++ b/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.LSR.html @@ -0,0 +1,129 @@ +LSR in os::drivers::chardev::ns16550a - Rust
pub struct LSR {
+    bits: u8,
+}
Expand description

LineStatusRegister

+

Fields

bits: u8

Implementations

Returns an empty set of flags.

+

Returns the set containing all flags.

+

Returns the raw value of the flags currently stored.

+

Convert from underlying bit representation, unless that +representation contains bits that do not correspond to a flag.

+

Convert from underlying bit representation, dropping any bits +that do not correspond to flags.

+

Convert from underlying bit representation, preserving all +bits (even those not corresponding to a defined flag).

+
Safety
+

The caller of the bitflags! macro can chose to allow or +disallow extra bits for their bitflags type.

+

The caller of from_bits_unchecked() has to ensure that +all bits correspond to a defined flag or that extra bits +are valid for this bitflags type.

+

Returns true if no flags are currently stored.

+

Returns true if all flags are currently set.

+

Returns true if there are flags common to both self and other.

+

Returns true if all of the flags in other are contained within self.

+

Inserts the specified flags in-place.

+

Removes the specified flags in-place.

+

Toggles the specified flags in-place.

+

Inserts or removes the specified flags depending on the passed value.

+

Returns the intersection between the flags in self and +other.

+

Specifically, the returned set contains only the flags which are +present in both self and other.

+

This is equivalent to using the & operator (e.g. +ops::BitAnd), as in flags & other.

+

Returns the union of between the flags in self and other.

+

Specifically, the returned set contains all flags which are +present in either self or other, including any which are +present in both (see Self::symmetric_difference if that +is undesirable).

+

This is equivalent to using the | operator (e.g. +ops::BitOr), as in flags | other.

+

Returns the difference between the flags in self and other.

+

Specifically, the returned set contains all flags present in +self, except for the ones present in other.

+

It is also conceptually equivalent to the “bit-clear” operation: +flags & !other (and this syntax is also supported).

+

This is equivalent to using the - operator (e.g. +ops::Sub), as in flags - other.

+

Returns the symmetric difference between the flags +in self and other.

+

Specifically, the returned set contains the flags present which +are present in self or other, but that are not present in +both. Equivalently, it contains the flags present in exactly +one of the sets self and other.

+

This is equivalent to using the ^ operator (e.g. +ops::BitXor), as in flags ^ other.

+

Returns the complement of this set of flags.

+

Specifically, the returned set contains all the flags which are +not set in self, but which are allowed for this type.

+

Alternatively, it can be thought of as the set difference +between Self::all() and self (e.g. Self::all() - self)

+

This is equivalent to using the ! operator (e.g. +ops::Not), as in !flags.

+

Trait Implementations

Formats the value using the given formatter.

+

Returns the intersection between the two sets of flags.

+

The resulting type after applying the & operator.

+

Disables all flags disabled in the set.

+

Returns the union of the two sets of flags.

+

The resulting type after applying the | operator.

+

Adds the set of flags.

+

Returns the left flags, but with all the right flags toggled.

+

The resulting type after applying the ^ operator.

+

Toggles the set of flags.

+

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Extends a collection with the contents of an iterator. Read more

+
🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

+
🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

+

Creates a value from an iterator. Read more

+

Feeds this value into the given Hasher. Read more

+

Feeds a slice of this type into the given Hasher. Read more

+

Formats the value using the given formatter.

+

Returns the complement of this set of flags.

+

The resulting type after applying the ! operator.

+

Formats the value using the given formatter.

+

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

Restrict a value to a certain interval. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more

+

Returns the set difference of the two sets of flags.

+

The resulting type after applying the - operator.

+

Disables all flags enabled in the set.

+

Formats the value using the given formatter.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.MCR.html b/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.MCR.html new file mode 100644 index 00000000..a826c15e --- /dev/null +++ b/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.MCR.html @@ -0,0 +1,129 @@ +MCR in os::drivers::chardev::ns16550a - Rust
pub struct MCR {
+    bits: u8,
+}
Expand description

Model Control Register

+

Fields

bits: u8

Implementations

Returns an empty set of flags.

+

Returns the set containing all flags.

+

Returns the raw value of the flags currently stored.

+

Convert from underlying bit representation, unless that +representation contains bits that do not correspond to a flag.

+

Convert from underlying bit representation, dropping any bits +that do not correspond to flags.

+

Convert from underlying bit representation, preserving all +bits (even those not corresponding to a defined flag).

+
Safety
+

The caller of the bitflags! macro can chose to allow or +disallow extra bits for their bitflags type.

+

The caller of from_bits_unchecked() has to ensure that +all bits correspond to a defined flag or that extra bits +are valid for this bitflags type.

+

Returns true if no flags are currently stored.

+

Returns true if all flags are currently set.

+

Returns true if there are flags common to both self and other.

+

Returns true if all of the flags in other are contained within self.

+

Inserts the specified flags in-place.

+

Removes the specified flags in-place.

+

Toggles the specified flags in-place.

+

Inserts or removes the specified flags depending on the passed value.

+

Returns the intersection between the flags in self and +other.

+

Specifically, the returned set contains only the flags which are +present in both self and other.

+

This is equivalent to using the & operator (e.g. +ops::BitAnd), as in flags & other.

+

Returns the union of between the flags in self and other.

+

Specifically, the returned set contains all flags which are +present in either self or other, including any which are +present in both (see Self::symmetric_difference if that +is undesirable).

+

This is equivalent to using the | operator (e.g. +ops::BitOr), as in flags | other.

+

Returns the difference between the flags in self and other.

+

Specifically, the returned set contains all flags present in +self, except for the ones present in other.

+

It is also conceptually equivalent to the “bit-clear” operation: +flags & !other (and this syntax is also supported).

+

This is equivalent to using the - operator (e.g. +ops::Sub), as in flags - other.

+

Returns the symmetric difference between the flags +in self and other.

+

Specifically, the returned set contains the flags present which +are present in self or other, but that are not present in +both. Equivalently, it contains the flags present in exactly +one of the sets self and other.

+

This is equivalent to using the ^ operator (e.g. +ops::BitXor), as in flags ^ other.

+

Returns the complement of this set of flags.

+

Specifically, the returned set contains all the flags which are +not set in self, but which are allowed for this type.

+

Alternatively, it can be thought of as the set difference +between Self::all() and self (e.g. Self::all() - self)

+

This is equivalent to using the ! operator (e.g. +ops::Not), as in !flags.

+

Trait Implementations

Formats the value using the given formatter.

+

Returns the intersection between the two sets of flags.

+

The resulting type after applying the & operator.

+

Disables all flags disabled in the set.

+

Returns the union of the two sets of flags.

+

The resulting type after applying the | operator.

+

Adds the set of flags.

+

Returns the left flags, but with all the right flags toggled.

+

The resulting type after applying the ^ operator.

+

Toggles the set of flags.

+

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Extends a collection with the contents of an iterator. Read more

+
🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

+
🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

+

Creates a value from an iterator. Read more

+

Feeds this value into the given Hasher. Read more

+

Feeds a slice of this type into the given Hasher. Read more

+

Formats the value using the given formatter.

+

Returns the complement of this set of flags.

+

The resulting type after applying the ! operator.

+

Formats the value using the given formatter.

+

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

Restrict a value to a certain interval. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more

+

Returns the set difference of the two sets of flags.

+

The resulting type after applying the - operator.

+

Disables all flags enabled in the set.

+

Formats the value using the given formatter.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.NS16550a.html b/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.NS16550a.html new file mode 100644 index 00000000..3e9db759 --- /dev/null +++ b/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.NS16550a.html @@ -0,0 +1,27 @@ +NS16550a in os::drivers::chardev::ns16550a - Rust
pub struct NS16550a<const BASE_ADDR: usize> {
+    inner: UPIntrFreeCell<NS16550aInner>,
+    condvar: Condvar,
+}

Fields

inner: UPIntrFreeCell<NS16550aInner>condvar: Condvar

Implementations

Trait Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.NS16550aInner.html b/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.NS16550aInner.html new file mode 100644 index 00000000..999b4323 --- /dev/null +++ b/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.NS16550aInner.html @@ -0,0 +1,27 @@ +NS16550aInner in os::drivers::chardev::ns16550a - Rust
struct NS16550aInner {
+    ns16550a: NS16550aRaw,
+    read_buffer: VecDeque<u8>,
+}

Fields

ns16550a: NS16550aRawread_buffer: VecDeque<u8>

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.NS16550aRaw.html b/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.NS16550aRaw.html new file mode 100644 index 00000000..27a6df44 --- /dev/null +++ b/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.NS16550aRaw.html @@ -0,0 +1,26 @@ +NS16550aRaw in os::drivers::chardev::ns16550a - Rust
pub struct NS16550aRaw {
+    base_addr: usize,
+}

Fields

base_addr: usize

Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.ReadWithoutDLAB.html b/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.ReadWithoutDLAB.html new file mode 100644 index 00000000..fbe62534 --- /dev/null +++ b/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.ReadWithoutDLAB.html @@ -0,0 +1,41 @@ +ReadWithoutDLAB in os::drivers::chardev::ns16550a - Rust
#[repr(C)]
struct ReadWithoutDLAB { + pub rbr: ReadOnly<u8>, + pub ier: Volatile<IER>, + pub iir: ReadOnly<u8>, + pub lcr: Volatile<u8>, + pub mcr: Volatile<MCR>, + pub lsr: ReadOnly<LSR>, + _padding1: ReadOnly<u8>, + _padding2: ReadOnly<u8>, +}

Fields

rbr: ReadOnly<u8>

receiver buffer register

+
ier: Volatile<IER>

interrupt enable register

+
iir: ReadOnly<u8>

interrupt identification register

+
lcr: Volatile<u8>

line control register

+
mcr: Volatile<MCR>

model control register

+
lsr: ReadOnly<LSR>

line status register

+
_padding1: ReadOnly<u8>

ignore MSR

+
_padding2: ReadOnly<u8>

ignore SCR

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.WriteWithoutDLAB.html b/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.WriteWithoutDLAB.html new file mode 100644 index 00000000..745160ec --- /dev/null +++ b/ch9-gui-dev/os/drivers/chardev/ns16550a/struct.WriteWithoutDLAB.html @@ -0,0 +1,39 @@ +WriteWithoutDLAB in os::drivers::chardev::ns16550a - Rust
#[repr(C)]
struct WriteWithoutDLAB { + pub thr: WriteOnly<u8>, + pub ier: Volatile<IER>, + _padding0: ReadOnly<u8>, + pub lcr: Volatile<u8>, + pub mcr: Volatile<MCR>, + pub lsr: ReadOnly<LSR>, + _padding1: ReadOnly<u16>, +}

Fields

thr: WriteOnly<u8>

transmitter holding register

+
ier: Volatile<IER>

interrupt enable register

+
_padding0: ReadOnly<u8>

ignore FCR

+
lcr: Volatile<u8>

line control register

+
mcr: Volatile<MCR>

modem control register

+
lsr: ReadOnly<LSR>

line status register

+
_padding1: ReadOnly<u16>

ignore other registers

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/chardev/sidebar-items.js b/ch9-gui-dev/os/drivers/chardev/sidebar-items.js new file mode 100644 index 00000000..0d2ff6fa --- /dev/null +++ b/ch9-gui-dev/os/drivers/chardev/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":[["ns16550a",""]],"struct":[["UART",""]],"trait":[["CharDevice",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/chardev/struct.UART.html b/ch9-gui-dev/os/drivers/chardev/struct.UART.html new file mode 100644 index 00000000..b4c27328 --- /dev/null +++ b/ch9-gui-dev/os/drivers/chardev/struct.UART.html @@ -0,0 +1,28 @@ +UART in os::drivers::chardev - Rust
pub struct UART {
+    __private_field: (),
+}

Fields

__private_field: ()

Trait Implementations

The resulting type after dereferencing.

+

Dereferences the value.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/chardev/trait.CharDevice.html b/ch9-gui-dev/os/drivers/chardev/trait.CharDevice.html new file mode 100644 index 00000000..cf53a142 --- /dev/null +++ b/ch9-gui-dev/os/drivers/chardev/trait.CharDevice.html @@ -0,0 +1,6 @@ +CharDevice in os::drivers::chardev - Rust
pub trait CharDevice {
+    fn init(&self);
+    fn read(&self) -> u8;
+    fn write(&self, ch: u8);
+    fn handle_irq(&self);
+}

Required Methods

Implementors

\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/gpu/constant.VIRTIO7.html b/ch9-gui-dev/os/drivers/gpu/constant.VIRTIO7.html new file mode 100644 index 00000000..e94165de --- /dev/null +++ b/ch9-gui-dev/os/drivers/gpu/constant.VIRTIO7.html @@ -0,0 +1 @@ +VIRTIO7 in os::drivers::gpu - Rust
const VIRTIO7: usize = 0x10007000;
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/gpu/index.html b/ch9-gui-dev/os/drivers/gpu/index.html new file mode 100644 index 00000000..cfd86822 --- /dev/null +++ b/ch9-gui-dev/os/drivers/gpu/index.html @@ -0,0 +1 @@ +os::drivers::gpu - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/gpu/sidebar-items.js b/ch9-gui-dev/os/drivers/gpu/sidebar-items.js new file mode 100644 index 00000000..54b6e6f6 --- /dev/null +++ b/ch9-gui-dev/os/drivers/gpu/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":[["VIRTIO7",""]],"static":[["BMP_DATA",""]],"struct":[["GPU_DEVICE",""],["VirtIOGpuWrapper",""]],"trait":[["GpuDevice",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/gpu/static.BMP_DATA.html b/ch9-gui-dev/os/drivers/gpu/static.BMP_DATA.html new file mode 100644 index 00000000..66b3c23d --- /dev/null +++ b/ch9-gui-dev/os/drivers/gpu/static.BMP_DATA.html @@ -0,0 +1 @@ +BMP_DATA in os::drivers::gpu - Rust
static BMP_DATA: &'static [u8]
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/gpu/struct.GPU_DEVICE.html b/ch9-gui-dev/os/drivers/gpu/struct.GPU_DEVICE.html new file mode 100644 index 00000000..a2ef2c29 --- /dev/null +++ b/ch9-gui-dev/os/drivers/gpu/struct.GPU_DEVICE.html @@ -0,0 +1,28 @@ +GPU_DEVICE in os::drivers::gpu - Rust
pub struct GPU_DEVICE {
+    __private_field: (),
+}

Fields

__private_field: ()

Trait Implementations

The resulting type after dereferencing.

+

Dereferences the value.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/gpu/struct.VirtIOGpuWrapper.html b/ch9-gui-dev/os/drivers/gpu/struct.VirtIOGpuWrapper.html new file mode 100644 index 00000000..e3123564 --- /dev/null +++ b/ch9-gui-dev/os/drivers/gpu/struct.VirtIOGpuWrapper.html @@ -0,0 +1,27 @@ +VirtIOGpuWrapper in os::drivers::gpu - Rust
pub struct VirtIOGpuWrapper {
+    gpu: UPIntrFreeCell<VirtIOGpu<'static, VirtioHal>>,
+    fb: &'static [u8],
+}

Fields

gpu: UPIntrFreeCell<VirtIOGpu<'static, VirtioHal>>fb: &'static [u8]

Implementations

Trait Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/gpu/trait.GpuDevice.html b/ch9-gui-dev/os/drivers/gpu/trait.GpuDevice.html new file mode 100644 index 00000000..36599d0a --- /dev/null +++ b/ch9-gui-dev/os/drivers/gpu/trait.GpuDevice.html @@ -0,0 +1,5 @@ +GpuDevice in os::drivers::gpu - Rust
pub trait GpuDevice: Send + Sync + Any {
+    fn update_cursor(&self);
+    fn get_framebuffer(&self) -> &mut [u8];
+    fn flush(&self);
+}

Required Methods

Implementors

\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/index.html b/ch9-gui-dev/os/drivers/index.html new file mode 100644 index 00000000..26ecbb97 --- /dev/null +++ b/ch9-gui-dev/os/drivers/index.html @@ -0,0 +1 @@ +os::drivers - Rust

Re-exports

pub use block::BLOCK_DEVICE;
pub use block::BLOCK_DEVICE;
pub use bus::*;
pub use chardev::UART;
pub use chardev::UART;
pub use gpu::*;
pub use input::*;

Modules

\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/input/constant.VIRTIO5.html b/ch9-gui-dev/os/drivers/input/constant.VIRTIO5.html new file mode 100644 index 00000000..5e6f0335 --- /dev/null +++ b/ch9-gui-dev/os/drivers/input/constant.VIRTIO5.html @@ -0,0 +1 @@ +VIRTIO5 in os::drivers::input - Rust
const VIRTIO5: usize = 0x10005000;
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/input/constant.VIRTIO6.html b/ch9-gui-dev/os/drivers/input/constant.VIRTIO6.html new file mode 100644 index 00000000..a15a779f --- /dev/null +++ b/ch9-gui-dev/os/drivers/input/constant.VIRTIO6.html @@ -0,0 +1 @@ +VIRTIO6 in os::drivers::input - Rust
const VIRTIO6: usize = 0x10006000;
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/input/index.html b/ch9-gui-dev/os/drivers/input/index.html new file mode 100644 index 00000000..af8e45b6 --- /dev/null +++ b/ch9-gui-dev/os/drivers/input/index.html @@ -0,0 +1 @@ +os::drivers::input - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/input/sidebar-items.js b/ch9-gui-dev/os/drivers/input/sidebar-items.js new file mode 100644 index 00000000..476b459a --- /dev/null +++ b/ch9-gui-dev/os/drivers/input/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":[["VIRTIO5",""],["VIRTIO6",""]],"struct":[["KEYBOARD_DEVICE",""],["MOUSE_DEVICE",""],["VirtIOInputWrapper",""]],"trait":[["InputDevice",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/input/struct.KEYBOARD_DEVICE.html b/ch9-gui-dev/os/drivers/input/struct.KEYBOARD_DEVICE.html new file mode 100644 index 00000000..0e87ec71 --- /dev/null +++ b/ch9-gui-dev/os/drivers/input/struct.KEYBOARD_DEVICE.html @@ -0,0 +1,28 @@ +KEYBOARD_DEVICE in os::drivers::input - Rust
pub struct KEYBOARD_DEVICE {
+    __private_field: (),
+}

Fields

__private_field: ()

Trait Implementations

The resulting type after dereferencing.

+

Dereferences the value.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/input/struct.MOUSE_DEVICE.html b/ch9-gui-dev/os/drivers/input/struct.MOUSE_DEVICE.html new file mode 100644 index 00000000..60f97c51 --- /dev/null +++ b/ch9-gui-dev/os/drivers/input/struct.MOUSE_DEVICE.html @@ -0,0 +1,28 @@ +MOUSE_DEVICE in os::drivers::input - Rust
pub struct MOUSE_DEVICE {
+    __private_field: (),
+}

Fields

__private_field: ()

Trait Implementations

The resulting type after dereferencing.

+

Dereferences the value.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/input/struct.VirtIOInputWrapper.html b/ch9-gui-dev/os/drivers/input/struct.VirtIOInputWrapper.html new file mode 100644 index 00000000..800d89e0 --- /dev/null +++ b/ch9-gui-dev/os/drivers/input/struct.VirtIOInputWrapper.html @@ -0,0 +1,24 @@ +VirtIOInputWrapper in os::drivers::input - Rust
struct VirtIOInputWrapper(UPIntrFreeCell<VirtIOInput<'static, VirtioHal>>);

Tuple Fields

0: UPIntrFreeCell<VirtIOInput<'static, VirtioHal>>

Implementations

Trait Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/input/trait.InputDevice.html b/ch9-gui-dev/os/drivers/input/trait.InputDevice.html new file mode 100644 index 00000000..cdd07883 --- /dev/null +++ b/ch9-gui-dev/os/drivers/input/trait.InputDevice.html @@ -0,0 +1,3 @@ +InputDevice in os::drivers::input - Rust
pub trait InputDevice: Send + Sync + Any {
+    fn handle_irq(&self);
+}

Required Methods

Implementors

\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/plic/enum.IntrTargetPriority.html b/ch9-gui-dev/os/drivers/plic/enum.IntrTargetPriority.html new file mode 100644 index 00000000..471baaae --- /dev/null +++ b/ch9-gui-dev/os/drivers/plic/enum.IntrTargetPriority.html @@ -0,0 +1,32 @@ +IntrTargetPriority in os::drivers::plic - Rust
pub enum IntrTargetPriority {
+    Machine,
+    Supervisor,
+}

Variants

Machine

Supervisor

Implementations

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/plic/index.html b/ch9-gui-dev/os/drivers/plic/index.html new file mode 100644 index 00000000..043ec326 --- /dev/null +++ b/ch9-gui-dev/os/drivers/plic/index.html @@ -0,0 +1 @@ +os::drivers::plic - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/plic/sidebar-items.js b/ch9-gui-dev/os/drivers/plic/sidebar-items.js new file mode 100644 index 00000000..42ac4a87 --- /dev/null +++ b/ch9-gui-dev/os/drivers/plic/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":[["IntrTargetPriority",""]],"struct":[["PLIC",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/plic/struct.PLIC.html b/ch9-gui-dev/os/drivers/plic/struct.PLIC.html new file mode 100644 index 00000000..aaf6cad3 --- /dev/null +++ b/ch9-gui-dev/os/drivers/plic/struct.PLIC.html @@ -0,0 +1,26 @@ +PLIC in os::drivers::plic - Rust
pub struct PLIC {
+    base_addr: usize,
+}

Fields

base_addr: usize

Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/drivers/sidebar-items.js b/ch9-gui-dev/os/drivers/sidebar-items.js new file mode 100644 index 00000000..258af4cd --- /dev/null +++ b/ch9-gui-dev/os/drivers/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":[["block",""],["bus",""],["chardev",""],["gpu",""],["input",""],["plic",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/fn.clear_bss.html b/ch9-gui-dev/os/fn.clear_bss.html new file mode 100644 index 00000000..43d94d42 --- /dev/null +++ b/ch9-gui-dev/os/fn.clear_bss.html @@ -0,0 +1 @@ +clear_bss in os - Rust

Function os::clear_bss

source · []
pub(crate) fn clear_bss()
\ No newline at end of file diff --git a/ch9-gui-dev/os/fn.rust_main.html b/ch9-gui-dev/os/fn.rust_main.html new file mode 100644 index 00000000..a7751ba0 --- /dev/null +++ b/ch9-gui-dev/os/fn.rust_main.html @@ -0,0 +1,2 @@ +rust_main in os - Rust

Function os::rust_main

source · []
#[no_mangle]
+pub fn rust_main() -> !
\ No newline at end of file diff --git a/ch9-gui-dev/os/fs/index.html b/ch9-gui-dev/os/fs/index.html new file mode 100644 index 00000000..6a7f90ad --- /dev/null +++ b/ch9-gui-dev/os/fs/index.html @@ -0,0 +1 @@ +os::fs - Rust

Module os::fs

source · []

Re-exports

pub use inode::list_apps;
pub use inode::open_file;
pub use inode::OSInode;
pub use inode::OpenFlags;
pub use inode::ROOT_INODE;
pub use inode::ROOT_INODE;
pub use pipe::make_pipe;
pub use pipe::Pipe;
pub use stdio::Stdin;
pub use stdio::Stdout;

Modules

inode 🔒
pipe 🔒
stdio 🔒

Traits

\ No newline at end of file diff --git a/ch9-gui-dev/os/fs/inode/fn.list_apps.html b/ch9-gui-dev/os/fs/inode/fn.list_apps.html new file mode 100644 index 00000000..89335301 --- /dev/null +++ b/ch9-gui-dev/os/fs/inode/fn.list_apps.html @@ -0,0 +1 @@ +list_apps in os::fs::inode - Rust
pub fn list_apps()
\ No newline at end of file diff --git a/ch9-gui-dev/os/fs/inode/fn.open_file.html b/ch9-gui-dev/os/fs/inode/fn.open_file.html new file mode 100644 index 00000000..920c58ae --- /dev/null +++ b/ch9-gui-dev/os/fs/inode/fn.open_file.html @@ -0,0 +1 @@ +open_file in os::fs::inode - Rust
pub fn open_file(name: &str, flags: OpenFlags) -> Option<Arc<OSInode>>
\ No newline at end of file diff --git a/ch9-gui-dev/os/fs/inode/index.html b/ch9-gui-dev/os/fs/inode/index.html new file mode 100644 index 00000000..703da839 --- /dev/null +++ b/ch9-gui-dev/os/fs/inode/index.html @@ -0,0 +1 @@ +os::fs::inode - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/fs/inode/sidebar-items.js b/ch9-gui-dev/os/fs/inode/sidebar-items.js new file mode 100644 index 00000000..53c2be6b --- /dev/null +++ b/ch9-gui-dev/os/fs/inode/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":[["list_apps",""],["open_file",""]],"struct":[["OSInode",""],["OSInodeInner",""],["OpenFlags",""],["ROOT_INODE",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/fs/inode/struct.OSInode.html b/ch9-gui-dev/os/fs/inode/struct.OSInode.html new file mode 100644 index 00000000..fa5c5b1b --- /dev/null +++ b/ch9-gui-dev/os/fs/inode/struct.OSInode.html @@ -0,0 +1,28 @@ +OSInode in os::fs::inode - Rust
pub struct OSInode {
+    readable: bool,
+    writable: bool,
+    inner: UPIntrFreeCell<OSInodeInner>,
+}

Fields

readable: boolwritable: boolinner: UPIntrFreeCell<OSInodeInner>

Implementations

Trait Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/fs/inode/struct.OSInodeInner.html b/ch9-gui-dev/os/fs/inode/struct.OSInodeInner.html new file mode 100644 index 00000000..2ac8ee59 --- /dev/null +++ b/ch9-gui-dev/os/fs/inode/struct.OSInodeInner.html @@ -0,0 +1,27 @@ +OSInodeInner in os::fs::inode - Rust
pub struct OSInodeInner {
+    offset: usize,
+    inode: Arc<Inode>,
+}

Fields

offset: usizeinode: Arc<Inode>

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/fs/inode/struct.OpenFlags.html b/ch9-gui-dev/os/fs/inode/struct.OpenFlags.html new file mode 100644 index 00000000..d0e059e8 --- /dev/null +++ b/ch9-gui-dev/os/fs/inode/struct.OpenFlags.html @@ -0,0 +1,130 @@ +OpenFlags in os::fs::inode - Rust
pub struct OpenFlags {
+    bits: u32,
+}

Fields

bits: u32

Implementations

Returns an empty set of flags.

+

Returns the set containing all flags.

+

Returns the raw value of the flags currently stored.

+

Convert from underlying bit representation, unless that +representation contains bits that do not correspond to a flag.

+

Convert from underlying bit representation, dropping any bits +that do not correspond to flags.

+

Convert from underlying bit representation, preserving all +bits (even those not corresponding to a defined flag).

+
Safety
+

The caller of the bitflags! macro can chose to allow or +disallow extra bits for their bitflags type.

+

The caller of from_bits_unchecked() has to ensure that +all bits correspond to a defined flag or that extra bits +are valid for this bitflags type.

+

Returns true if no flags are currently stored.

+

Returns true if all flags are currently set.

+

Returns true if there are flags common to both self and other.

+

Returns true if all of the flags in other are contained within self.

+

Inserts the specified flags in-place.

+

Removes the specified flags in-place.

+

Toggles the specified flags in-place.

+

Inserts or removes the specified flags depending on the passed value.

+

Returns the intersection between the flags in self and +other.

+

Specifically, the returned set contains only the flags which are +present in both self and other.

+

This is equivalent to using the & operator (e.g. +ops::BitAnd), as in flags & other.

+

Returns the union of between the flags in self and other.

+

Specifically, the returned set contains all flags which are +present in either self or other, including any which are +present in both (see Self::symmetric_difference if that +is undesirable).

+

This is equivalent to using the | operator (e.g. +ops::BitOr), as in flags | other.

+

Returns the difference between the flags in self and other.

+

Specifically, the returned set contains all flags present in +self, except for the ones present in other.

+

It is also conceptually equivalent to the “bit-clear” operation: +flags & !other (and this syntax is also supported).

+

This is equivalent to using the - operator (e.g. +ops::Sub), as in flags - other.

+

Returns the symmetric difference between the flags +in self and other.

+

Specifically, the returned set contains the flags present which +are present in self or other, but that are not present in +both. Equivalently, it contains the flags present in exactly +one of the sets self and other.

+

This is equivalent to using the ^ operator (e.g. +ops::BitXor), as in flags ^ other.

+

Returns the complement of this set of flags.

+

Specifically, the returned set contains all the flags which are +not set in self, but which are allowed for this type.

+

Alternatively, it can be thought of as the set difference +between Self::all() and self (e.g. Self::all() - self)

+

This is equivalent to using the ! operator (e.g. +ops::Not), as in !flags.

+

Do not check validity for simplicity +Return (readable, writable)

+

Trait Implementations

Formats the value using the given formatter.

+

Returns the intersection between the two sets of flags.

+

The resulting type after applying the & operator.

+

Disables all flags disabled in the set.

+

Returns the union of the two sets of flags.

+

The resulting type after applying the | operator.

+

Adds the set of flags.

+

Returns the left flags, but with all the right flags toggled.

+

The resulting type after applying the ^ operator.

+

Toggles the set of flags.

+

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Extends a collection with the contents of an iterator. Read more

+
🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

+
🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

+

Creates a value from an iterator. Read more

+

Feeds this value into the given Hasher. Read more

+

Feeds a slice of this type into the given Hasher. Read more

+

Formats the value using the given formatter.

+

Returns the complement of this set of flags.

+

The resulting type after applying the ! operator.

+

Formats the value using the given formatter.

+

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

Restrict a value to a certain interval. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more

+

Returns the set difference of the two sets of flags.

+

The resulting type after applying the - operator.

+

Disables all flags enabled in the set.

+

Formats the value using the given formatter.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/fs/inode/struct.ROOT_INODE.html b/ch9-gui-dev/os/fs/inode/struct.ROOT_INODE.html new file mode 100644 index 00000000..5d71e3bb --- /dev/null +++ b/ch9-gui-dev/os/fs/inode/struct.ROOT_INODE.html @@ -0,0 +1,28 @@ +ROOT_INODE in os::fs::inode - Rust
pub struct ROOT_INODE {
+    __private_field: (),
+}

Fields

__private_field: ()

Trait Implementations

The resulting type after dereferencing.

+

Dereferences the value.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/fs/pipe/constant.RING_BUFFER_SIZE.html b/ch9-gui-dev/os/fs/pipe/constant.RING_BUFFER_SIZE.html new file mode 100644 index 00000000..805b061d --- /dev/null +++ b/ch9-gui-dev/os/fs/pipe/constant.RING_BUFFER_SIZE.html @@ -0,0 +1 @@ +RING_BUFFER_SIZE in os::fs::pipe - Rust
const RING_BUFFER_SIZE: usize = 32;
\ No newline at end of file diff --git a/ch9-gui-dev/os/fs/pipe/enum.RingBufferStatus.html b/ch9-gui-dev/os/fs/pipe/enum.RingBufferStatus.html new file mode 100644 index 00000000..16170de3 --- /dev/null +++ b/ch9-gui-dev/os/fs/pipe/enum.RingBufferStatus.html @@ -0,0 +1,36 @@ +RingBufferStatus in os::fs::pipe - Rust
enum RingBufferStatus {
+    Full,
+    Empty,
+    Normal,
+}

Variants

Full

Empty

Normal

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/fs/pipe/fn.make_pipe.html b/ch9-gui-dev/os/fs/pipe/fn.make_pipe.html new file mode 100644 index 00000000..ecc081f0 --- /dev/null +++ b/ch9-gui-dev/os/fs/pipe/fn.make_pipe.html @@ -0,0 +1,2 @@ +make_pipe in os::fs::pipe - Rust

Function os::fs::pipe::make_pipe

source · []
pub fn make_pipe() -> (Arc<Pipe>, Arc<Pipe>)
Expand description

Return (read_end, write_end)

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/fs/pipe/index.html b/ch9-gui-dev/os/fs/pipe/index.html new file mode 100644 index 00000000..2552d620 --- /dev/null +++ b/ch9-gui-dev/os/fs/pipe/index.html @@ -0,0 +1,2 @@ +os::fs::pipe - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/fs/pipe/sidebar-items.js b/ch9-gui-dev/os/fs/pipe/sidebar-items.js new file mode 100644 index 00000000..b687c9c1 --- /dev/null +++ b/ch9-gui-dev/os/fs/pipe/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":[["RING_BUFFER_SIZE",""]],"enum":[["RingBufferStatus",""]],"fn":[["make_pipe","Return (read_end, write_end)"]],"struct":[["Pipe",""],["PipeRingBuffer",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/fs/pipe/struct.Pipe.html b/ch9-gui-dev/os/fs/pipe/struct.Pipe.html new file mode 100644 index 00000000..a8c661f9 --- /dev/null +++ b/ch9-gui-dev/os/fs/pipe/struct.Pipe.html @@ -0,0 +1,28 @@ +Pipe in os::fs::pipe - Rust

Struct os::fs::pipe::Pipe

source · []
pub struct Pipe {
+    readable: bool,
+    writable: bool,
+    buffer: Arc<UPIntrFreeCell<PipeRingBuffer>>,
+}

Fields

readable: boolwritable: boolbuffer: Arc<UPIntrFreeCell<PipeRingBuffer>>

Implementations

Trait Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/fs/pipe/struct.PipeRingBuffer.html b/ch9-gui-dev/os/fs/pipe/struct.PipeRingBuffer.html new file mode 100644 index 00000000..986d7ab3 --- /dev/null +++ b/ch9-gui-dev/os/fs/pipe/struct.PipeRingBuffer.html @@ -0,0 +1,30 @@ +PipeRingBuffer in os::fs::pipe - Rust
pub struct PipeRingBuffer {
+    arr: [u8; 32],
+    head: usize,
+    tail: usize,
+    status: RingBufferStatus,
+    write_end: Option<Weak<Pipe>>,
+}

Fields

arr: [u8; 32]head: usizetail: usizestatus: RingBufferStatuswrite_end: Option<Weak<Pipe>>

Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/fs/sidebar-items.js b/ch9-gui-dev/os/fs/sidebar-items.js new file mode 100644 index 00000000..2cabee7d --- /dev/null +++ b/ch9-gui-dev/os/fs/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":[["inode",""],["pipe",""],["stdio",""]],"trait":[["File",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/fs/stdio/index.html b/ch9-gui-dev/os/fs/stdio/index.html new file mode 100644 index 00000000..d1fb7e4c --- /dev/null +++ b/ch9-gui-dev/os/fs/stdio/index.html @@ -0,0 +1 @@ +os::fs::stdio - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/fs/stdio/sidebar-items.js b/ch9-gui-dev/os/fs/stdio/sidebar-items.js new file mode 100644 index 00000000..bb4987e8 --- /dev/null +++ b/ch9-gui-dev/os/fs/stdio/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":[["Stdin",""],["Stdout",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/fs/stdio/struct.Stdin.html b/ch9-gui-dev/os/fs/stdio/struct.Stdin.html new file mode 100644 index 00000000..72ef80c6 --- /dev/null +++ b/ch9-gui-dev/os/fs/stdio/struct.Stdin.html @@ -0,0 +1,24 @@ +Stdin in os::fs::stdio - Rust

Struct os::fs::stdio::Stdin

source · []
pub struct Stdin;

Trait Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/fs/stdio/struct.Stdout.html b/ch9-gui-dev/os/fs/stdio/struct.Stdout.html new file mode 100644 index 00000000..269a3951 --- /dev/null +++ b/ch9-gui-dev/os/fs/stdio/struct.Stdout.html @@ -0,0 +1,24 @@ +Stdout in os::fs::stdio - Rust
pub struct Stdout;

Trait Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/fs/trait.File.html b/ch9-gui-dev/os/fs/trait.File.html new file mode 100644 index 00000000..f68493a0 --- /dev/null +++ b/ch9-gui-dev/os/fs/trait.File.html @@ -0,0 +1,6 @@ +File in os::fs - Rust

Trait os::fs::File

source · []
pub trait File: Send + Sync {
+    fn readable(&self) -> bool;
+    fn writable(&self) -> bool;
+    fn read(&self, buf: UserBuffer) -> usize;
+    fn write(&self, buf: UserBuffer) -> usize;
+}

Required Methods

Implementors

\ No newline at end of file diff --git a/ch9-gui-dev/os/gui/graphic/index.html b/ch9-gui-dev/os/gui/graphic/index.html new file mode 100644 index 00000000..193d096a --- /dev/null +++ b/ch9-gui-dev/os/gui/graphic/index.html @@ -0,0 +1 @@ +os::gui::graphic - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/gui/graphic/sidebar-items.js b/ch9-gui-dev/os/gui/graphic/sidebar-items.js new file mode 100644 index 00000000..987266dc --- /dev/null +++ b/ch9-gui-dev/os/gui/graphic/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":[["Graphics",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/gui/graphic/struct.Graphics.html b/ch9-gui-dev/os/gui/graphic/struct.Graphics.html new file mode 100644 index 00000000..a1dbcd8f --- /dev/null +++ b/ch9-gui-dev/os/gui/graphic/struct.Graphics.html @@ -0,0 +1,45 @@ +Graphics in os::gui::graphic - Rust
pub struct Graphics {
+    pub size: Size,
+    pub point: Point,
+    pub drv: Arc<dyn GpuDevice>,
+}

Fields

size: Sizepoint: Pointdrv: Arc<dyn GpuDevice>

Implementations

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

The pixel color type the targetted display supports.

+

Error type to return when a drawing operation fails. Read more

+

Draw individual pixels to the display without a defined order. Read more

+

Fill a given area with an iterator providing a contiguous stream of pixel colors. Read more

+

Fill a given area with a solid color. Read more

+

Fill the entire display with a solid color. Read more

+

Returns the size of the bounding box.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the bounding box.

+

Creates a translated draw target based on this draw target. Read more

+

Creates a cropped draw target based on this draw target. Read more

+

Creates a clipped draw target based on this draw target. Read more

+

Creates a color conversion draw target. Read more

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/gui/index.html b/ch9-gui-dev/os/gui/index.html new file mode 100644 index 00000000..bd9e1816 --- /dev/null +++ b/ch9-gui-dev/os/gui/index.html @@ -0,0 +1 @@ +os::gui - Rust

Module os::gui

source · []

Re-exports

pub use paint::init_paint;
pub use paint::move_rect;
pub use paint::reset;

Modules

graphic 🔒
paint 🔒
\ No newline at end of file diff --git a/ch9-gui-dev/os/gui/paint/constant.INIT_X.html b/ch9-gui-dev/os/gui/paint/constant.INIT_X.html new file mode 100644 index 00000000..8fc8ba60 --- /dev/null +++ b/ch9-gui-dev/os/gui/paint/constant.INIT_X.html @@ -0,0 +1 @@ +INIT_X in os::gui::paint - Rust

Constant os::gui::paint::INIT_X

source · []
const INIT_X: i32 = 640;
\ No newline at end of file diff --git a/ch9-gui-dev/os/gui/paint/constant.INIT_Y.html b/ch9-gui-dev/os/gui/paint/constant.INIT_Y.html new file mode 100644 index 00000000..8cd2722b --- /dev/null +++ b/ch9-gui-dev/os/gui/paint/constant.INIT_Y.html @@ -0,0 +1 @@ +INIT_Y in os::gui::paint - Rust

Constant os::gui::paint::INIT_Y

source · []
const INIT_Y: i32 = 400;
\ No newline at end of file diff --git a/ch9-gui-dev/os/gui/paint/constant.RECT_SIZE.html b/ch9-gui-dev/os/gui/paint/constant.RECT_SIZE.html new file mode 100644 index 00000000..2d8d8724 --- /dev/null +++ b/ch9-gui-dev/os/gui/paint/constant.RECT_SIZE.html @@ -0,0 +1 @@ +RECT_SIZE in os::gui::paint - Rust
const RECT_SIZE: u32 = 40;
\ No newline at end of file diff --git a/ch9-gui-dev/os/gui/paint/fn.init_paint.html b/ch9-gui-dev/os/gui/paint/fn.init_paint.html new file mode 100644 index 00000000..00698a9c --- /dev/null +++ b/ch9-gui-dev/os/gui/paint/fn.init_paint.html @@ -0,0 +1 @@ +init_paint in os::gui::paint - Rust
pub fn init_paint()
\ No newline at end of file diff --git a/ch9-gui-dev/os/gui/paint/fn.move_rect.html b/ch9-gui-dev/os/gui/paint/fn.move_rect.html new file mode 100644 index 00000000..23ea01ed --- /dev/null +++ b/ch9-gui-dev/os/gui/paint/fn.move_rect.html @@ -0,0 +1 @@ +move_rect in os::gui::paint - Rust
pub fn move_rect(dx: i32, dy: i32)
\ No newline at end of file diff --git a/ch9-gui-dev/os/gui/paint/fn.reset.html b/ch9-gui-dev/os/gui/paint/fn.reset.html new file mode 100644 index 00000000..83708912 --- /dev/null +++ b/ch9-gui-dev/os/gui/paint/fn.reset.html @@ -0,0 +1 @@ +reset in os::gui::paint - Rust

Function os::gui::paint::reset

source · []
pub fn reset()
\ No newline at end of file diff --git a/ch9-gui-dev/os/gui/paint/index.html b/ch9-gui-dev/os/gui/paint/index.html new file mode 100644 index 00000000..782b984f --- /dev/null +++ b/ch9-gui-dev/os/gui/paint/index.html @@ -0,0 +1 @@ +os::gui::paint - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/gui/paint/sidebar-items.js b/ch9-gui-dev/os/gui/paint/sidebar-items.js new file mode 100644 index 00000000..91628ecf --- /dev/null +++ b/ch9-gui-dev/os/gui/paint/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":[["INIT_X",""],["INIT_Y",""],["RECT_SIZE",""]],"fn":[["init_paint",""],["move_rect",""],["reset",""]],"struct":[["DRAWING_BOARD",""],["DrawingBoard",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/gui/paint/struct.DRAWING_BOARD.html b/ch9-gui-dev/os/gui/paint/struct.DRAWING_BOARD.html new file mode 100644 index 00000000..85aca819 --- /dev/null +++ b/ch9-gui-dev/os/gui/paint/struct.DRAWING_BOARD.html @@ -0,0 +1,29 @@ +DRAWING_BOARD in os::gui::paint - Rust
pub struct DRAWING_BOARD {
+    __private_field: (),
+}

Fields

__private_field: ()

Methods from Deref<Target = UPIntrFreeCell<DrawingBoard>>

Panic if the data has been borrowed.

+

Trait Implementations

The resulting type after dereferencing.

+

Dereferences the value.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/gui/paint/struct.DrawingBoard.html b/ch9-gui-dev/os/gui/paint/struct.DrawingBoard.html new file mode 100644 index 00000000..8f583ecd --- /dev/null +++ b/ch9-gui-dev/os/gui/paint/struct.DrawingBoard.html @@ -0,0 +1,27 @@ +DrawingBoard in os::gui::paint - Rust
pub struct DrawingBoard {
+    graphics: Graphics,
+    latest_pos: Point,
+}

Fields

graphics: Graphicslatest_pos: Point

Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/gui/sidebar-items.js b/ch9-gui-dev/os/gui/sidebar-items.js new file mode 100644 index 00000000..e33d82cf --- /dev/null +++ b/ch9-gui-dev/os/gui/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":[["graphic",""],["paint",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/index.html b/ch9-gui-dev/os/index.html new file mode 100644 index 00000000..ae5d7995 --- /dev/null +++ b/ch9-gui-dev/os/index.html @@ -0,0 +1 @@ +os - Rust

Crate os

source · []

Modules

board 🔒
config 🔒
console 🔒
drivers 🔒
fs 🔒
gui 🔒
lang_items 🔒
mm 🔒
sbi 🔒
sync 🔒
syscall 🔒
task 🔒
timer 🔒
trap 🔒

Macros

Structs

Functions

\ No newline at end of file diff --git a/ch9-gui-dev/os/lang_items/fn.backtrace.html b/ch9-gui-dev/os/lang_items/fn.backtrace.html new file mode 100644 index 00000000..541e422c --- /dev/null +++ b/ch9-gui-dev/os/lang_items/fn.backtrace.html @@ -0,0 +1 @@ +backtrace in os::lang_items - Rust
unsafe fn backtrace()
\ No newline at end of file diff --git a/ch9-gui-dev/os/lang_items/fn.panic.html b/ch9-gui-dev/os/lang_items/fn.panic.html new file mode 100644 index 00000000..4ef1f2d9 --- /dev/null +++ b/ch9-gui-dev/os/lang_items/fn.panic.html @@ -0,0 +1 @@ +panic in os::lang_items - Rust
fn panic(info: &PanicInfo<'_>) -> !
\ No newline at end of file diff --git a/ch9-gui-dev/os/lang_items/index.html b/ch9-gui-dev/os/lang_items/index.html new file mode 100644 index 00000000..c86ba625 --- /dev/null +++ b/ch9-gui-dev/os/lang_items/index.html @@ -0,0 +1 @@ +os::lang_items - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/lang_items/sidebar-items.js b/ch9-gui-dev/os/lang_items/sidebar-items.js new file mode 100644 index 00000000..a9303c53 --- /dev/null +++ b/ch9-gui-dev/os/lang_items/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":[["backtrace",""],["panic",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/macro.print!.html b/ch9-gui-dev/os/macro.print!.html new file mode 100644 index 00000000..0d57e6ea --- /dev/null +++ b/ch9-gui-dev/os/macro.print!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.print.html...

+ + + \ No newline at end of file diff --git a/ch9-gui-dev/os/macro.print.html b/ch9-gui-dev/os/macro.print.html new file mode 100644 index 00000000..c1fb648c --- /dev/null +++ b/ch9-gui-dev/os/macro.print.html @@ -0,0 +1,4 @@ +print in os - Rust

Macro os::print

source · []
macro_rules! print {
+    ($fmt: literal $(, $($arg: tt)+)?) => { ... };
+}
+
\ No newline at end of file diff --git a/ch9-gui-dev/os/macro.println!.html b/ch9-gui-dev/os/macro.println!.html new file mode 100644 index 00000000..268c2ae6 --- /dev/null +++ b/ch9-gui-dev/os/macro.println!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.println.html...

+ + + \ No newline at end of file diff --git a/ch9-gui-dev/os/macro.println.html b/ch9-gui-dev/os/macro.println.html new file mode 100644 index 00000000..a4b98193 --- /dev/null +++ b/ch9-gui-dev/os/macro.println.html @@ -0,0 +1,4 @@ +println in os - Rust
macro_rules! println {
+    ($fmt: literal $(, $($arg: tt)+)?) => { ... };
+}
+
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/address/constant.PA_WIDTH_SV39.html b/ch9-gui-dev/os/mm/address/constant.PA_WIDTH_SV39.html new file mode 100644 index 00000000..aed7ccb2 --- /dev/null +++ b/ch9-gui-dev/os/mm/address/constant.PA_WIDTH_SV39.html @@ -0,0 +1 @@ +PA_WIDTH_SV39 in os::mm::address - Rust
const PA_WIDTH_SV39: usize = 56;
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/address/constant.PPN_WIDTH_SV39.html b/ch9-gui-dev/os/mm/address/constant.PPN_WIDTH_SV39.html new file mode 100644 index 00000000..1a19b733 --- /dev/null +++ b/ch9-gui-dev/os/mm/address/constant.PPN_WIDTH_SV39.html @@ -0,0 +1 @@ +PPN_WIDTH_SV39 in os::mm::address - Rust
const PPN_WIDTH_SV39: usize = _; // 44usize
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/address/constant.VA_WIDTH_SV39.html b/ch9-gui-dev/os/mm/address/constant.VA_WIDTH_SV39.html new file mode 100644 index 00000000..245197a3 --- /dev/null +++ b/ch9-gui-dev/os/mm/address/constant.VA_WIDTH_SV39.html @@ -0,0 +1 @@ +VA_WIDTH_SV39 in os::mm::address - Rust
const VA_WIDTH_SV39: usize = 39;
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/address/constant.VPN_WIDTH_SV39.html b/ch9-gui-dev/os/mm/address/constant.VPN_WIDTH_SV39.html new file mode 100644 index 00000000..bb1dfb22 --- /dev/null +++ b/ch9-gui-dev/os/mm/address/constant.VPN_WIDTH_SV39.html @@ -0,0 +1 @@ +VPN_WIDTH_SV39 in os::mm::address - Rust
const VPN_WIDTH_SV39: usize = _; // 27usize
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/address/index.html b/ch9-gui-dev/os/mm/address/index.html new file mode 100644 index 00000000..1553c01c --- /dev/null +++ b/ch9-gui-dev/os/mm/address/index.html @@ -0,0 +1,2 @@ +os::mm::address - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/address/sidebar-items.js b/ch9-gui-dev/os/mm/address/sidebar-items.js new file mode 100644 index 00000000..81e6698f --- /dev/null +++ b/ch9-gui-dev/os/mm/address/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":[["PA_WIDTH_SV39",""],["PPN_WIDTH_SV39",""],["VA_WIDTH_SV39",""],["VPN_WIDTH_SV39",""]],"struct":[["PhysAddr","Definitions"],["PhysPageNum",""],["SimpleRange",""],["SimpleRangeIterator",""],["VirtAddr",""],["VirtPageNum",""]],"trait":[["StepByOne",""]],"type":[["PPNRange",""],["VPNRange",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/mm/address/struct.PhysAddr.html b/ch9-gui-dev/os/mm/address/struct.PhysAddr.html new file mode 100644 index 00000000..0179afab --- /dev/null +++ b/ch9-gui-dev/os/mm/address/struct.PhysAddr.html @@ -0,0 +1,52 @@ +PhysAddr in os::mm::address - Rust
#[repr(C)]
pub struct PhysAddr(pub usize);
Expand description

Definitions

+

Tuple Fields

0: usize

Implementations

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Converts to this type from the input type.

+

Converts to this type from the input type.

+

Converts to this type from the input type.

+

T: {PhysAddr, VirtAddr, PhysPageNum, VirtPageNum} +T -> usize: T.0 +usize -> T: usize.into()

+

Converts to this type from the input type.

+

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

Restrict a value to a certain interval. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/address/struct.PhysPageNum.html b/ch9-gui-dev/os/mm/address/struct.PhysPageNum.html new file mode 100644 index 00000000..7f51a26b --- /dev/null +++ b/ch9-gui-dev/os/mm/address/struct.PhysPageNum.html @@ -0,0 +1,48 @@ +PhysPageNum in os::mm::address - Rust
#[repr(C)]
pub struct PhysPageNum(pub usize);

Tuple Fields

0: usize

Implementations

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Converts to this type from the input type.

+

Converts to this type from the input type.

+

Converts to this type from the input type.

+

Converts to this type from the input type.

+

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

Restrict a value to a certain interval. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/address/struct.SimpleRange.html b/ch9-gui-dev/os/mm/address/struct.SimpleRange.html new file mode 100644 index 00000000..a6c506fe --- /dev/null +++ b/ch9-gui-dev/os/mm/address/struct.SimpleRange.html @@ -0,0 +1,35 @@ +SimpleRange in os::mm::address - Rust
pub struct SimpleRange<T> where
    T: StepByOne + Copy + PartialEq + PartialOrd + Debug
{ + l: T, + r: T, +}

Fields

l: Tr: T

Implementations

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

The type of the elements being iterated over.

+

Which kind of iterator are we turning this into?

+

Creates an iterator from a value. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/address/struct.SimpleRangeIterator.html b/ch9-gui-dev/os/mm/address/struct.SimpleRangeIterator.html new file mode 100644 index 00000000..52cfcdd2 --- /dev/null +++ b/ch9-gui-dev/os/mm/address/struct.SimpleRangeIterator.html @@ -0,0 +1,145 @@ +SimpleRangeIterator in os::mm::address - Rust
pub struct SimpleRangeIterator<T> where
    T: StepByOne + Copy + PartialEq + PartialOrd + Debug
{ + current: T, + end: T, +}

Fields

current: Tend: T

Implementations

Trait Implementations

The type of the elements being iterated over.

+

Advances the iterator and returns the next value. Read more

+
🔬 This is a nightly-only experimental API. (iter_next_chunk)

Advances the iterator and returns an array containing the next N values. Read more

+

Returns the bounds on the remaining length of the iterator. Read more

+

Consumes the iterator, counting the number of iterations and returning it. Read more

+

Consumes the iterator, returning the last element. Read more

+
🔬 This is a nightly-only experimental API. (iter_advance_by)

Advances the iterator by n elements. Read more

+

Returns the nth element of the iterator. Read more

+

Creates an iterator starting at the same point, but stepping by +the given amount at each iteration. Read more

+

Takes two iterators and creates a new iterator over both in sequence. Read more

+

‘Zips up’ two iterators into a single iterator of pairs. Read more

+
🔬 This is a nightly-only experimental API. (iter_intersperse)

Creates a new iterator which places a copy of separator between adjacent +items of the original iterator. Read more

+
🔬 This is a nightly-only experimental API. (iter_intersperse)

Creates a new iterator which places an item generated by separator +between adjacent items of the original iterator. Read more

+

Takes a closure and creates an iterator which calls that closure on each +element. Read more

+

Calls a closure on each element of an iterator. Read more

+

Creates an iterator which uses a closure to determine if an element +should be yielded. Read more

+

Creates an iterator that both filters and maps. Read more

+

Creates an iterator which gives the current iteration count as well as +the next value. Read more

+

Creates an iterator which can use the peek and peek_mut methods +to look at the next element of the iterator without consuming it. See +their documentation for more information. Read more

+

Creates an iterator that skips elements based on a predicate. Read more

+

Creates an iterator that yields elements based on a predicate. Read more

+

Creates an iterator that both yields elements based on a predicate and maps. Read more

+

Creates an iterator that skips the first n elements. Read more

+

Creates an iterator that yields the first n elements, or fewer +if the underlying iterator ends sooner. Read more

+

An iterator adapter similar to fold that holds internal state and +produces a new iterator. Read more

+

Creates an iterator that works like map, but flattens nested structure. Read more

+

Creates an iterator that flattens nested structure. Read more

+

Creates an iterator which ends after the first None. Read more

+

Does something with each element of an iterator, passing the value on. Read more

+

Borrows an iterator, rather than consuming it. Read more

+

Transforms an iterator into a collection. Read more

+
🔬 This is a nightly-only experimental API. (iterator_try_collect)

Fallibly transforms an iterator into a collection, short circuiting if +a failure is encountered. Read more

+
🔬 This is a nightly-only experimental API. (iter_collect_into)

Collects all the items from an iterator into a collection. Read more

+

Consumes an iterator, creating two collections from it. Read more

+
🔬 This is a nightly-only experimental API. (iter_partition_in_place)

Reorders the elements of this iterator in-place according to the given predicate, +such that all those that return true precede all those that return false. +Returns the number of true elements found. Read more

+
🔬 This is a nightly-only experimental API. (iter_is_partitioned)

Checks if the elements of this iterator are partitioned according to the given predicate, +such that all those that return true precede all those that return false. Read more

+

An iterator method that applies a function as long as it returns +successfully, producing a single, final value. Read more

+

An iterator method that applies a fallible function to each item in the +iterator, stopping at the first error and returning that error. Read more

+

Folds every element into an accumulator by applying an operation, +returning the final result. Read more

+

Reduces the elements to a single one, by repeatedly applying a reducing +operation. Read more

+
🔬 This is a nightly-only experimental API. (iterator_try_reduce)

Reduces the elements to a single one by repeatedly applying a reducing operation. If the +closure returns a failure, the failure is propagated back to the caller immediately. Read more

+

Tests if every element of the iterator matches a predicate. Read more

+

Tests if any element of the iterator matches a predicate. Read more

+

Searches for an element of an iterator that satisfies a predicate. Read more

+

Applies function to the elements of iterator and returns +the first non-none result. Read more

+
🔬 This is a nightly-only experimental API. (try_find)

Applies function to the elements of iterator and returns +the first true result or the first error. Read more

+

Searches for an element in an iterator, returning its index. Read more

+

Searches for an element in an iterator from the right, returning its +index. Read more

+

Returns the maximum element of an iterator. Read more

+

Returns the minimum element of an iterator. Read more

+

Returns the element that gives the maximum value from the +specified function. Read more

+

Returns the element that gives the maximum value with respect to the +specified comparison function. Read more

+

Returns the element that gives the minimum value from the +specified function. Read more

+

Returns the element that gives the minimum value with respect to the +specified comparison function. Read more

+

Reverses an iterator’s direction. Read more

+

Converts an iterator of pairs into a pair of containers. Read more

+

Creates an iterator which copies all of its elements. Read more

+

Creates an iterator which clones all of its elements. Read more

+

Repeats an iterator endlessly. Read more

+

Sums the elements of an iterator. Read more

+

Iterates over the entire iterator, multiplying all the elements Read more

+

Lexicographically compares the elements of this Iterator with those +of another. Read more

+
🔬 This is a nightly-only experimental API. (iter_order_by)

Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more

+

Lexicographically compares the elements of this Iterator with those +of another. Read more

+
🔬 This is a nightly-only experimental API. (iter_order_by)

Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more

+

Determines if the elements of this Iterator are equal to those of +another. Read more

+
🔬 This is a nightly-only experimental API. (iter_order_by)

Determines if the elements of this Iterator are equal to those of +another with respect to the specified equality function. Read more

+

Determines if the elements of this Iterator are unequal to those of +another. Read more

+

Determines if the elements of this Iterator are lexicographically +less than those of another. Read more

+

Determines if the elements of this Iterator are lexicographically +less or equal to those of another. Read more

+

Determines if the elements of this Iterator are lexicographically +greater than those of another. Read more

+

Determines if the elements of this Iterator are lexicographically +greater than or equal to those of another. Read more

+
🔬 This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this iterator are sorted. Read more

+
🔬 This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this iterator are sorted using the given comparator function. Read more

+
🔬 This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this iterator are sorted using the given key extraction +function. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

The type of the elements being iterated over.

+

Which kind of iterator are we turning this into?

+

Creates an iterator from a value. Read more

+

Casts the value.

+

Casts the value.

+

Draws the pixel iterator to a draw target.

+

Returns a translated version of the iterator.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/address/struct.VirtAddr.html b/ch9-gui-dev/os/mm/address/struct.VirtAddr.html new file mode 100644 index 00000000..3af4c4b4 --- /dev/null +++ b/ch9-gui-dev/os/mm/address/struct.VirtAddr.html @@ -0,0 +1,49 @@ +VirtAddr in os::mm::address - Rust
#[repr(C)]
pub struct VirtAddr(pub usize);

Tuple Fields

0: usize

Implementations

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Debugging

+

Formats the value using the given formatter. Read more

+

Converts to this type from the input type.

+

Converts to this type from the input type.

+

Converts to this type from the input type.

+

Converts to this type from the input type.

+

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

Restrict a value to a certain interval. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/address/struct.VirtPageNum.html b/ch9-gui-dev/os/mm/address/struct.VirtPageNum.html new file mode 100644 index 00000000..ca05b633 --- /dev/null +++ b/ch9-gui-dev/os/mm/address/struct.VirtPageNum.html @@ -0,0 +1,48 @@ +VirtPageNum in os::mm::address - Rust
#[repr(C)]
pub struct VirtPageNum(pub usize);

Tuple Fields

0: usize

Implementations

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Converts to this type from the input type.

+

Converts to this type from the input type.

+

Converts to this type from the input type.

+

Converts to this type from the input type.

+

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

Restrict a value to a certain interval. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/address/trait.StepByOne.html b/ch9-gui-dev/os/mm/address/trait.StepByOne.html new file mode 100644 index 00000000..cd507cea --- /dev/null +++ b/ch9-gui-dev/os/mm/address/trait.StepByOne.html @@ -0,0 +1,3 @@ +StepByOne in os::mm::address - Rust
pub trait StepByOne {
+    fn step(&mut self);
+}

Required Methods

Implementors

\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/address/type.PPNRange.html b/ch9-gui-dev/os/mm/address/type.PPNRange.html new file mode 100644 index 00000000..a20107d6 --- /dev/null +++ b/ch9-gui-dev/os/mm/address/type.PPNRange.html @@ -0,0 +1 @@ +PPNRange in os::mm::address - Rust

Type Definition os::mm::address::PPNRange

source · []
pub type PPNRange = SimpleRange<PhysPageNum>;
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/address/type.VPNRange.html b/ch9-gui-dev/os/mm/address/type.VPNRange.html new file mode 100644 index 00000000..76019454 --- /dev/null +++ b/ch9-gui-dev/os/mm/address/type.VPNRange.html @@ -0,0 +1 @@ +VPNRange in os::mm::address - Rust

Type Definition os::mm::address::VPNRange

source · []
pub type VPNRange = SimpleRange<VirtPageNum>;
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/fn.init.html b/ch9-gui-dev/os/mm/fn.init.html new file mode 100644 index 00000000..dc3f5588 --- /dev/null +++ b/ch9-gui-dev/os/mm/fn.init.html @@ -0,0 +1 @@ +init in os::mm - Rust

Function os::mm::init

source · []
pub fn init()
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/frame_allocator/fn.frame_alloc.html b/ch9-gui-dev/os/mm/frame_allocator/fn.frame_alloc.html new file mode 100644 index 00000000..f18b5f09 --- /dev/null +++ b/ch9-gui-dev/os/mm/frame_allocator/fn.frame_alloc.html @@ -0,0 +1 @@ +frame_alloc in os::mm::frame_allocator - Rust
pub fn frame_alloc() -> Option<FrameTracker>
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/frame_allocator/fn.frame_allocator_test.html b/ch9-gui-dev/os/mm/frame_allocator/fn.frame_allocator_test.html new file mode 100644 index 00000000..ab161fc5 --- /dev/null +++ b/ch9-gui-dev/os/mm/frame_allocator/fn.frame_allocator_test.html @@ -0,0 +1 @@ +frame_allocator_test in os::mm::frame_allocator - Rust
pub fn frame_allocator_test()
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/frame_allocator/fn.frame_dealloc.html b/ch9-gui-dev/os/mm/frame_allocator/fn.frame_dealloc.html new file mode 100644 index 00000000..83a8cc40 --- /dev/null +++ b/ch9-gui-dev/os/mm/frame_allocator/fn.frame_dealloc.html @@ -0,0 +1 @@ +frame_dealloc in os::mm::frame_allocator - Rust
pub fn frame_dealloc(ppn: PhysPageNum)
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/frame_allocator/fn.init_frame_allocator.html b/ch9-gui-dev/os/mm/frame_allocator/fn.init_frame_allocator.html new file mode 100644 index 00000000..aafdac70 --- /dev/null +++ b/ch9-gui-dev/os/mm/frame_allocator/fn.init_frame_allocator.html @@ -0,0 +1 @@ +init_frame_allocator in os::mm::frame_allocator - Rust
pub fn init_frame_allocator()
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/frame_allocator/index.html b/ch9-gui-dev/os/mm/frame_allocator/index.html new file mode 100644 index 00000000..8a153eca --- /dev/null +++ b/ch9-gui-dev/os/mm/frame_allocator/index.html @@ -0,0 +1 @@ +os::mm::frame_allocator - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/frame_allocator/sidebar-items.js b/ch9-gui-dev/os/mm/frame_allocator/sidebar-items.js new file mode 100644 index 00000000..82ea2c12 --- /dev/null +++ b/ch9-gui-dev/os/mm/frame_allocator/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":[["frame_alloc",""],["frame_allocator_test",""],["frame_dealloc",""],["init_frame_allocator",""]],"struct":[["FRAME_ALLOCATOR",""],["FrameTracker",""],["StackFrameAllocator",""]],"trait":[["FrameAllocator",""]],"type":[["FrameAllocatorImpl",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/mm/frame_allocator/struct.FRAME_ALLOCATOR.html b/ch9-gui-dev/os/mm/frame_allocator/struct.FRAME_ALLOCATOR.html new file mode 100644 index 00000000..32963a3c --- /dev/null +++ b/ch9-gui-dev/os/mm/frame_allocator/struct.FRAME_ALLOCATOR.html @@ -0,0 +1,29 @@ +FRAME_ALLOCATOR in os::mm::frame_allocator - Rust
pub struct FRAME_ALLOCATOR {
+    __private_field: (),
+}

Fields

__private_field: ()

Methods from Deref<Target = UPIntrFreeCell<StackFrameAllocator>>

Panic if the data has been borrowed.

+

Trait Implementations

The resulting type after dereferencing.

+

Dereferences the value.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/frame_allocator/struct.FrameTracker.html b/ch9-gui-dev/os/mm/frame_allocator/struct.FrameTracker.html new file mode 100644 index 00000000..92b2cc03 --- /dev/null +++ b/ch9-gui-dev/os/mm/frame_allocator/struct.FrameTracker.html @@ -0,0 +1,28 @@ +FrameTracker in os::mm::frame_allocator - Rust
pub struct FrameTracker {
+    pub ppn: PhysPageNum,
+}

Fields

ppn: PhysPageNum

Implementations

Trait Implementations

Formats the value using the given formatter. Read more

+

Executes the destructor for this type. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/frame_allocator/struct.StackFrameAllocator.html b/ch9-gui-dev/os/mm/frame_allocator/struct.StackFrameAllocator.html new file mode 100644 index 00000000..efff070e --- /dev/null +++ b/ch9-gui-dev/os/mm/frame_allocator/struct.StackFrameAllocator.html @@ -0,0 +1,28 @@ +StackFrameAllocator in os::mm::frame_allocator - Rust
pub struct StackFrameAllocator {
+    current: usize,
+    end: usize,
+    recycled: Vec<usize>,
+}

Fields

current: usizeend: usizerecycled: Vec<usize>

Implementations

Trait Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/frame_allocator/trait.FrameAllocator.html b/ch9-gui-dev/os/mm/frame_allocator/trait.FrameAllocator.html new file mode 100644 index 00000000..e5f8b4cc --- /dev/null +++ b/ch9-gui-dev/os/mm/frame_allocator/trait.FrameAllocator.html @@ -0,0 +1,5 @@ +FrameAllocator in os::mm::frame_allocator - Rust
trait FrameAllocator {
+    fn new() -> Self;
+    fn alloc(&mut self) -> Option<PhysPageNum>;
+    fn dealloc(&mut self, ppn: PhysPageNum);
+}

Required Methods

Implementors

\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/frame_allocator/type.FrameAllocatorImpl.html b/ch9-gui-dev/os/mm/frame_allocator/type.FrameAllocatorImpl.html new file mode 100644 index 00000000..cd2c754f --- /dev/null +++ b/ch9-gui-dev/os/mm/frame_allocator/type.FrameAllocatorImpl.html @@ -0,0 +1 @@ +FrameAllocatorImpl in os::mm::frame_allocator - Rust
type FrameAllocatorImpl = StackFrameAllocator;
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/heap_allocator/fn.handle_alloc_error.html b/ch9-gui-dev/os/mm/heap_allocator/fn.handle_alloc_error.html new file mode 100644 index 00000000..3611a271 --- /dev/null +++ b/ch9-gui-dev/os/mm/heap_allocator/fn.handle_alloc_error.html @@ -0,0 +1 @@ +handle_alloc_error in os::mm::heap_allocator - Rust
pub fn handle_alloc_error(layout: Layout) -> !
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/heap_allocator/fn.heap_test.html b/ch9-gui-dev/os/mm/heap_allocator/fn.heap_test.html new file mode 100644 index 00000000..f2bc5fb0 --- /dev/null +++ b/ch9-gui-dev/os/mm/heap_allocator/fn.heap_test.html @@ -0,0 +1 @@ +heap_test in os::mm::heap_allocator - Rust
pub fn heap_test()
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/heap_allocator/fn.init_heap.html b/ch9-gui-dev/os/mm/heap_allocator/fn.init_heap.html new file mode 100644 index 00000000..9fc00184 --- /dev/null +++ b/ch9-gui-dev/os/mm/heap_allocator/fn.init_heap.html @@ -0,0 +1 @@ +init_heap in os::mm::heap_allocator - Rust
pub fn init_heap()
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/heap_allocator/index.html b/ch9-gui-dev/os/mm/heap_allocator/index.html new file mode 100644 index 00000000..05d8dac7 --- /dev/null +++ b/ch9-gui-dev/os/mm/heap_allocator/index.html @@ -0,0 +1 @@ +os::mm::heap_allocator - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/heap_allocator/sidebar-items.js b/ch9-gui-dev/os/mm/heap_allocator/sidebar-items.js new file mode 100644 index 00000000..8ce5d1d6 --- /dev/null +++ b/ch9-gui-dev/os/mm/heap_allocator/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":[["handle_alloc_error",""],["heap_test",""],["init_heap",""]],"static":[["HEAP_ALLOCATOR",""],["HEAP_SPACE",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/mm/heap_allocator/static.HEAP_ALLOCATOR.html b/ch9-gui-dev/os/mm/heap_allocator/static.HEAP_ALLOCATOR.html new file mode 100644 index 00000000..1ffb2174 --- /dev/null +++ b/ch9-gui-dev/os/mm/heap_allocator/static.HEAP_ALLOCATOR.html @@ -0,0 +1 @@ +HEAP_ALLOCATOR in os::mm::heap_allocator - Rust
static HEAP_ALLOCATOR: LockedHeap
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/heap_allocator/static.HEAP_SPACE.html b/ch9-gui-dev/os/mm/heap_allocator/static.HEAP_SPACE.html new file mode 100644 index 00000000..22c5f5d6 --- /dev/null +++ b/ch9-gui-dev/os/mm/heap_allocator/static.HEAP_SPACE.html @@ -0,0 +1 @@ +HEAP_SPACE in os::mm::heap_allocator - Rust
static mut HEAP_SPACE: [u8; 16777216]
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/index.html b/ch9-gui-dev/os/mm/index.html new file mode 100644 index 00000000..e0c54e57 --- /dev/null +++ b/ch9-gui-dev/os/mm/index.html @@ -0,0 +1 @@ +os::mm - Rust

Module os::mm

source · []

Re-exports

pub use address::VPNRange;
pub use address::PPNRange;
pub use address::PhysAddr;
pub use address::PhysPageNum;
pub use address::StepByOne;
pub use address::VirtAddr;
pub use address::VirtPageNum;
pub use frame_allocator::frame_alloc;
pub use frame_allocator::frame_dealloc;
pub use frame_allocator::FrameTracker;
pub use memory_set::remap_test;
pub use memory_set::kernel_token;
pub use memory_set::MapPermission;
pub use memory_set::MemorySet;
pub use memory_set::MapArea;
pub use memory_set::MapType;
pub use memory_set::KERNEL_SPACE;
pub use memory_set::KERNEL_SPACE;
pub use page_table::translated_byte_buffer;
pub use page_table::translated_ref;
pub use page_table::translated_refmut;
pub use page_table::translated_str;
pub use page_table::PageTable;
pub use page_table::PageTableEntry;
pub use page_table::UserBuffer;
pub use page_table::UserBufferIterator;

Modules

Functions

\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/memory_set/enum.MapType.html b/ch9-gui-dev/os/mm/memory_set/enum.MapType.html new file mode 100644 index 00000000..741bce96 --- /dev/null +++ b/ch9-gui-dev/os/mm/memory_set/enum.MapType.html @@ -0,0 +1,36 @@ +MapType in os::mm::memory_set - Rust
pub enum MapType {
+    Identical,
+    Framed,
+}

Variants

Identical

Framed

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/memory_set/fn.ebss.html b/ch9-gui-dev/os/mm/memory_set/fn.ebss.html new file mode 100644 index 00000000..b7236c8c --- /dev/null +++ b/ch9-gui-dev/os/mm/memory_set/fn.ebss.html @@ -0,0 +1 @@ +ebss in os::mm::memory_set - Rust
unsafe extern "C" fn ebss()
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/memory_set/fn.edata.html b/ch9-gui-dev/os/mm/memory_set/fn.edata.html new file mode 100644 index 00000000..b0e3fef3 --- /dev/null +++ b/ch9-gui-dev/os/mm/memory_set/fn.edata.html @@ -0,0 +1 @@ +edata in os::mm::memory_set - Rust
unsafe extern "C" fn edata()
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/memory_set/fn.ekernel.html b/ch9-gui-dev/os/mm/memory_set/fn.ekernel.html new file mode 100644 index 00000000..c4ecd2dc --- /dev/null +++ b/ch9-gui-dev/os/mm/memory_set/fn.ekernel.html @@ -0,0 +1 @@ +ekernel in os::mm::memory_set - Rust
unsafe extern "C" fn ekernel()
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/memory_set/fn.erodata.html b/ch9-gui-dev/os/mm/memory_set/fn.erodata.html new file mode 100644 index 00000000..a5a01963 --- /dev/null +++ b/ch9-gui-dev/os/mm/memory_set/fn.erodata.html @@ -0,0 +1 @@ +erodata in os::mm::memory_set - Rust
unsafe extern "C" fn erodata()
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/memory_set/fn.etext.html b/ch9-gui-dev/os/mm/memory_set/fn.etext.html new file mode 100644 index 00000000..ab8b7882 --- /dev/null +++ b/ch9-gui-dev/os/mm/memory_set/fn.etext.html @@ -0,0 +1 @@ +etext in os::mm::memory_set - Rust
unsafe extern "C" fn etext()
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/memory_set/fn.kernel_token.html b/ch9-gui-dev/os/mm/memory_set/fn.kernel_token.html new file mode 100644 index 00000000..af7d0d5c --- /dev/null +++ b/ch9-gui-dev/os/mm/memory_set/fn.kernel_token.html @@ -0,0 +1 @@ +kernel_token in os::mm::memory_set - Rust
pub fn kernel_token() -> usize
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/memory_set/fn.remap_test.html b/ch9-gui-dev/os/mm/memory_set/fn.remap_test.html new file mode 100644 index 00000000..0e4dab10 --- /dev/null +++ b/ch9-gui-dev/os/mm/memory_set/fn.remap_test.html @@ -0,0 +1 @@ +remap_test in os::mm::memory_set - Rust
pub fn remap_test()
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/memory_set/fn.sbss_with_stack.html b/ch9-gui-dev/os/mm/memory_set/fn.sbss_with_stack.html new file mode 100644 index 00000000..cfde46ad --- /dev/null +++ b/ch9-gui-dev/os/mm/memory_set/fn.sbss_with_stack.html @@ -0,0 +1 @@ +sbss_with_stack in os::mm::memory_set - Rust
unsafe extern "C" fn sbss_with_stack()
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/memory_set/fn.sdata.html b/ch9-gui-dev/os/mm/memory_set/fn.sdata.html new file mode 100644 index 00000000..6abcfb9c --- /dev/null +++ b/ch9-gui-dev/os/mm/memory_set/fn.sdata.html @@ -0,0 +1 @@ +sdata in os::mm::memory_set - Rust
unsafe extern "C" fn sdata()
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/memory_set/fn.srodata.html b/ch9-gui-dev/os/mm/memory_set/fn.srodata.html new file mode 100644 index 00000000..b63abec2 --- /dev/null +++ b/ch9-gui-dev/os/mm/memory_set/fn.srodata.html @@ -0,0 +1 @@ +srodata in os::mm::memory_set - Rust
unsafe extern "C" fn srodata()
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/memory_set/fn.stext.html b/ch9-gui-dev/os/mm/memory_set/fn.stext.html new file mode 100644 index 00000000..f0bd6e3e --- /dev/null +++ b/ch9-gui-dev/os/mm/memory_set/fn.stext.html @@ -0,0 +1 @@ +stext in os::mm::memory_set - Rust
unsafe extern "C" fn stext()
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/memory_set/fn.strampoline.html b/ch9-gui-dev/os/mm/memory_set/fn.strampoline.html new file mode 100644 index 00000000..7bd50a46 --- /dev/null +++ b/ch9-gui-dev/os/mm/memory_set/fn.strampoline.html @@ -0,0 +1 @@ +strampoline in os::mm::memory_set - Rust
unsafe extern "C" fn strampoline()
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/memory_set/index.html b/ch9-gui-dev/os/mm/memory_set/index.html new file mode 100644 index 00000000..47359282 --- /dev/null +++ b/ch9-gui-dev/os/mm/memory_set/index.html @@ -0,0 +1 @@ +os::mm::memory_set - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/memory_set/sidebar-items.js b/ch9-gui-dev/os/mm/memory_set/sidebar-items.js new file mode 100644 index 00000000..78b4a7c7 --- /dev/null +++ b/ch9-gui-dev/os/mm/memory_set/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":[["MapType",""]],"fn":[["ebss",""],["edata",""],["ekernel",""],["erodata",""],["etext",""],["kernel_token",""],["remap_test",""],["sbss_with_stack",""],["sdata",""],["srodata",""],["stext",""],["strampoline",""]],"struct":[["KERNEL_SPACE",""],["MapArea",""],["MapPermission",""],["MemorySet",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/mm/memory_set/struct.KERNEL_SPACE.html b/ch9-gui-dev/os/mm/memory_set/struct.KERNEL_SPACE.html new file mode 100644 index 00000000..a7633226 --- /dev/null +++ b/ch9-gui-dev/os/mm/memory_set/struct.KERNEL_SPACE.html @@ -0,0 +1,28 @@ +KERNEL_SPACE in os::mm::memory_set - Rust
pub struct KERNEL_SPACE {
+    __private_field: (),
+}

Fields

__private_field: ()

Trait Implementations

The resulting type after dereferencing.

+

Dereferences the value.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/memory_set/struct.MapArea.html b/ch9-gui-dev/os/mm/memory_set/struct.MapArea.html new file mode 100644 index 00000000..c4c24734 --- /dev/null +++ b/ch9-gui-dev/os/mm/memory_set/struct.MapArea.html @@ -0,0 +1,31 @@ +MapArea in os::mm::memory_set - Rust
pub struct MapArea {
+    vpn_range: SimpleRange<VirtPageNum>,
+    data_frames: BTreeMap<VirtPageNum, FrameTracker>,
+    map_type: MapType,
+    map_perm: MapPermission,
+}

Fields

vpn_range: SimpleRange<VirtPageNum>data_frames: BTreeMap<VirtPageNum, FrameTracker>map_type: MapTypemap_perm: MapPermission

Implementations

data: start-aligned but maybe with shorter length +assume that all frames were cleared before

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/memory_set/struct.MapPermission.html b/ch9-gui-dev/os/mm/memory_set/struct.MapPermission.html new file mode 100644 index 00000000..fb1cf089 --- /dev/null +++ b/ch9-gui-dev/os/mm/memory_set/struct.MapPermission.html @@ -0,0 +1,128 @@ +MapPermission in os::mm::memory_set - Rust
pub struct MapPermission {
+    bits: u8,
+}

Fields

bits: u8

Implementations

Returns an empty set of flags.

+

Returns the set containing all flags.

+

Returns the raw value of the flags currently stored.

+

Convert from underlying bit representation, unless that +representation contains bits that do not correspond to a flag.

+

Convert from underlying bit representation, dropping any bits +that do not correspond to flags.

+

Convert from underlying bit representation, preserving all +bits (even those not corresponding to a defined flag).

+
Safety
+

The caller of the bitflags! macro can chose to allow or +disallow extra bits for their bitflags type.

+

The caller of from_bits_unchecked() has to ensure that +all bits correspond to a defined flag or that extra bits +are valid for this bitflags type.

+

Returns true if no flags are currently stored.

+

Returns true if all flags are currently set.

+

Returns true if there are flags common to both self and other.

+

Returns true if all of the flags in other are contained within self.

+

Inserts the specified flags in-place.

+

Removes the specified flags in-place.

+

Toggles the specified flags in-place.

+

Inserts or removes the specified flags depending on the passed value.

+

Returns the intersection between the flags in self and +other.

+

Specifically, the returned set contains only the flags which are +present in both self and other.

+

This is equivalent to using the & operator (e.g. +ops::BitAnd), as in flags & other.

+

Returns the union of between the flags in self and other.

+

Specifically, the returned set contains all flags which are +present in either self or other, including any which are +present in both (see Self::symmetric_difference if that +is undesirable).

+

This is equivalent to using the | operator (e.g. +ops::BitOr), as in flags | other.

+

Returns the difference between the flags in self and other.

+

Specifically, the returned set contains all flags present in +self, except for the ones present in other.

+

It is also conceptually equivalent to the “bit-clear” operation: +flags & !other (and this syntax is also supported).

+

This is equivalent to using the - operator (e.g. +ops::Sub), as in flags - other.

+

Returns the symmetric difference between the flags +in self and other.

+

Specifically, the returned set contains the flags present which +are present in self or other, but that are not present in +both. Equivalently, it contains the flags present in exactly +one of the sets self and other.

+

This is equivalent to using the ^ operator (e.g. +ops::BitXor), as in flags ^ other.

+

Returns the complement of this set of flags.

+

Specifically, the returned set contains all the flags which are +not set in self, but which are allowed for this type.

+

Alternatively, it can be thought of as the set difference +between Self::all() and self (e.g. Self::all() - self)

+

This is equivalent to using the ! operator (e.g. +ops::Not), as in !flags.

+

Trait Implementations

Formats the value using the given formatter.

+

Returns the intersection between the two sets of flags.

+

The resulting type after applying the & operator.

+

Disables all flags disabled in the set.

+

Returns the union of the two sets of flags.

+

The resulting type after applying the | operator.

+

Adds the set of flags.

+

Returns the left flags, but with all the right flags toggled.

+

The resulting type after applying the ^ operator.

+

Toggles the set of flags.

+

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Extends a collection with the contents of an iterator. Read more

+
🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

+
🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

+

Creates a value from an iterator. Read more

+

Feeds this value into the given Hasher. Read more

+

Feeds a slice of this type into the given Hasher. Read more

+

Formats the value using the given formatter.

+

Returns the complement of this set of flags.

+

The resulting type after applying the ! operator.

+

Formats the value using the given formatter.

+

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

Restrict a value to a certain interval. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more

+

Returns the set difference of the two sets of flags.

+

The resulting type after applying the - operator.

+

Disables all flags enabled in the set.

+

Formats the value using the given formatter.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/memory_set/struct.MemorySet.html b/ch9-gui-dev/os/mm/memory_set/struct.MemorySet.html new file mode 100644 index 00000000..6c30104d --- /dev/null +++ b/ch9-gui-dev/os/mm/memory_set/struct.MemorySet.html @@ -0,0 +1,32 @@ +MemorySet in os::mm::memory_set - Rust
pub struct MemorySet {
+    page_table: PageTable,
+    areas: Vec<MapArea>,
+}

Fields

page_table: PageTableareas: Vec<MapArea>

Implementations

Assume that no conflicts.

+

Mention that trampoline is not collected by areas.

+

Without kernel stacks.

+

Include sections in elf and trampoline, +also returns user_sp_base and entry point.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/page_table/fn.translated_byte_buffer.html b/ch9-gui-dev/os/mm/page_table/fn.translated_byte_buffer.html new file mode 100644 index 00000000..a35e2b62 --- /dev/null +++ b/ch9-gui-dev/os/mm/page_table/fn.translated_byte_buffer.html @@ -0,0 +1 @@ +translated_byte_buffer in os::mm::page_table - Rust
pub fn translated_byte_buffer(
    token: usize,
    ptr: *const u8,
    len: usize
) -> Vec<&'static mut [u8]>
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/page_table/fn.translated_ref.html b/ch9-gui-dev/os/mm/page_table/fn.translated_ref.html new file mode 100644 index 00000000..b97fd53c --- /dev/null +++ b/ch9-gui-dev/os/mm/page_table/fn.translated_ref.html @@ -0,0 +1 @@ +translated_ref in os::mm::page_table - Rust
pub fn translated_ref<T>(token: usize, ptr: *const T) -> &'static T
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/page_table/fn.translated_refmut.html b/ch9-gui-dev/os/mm/page_table/fn.translated_refmut.html new file mode 100644 index 00000000..49a64f43 --- /dev/null +++ b/ch9-gui-dev/os/mm/page_table/fn.translated_refmut.html @@ -0,0 +1 @@ +translated_refmut in os::mm::page_table - Rust
pub fn translated_refmut<T>(token: usize, ptr: *mut T) -> &'static mut T
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/page_table/fn.translated_str.html b/ch9-gui-dev/os/mm/page_table/fn.translated_str.html new file mode 100644 index 00000000..56e5692d --- /dev/null +++ b/ch9-gui-dev/os/mm/page_table/fn.translated_str.html @@ -0,0 +1,2 @@ +translated_str in os::mm::page_table - Rust
pub fn translated_str(token: usize, ptr: *const u8) -> String
Expand description

Load a string from other address spaces into kernel space without an end \0.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/page_table/index.html b/ch9-gui-dev/os/mm/page_table/index.html new file mode 100644 index 00000000..f335083f --- /dev/null +++ b/ch9-gui-dev/os/mm/page_table/index.html @@ -0,0 +1,2 @@ +os::mm::page_table - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/page_table/sidebar-items.js b/ch9-gui-dev/os/mm/page_table/sidebar-items.js new file mode 100644 index 00000000..8707dec1 --- /dev/null +++ b/ch9-gui-dev/os/mm/page_table/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":[["translated_byte_buffer",""],["translated_ref",""],["translated_refmut",""],["translated_str","Load a string from other address spaces into kernel space without an end `\\0`."]],"struct":[["PTEFlags",""],["PageTable",""],["PageTableEntry",""],["UserBuffer",""],["UserBufferIterator",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/mm/page_table/struct.PTEFlags.html b/ch9-gui-dev/os/mm/page_table/struct.PTEFlags.html new file mode 100644 index 00000000..b3a13c1a --- /dev/null +++ b/ch9-gui-dev/os/mm/page_table/struct.PTEFlags.html @@ -0,0 +1,128 @@ +PTEFlags in os::mm::page_table - Rust
pub struct PTEFlags {
+    bits: u8,
+}

Fields

bits: u8

Implementations

Returns an empty set of flags.

+

Returns the set containing all flags.

+

Returns the raw value of the flags currently stored.

+

Convert from underlying bit representation, unless that +representation contains bits that do not correspond to a flag.

+

Convert from underlying bit representation, dropping any bits +that do not correspond to flags.

+

Convert from underlying bit representation, preserving all +bits (even those not corresponding to a defined flag).

+
Safety
+

The caller of the bitflags! macro can chose to allow or +disallow extra bits for their bitflags type.

+

The caller of from_bits_unchecked() has to ensure that +all bits correspond to a defined flag or that extra bits +are valid for this bitflags type.

+

Returns true if no flags are currently stored.

+

Returns true if all flags are currently set.

+

Returns true if there are flags common to both self and other.

+

Returns true if all of the flags in other are contained within self.

+

Inserts the specified flags in-place.

+

Removes the specified flags in-place.

+

Toggles the specified flags in-place.

+

Inserts or removes the specified flags depending on the passed value.

+

Returns the intersection between the flags in self and +other.

+

Specifically, the returned set contains only the flags which are +present in both self and other.

+

This is equivalent to using the & operator (e.g. +ops::BitAnd), as in flags & other.

+

Returns the union of between the flags in self and other.

+

Specifically, the returned set contains all flags which are +present in either self or other, including any which are +present in both (see Self::symmetric_difference if that +is undesirable).

+

This is equivalent to using the | operator (e.g. +ops::BitOr), as in flags | other.

+

Returns the difference between the flags in self and other.

+

Specifically, the returned set contains all flags present in +self, except for the ones present in other.

+

It is also conceptually equivalent to the “bit-clear” operation: +flags & !other (and this syntax is also supported).

+

This is equivalent to using the - operator (e.g. +ops::Sub), as in flags - other.

+

Returns the symmetric difference between the flags +in self and other.

+

Specifically, the returned set contains the flags present which +are present in self or other, but that are not present in +both. Equivalently, it contains the flags present in exactly +one of the sets self and other.

+

This is equivalent to using the ^ operator (e.g. +ops::BitXor), as in flags ^ other.

+

Returns the complement of this set of flags.

+

Specifically, the returned set contains all the flags which are +not set in self, but which are allowed for this type.

+

Alternatively, it can be thought of as the set difference +between Self::all() and self (e.g. Self::all() - self)

+

This is equivalent to using the ! operator (e.g. +ops::Not), as in !flags.

+

Trait Implementations

Formats the value using the given formatter.

+

Returns the intersection between the two sets of flags.

+

The resulting type after applying the & operator.

+

Disables all flags disabled in the set.

+

Returns the union of the two sets of flags.

+

The resulting type after applying the | operator.

+

Adds the set of flags.

+

Returns the left flags, but with all the right flags toggled.

+

The resulting type after applying the ^ operator.

+

Toggles the set of flags.

+

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Extends a collection with the contents of an iterator. Read more

+
🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

+
🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

+

Creates a value from an iterator. Read more

+

Feeds this value into the given Hasher. Read more

+

Feeds a slice of this type into the given Hasher. Read more

+

Formats the value using the given formatter.

+

Returns the complement of this set of flags.

+

The resulting type after applying the ! operator.

+

Formats the value using the given formatter.

+

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

Restrict a value to a certain interval. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more

+

Returns the set difference of the two sets of flags.

+

The resulting type after applying the - operator.

+

Disables all flags enabled in the set.

+

Formats the value using the given formatter.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/page_table/struct.PageTable.html b/ch9-gui-dev/os/mm/page_table/struct.PageTable.html new file mode 100644 index 00000000..1c582bd1 --- /dev/null +++ b/ch9-gui-dev/os/mm/page_table/struct.PageTable.html @@ -0,0 +1,29 @@ +PageTable in os::mm::page_table - Rust
pub struct PageTable {
+    root_ppn: PhysPageNum,
+    frames: Vec<FrameTracker>,
+}

Fields

root_ppn: PhysPageNumframes: Vec<FrameTracker>

Implementations

Assume that it won’t oom when creating/mapping.

+

Temporarily used to get arguments from user space.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/page_table/struct.PageTableEntry.html b/ch9-gui-dev/os/mm/page_table/struct.PageTableEntry.html new file mode 100644 index 00000000..6571de4d --- /dev/null +++ b/ch9-gui-dev/os/mm/page_table/struct.PageTableEntry.html @@ -0,0 +1,31 @@ +PageTableEntry in os::mm::page_table - Rust
#[repr(C)]
pub struct PageTableEntry { + pub bits: usize, +}

Fields

bits: usize

Implementations

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/page_table/struct.UserBuffer.html b/ch9-gui-dev/os/mm/page_table/struct.UserBuffer.html new file mode 100644 index 00000000..e6558c10 --- /dev/null +++ b/ch9-gui-dev/os/mm/page_table/struct.UserBuffer.html @@ -0,0 +1,29 @@ +UserBuffer in os::mm::page_table - Rust
pub struct UserBuffer {
+    pub buffers: Vec<&'static mut [u8]>,
+}

Fields

buffers: Vec<&'static mut [u8]>

Implementations

Trait Implementations

The type of the elements being iterated over.

+

Which kind of iterator are we turning this into?

+

Creates an iterator from a value. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/page_table/struct.UserBufferIterator.html b/ch9-gui-dev/os/mm/page_table/struct.UserBufferIterator.html new file mode 100644 index 00000000..23b96630 --- /dev/null +++ b/ch9-gui-dev/os/mm/page_table/struct.UserBufferIterator.html @@ -0,0 +1,144 @@ +UserBufferIterator in os::mm::page_table - Rust
pub struct UserBufferIterator {
+    buffers: Vec<&'static mut [u8]>,
+    current_buffer: usize,
+    current_idx: usize,
+}

Fields

buffers: Vec<&'static mut [u8]>current_buffer: usizecurrent_idx: usize

Trait Implementations

The type of the elements being iterated over.

+

Advances the iterator and returns the next value. Read more

+
🔬 This is a nightly-only experimental API. (iter_next_chunk)

Advances the iterator and returns an array containing the next N values. Read more

+

Returns the bounds on the remaining length of the iterator. Read more

+

Consumes the iterator, counting the number of iterations and returning it. Read more

+

Consumes the iterator, returning the last element. Read more

+
🔬 This is a nightly-only experimental API. (iter_advance_by)

Advances the iterator by n elements. Read more

+

Returns the nth element of the iterator. Read more

+

Creates an iterator starting at the same point, but stepping by +the given amount at each iteration. Read more

+

Takes two iterators and creates a new iterator over both in sequence. Read more

+

‘Zips up’ two iterators into a single iterator of pairs. Read more

+
🔬 This is a nightly-only experimental API. (iter_intersperse)

Creates a new iterator which places a copy of separator between adjacent +items of the original iterator. Read more

+
🔬 This is a nightly-only experimental API. (iter_intersperse)

Creates a new iterator which places an item generated by separator +between adjacent items of the original iterator. Read more

+

Takes a closure and creates an iterator which calls that closure on each +element. Read more

+

Calls a closure on each element of an iterator. Read more

+

Creates an iterator which uses a closure to determine if an element +should be yielded. Read more

+

Creates an iterator that both filters and maps. Read more

+

Creates an iterator which gives the current iteration count as well as +the next value. Read more

+

Creates an iterator which can use the peek and peek_mut methods +to look at the next element of the iterator without consuming it. See +their documentation for more information. Read more

+

Creates an iterator that skips elements based on a predicate. Read more

+

Creates an iterator that yields elements based on a predicate. Read more

+

Creates an iterator that both yields elements based on a predicate and maps. Read more

+

Creates an iterator that skips the first n elements. Read more

+

Creates an iterator that yields the first n elements, or fewer +if the underlying iterator ends sooner. Read more

+

An iterator adapter similar to fold that holds internal state and +produces a new iterator. Read more

+

Creates an iterator that works like map, but flattens nested structure. Read more

+

Creates an iterator that flattens nested structure. Read more

+

Creates an iterator which ends after the first None. Read more

+

Does something with each element of an iterator, passing the value on. Read more

+

Borrows an iterator, rather than consuming it. Read more

+

Transforms an iterator into a collection. Read more

+
🔬 This is a nightly-only experimental API. (iterator_try_collect)

Fallibly transforms an iterator into a collection, short circuiting if +a failure is encountered. Read more

+
🔬 This is a nightly-only experimental API. (iter_collect_into)

Collects all the items from an iterator into a collection. Read more

+

Consumes an iterator, creating two collections from it. Read more

+
🔬 This is a nightly-only experimental API. (iter_partition_in_place)

Reorders the elements of this iterator in-place according to the given predicate, +such that all those that return true precede all those that return false. +Returns the number of true elements found. Read more

+
🔬 This is a nightly-only experimental API. (iter_is_partitioned)

Checks if the elements of this iterator are partitioned according to the given predicate, +such that all those that return true precede all those that return false. Read more

+

An iterator method that applies a function as long as it returns +successfully, producing a single, final value. Read more

+

An iterator method that applies a fallible function to each item in the +iterator, stopping at the first error and returning that error. Read more

+

Folds every element into an accumulator by applying an operation, +returning the final result. Read more

+

Reduces the elements to a single one, by repeatedly applying a reducing +operation. Read more

+
🔬 This is a nightly-only experimental API. (iterator_try_reduce)

Reduces the elements to a single one by repeatedly applying a reducing operation. If the +closure returns a failure, the failure is propagated back to the caller immediately. Read more

+

Tests if every element of the iterator matches a predicate. Read more

+

Tests if any element of the iterator matches a predicate. Read more

+

Searches for an element of an iterator that satisfies a predicate. Read more

+

Applies function to the elements of iterator and returns +the first non-none result. Read more

+
🔬 This is a nightly-only experimental API. (try_find)

Applies function to the elements of iterator and returns +the first true result or the first error. Read more

+

Searches for an element in an iterator, returning its index. Read more

+

Searches for an element in an iterator from the right, returning its +index. Read more

+

Returns the maximum element of an iterator. Read more

+

Returns the minimum element of an iterator. Read more

+

Returns the element that gives the maximum value from the +specified function. Read more

+

Returns the element that gives the maximum value with respect to the +specified comparison function. Read more

+

Returns the element that gives the minimum value from the +specified function. Read more

+

Returns the element that gives the minimum value with respect to the +specified comparison function. Read more

+

Reverses an iterator’s direction. Read more

+

Converts an iterator of pairs into a pair of containers. Read more

+

Creates an iterator which copies all of its elements. Read more

+

Creates an iterator which clones all of its elements. Read more

+

Repeats an iterator endlessly. Read more

+

Sums the elements of an iterator. Read more

+

Iterates over the entire iterator, multiplying all the elements Read more

+

Lexicographically compares the elements of this Iterator with those +of another. Read more

+
🔬 This is a nightly-only experimental API. (iter_order_by)

Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more

+

Lexicographically compares the elements of this Iterator with those +of another. Read more

+
🔬 This is a nightly-only experimental API. (iter_order_by)

Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more

+

Determines if the elements of this Iterator are equal to those of +another. Read more

+
🔬 This is a nightly-only experimental API. (iter_order_by)

Determines if the elements of this Iterator are equal to those of +another with respect to the specified equality function. Read more

+

Determines if the elements of this Iterator are unequal to those of +another. Read more

+

Determines if the elements of this Iterator are lexicographically +less than those of another. Read more

+

Determines if the elements of this Iterator are lexicographically +less or equal to those of another. Read more

+

Determines if the elements of this Iterator are lexicographically +greater than those of another. Read more

+

Determines if the elements of this Iterator are lexicographically +greater than or equal to those of another. Read more

+
🔬 This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this iterator are sorted. Read more

+
🔬 This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this iterator are sorted using the given comparator function. Read more

+
🔬 This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this iterator are sorted using the given key extraction +function. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

The type of the elements being iterated over.

+

Which kind of iterator are we turning this into?

+

Creates an iterator from a value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/mm/sidebar-items.js b/ch9-gui-dev/os/mm/sidebar-items.js new file mode 100644 index 00000000..e18dfe81 --- /dev/null +++ b/ch9-gui-dev/os/mm/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":[["init",""]],"mod":[["address",""],["frame_allocator",""],["heap_allocator",""],["memory_set",""],["page_table",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/sbi/constant.SBI_CLEAR_IPI.html b/ch9-gui-dev/os/sbi/constant.SBI_CLEAR_IPI.html new file mode 100644 index 00000000..7bd2b4d4 --- /dev/null +++ b/ch9-gui-dev/os/sbi/constant.SBI_CLEAR_IPI.html @@ -0,0 +1 @@ +SBI_CLEAR_IPI in os::sbi - Rust
const SBI_CLEAR_IPI: usize = 3;
\ No newline at end of file diff --git a/ch9-gui-dev/os/sbi/constant.SBI_CONSOLE_GETCHAR.html b/ch9-gui-dev/os/sbi/constant.SBI_CONSOLE_GETCHAR.html new file mode 100644 index 00000000..82709775 --- /dev/null +++ b/ch9-gui-dev/os/sbi/constant.SBI_CONSOLE_GETCHAR.html @@ -0,0 +1 @@ +SBI_CONSOLE_GETCHAR in os::sbi - Rust
const SBI_CONSOLE_GETCHAR: usize = 2;
\ No newline at end of file diff --git a/ch9-gui-dev/os/sbi/constant.SBI_CONSOLE_PUTCHAR.html b/ch9-gui-dev/os/sbi/constant.SBI_CONSOLE_PUTCHAR.html new file mode 100644 index 00000000..10915495 --- /dev/null +++ b/ch9-gui-dev/os/sbi/constant.SBI_CONSOLE_PUTCHAR.html @@ -0,0 +1 @@ +SBI_CONSOLE_PUTCHAR in os::sbi - Rust
const SBI_CONSOLE_PUTCHAR: usize = 1;
\ No newline at end of file diff --git a/ch9-gui-dev/os/sbi/constant.SBI_REMOTE_FENCE_I.html b/ch9-gui-dev/os/sbi/constant.SBI_REMOTE_FENCE_I.html new file mode 100644 index 00000000..a397da74 --- /dev/null +++ b/ch9-gui-dev/os/sbi/constant.SBI_REMOTE_FENCE_I.html @@ -0,0 +1 @@ +SBI_REMOTE_FENCE_I in os::sbi - Rust
const SBI_REMOTE_FENCE_I: usize = 5;
\ No newline at end of file diff --git a/ch9-gui-dev/os/sbi/constant.SBI_REMOTE_SFENCE_VMA.html b/ch9-gui-dev/os/sbi/constant.SBI_REMOTE_SFENCE_VMA.html new file mode 100644 index 00000000..7e80705a --- /dev/null +++ b/ch9-gui-dev/os/sbi/constant.SBI_REMOTE_SFENCE_VMA.html @@ -0,0 +1 @@ +SBI_REMOTE_SFENCE_VMA in os::sbi - Rust
const SBI_REMOTE_SFENCE_VMA: usize = 6;
\ No newline at end of file diff --git a/ch9-gui-dev/os/sbi/constant.SBI_REMOTE_SFENCE_VMA_ASID.html b/ch9-gui-dev/os/sbi/constant.SBI_REMOTE_SFENCE_VMA_ASID.html new file mode 100644 index 00000000..b39b840b --- /dev/null +++ b/ch9-gui-dev/os/sbi/constant.SBI_REMOTE_SFENCE_VMA_ASID.html @@ -0,0 +1 @@ +SBI_REMOTE_SFENCE_VMA_ASID in os::sbi - Rust
const SBI_REMOTE_SFENCE_VMA_ASID: usize = 7;
\ No newline at end of file diff --git a/ch9-gui-dev/os/sbi/constant.SBI_SEND_IPI.html b/ch9-gui-dev/os/sbi/constant.SBI_SEND_IPI.html new file mode 100644 index 00000000..8048e517 --- /dev/null +++ b/ch9-gui-dev/os/sbi/constant.SBI_SEND_IPI.html @@ -0,0 +1 @@ +SBI_SEND_IPI in os::sbi - Rust
const SBI_SEND_IPI: usize = 4;
\ No newline at end of file diff --git a/ch9-gui-dev/os/sbi/constant.SBI_SET_TIMER.html b/ch9-gui-dev/os/sbi/constant.SBI_SET_TIMER.html new file mode 100644 index 00000000..0d9f9f56 --- /dev/null +++ b/ch9-gui-dev/os/sbi/constant.SBI_SET_TIMER.html @@ -0,0 +1 @@ +SBI_SET_TIMER in os::sbi - Rust
const SBI_SET_TIMER: usize = 0;
\ No newline at end of file diff --git a/ch9-gui-dev/os/sbi/constant.SBI_SHUTDOWN.html b/ch9-gui-dev/os/sbi/constant.SBI_SHUTDOWN.html new file mode 100644 index 00000000..1b1a6f91 --- /dev/null +++ b/ch9-gui-dev/os/sbi/constant.SBI_SHUTDOWN.html @@ -0,0 +1 @@ +SBI_SHUTDOWN in os::sbi - Rust
const SBI_SHUTDOWN: usize = 8;
\ No newline at end of file diff --git a/ch9-gui-dev/os/sbi/fn.console_getchar.html b/ch9-gui-dev/os/sbi/fn.console_getchar.html new file mode 100644 index 00000000..1e39dfe2 --- /dev/null +++ b/ch9-gui-dev/os/sbi/fn.console_getchar.html @@ -0,0 +1 @@ +console_getchar in os::sbi - Rust
pub fn console_getchar() -> usize
\ No newline at end of file diff --git a/ch9-gui-dev/os/sbi/fn.console_putchar.html b/ch9-gui-dev/os/sbi/fn.console_putchar.html new file mode 100644 index 00000000..4251a9ab --- /dev/null +++ b/ch9-gui-dev/os/sbi/fn.console_putchar.html @@ -0,0 +1 @@ +console_putchar in os::sbi - Rust
pub fn console_putchar(c: usize)
\ No newline at end of file diff --git a/ch9-gui-dev/os/sbi/fn.sbi_call.html b/ch9-gui-dev/os/sbi/fn.sbi_call.html new file mode 100644 index 00000000..5615c4ea --- /dev/null +++ b/ch9-gui-dev/os/sbi/fn.sbi_call.html @@ -0,0 +1 @@ +sbi_call in os::sbi - Rust

Function os::sbi::sbi_call

source · []
fn sbi_call(which: usize, arg0: usize, arg1: usize, arg2: usize) -> usize
\ No newline at end of file diff --git a/ch9-gui-dev/os/sbi/fn.set_timer.html b/ch9-gui-dev/os/sbi/fn.set_timer.html new file mode 100644 index 00000000..9b902dfb --- /dev/null +++ b/ch9-gui-dev/os/sbi/fn.set_timer.html @@ -0,0 +1 @@ +set_timer in os::sbi - Rust

Function os::sbi::set_timer

source · []
pub fn set_timer(timer: usize)
\ No newline at end of file diff --git a/ch9-gui-dev/os/sbi/fn.shutdown.html b/ch9-gui-dev/os/sbi/fn.shutdown.html new file mode 100644 index 00000000..f021f742 --- /dev/null +++ b/ch9-gui-dev/os/sbi/fn.shutdown.html @@ -0,0 +1 @@ +shutdown in os::sbi - Rust

Function os::sbi::shutdown

source · []
pub fn shutdown(exit_code: usize) -> !
\ No newline at end of file diff --git a/ch9-gui-dev/os/sbi/index.html b/ch9-gui-dev/os/sbi/index.html new file mode 100644 index 00000000..b213183b --- /dev/null +++ b/ch9-gui-dev/os/sbi/index.html @@ -0,0 +1 @@ +os::sbi - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/sbi/sidebar-items.js b/ch9-gui-dev/os/sbi/sidebar-items.js new file mode 100644 index 00000000..87cbb11a --- /dev/null +++ b/ch9-gui-dev/os/sbi/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":[["SBI_CLEAR_IPI",""],["SBI_CONSOLE_GETCHAR",""],["SBI_CONSOLE_PUTCHAR",""],["SBI_REMOTE_FENCE_I",""],["SBI_REMOTE_SFENCE_VMA",""],["SBI_REMOTE_SFENCE_VMA_ASID",""],["SBI_SEND_IPI",""],["SBI_SET_TIMER",""],["SBI_SHUTDOWN",""]],"fn":[["console_getchar",""],["console_putchar",""],["sbi_call",""],["set_timer",""],["shutdown",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/sidebar-items.js b/ch9-gui-dev/os/sidebar-items.js new file mode 100644 index 00000000..983a33b0 --- /dev/null +++ b/ch9-gui-dev/os/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":[["clear_bss",""],["rust_main",""]],"macro":[["print",""],["println",""]],"mod":[["board",""],["config",""],["console",""],["drivers",""],["fs",""],["gui",""],["lang_items",""],["mm",""],["sbi",""],["sync",""],["syscall",""],["task",""],["timer",""],["trap",""]],"struct":[["DEV_NON_BLOCKING_ACCESS",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/struct.DEV_NON_BLOCKING_ACCESS.html b/ch9-gui-dev/os/struct.DEV_NON_BLOCKING_ACCESS.html new file mode 100644 index 00000000..ddbe30a7 --- /dev/null +++ b/ch9-gui-dev/os/struct.DEV_NON_BLOCKING_ACCESS.html @@ -0,0 +1,29 @@ +DEV_NON_BLOCKING_ACCESS in os - Rust
pub struct DEV_NON_BLOCKING_ACCESS {
+    pub(crate) __private_field: (),
+}

Fields

__private_field: ()

Methods from Deref<Target = UPIntrFreeCell<bool>>

Panic if the data has been borrowed.

+

Trait Implementations

The resulting type after dereferencing.

+

Dereferences the value.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/sync/condvar/index.html b/ch9-gui-dev/os/sync/condvar/index.html new file mode 100644 index 00000000..3d233868 --- /dev/null +++ b/ch9-gui-dev/os/sync/condvar/index.html @@ -0,0 +1 @@ +os::sync::condvar - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/sync/condvar/sidebar-items.js b/ch9-gui-dev/os/sync/condvar/sidebar-items.js new file mode 100644 index 00000000..9b8c6253 --- /dev/null +++ b/ch9-gui-dev/os/sync/condvar/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":[["Condvar",""],["CondvarInner",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/sync/condvar/struct.Condvar.html b/ch9-gui-dev/os/sync/condvar/struct.Condvar.html new file mode 100644 index 00000000..762f845e --- /dev/null +++ b/ch9-gui-dev/os/sync/condvar/struct.Condvar.html @@ -0,0 +1,26 @@ +Condvar in os::sync::condvar - Rust
pub struct Condvar {
+    pub inner: UPIntrFreeCell<CondvarInner>,
+}

Fields

inner: UPIntrFreeCell<CondvarInner>

Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/sync/condvar/struct.CondvarInner.html b/ch9-gui-dev/os/sync/condvar/struct.CondvarInner.html new file mode 100644 index 00000000..174a610f --- /dev/null +++ b/ch9-gui-dev/os/sync/condvar/struct.CondvarInner.html @@ -0,0 +1,26 @@ +CondvarInner in os::sync::condvar - Rust
pub struct CondvarInner {
+    pub wait_queue: VecDeque<Arc<TaskControlBlock>>,
+}

Fields

wait_queue: VecDeque<Arc<TaskControlBlock>>

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/sync/index.html b/ch9-gui-dev/os/sync/index.html new file mode 100644 index 00000000..4e3008f2 --- /dev/null +++ b/ch9-gui-dev/os/sync/index.html @@ -0,0 +1 @@ +os::sync - Rust

Module os::sync

source · []

Re-exports

pub use condvar::Condvar;
pub use mutex::Mutex;
pub use mutex::MutexBlocking;
pub use mutex::MutexSpin;
pub use semaphore::Semaphore;
pub use up::UPIntrFreeCell;
pub use up::UPIntrRefMut;

Modules

condvar 🔒
mutex 🔒
semaphore 🔒
up 🔒
\ No newline at end of file diff --git a/ch9-gui-dev/os/sync/mutex/index.html b/ch9-gui-dev/os/sync/mutex/index.html new file mode 100644 index 00000000..d2e500db --- /dev/null +++ b/ch9-gui-dev/os/sync/mutex/index.html @@ -0,0 +1 @@ +os::sync::mutex - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/sync/mutex/sidebar-items.js b/ch9-gui-dev/os/sync/mutex/sidebar-items.js new file mode 100644 index 00000000..678629d0 --- /dev/null +++ b/ch9-gui-dev/os/sync/mutex/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":[["MutexBlocking",""],["MutexBlockingInner",""],["MutexSpin",""]],"trait":[["Mutex",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/sync/mutex/struct.MutexBlocking.html b/ch9-gui-dev/os/sync/mutex/struct.MutexBlocking.html new file mode 100644 index 00000000..21ab8fe3 --- /dev/null +++ b/ch9-gui-dev/os/sync/mutex/struct.MutexBlocking.html @@ -0,0 +1,26 @@ +MutexBlocking in os::sync::mutex - Rust
pub struct MutexBlocking {
+    inner: UPIntrFreeCell<MutexBlockingInner>,
+}

Fields

inner: UPIntrFreeCell<MutexBlockingInner>

Implementations

Trait Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/sync/mutex/struct.MutexBlockingInner.html b/ch9-gui-dev/os/sync/mutex/struct.MutexBlockingInner.html new file mode 100644 index 00000000..51270e15 --- /dev/null +++ b/ch9-gui-dev/os/sync/mutex/struct.MutexBlockingInner.html @@ -0,0 +1,27 @@ +MutexBlockingInner in os::sync::mutex - Rust
pub struct MutexBlockingInner {
+    locked: bool,
+    wait_queue: VecDeque<Arc<TaskControlBlock>>,
+}

Fields

locked: boolwait_queue: VecDeque<Arc<TaskControlBlock>>

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/sync/mutex/struct.MutexSpin.html b/ch9-gui-dev/os/sync/mutex/struct.MutexSpin.html new file mode 100644 index 00000000..c62b9a1d --- /dev/null +++ b/ch9-gui-dev/os/sync/mutex/struct.MutexSpin.html @@ -0,0 +1,26 @@ +MutexSpin in os::sync::mutex - Rust
pub struct MutexSpin {
+    locked: UPIntrFreeCell<bool>,
+}

Fields

locked: UPIntrFreeCell<bool>

Implementations

Trait Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/sync/mutex/trait.Mutex.html b/ch9-gui-dev/os/sync/mutex/trait.Mutex.html new file mode 100644 index 00000000..018cad08 --- /dev/null +++ b/ch9-gui-dev/os/sync/mutex/trait.Mutex.html @@ -0,0 +1,4 @@ +Mutex in os::sync::mutex - Rust
pub trait Mutex: Sync + Send {
+    fn lock(&self);
+    fn unlock(&self);
+}

Required Methods

Implementors

\ No newline at end of file diff --git a/ch9-gui-dev/os/sync/semaphore/index.html b/ch9-gui-dev/os/sync/semaphore/index.html new file mode 100644 index 00000000..d2282eee --- /dev/null +++ b/ch9-gui-dev/os/sync/semaphore/index.html @@ -0,0 +1 @@ +os::sync::semaphore - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/sync/semaphore/sidebar-items.js b/ch9-gui-dev/os/sync/semaphore/sidebar-items.js new file mode 100644 index 00000000..eb712180 --- /dev/null +++ b/ch9-gui-dev/os/sync/semaphore/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":[["Semaphore",""],["SemaphoreInner",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/sync/semaphore/struct.Semaphore.html b/ch9-gui-dev/os/sync/semaphore/struct.Semaphore.html new file mode 100644 index 00000000..e1de2fb6 --- /dev/null +++ b/ch9-gui-dev/os/sync/semaphore/struct.Semaphore.html @@ -0,0 +1,26 @@ +Semaphore in os::sync::semaphore - Rust
pub struct Semaphore {
+    pub inner: UPIntrFreeCell<SemaphoreInner>,
+}

Fields

inner: UPIntrFreeCell<SemaphoreInner>

Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/sync/semaphore/struct.SemaphoreInner.html b/ch9-gui-dev/os/sync/semaphore/struct.SemaphoreInner.html new file mode 100644 index 00000000..2b461a8d --- /dev/null +++ b/ch9-gui-dev/os/sync/semaphore/struct.SemaphoreInner.html @@ -0,0 +1,27 @@ +SemaphoreInner in os::sync::semaphore - Rust
pub struct SemaphoreInner {
+    pub count: isize,
+    pub wait_queue: VecDeque<Arc<TaskControlBlock>>,
+}

Fields

count: isizewait_queue: VecDeque<Arc<TaskControlBlock>>

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/sync/sidebar-items.js b/ch9-gui-dev/os/sync/sidebar-items.js new file mode 100644 index 00000000..1ee8d463 --- /dev/null +++ b/ch9-gui-dev/os/sync/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":[["condvar",""],["mutex",""],["semaphore",""],["up",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/sync/up/index.html b/ch9-gui-dev/os/sync/up/index.html new file mode 100644 index 00000000..8f591d47 --- /dev/null +++ b/ch9-gui-dev/os/sync/up/index.html @@ -0,0 +1 @@ +os::sync::up - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/sync/up/sidebar-items.js b/ch9-gui-dev/os/sync/up/sidebar-items.js new file mode 100644 index 00000000..6494946f --- /dev/null +++ b/ch9-gui-dev/os/sync/up/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":[["INTR_MASKING_INFO",""],["IntrMaskingInfo",""],["UPIntrFreeCell",""],["UPIntrRefMut",""],["UPSafeCellRaw",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/sync/up/struct.INTR_MASKING_INFO.html b/ch9-gui-dev/os/sync/up/struct.INTR_MASKING_INFO.html new file mode 100644 index 00000000..0b5024f1 --- /dev/null +++ b/ch9-gui-dev/os/sync/up/struct.INTR_MASKING_INFO.html @@ -0,0 +1,28 @@ +INTR_MASKING_INFO in os::sync::up - Rust
struct INTR_MASKING_INFO {
+    __private_field: (),
+}

Fields

__private_field: ()

Methods from Deref<Target = UPSafeCellRaw<IntrMaskingInfo>>

Trait Implementations

The resulting type after dereferencing.

+

Dereferences the value.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/sync/up/struct.IntrMaskingInfo.html b/ch9-gui-dev/os/sync/up/struct.IntrMaskingInfo.html new file mode 100644 index 00000000..569888ca --- /dev/null +++ b/ch9-gui-dev/os/sync/up/struct.IntrMaskingInfo.html @@ -0,0 +1,27 @@ +IntrMaskingInfo in os::sync::up - Rust
pub struct IntrMaskingInfo {
+    nested_level: usize,
+    sie_before_masking: bool,
+}

Fields

nested_level: usizesie_before_masking: bool

Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/sync/up/struct.UPIntrFreeCell.html b/ch9-gui-dev/os/sync/up/struct.UPIntrFreeCell.html new file mode 100644 index 00000000..dfbd9f3f --- /dev/null +++ b/ch9-gui-dev/os/sync/up/struct.UPIntrFreeCell.html @@ -0,0 +1,28 @@ +UPIntrFreeCell in os::sync::up - Rust
pub struct UPIntrFreeCell<T> {
+    inner: RefCell<T>,
+}

Fields

inner: RefCell<T>

inner data

+

Implementations

Panic if the data has been borrowed.

+

Trait Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/sync/up/struct.UPIntrRefMut.html b/ch9-gui-dev/os/sync/up/struct.UPIntrRefMut.html new file mode 100644 index 00000000..3879a42c --- /dev/null +++ b/ch9-gui-dev/os/sync/up/struct.UPIntrRefMut.html @@ -0,0 +1,28 @@ +UPIntrRefMut in os::sync::up - Rust
pub struct UPIntrRefMut<'a, T>(Option<RefMut<'a, T>>);

Tuple Fields

0: Option<RefMut<'a, T>>

Trait Implementations

The resulting type after dereferencing.

+

Dereferences the value.

+

Mutably dereferences the value.

+

Executes the destructor for this type. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/sync/up/struct.UPSafeCellRaw.html b/ch9-gui-dev/os/sync/up/struct.UPSafeCellRaw.html new file mode 100644 index 00000000..f53ef2c6 --- /dev/null +++ b/ch9-gui-dev/os/sync/up/struct.UPSafeCellRaw.html @@ -0,0 +1,26 @@ +UPSafeCellRaw in os::sync::up - Rust
pub struct UPSafeCellRaw<T> {
+    inner: UnsafeCell<T>,
+}

Fields

inner: UnsafeCell<T>

Implementations

Trait Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_CLOSE.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_CLOSE.html new file mode 100644 index 00000000..71982e73 --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_CLOSE.html @@ -0,0 +1 @@ +SYSCALL_CLOSE in os::syscall - Rust
const SYSCALL_CLOSE: usize = 57;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_CONDVAR_CREATE.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_CONDVAR_CREATE.html new file mode 100644 index 00000000..4b82d1f9 --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_CONDVAR_CREATE.html @@ -0,0 +1 @@ +SYSCALL_CONDVAR_CREATE in os::syscall - Rust
const SYSCALL_CONDVAR_CREATE: usize = 1030;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_CONDVAR_SIGNAL.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_CONDVAR_SIGNAL.html new file mode 100644 index 00000000..f8956fd8 --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_CONDVAR_SIGNAL.html @@ -0,0 +1 @@ +SYSCALL_CONDVAR_SIGNAL in os::syscall - Rust
const SYSCALL_CONDVAR_SIGNAL: usize = 1031;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_CONDVAR_WAIT.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_CONDVAR_WAIT.html new file mode 100644 index 00000000..a94489cc --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_CONDVAR_WAIT.html @@ -0,0 +1 @@ +SYSCALL_CONDVAR_WAIT in os::syscall - Rust
const SYSCALL_CONDVAR_WAIT: usize = 1032;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_DUP.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_DUP.html new file mode 100644 index 00000000..44810414 --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_DUP.html @@ -0,0 +1 @@ +SYSCALL_DUP in os::syscall - Rust
const SYSCALL_DUP: usize = 24;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_EXEC.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_EXEC.html new file mode 100644 index 00000000..35dc36ba --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_EXEC.html @@ -0,0 +1 @@ +SYSCALL_EXEC in os::syscall - Rust
const SYSCALL_EXEC: usize = 221;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_EXIT.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_EXIT.html new file mode 100644 index 00000000..482c7d1d --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_EXIT.html @@ -0,0 +1 @@ +SYSCALL_EXIT in os::syscall - Rust
const SYSCALL_EXIT: usize = 93;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_FORK.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_FORK.html new file mode 100644 index 00000000..726ca8e3 --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_FORK.html @@ -0,0 +1 @@ +SYSCALL_FORK in os::syscall - Rust
const SYSCALL_FORK: usize = 220;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_FRAMEBUFFER.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_FRAMEBUFFER.html new file mode 100644 index 00000000..2ad0cc05 --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_FRAMEBUFFER.html @@ -0,0 +1 @@ +SYSCALL_FRAMEBUFFER in os::syscall - Rust
const SYSCALL_FRAMEBUFFER: usize = 2000;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_FRAMEBUFFER_FLUSH.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_FRAMEBUFFER_FLUSH.html new file mode 100644 index 00000000..b4e8b3aa --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_FRAMEBUFFER_FLUSH.html @@ -0,0 +1 @@ +SYSCALL_FRAMEBUFFER_FLUSH in os::syscall - Rust
const SYSCALL_FRAMEBUFFER_FLUSH: usize = 2001;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_GETPID.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_GETPID.html new file mode 100644 index 00000000..0df958d2 --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_GETPID.html @@ -0,0 +1 @@ +SYSCALL_GETPID in os::syscall - Rust
const SYSCALL_GETPID: usize = 172;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_GETTID.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_GETTID.html new file mode 100644 index 00000000..f832c884 --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_GETTID.html @@ -0,0 +1 @@ +SYSCALL_GETTID in os::syscall - Rust
const SYSCALL_GETTID: usize = 1001;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_GET_TIME.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_GET_TIME.html new file mode 100644 index 00000000..580e8032 --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_GET_TIME.html @@ -0,0 +1 @@ +SYSCALL_GET_TIME in os::syscall - Rust
const SYSCALL_GET_TIME: usize = 169;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_KILL.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_KILL.html new file mode 100644 index 00000000..42154400 --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_KILL.html @@ -0,0 +1 @@ +SYSCALL_KILL in os::syscall - Rust
const SYSCALL_KILL: usize = 129;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_MUTEX_CREATE.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_MUTEX_CREATE.html new file mode 100644 index 00000000..87e29d2c --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_MUTEX_CREATE.html @@ -0,0 +1 @@ +SYSCALL_MUTEX_CREATE in os::syscall - Rust
const SYSCALL_MUTEX_CREATE: usize = 1010;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_MUTEX_LOCK.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_MUTEX_LOCK.html new file mode 100644 index 00000000..a4bda549 --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_MUTEX_LOCK.html @@ -0,0 +1 @@ +SYSCALL_MUTEX_LOCK in os::syscall - Rust
const SYSCALL_MUTEX_LOCK: usize = 1011;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_MUTEX_UNLOCK.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_MUTEX_UNLOCK.html new file mode 100644 index 00000000..e2856686 --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_MUTEX_UNLOCK.html @@ -0,0 +1 @@ +SYSCALL_MUTEX_UNLOCK in os::syscall - Rust
const SYSCALL_MUTEX_UNLOCK: usize = 1012;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_OPEN.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_OPEN.html new file mode 100644 index 00000000..7292a72e --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_OPEN.html @@ -0,0 +1 @@ +SYSCALL_OPEN in os::syscall - Rust
const SYSCALL_OPEN: usize = 56;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_PIPE.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_PIPE.html new file mode 100644 index 00000000..eed559de --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_PIPE.html @@ -0,0 +1 @@ +SYSCALL_PIPE in os::syscall - Rust
const SYSCALL_PIPE: usize = 59;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_READ.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_READ.html new file mode 100644 index 00000000..820a3d9a --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_READ.html @@ -0,0 +1 @@ +SYSCALL_READ in os::syscall - Rust
const SYSCALL_READ: usize = 63;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_SEMAPHORE_CREATE.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_SEMAPHORE_CREATE.html new file mode 100644 index 00000000..9f40f264 --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_SEMAPHORE_CREATE.html @@ -0,0 +1 @@ +SYSCALL_SEMAPHORE_CREATE in os::syscall - Rust
const SYSCALL_SEMAPHORE_CREATE: usize = 1020;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_SEMAPHORE_DOWN.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_SEMAPHORE_DOWN.html new file mode 100644 index 00000000..15ca1e88 --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_SEMAPHORE_DOWN.html @@ -0,0 +1 @@ +SYSCALL_SEMAPHORE_DOWN in os::syscall - Rust
const SYSCALL_SEMAPHORE_DOWN: usize = 1022;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_SEMAPHORE_UP.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_SEMAPHORE_UP.html new file mode 100644 index 00000000..930b6efe --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_SEMAPHORE_UP.html @@ -0,0 +1 @@ +SYSCALL_SEMAPHORE_UP in os::syscall - Rust
const SYSCALL_SEMAPHORE_UP: usize = 1021;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_SLEEP.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_SLEEP.html new file mode 100644 index 00000000..305886d9 --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_SLEEP.html @@ -0,0 +1 @@ +SYSCALL_SLEEP in os::syscall - Rust
const SYSCALL_SLEEP: usize = 101;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_THREAD_CREATE.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_THREAD_CREATE.html new file mode 100644 index 00000000..8ee32bc5 --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_THREAD_CREATE.html @@ -0,0 +1 @@ +SYSCALL_THREAD_CREATE in os::syscall - Rust
const SYSCALL_THREAD_CREATE: usize = 1000;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_WAITPID.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_WAITPID.html new file mode 100644 index 00000000..09d7b21a --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_WAITPID.html @@ -0,0 +1 @@ +SYSCALL_WAITPID in os::syscall - Rust
const SYSCALL_WAITPID: usize = 260;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_WAITTID.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_WAITTID.html new file mode 100644 index 00000000..b41c380c --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_WAITTID.html @@ -0,0 +1 @@ +SYSCALL_WAITTID in os::syscall - Rust
const SYSCALL_WAITTID: usize = 1002;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_WRITE.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_WRITE.html new file mode 100644 index 00000000..a143c171 --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_WRITE.html @@ -0,0 +1 @@ +SYSCALL_WRITE in os::syscall - Rust
const SYSCALL_WRITE: usize = 64;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/constant.SYSCALL_YIELD.html b/ch9-gui-dev/os/syscall/constant.SYSCALL_YIELD.html new file mode 100644 index 00000000..c6ea904b --- /dev/null +++ b/ch9-gui-dev/os/syscall/constant.SYSCALL_YIELD.html @@ -0,0 +1 @@ +SYSCALL_YIELD in os::syscall - Rust
const SYSCALL_YIELD: usize = 124;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/fn.syscall.html b/ch9-gui-dev/os/syscall/fn.syscall.html new file mode 100644 index 00000000..c472d123 --- /dev/null +++ b/ch9-gui-dev/os/syscall/fn.syscall.html @@ -0,0 +1 @@ +syscall in os::syscall - Rust
pub fn syscall(syscall_id: usize, args: [usize; 3]) -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/fs/fn.sys_close.html b/ch9-gui-dev/os/syscall/fs/fn.sys_close.html new file mode 100644 index 00000000..d50436e6 --- /dev/null +++ b/ch9-gui-dev/os/syscall/fs/fn.sys_close.html @@ -0,0 +1 @@ +sys_close in os::syscall::fs - Rust
pub fn sys_close(fd: usize) -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/fs/fn.sys_dup.html b/ch9-gui-dev/os/syscall/fs/fn.sys_dup.html new file mode 100644 index 00000000..a827e37f --- /dev/null +++ b/ch9-gui-dev/os/syscall/fs/fn.sys_dup.html @@ -0,0 +1 @@ +sys_dup in os::syscall::fs - Rust
pub fn sys_dup(fd: usize) -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/fs/fn.sys_open.html b/ch9-gui-dev/os/syscall/fs/fn.sys_open.html new file mode 100644 index 00000000..d42090eb --- /dev/null +++ b/ch9-gui-dev/os/syscall/fs/fn.sys_open.html @@ -0,0 +1 @@ +sys_open in os::syscall::fs - Rust
pub fn sys_open(path: *const u8, flags: u32) -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/fs/fn.sys_pipe.html b/ch9-gui-dev/os/syscall/fs/fn.sys_pipe.html new file mode 100644 index 00000000..1ef5ea2d --- /dev/null +++ b/ch9-gui-dev/os/syscall/fs/fn.sys_pipe.html @@ -0,0 +1 @@ +sys_pipe in os::syscall::fs - Rust
pub fn sys_pipe(pipe: *mut usize) -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/fs/fn.sys_read.html b/ch9-gui-dev/os/syscall/fs/fn.sys_read.html new file mode 100644 index 00000000..bf9eedc5 --- /dev/null +++ b/ch9-gui-dev/os/syscall/fs/fn.sys_read.html @@ -0,0 +1 @@ +sys_read in os::syscall::fs - Rust
pub fn sys_read(fd: usize, buf: *const u8, len: usize) -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/fs/fn.sys_write.html b/ch9-gui-dev/os/syscall/fs/fn.sys_write.html new file mode 100644 index 00000000..47ea4762 --- /dev/null +++ b/ch9-gui-dev/os/syscall/fs/fn.sys_write.html @@ -0,0 +1 @@ +sys_write in os::syscall::fs - Rust
pub fn sys_write(fd: usize, buf: *const u8, len: usize) -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/fs/index.html b/ch9-gui-dev/os/syscall/fs/index.html new file mode 100644 index 00000000..8ef27c25 --- /dev/null +++ b/ch9-gui-dev/os/syscall/fs/index.html @@ -0,0 +1 @@ +os::syscall::fs - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/fs/sidebar-items.js b/ch9-gui-dev/os/syscall/fs/sidebar-items.js new file mode 100644 index 00000000..6c15f91e --- /dev/null +++ b/ch9-gui-dev/os/syscall/fs/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":[["sys_close",""],["sys_dup",""],["sys_open",""],["sys_pipe",""],["sys_read",""],["sys_write",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/gui/constant.FB_VADDR.html b/ch9-gui-dev/os/syscall/gui/constant.FB_VADDR.html new file mode 100644 index 00000000..7669cc38 --- /dev/null +++ b/ch9-gui-dev/os/syscall/gui/constant.FB_VADDR.html @@ -0,0 +1 @@ +FB_VADDR in os::syscall::gui - Rust
const FB_VADDR: usize = 0x10000000;
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/gui/fn.sys_framebuffer.html b/ch9-gui-dev/os/syscall/gui/fn.sys_framebuffer.html new file mode 100644 index 00000000..a96bc8e7 --- /dev/null +++ b/ch9-gui-dev/os/syscall/gui/fn.sys_framebuffer.html @@ -0,0 +1 @@ +sys_framebuffer in os::syscall::gui - Rust
pub fn sys_framebuffer() -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/gui/fn.sys_framebuffer_flush.html b/ch9-gui-dev/os/syscall/gui/fn.sys_framebuffer_flush.html new file mode 100644 index 00000000..02ebf608 --- /dev/null +++ b/ch9-gui-dev/os/syscall/gui/fn.sys_framebuffer_flush.html @@ -0,0 +1 @@ +sys_framebuffer_flush in os::syscall::gui - Rust
pub fn sys_framebuffer_flush() -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/gui/index.html b/ch9-gui-dev/os/syscall/gui/index.html new file mode 100644 index 00000000..3b94ca55 --- /dev/null +++ b/ch9-gui-dev/os/syscall/gui/index.html @@ -0,0 +1 @@ +os::syscall::gui - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/gui/sidebar-items.js b/ch9-gui-dev/os/syscall/gui/sidebar-items.js new file mode 100644 index 00000000..a7b6f249 --- /dev/null +++ b/ch9-gui-dev/os/syscall/gui/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":[["FB_VADDR",""]],"fn":[["sys_framebuffer",""],["sys_framebuffer_flush",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/index.html b/ch9-gui-dev/os/syscall/index.html new file mode 100644 index 00000000..d6b735f4 --- /dev/null +++ b/ch9-gui-dev/os/syscall/index.html @@ -0,0 +1 @@ +os::syscall - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/process/fn.sys_exec.html b/ch9-gui-dev/os/syscall/process/fn.sys_exec.html new file mode 100644 index 00000000..9fbc67be --- /dev/null +++ b/ch9-gui-dev/os/syscall/process/fn.sys_exec.html @@ -0,0 +1 @@ +sys_exec in os::syscall::process - Rust
pub fn sys_exec(path: *const u8, args: *const usize) -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/process/fn.sys_exit.html b/ch9-gui-dev/os/syscall/process/fn.sys_exit.html new file mode 100644 index 00000000..2fb3783a --- /dev/null +++ b/ch9-gui-dev/os/syscall/process/fn.sys_exit.html @@ -0,0 +1 @@ +sys_exit in os::syscall::process - Rust
pub fn sys_exit(exit_code: i32) -> !
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/process/fn.sys_fork.html b/ch9-gui-dev/os/syscall/process/fn.sys_fork.html new file mode 100644 index 00000000..69c79947 --- /dev/null +++ b/ch9-gui-dev/os/syscall/process/fn.sys_fork.html @@ -0,0 +1 @@ +sys_fork in os::syscall::process - Rust
pub fn sys_fork() -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/process/fn.sys_get_time.html b/ch9-gui-dev/os/syscall/process/fn.sys_get_time.html new file mode 100644 index 00000000..64d6d421 --- /dev/null +++ b/ch9-gui-dev/os/syscall/process/fn.sys_get_time.html @@ -0,0 +1 @@ +sys_get_time in os::syscall::process - Rust
pub fn sys_get_time() -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/process/fn.sys_getpid.html b/ch9-gui-dev/os/syscall/process/fn.sys_getpid.html new file mode 100644 index 00000000..d0117492 --- /dev/null +++ b/ch9-gui-dev/os/syscall/process/fn.sys_getpid.html @@ -0,0 +1 @@ +sys_getpid in os::syscall::process - Rust
pub fn sys_getpid() -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/process/fn.sys_kill.html b/ch9-gui-dev/os/syscall/process/fn.sys_kill.html new file mode 100644 index 00000000..a4a096e2 --- /dev/null +++ b/ch9-gui-dev/os/syscall/process/fn.sys_kill.html @@ -0,0 +1 @@ +sys_kill in os::syscall::process - Rust
pub fn sys_kill(pid: usize, signal: u32) -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/process/fn.sys_waitpid.html b/ch9-gui-dev/os/syscall/process/fn.sys_waitpid.html new file mode 100644 index 00000000..fa2f4357 --- /dev/null +++ b/ch9-gui-dev/os/syscall/process/fn.sys_waitpid.html @@ -0,0 +1,3 @@ +sys_waitpid in os::syscall::process - Rust
pub fn sys_waitpid(pid: isize, exit_code_ptr: *mut i32) -> isize
Expand description

If there is not a child process whose pid is same as given, return -1. +Else if there is a child process but it is still running, return -2.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/process/fn.sys_yield.html b/ch9-gui-dev/os/syscall/process/fn.sys_yield.html new file mode 100644 index 00000000..f7b15e56 --- /dev/null +++ b/ch9-gui-dev/os/syscall/process/fn.sys_yield.html @@ -0,0 +1 @@ +sys_yield in os::syscall::process - Rust
pub fn sys_yield() -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/process/index.html b/ch9-gui-dev/os/syscall/process/index.html new file mode 100644 index 00000000..1595a357 --- /dev/null +++ b/ch9-gui-dev/os/syscall/process/index.html @@ -0,0 +1,3 @@ +os::syscall::process - Rust

Functions

If there is not a child process whose pid is same as given, return -1. +Else if there is a child process but it is still running, return -2.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/process/sidebar-items.js b/ch9-gui-dev/os/syscall/process/sidebar-items.js new file mode 100644 index 00000000..dc9db2de --- /dev/null +++ b/ch9-gui-dev/os/syscall/process/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":[["sys_exec",""],["sys_exit",""],["sys_fork",""],["sys_get_time",""],["sys_getpid",""],["sys_kill",""],["sys_waitpid","If there is not a child process whose pid is same as given, return -1. Else if there is a child process but it is still running, return -2."],["sys_yield",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/sidebar-items.js b/ch9-gui-dev/os/syscall/sidebar-items.js new file mode 100644 index 00000000..9b83c12d --- /dev/null +++ b/ch9-gui-dev/os/syscall/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":[["SYSCALL_CLOSE",""],["SYSCALL_CONDVAR_CREATE",""],["SYSCALL_CONDVAR_SIGNAL",""],["SYSCALL_CONDVAR_WAIT",""],["SYSCALL_DUP",""],["SYSCALL_EXEC",""],["SYSCALL_EXIT",""],["SYSCALL_FORK",""],["SYSCALL_FRAMEBUFFER",""],["SYSCALL_FRAMEBUFFER_FLUSH",""],["SYSCALL_GETPID",""],["SYSCALL_GETTID",""],["SYSCALL_GET_TIME",""],["SYSCALL_KILL",""],["SYSCALL_MUTEX_CREATE",""],["SYSCALL_MUTEX_LOCK",""],["SYSCALL_MUTEX_UNLOCK",""],["SYSCALL_OPEN",""],["SYSCALL_PIPE",""],["SYSCALL_READ",""],["SYSCALL_SEMAPHORE_CREATE",""],["SYSCALL_SEMAPHORE_DOWN",""],["SYSCALL_SEMAPHORE_UP",""],["SYSCALL_SLEEP",""],["SYSCALL_THREAD_CREATE",""],["SYSCALL_WAITPID",""],["SYSCALL_WAITTID",""],["SYSCALL_WRITE",""],["SYSCALL_YIELD",""]],"fn":[["syscall",""]],"mod":[["fs",""],["gui",""],["process",""],["sync",""],["thread",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/sync/fn.sys_condvar_create.html b/ch9-gui-dev/os/syscall/sync/fn.sys_condvar_create.html new file mode 100644 index 00000000..28ef966c --- /dev/null +++ b/ch9-gui-dev/os/syscall/sync/fn.sys_condvar_create.html @@ -0,0 +1 @@ +sys_condvar_create in os::syscall::sync - Rust
pub fn sys_condvar_create(_arg: usize) -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/sync/fn.sys_condvar_signal.html b/ch9-gui-dev/os/syscall/sync/fn.sys_condvar_signal.html new file mode 100644 index 00000000..66feaf3b --- /dev/null +++ b/ch9-gui-dev/os/syscall/sync/fn.sys_condvar_signal.html @@ -0,0 +1 @@ +sys_condvar_signal in os::syscall::sync - Rust
pub fn sys_condvar_signal(condvar_id: usize) -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/sync/fn.sys_condvar_wait.html b/ch9-gui-dev/os/syscall/sync/fn.sys_condvar_wait.html new file mode 100644 index 00000000..cdcc882d --- /dev/null +++ b/ch9-gui-dev/os/syscall/sync/fn.sys_condvar_wait.html @@ -0,0 +1 @@ +sys_condvar_wait in os::syscall::sync - Rust
pub fn sys_condvar_wait(condvar_id: usize, mutex_id: usize) -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/sync/fn.sys_mutex_create.html b/ch9-gui-dev/os/syscall/sync/fn.sys_mutex_create.html new file mode 100644 index 00000000..5f3511d1 --- /dev/null +++ b/ch9-gui-dev/os/syscall/sync/fn.sys_mutex_create.html @@ -0,0 +1 @@ +sys_mutex_create in os::syscall::sync - Rust
pub fn sys_mutex_create(blocking: bool) -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/sync/fn.sys_mutex_lock.html b/ch9-gui-dev/os/syscall/sync/fn.sys_mutex_lock.html new file mode 100644 index 00000000..0326bfcd --- /dev/null +++ b/ch9-gui-dev/os/syscall/sync/fn.sys_mutex_lock.html @@ -0,0 +1 @@ +sys_mutex_lock in os::syscall::sync - Rust
pub fn sys_mutex_lock(mutex_id: usize) -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/sync/fn.sys_mutex_unlock.html b/ch9-gui-dev/os/syscall/sync/fn.sys_mutex_unlock.html new file mode 100644 index 00000000..ccf1ed10 --- /dev/null +++ b/ch9-gui-dev/os/syscall/sync/fn.sys_mutex_unlock.html @@ -0,0 +1 @@ +sys_mutex_unlock in os::syscall::sync - Rust
pub fn sys_mutex_unlock(mutex_id: usize) -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/sync/fn.sys_semaphore_create.html b/ch9-gui-dev/os/syscall/sync/fn.sys_semaphore_create.html new file mode 100644 index 00000000..cb9eeb36 --- /dev/null +++ b/ch9-gui-dev/os/syscall/sync/fn.sys_semaphore_create.html @@ -0,0 +1 @@ +sys_semaphore_create in os::syscall::sync - Rust
pub fn sys_semaphore_create(res_count: usize) -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/sync/fn.sys_semaphore_down.html b/ch9-gui-dev/os/syscall/sync/fn.sys_semaphore_down.html new file mode 100644 index 00000000..0bfdab55 --- /dev/null +++ b/ch9-gui-dev/os/syscall/sync/fn.sys_semaphore_down.html @@ -0,0 +1 @@ +sys_semaphore_down in os::syscall::sync - Rust
pub fn sys_semaphore_down(sem_id: usize) -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/sync/fn.sys_semaphore_up.html b/ch9-gui-dev/os/syscall/sync/fn.sys_semaphore_up.html new file mode 100644 index 00000000..5980490f --- /dev/null +++ b/ch9-gui-dev/os/syscall/sync/fn.sys_semaphore_up.html @@ -0,0 +1 @@ +sys_semaphore_up in os::syscall::sync - Rust
pub fn sys_semaphore_up(sem_id: usize) -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/sync/fn.sys_sleep.html b/ch9-gui-dev/os/syscall/sync/fn.sys_sleep.html new file mode 100644 index 00000000..9c477e60 --- /dev/null +++ b/ch9-gui-dev/os/syscall/sync/fn.sys_sleep.html @@ -0,0 +1 @@ +sys_sleep in os::syscall::sync - Rust
pub fn sys_sleep(ms: usize) -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/sync/index.html b/ch9-gui-dev/os/syscall/sync/index.html new file mode 100644 index 00000000..4254e121 --- /dev/null +++ b/ch9-gui-dev/os/syscall/sync/index.html @@ -0,0 +1 @@ +os::syscall::sync - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/sync/sidebar-items.js b/ch9-gui-dev/os/syscall/sync/sidebar-items.js new file mode 100644 index 00000000..61767564 --- /dev/null +++ b/ch9-gui-dev/os/syscall/sync/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":[["sys_condvar_create",""],["sys_condvar_signal",""],["sys_condvar_wait",""],["sys_mutex_create",""],["sys_mutex_lock",""],["sys_mutex_unlock",""],["sys_semaphore_create",""],["sys_semaphore_down",""],["sys_semaphore_up",""],["sys_sleep",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/thread/fn.sys_gettid.html b/ch9-gui-dev/os/syscall/thread/fn.sys_gettid.html new file mode 100644 index 00000000..f0ff4922 --- /dev/null +++ b/ch9-gui-dev/os/syscall/thread/fn.sys_gettid.html @@ -0,0 +1 @@ +sys_gettid in os::syscall::thread - Rust
pub fn sys_gettid() -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/thread/fn.sys_thread_create.html b/ch9-gui-dev/os/syscall/thread/fn.sys_thread_create.html new file mode 100644 index 00000000..08d04a7f --- /dev/null +++ b/ch9-gui-dev/os/syscall/thread/fn.sys_thread_create.html @@ -0,0 +1 @@ +sys_thread_create in os::syscall::thread - Rust
pub fn sys_thread_create(entry: usize, arg: usize) -> isize
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/thread/fn.sys_waittid.html b/ch9-gui-dev/os/syscall/thread/fn.sys_waittid.html new file mode 100644 index 00000000..ed833086 --- /dev/null +++ b/ch9-gui-dev/os/syscall/thread/fn.sys_waittid.html @@ -0,0 +1,4 @@ +sys_waittid in os::syscall::thread - Rust
pub fn sys_waittid(tid: usize) -> i32
Expand description

thread does not exist, return -1 +thread has not exited yet, return -2 +otherwise, return thread’s exit code

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/thread/index.html b/ch9-gui-dev/os/syscall/thread/index.html new file mode 100644 index 00000000..8b5500ea --- /dev/null +++ b/ch9-gui-dev/os/syscall/thread/index.html @@ -0,0 +1,4 @@ +os::syscall::thread - Rust

Functions

thread does not exist, return -1 +thread has not exited yet, return -2 +otherwise, return thread’s exit code

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/syscall/thread/sidebar-items.js b/ch9-gui-dev/os/syscall/thread/sidebar-items.js new file mode 100644 index 00000000..2f4d8706 --- /dev/null +++ b/ch9-gui-dev/os/syscall/thread/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":[["sys_gettid",""],["sys_thread_create",""],["sys_waittid","thread does not exist, return -1 thread has not exited yet, return -2 otherwise, return thread’s exit code"]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/task/context/index.html b/ch9-gui-dev/os/task/context/index.html new file mode 100644 index 00000000..b89644c0 --- /dev/null +++ b/ch9-gui-dev/os/task/context/index.html @@ -0,0 +1 @@ +os::task::context - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/context/sidebar-items.js b/ch9-gui-dev/os/task/context/sidebar-items.js new file mode 100644 index 00000000..2833ef70 --- /dev/null +++ b/ch9-gui-dev/os/task/context/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":[["TaskContext",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/task/context/struct.TaskContext.html b/ch9-gui-dev/os/task/context/struct.TaskContext.html new file mode 100644 index 00000000..cac98353 --- /dev/null +++ b/ch9-gui-dev/os/task/context/struct.TaskContext.html @@ -0,0 +1,28 @@ +TaskContext in os::task::context - Rust
#[repr(C)]
pub struct TaskContext { + ra: usize, + sp: usize, + s: [usize; 12], +}

Fields

ra: usizesp: usizes: [usize; 12]

Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/fn.add_initproc.html b/ch9-gui-dev/os/task/fn.add_initproc.html new file mode 100644 index 00000000..50207671 --- /dev/null +++ b/ch9-gui-dev/os/task/fn.add_initproc.html @@ -0,0 +1 @@ +add_initproc in os::task - Rust
pub fn add_initproc()
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/fn.block_current_and_run_next.html b/ch9-gui-dev/os/task/fn.block_current_and_run_next.html new file mode 100644 index 00000000..bcb697ff --- /dev/null +++ b/ch9-gui-dev/os/task/fn.block_current_and_run_next.html @@ -0,0 +1 @@ +block_current_and_run_next in os::task - Rust
pub fn block_current_and_run_next()
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/fn.block_current_task.html b/ch9-gui-dev/os/task/fn.block_current_task.html new file mode 100644 index 00000000..fa9f3fb8 --- /dev/null +++ b/ch9-gui-dev/os/task/fn.block_current_task.html @@ -0,0 +1,2 @@ +block_current_task in os::task - Rust
pub fn block_current_task() -> *mut TaskContext
Expand description

This function must be followed by a schedule

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/fn.check_signals_of_current.html b/ch9-gui-dev/os/task/fn.check_signals_of_current.html new file mode 100644 index 00000000..1a6827c1 --- /dev/null +++ b/ch9-gui-dev/os/task/fn.check_signals_of_current.html @@ -0,0 +1 @@ +check_signals_of_current in os::task - Rust
pub fn check_signals_of_current() -> Option<(i32, &'static str)>
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/fn.current_add_signal.html b/ch9-gui-dev/os/task/fn.current_add_signal.html new file mode 100644 index 00000000..684b673a --- /dev/null +++ b/ch9-gui-dev/os/task/fn.current_add_signal.html @@ -0,0 +1 @@ +current_add_signal in os::task - Rust
pub fn current_add_signal(signal: SignalFlags)
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/fn.exit_current_and_run_next.html b/ch9-gui-dev/os/task/fn.exit_current_and_run_next.html new file mode 100644 index 00000000..1803d576 --- /dev/null +++ b/ch9-gui-dev/os/task/fn.exit_current_and_run_next.html @@ -0,0 +1 @@ +exit_current_and_run_next in os::task - Rust
pub fn exit_current_and_run_next(exit_code: i32)
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/fn.suspend_current_and_run_next.html b/ch9-gui-dev/os/task/fn.suspend_current_and_run_next.html new file mode 100644 index 00000000..6cebceea --- /dev/null +++ b/ch9-gui-dev/os/task/fn.suspend_current_and_run_next.html @@ -0,0 +1 @@ +suspend_current_and_run_next in os::task - Rust
pub fn suspend_current_and_run_next()
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/id/constant.IDLE_PID.html b/ch9-gui-dev/os/task/id/constant.IDLE_PID.html new file mode 100644 index 00000000..be64cf04 --- /dev/null +++ b/ch9-gui-dev/os/task/id/constant.IDLE_PID.html @@ -0,0 +1 @@ +IDLE_PID in os::task::id - Rust

Constant os::task::id::IDLE_PID

source · []
pub const IDLE_PID: usize = 0;
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/id/fn.kernel_stack_position.html b/ch9-gui-dev/os/task/id/fn.kernel_stack_position.html new file mode 100644 index 00000000..a4a471e3 --- /dev/null +++ b/ch9-gui-dev/os/task/id/fn.kernel_stack_position.html @@ -0,0 +1,2 @@ +kernel_stack_position in os::task::id - Rust
pub fn kernel_stack_position(kstack_id: usize) -> (usize, usize)
Expand description

Return (bottom, top) of a kernel stack in kernel space.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/id/fn.kstack_alloc.html b/ch9-gui-dev/os/task/id/fn.kstack_alloc.html new file mode 100644 index 00000000..7b71aa0d --- /dev/null +++ b/ch9-gui-dev/os/task/id/fn.kstack_alloc.html @@ -0,0 +1 @@ +kstack_alloc in os::task::id - Rust
pub fn kstack_alloc() -> KernelStack
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/id/fn.pid_alloc.html b/ch9-gui-dev/os/task/id/fn.pid_alloc.html new file mode 100644 index 00000000..0910c6c0 --- /dev/null +++ b/ch9-gui-dev/os/task/id/fn.pid_alloc.html @@ -0,0 +1 @@ +pid_alloc in os::task::id - Rust

Function os::task::id::pid_alloc

source · []
pub fn pid_alloc() -> PidHandle
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/id/fn.trap_cx_bottom_from_tid.html b/ch9-gui-dev/os/task/id/fn.trap_cx_bottom_from_tid.html new file mode 100644 index 00000000..9ba11c29 --- /dev/null +++ b/ch9-gui-dev/os/task/id/fn.trap_cx_bottom_from_tid.html @@ -0,0 +1 @@ +trap_cx_bottom_from_tid in os::task::id - Rust
fn trap_cx_bottom_from_tid(tid: usize) -> usize
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/id/fn.ustack_bottom_from_tid.html b/ch9-gui-dev/os/task/id/fn.ustack_bottom_from_tid.html new file mode 100644 index 00000000..4df9810f --- /dev/null +++ b/ch9-gui-dev/os/task/id/fn.ustack_bottom_from_tid.html @@ -0,0 +1 @@ +ustack_bottom_from_tid in os::task::id - Rust
fn ustack_bottom_from_tid(ustack_base: usize, tid: usize) -> usize
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/id/index.html b/ch9-gui-dev/os/task/id/index.html new file mode 100644 index 00000000..af42184d --- /dev/null +++ b/ch9-gui-dev/os/task/id/index.html @@ -0,0 +1,2 @@ +os::task::id - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/id/sidebar-items.js b/ch9-gui-dev/os/task/id/sidebar-items.js new file mode 100644 index 00000000..a2168483 --- /dev/null +++ b/ch9-gui-dev/os/task/id/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":[["IDLE_PID",""]],"fn":[["kernel_stack_position","Return (bottom, top) of a kernel stack in kernel space."],["kstack_alloc",""],["pid_alloc",""],["trap_cx_bottom_from_tid",""],["ustack_bottom_from_tid",""]],"struct":[["KSTACK_ALLOCATOR",""],["KernelStack",""],["PID_ALLOCATOR",""],["PidHandle",""],["RecycleAllocator",""],["TaskUserRes",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/task/id/struct.KSTACK_ALLOCATOR.html b/ch9-gui-dev/os/task/id/struct.KSTACK_ALLOCATOR.html new file mode 100644 index 00000000..c4920702 --- /dev/null +++ b/ch9-gui-dev/os/task/id/struct.KSTACK_ALLOCATOR.html @@ -0,0 +1,29 @@ +KSTACK_ALLOCATOR in os::task::id - Rust
struct KSTACK_ALLOCATOR {
+    __private_field: (),
+}

Fields

__private_field: ()

Methods from Deref<Target = UPIntrFreeCell<RecycleAllocator>>

Panic if the data has been borrowed.

+

Trait Implementations

The resulting type after dereferencing.

+

Dereferences the value.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/id/struct.KernelStack.html b/ch9-gui-dev/os/task/id/struct.KernelStack.html new file mode 100644 index 00000000..b8ccb25e --- /dev/null +++ b/ch9-gui-dev/os/task/id/struct.KernelStack.html @@ -0,0 +1,25 @@ +KernelStack in os::task::id - Rust
pub struct KernelStack(pub usize);

Tuple Fields

0: usize

Implementations

Trait Implementations

Executes the destructor for this type. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/id/struct.PID_ALLOCATOR.html b/ch9-gui-dev/os/task/id/struct.PID_ALLOCATOR.html new file mode 100644 index 00000000..5ca7a2dd --- /dev/null +++ b/ch9-gui-dev/os/task/id/struct.PID_ALLOCATOR.html @@ -0,0 +1,29 @@ +PID_ALLOCATOR in os::task::id - Rust
struct PID_ALLOCATOR {
+    __private_field: (),
+}

Fields

__private_field: ()

Methods from Deref<Target = UPIntrFreeCell<RecycleAllocator>>

Panic if the data has been borrowed.

+

Trait Implementations

The resulting type after dereferencing.

+

Dereferences the value.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/id/struct.PidHandle.html b/ch9-gui-dev/os/task/id/struct.PidHandle.html new file mode 100644 index 00000000..0a9632f7 --- /dev/null +++ b/ch9-gui-dev/os/task/id/struct.PidHandle.html @@ -0,0 +1,25 @@ +PidHandle in os::task::id - Rust
pub struct PidHandle(pub usize);

Tuple Fields

0: usize

Trait Implementations

Executes the destructor for this type. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/id/struct.RecycleAllocator.html b/ch9-gui-dev/os/task/id/struct.RecycleAllocator.html new file mode 100644 index 00000000..5cda311c --- /dev/null +++ b/ch9-gui-dev/os/task/id/struct.RecycleAllocator.html @@ -0,0 +1,27 @@ +RecycleAllocator in os::task::id - Rust
pub struct RecycleAllocator {
+    current: usize,
+    recycled: Vec<usize>,
+}

Fields

current: usizerecycled: Vec<usize>

Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/id/struct.TaskUserRes.html b/ch9-gui-dev/os/task/id/struct.TaskUserRes.html new file mode 100644 index 00000000..895778ea --- /dev/null +++ b/ch9-gui-dev/os/task/id/struct.TaskUserRes.html @@ -0,0 +1,29 @@ +TaskUserRes in os::task::id - Rust
pub struct TaskUserRes {
+    pub tid: usize,
+    pub ustack_base: usize,
+    pub process: Weak<ProcessControlBlock>,
+}

Fields

tid: usizeustack_base: usizeprocess: Weak<ProcessControlBlock>

Implementations

Trait Implementations

Executes the destructor for this type. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/index.html b/ch9-gui-dev/os/task/index.html new file mode 100644 index 00000000..cc015e76 --- /dev/null +++ b/ch9-gui-dev/os/task/index.html @@ -0,0 +1,2 @@ +os::task - Rust

Module os::task

source · []

Re-exports

pub use context::TaskContext;
pub use id::kstack_alloc;
pub use id::pid_alloc;
pub use id::KernelStack;
pub use id::PidHandle;
pub use id::IDLE_PID;
pub use manager::add_task;
pub use manager::pid2process;
pub use manager::remove_from_pid2process;
pub use processor::current_kstack_top;
pub use processor::current_process;
pub use processor::current_task;
pub use processor::current_trap_cx;
pub use processor::current_trap_cx_user_va;
pub use processor::current_user_token;
pub use processor::run_tasks;
pub use processor::schedule;
pub use processor::take_current_task;
pub use signal::SignalFlags;
pub use task::TaskControlBlock;
pub use task::TaskStatus;

Modules

context 🔒
id 🔒
manager 🔒
process 🔒
processor 🔒
signal 🔒
switch 🔒
task 🔒

Structs

Functions

\ No newline at end of file diff --git a/ch9-gui-dev/os/task/manager/fn.add_task.html b/ch9-gui-dev/os/task/manager/fn.add_task.html new file mode 100644 index 00000000..62104001 --- /dev/null +++ b/ch9-gui-dev/os/task/manager/fn.add_task.html @@ -0,0 +1 @@ +add_task in os::task::manager - Rust
pub fn add_task(task: Arc<TaskControlBlock>)
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/manager/fn.fetch_task.html b/ch9-gui-dev/os/task/manager/fn.fetch_task.html new file mode 100644 index 00000000..c8c221bf --- /dev/null +++ b/ch9-gui-dev/os/task/manager/fn.fetch_task.html @@ -0,0 +1 @@ +fetch_task in os::task::manager - Rust
pub fn fetch_task() -> Option<Arc<TaskControlBlock>>
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/manager/fn.insert_into_pid2process.html b/ch9-gui-dev/os/task/manager/fn.insert_into_pid2process.html new file mode 100644 index 00000000..317a69c7 --- /dev/null +++ b/ch9-gui-dev/os/task/manager/fn.insert_into_pid2process.html @@ -0,0 +1 @@ +insert_into_pid2process in os::task::manager - Rust
pub fn insert_into_pid2process(pid: usize, process: Arc<ProcessControlBlock>)
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/manager/fn.pid2process.html b/ch9-gui-dev/os/task/manager/fn.pid2process.html new file mode 100644 index 00000000..b974f541 --- /dev/null +++ b/ch9-gui-dev/os/task/manager/fn.pid2process.html @@ -0,0 +1 @@ +pid2process in os::task::manager - Rust
pub fn pid2process(pid: usize) -> Option<Arc<ProcessControlBlock>>
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/manager/fn.remove_from_pid2process.html b/ch9-gui-dev/os/task/manager/fn.remove_from_pid2process.html new file mode 100644 index 00000000..9bc8fc1d --- /dev/null +++ b/ch9-gui-dev/os/task/manager/fn.remove_from_pid2process.html @@ -0,0 +1 @@ +remove_from_pid2process in os::task::manager - Rust
pub fn remove_from_pid2process(pid: usize)
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/manager/index.html b/ch9-gui-dev/os/task/manager/index.html new file mode 100644 index 00000000..84bed36b --- /dev/null +++ b/ch9-gui-dev/os/task/manager/index.html @@ -0,0 +1 @@ +os::task::manager - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/manager/sidebar-items.js b/ch9-gui-dev/os/task/manager/sidebar-items.js new file mode 100644 index 00000000..2738ce2e --- /dev/null +++ b/ch9-gui-dev/os/task/manager/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":[["add_task",""],["fetch_task",""],["insert_into_pid2process",""],["pid2process",""],["remove_from_pid2process",""]],"struct":[["PID2PCB",""],["TASK_MANAGER",""],["TaskManager",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/task/manager/struct.PID2PCB.html b/ch9-gui-dev/os/task/manager/struct.PID2PCB.html new file mode 100644 index 00000000..8172d001 --- /dev/null +++ b/ch9-gui-dev/os/task/manager/struct.PID2PCB.html @@ -0,0 +1,29 @@ +PID2PCB in os::task::manager - Rust
pub struct PID2PCB {
+    __private_field: (),
+}

Fields

__private_field: ()

Methods from Deref<Target = UPIntrFreeCell<BTreeMap<usize, Arc<ProcessControlBlock>>>>

Panic if the data has been borrowed.

+

Trait Implementations

The resulting type after dereferencing.

+

Dereferences the value.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/manager/struct.TASK_MANAGER.html b/ch9-gui-dev/os/task/manager/struct.TASK_MANAGER.html new file mode 100644 index 00000000..ca231d94 --- /dev/null +++ b/ch9-gui-dev/os/task/manager/struct.TASK_MANAGER.html @@ -0,0 +1,29 @@ +TASK_MANAGER in os::task::manager - Rust
pub struct TASK_MANAGER {
+    __private_field: (),
+}

Fields

__private_field: ()

Methods from Deref<Target = UPIntrFreeCell<TaskManager>>

Panic if the data has been borrowed.

+

Trait Implementations

The resulting type after dereferencing.

+

Dereferences the value.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/manager/struct.TaskManager.html b/ch9-gui-dev/os/task/manager/struct.TaskManager.html new file mode 100644 index 00000000..1c9e5b39 --- /dev/null +++ b/ch9-gui-dev/os/task/manager/struct.TaskManager.html @@ -0,0 +1,27 @@ +TaskManager in os::task::manager - Rust
pub struct TaskManager {
+    ready_queue: VecDeque<Arc<TaskControlBlock>>,
+}

Fields

ready_queue: VecDeque<Arc<TaskControlBlock>>

Implementations

A simple FIFO scheduler.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/process/index.html b/ch9-gui-dev/os/task/process/index.html new file mode 100644 index 00000000..b9e5c9d4 --- /dev/null +++ b/ch9-gui-dev/os/task/process/index.html @@ -0,0 +1 @@ +os::task::process - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/process/sidebar-items.js b/ch9-gui-dev/os/task/process/sidebar-items.js new file mode 100644 index 00000000..f5ab4a33 --- /dev/null +++ b/ch9-gui-dev/os/task/process/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":[["ProcessControlBlock",""],["ProcessControlBlockInner",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/task/process/struct.ProcessControlBlock.html b/ch9-gui-dev/os/task/process/struct.ProcessControlBlock.html new file mode 100644 index 00000000..8f3d20ce --- /dev/null +++ b/ch9-gui-dev/os/task/process/struct.ProcessControlBlock.html @@ -0,0 +1,29 @@ +ProcessControlBlock in os::task::process - Rust
pub struct ProcessControlBlock {
+    pub pid: PidHandle,
+    inner: UPIntrFreeCell<ProcessControlBlockInner>,
+}

Fields

pid: PidHandleinner: UPIntrFreeCell<ProcessControlBlockInner>

Implementations

Only support processes with a single thread.

+

Only support processes with a single thread.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/process/struct.ProcessControlBlockInner.html b/ch9-gui-dev/os/task/process/struct.ProcessControlBlockInner.html new file mode 100644 index 00000000..e6068197 --- /dev/null +++ b/ch9-gui-dev/os/task/process/struct.ProcessControlBlockInner.html @@ -0,0 +1,37 @@ +ProcessControlBlockInner in os::task::process - Rust
pub struct ProcessControlBlockInner {
+    pub is_zombie: bool,
+    pub memory_set: MemorySet,
+    pub parent: Option<Weak<ProcessControlBlock>>,
+    pub children: Vec<Arc<ProcessControlBlock>>,
+    pub exit_code: i32,
+    pub fd_table: Vec<Option<Arc<dyn File + Send + Sync>>>,
+    pub signals: SignalFlags,
+    pub tasks: Vec<Option<Arc<TaskControlBlock>>>,
+    pub task_res_allocator: RecycleAllocator,
+    pub mutex_list: Vec<Option<Arc<dyn Mutex>>>,
+    pub semaphore_list: Vec<Option<Arc<Semaphore>>>,
+    pub condvar_list: Vec<Option<Arc<Condvar>>>,
+}

Fields

is_zombie: boolmemory_set: MemorySetparent: Option<Weak<ProcessControlBlock>>children: Vec<Arc<ProcessControlBlock>>exit_code: i32fd_table: Vec<Option<Arc<dyn File + Send + Sync>>>signals: SignalFlagstasks: Vec<Option<Arc<TaskControlBlock>>>task_res_allocator: RecycleAllocatormutex_list: Vec<Option<Arc<dyn Mutex>>>semaphore_list: Vec<Option<Arc<Semaphore>>>condvar_list: Vec<Option<Arc<Condvar>>>

Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/processor/fn.current_kstack_top.html b/ch9-gui-dev/os/task/processor/fn.current_kstack_top.html new file mode 100644 index 00000000..e7380d53 --- /dev/null +++ b/ch9-gui-dev/os/task/processor/fn.current_kstack_top.html @@ -0,0 +1 @@ +current_kstack_top in os::task::processor - Rust
pub fn current_kstack_top() -> usize
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/processor/fn.current_process.html b/ch9-gui-dev/os/task/processor/fn.current_process.html new file mode 100644 index 00000000..2810248e --- /dev/null +++ b/ch9-gui-dev/os/task/processor/fn.current_process.html @@ -0,0 +1 @@ +current_process in os::task::processor - Rust
pub fn current_process() -> Arc<ProcessControlBlock>
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/processor/fn.current_task.html b/ch9-gui-dev/os/task/processor/fn.current_task.html new file mode 100644 index 00000000..ab9cf8a1 --- /dev/null +++ b/ch9-gui-dev/os/task/processor/fn.current_task.html @@ -0,0 +1 @@ +current_task in os::task::processor - Rust
pub fn current_task() -> Option<Arc<TaskControlBlock>>
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/processor/fn.current_trap_cx.html b/ch9-gui-dev/os/task/processor/fn.current_trap_cx.html new file mode 100644 index 00000000..da20aaa2 --- /dev/null +++ b/ch9-gui-dev/os/task/processor/fn.current_trap_cx.html @@ -0,0 +1 @@ +current_trap_cx in os::task::processor - Rust
pub fn current_trap_cx() -> &'static mut TrapContext
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/processor/fn.current_trap_cx_user_va.html b/ch9-gui-dev/os/task/processor/fn.current_trap_cx_user_va.html new file mode 100644 index 00000000..b3218706 --- /dev/null +++ b/ch9-gui-dev/os/task/processor/fn.current_trap_cx_user_va.html @@ -0,0 +1 @@ +current_trap_cx_user_va in os::task::processor - Rust
pub fn current_trap_cx_user_va() -> usize
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/processor/fn.current_user_token.html b/ch9-gui-dev/os/task/processor/fn.current_user_token.html new file mode 100644 index 00000000..9c8d851d --- /dev/null +++ b/ch9-gui-dev/os/task/processor/fn.current_user_token.html @@ -0,0 +1 @@ +current_user_token in os::task::processor - Rust
pub fn current_user_token() -> usize
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/processor/fn.run_tasks.html b/ch9-gui-dev/os/task/processor/fn.run_tasks.html new file mode 100644 index 00000000..58db02c5 --- /dev/null +++ b/ch9-gui-dev/os/task/processor/fn.run_tasks.html @@ -0,0 +1 @@ +run_tasks in os::task::processor - Rust
pub fn run_tasks()
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/processor/fn.schedule.html b/ch9-gui-dev/os/task/processor/fn.schedule.html new file mode 100644 index 00000000..46cf8d4a --- /dev/null +++ b/ch9-gui-dev/os/task/processor/fn.schedule.html @@ -0,0 +1 @@ +schedule in os::task::processor - Rust
pub fn schedule(switched_task_cx_ptr: *mut TaskContext)
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/processor/fn.take_current_task.html b/ch9-gui-dev/os/task/processor/fn.take_current_task.html new file mode 100644 index 00000000..62ba5349 --- /dev/null +++ b/ch9-gui-dev/os/task/processor/fn.take_current_task.html @@ -0,0 +1 @@ +take_current_task in os::task::processor - Rust
pub fn take_current_task() -> Option<Arc<TaskControlBlock>>
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/processor/index.html b/ch9-gui-dev/os/task/processor/index.html new file mode 100644 index 00000000..79ae5004 --- /dev/null +++ b/ch9-gui-dev/os/task/processor/index.html @@ -0,0 +1 @@ +os::task::processor - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/processor/sidebar-items.js b/ch9-gui-dev/os/task/processor/sidebar-items.js new file mode 100644 index 00000000..85a8f68a --- /dev/null +++ b/ch9-gui-dev/os/task/processor/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":[["current_kstack_top",""],["current_process",""],["current_task",""],["current_trap_cx",""],["current_trap_cx_user_va",""],["current_user_token",""],["run_tasks",""],["schedule",""],["take_current_task",""]],"struct":[["PROCESSOR",""],["Processor",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/task/processor/struct.PROCESSOR.html b/ch9-gui-dev/os/task/processor/struct.PROCESSOR.html new file mode 100644 index 00000000..f5e72b0e --- /dev/null +++ b/ch9-gui-dev/os/task/processor/struct.PROCESSOR.html @@ -0,0 +1,29 @@ +PROCESSOR in os::task::processor - Rust
pub struct PROCESSOR {
+    __private_field: (),
+}

Fields

__private_field: ()

Methods from Deref<Target = UPIntrFreeCell<Processor>>

Panic if the data has been borrowed.

+

Trait Implementations

The resulting type after dereferencing.

+

Dereferences the value.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/processor/struct.Processor.html b/ch9-gui-dev/os/task/processor/struct.Processor.html new file mode 100644 index 00000000..16366828 --- /dev/null +++ b/ch9-gui-dev/os/task/processor/struct.Processor.html @@ -0,0 +1,27 @@ +Processor in os::task::processor - Rust
pub struct Processor {
+    current: Option<Arc<TaskControlBlock>>,
+    idle_task_cx: TaskContext,
+}

Fields

current: Option<Arc<TaskControlBlock>>idle_task_cx: TaskContext

Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/sidebar-items.js b/ch9-gui-dev/os/task/sidebar-items.js new file mode 100644 index 00000000..7241fe19 --- /dev/null +++ b/ch9-gui-dev/os/task/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":[["add_initproc",""],["block_current_and_run_next",""],["block_current_task","This function must be followed by a schedule"],["check_signals_of_current",""],["current_add_signal",""],["exit_current_and_run_next",""],["suspend_current_and_run_next",""]],"mod":[["context",""],["id",""],["manager",""],["process",""],["processor",""],["signal",""],["switch",""],["task",""]],"struct":[["INITPROC",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/task/signal/index.html b/ch9-gui-dev/os/task/signal/index.html new file mode 100644 index 00000000..4ef7b2fa --- /dev/null +++ b/ch9-gui-dev/os/task/signal/index.html @@ -0,0 +1 @@ +os::task::signal - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/signal/sidebar-items.js b/ch9-gui-dev/os/task/signal/sidebar-items.js new file mode 100644 index 00000000..e74f4eca --- /dev/null +++ b/ch9-gui-dev/os/task/signal/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":[["SignalFlags",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/task/signal/struct.SignalFlags.html b/ch9-gui-dev/os/task/signal/struct.SignalFlags.html new file mode 100644 index 00000000..b506a326 --- /dev/null +++ b/ch9-gui-dev/os/task/signal/struct.SignalFlags.html @@ -0,0 +1,128 @@ +SignalFlags in os::task::signal - Rust
pub struct SignalFlags {
+    bits: u32,
+}

Fields

bits: u32

Implementations

Returns an empty set of flags.

+

Returns the set containing all flags.

+

Returns the raw value of the flags currently stored.

+

Convert from underlying bit representation, unless that +representation contains bits that do not correspond to a flag.

+

Convert from underlying bit representation, dropping any bits +that do not correspond to flags.

+

Convert from underlying bit representation, preserving all +bits (even those not corresponding to a defined flag).

+
Safety
+

The caller of the bitflags! macro can chose to allow or +disallow extra bits for their bitflags type.

+

The caller of from_bits_unchecked() has to ensure that +all bits correspond to a defined flag or that extra bits +are valid for this bitflags type.

+

Returns true if no flags are currently stored.

+

Returns true if all flags are currently set.

+

Returns true if there are flags common to both self and other.

+

Returns true if all of the flags in other are contained within self.

+

Inserts the specified flags in-place.

+

Removes the specified flags in-place.

+

Toggles the specified flags in-place.

+

Inserts or removes the specified flags depending on the passed value.

+

Returns the intersection between the flags in self and +other.

+

Specifically, the returned set contains only the flags which are +present in both self and other.

+

This is equivalent to using the & operator (e.g. +ops::BitAnd), as in flags & other.

+

Returns the union of between the flags in self and other.

+

Specifically, the returned set contains all flags which are +present in either self or other, including any which are +present in both (see Self::symmetric_difference if that +is undesirable).

+

This is equivalent to using the | operator (e.g. +ops::BitOr), as in flags | other.

+

Returns the difference between the flags in self and other.

+

Specifically, the returned set contains all flags present in +self, except for the ones present in other.

+

It is also conceptually equivalent to the “bit-clear” operation: +flags & !other (and this syntax is also supported).

+

This is equivalent to using the - operator (e.g. +ops::Sub), as in flags - other.

+

Returns the symmetric difference between the flags +in self and other.

+

Specifically, the returned set contains the flags present which +are present in self or other, but that are not present in +both. Equivalently, it contains the flags present in exactly +one of the sets self and other.

+

This is equivalent to using the ^ operator (e.g. +ops::BitXor), as in flags ^ other.

+

Returns the complement of this set of flags.

+

Specifically, the returned set contains all the flags which are +not set in self, but which are allowed for this type.

+

Alternatively, it can be thought of as the set difference +between Self::all() and self (e.g. Self::all() - self)

+

This is equivalent to using the ! operator (e.g. +ops::Not), as in !flags.

+

Trait Implementations

Formats the value using the given formatter.

+

Returns the intersection between the two sets of flags.

+

The resulting type after applying the & operator.

+

Disables all flags disabled in the set.

+

Returns the union of the two sets of flags.

+

The resulting type after applying the | operator.

+

Adds the set of flags.

+

Returns the left flags, but with all the right flags toggled.

+

The resulting type after applying the ^ operator.

+

Toggles the set of flags.

+

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

Formats the value using the given formatter. Read more

+

Extends a collection with the contents of an iterator. Read more

+
🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

+
🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

+

Creates a value from an iterator. Read more

+

Feeds this value into the given Hasher. Read more

+

Feeds a slice of this type into the given Hasher. Read more

+

Formats the value using the given formatter.

+

Returns the complement of this set of flags.

+

The resulting type after applying the ! operator.

+

Formats the value using the given formatter.

+

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

Restrict a value to a certain interval. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more

+

Returns the set difference of the two sets of flags.

+

The resulting type after applying the - operator.

+

Disables all flags enabled in the set.

+

Formats the value using the given formatter.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/struct.INITPROC.html b/ch9-gui-dev/os/task/struct.INITPROC.html new file mode 100644 index 00000000..01056560 --- /dev/null +++ b/ch9-gui-dev/os/task/struct.INITPROC.html @@ -0,0 +1,28 @@ +INITPROC in os::task - Rust
pub struct INITPROC {
+    __private_field: (),
+}

Fields

__private_field: ()

Trait Implementations

The resulting type after dereferencing.

+

Dereferences the value.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/switch/fn.__switch.html b/ch9-gui-dev/os/task/switch/fn.__switch.html new file mode 100644 index 00000000..66123082 --- /dev/null +++ b/ch9-gui-dev/os/task/switch/fn.__switch.html @@ -0,0 +1 @@ +__switch in os::task::switch - Rust
pub unsafe extern "C" fn __switch(
    current_task_cx_ptr: *mut TaskContext,
    next_task_cx_ptr: *const TaskContext
)
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/switch/index.html b/ch9-gui-dev/os/task/switch/index.html new file mode 100644 index 00000000..4f68c613 --- /dev/null +++ b/ch9-gui-dev/os/task/switch/index.html @@ -0,0 +1 @@ +os::task::switch - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/switch/sidebar-items.js b/ch9-gui-dev/os/task/switch/sidebar-items.js new file mode 100644 index 00000000..28ba182b --- /dev/null +++ b/ch9-gui-dev/os/task/switch/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":[["__switch",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/task/task/enum.TaskStatus.html b/ch9-gui-dev/os/task/task/enum.TaskStatus.html new file mode 100644 index 00000000..611f1367 --- /dev/null +++ b/ch9-gui-dev/os/task/task/enum.TaskStatus.html @@ -0,0 +1,36 @@ +TaskStatus in os::task::task - Rust
pub enum TaskStatus {
+    Ready,
+    Running,
+    Blocking,
+}

Variants

Ready

Running

Blocking

Trait Implementations

Returns a copy of the value. Read more

+

Performs copy-assignment from source. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The resulting type after obtaining ownership.

+

Creates owned data from borrowed data, usually by cloning. Read more

+

Uses borrowed data to replace owned data, usually by cloning. Read more

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/task/index.html b/ch9-gui-dev/os/task/task/index.html new file mode 100644 index 00000000..b0287c6b --- /dev/null +++ b/ch9-gui-dev/os/task/task/index.html @@ -0,0 +1 @@ +os::task::task - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/task/sidebar-items.js b/ch9-gui-dev/os/task/task/sidebar-items.js new file mode 100644 index 00000000..272090ba --- /dev/null +++ b/ch9-gui-dev/os/task/task/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":[["TaskStatus",""]],"struct":[["TaskControlBlock",""],["TaskControlBlockInner",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/task/task/struct.TaskControlBlock.html b/ch9-gui-dev/os/task/task/struct.TaskControlBlock.html new file mode 100644 index 00000000..e3dbce7f --- /dev/null +++ b/ch9-gui-dev/os/task/task/struct.TaskControlBlock.html @@ -0,0 +1,28 @@ +TaskControlBlock in os::task::task - Rust
pub struct TaskControlBlock {
+    pub process: Weak<ProcessControlBlock>,
+    pub kstack: KernelStack,
+    pub inner: UPIntrFreeCell<TaskControlBlockInner>,
+}

Fields

process: Weak<ProcessControlBlock>kstack: KernelStackinner: UPIntrFreeCell<TaskControlBlockInner>

Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/task/task/struct.TaskControlBlockInner.html b/ch9-gui-dev/os/task/task/struct.TaskControlBlockInner.html new file mode 100644 index 00000000..4d6adecd --- /dev/null +++ b/ch9-gui-dev/os/task/task/struct.TaskControlBlockInner.html @@ -0,0 +1,30 @@ +TaskControlBlockInner in os::task::task - Rust
pub struct TaskControlBlockInner {
+    pub res: Option<TaskUserRes>,
+    pub trap_cx_ppn: PhysPageNum,
+    pub task_cx: TaskContext,
+    pub task_status: TaskStatus,
+    pub exit_code: Option<i32>,
+}

Fields

res: Option<TaskUserRes>trap_cx_ppn: PhysPageNumtask_cx: TaskContexttask_status: TaskStatusexit_code: Option<i32>

Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/timer/constant.MSEC_PER_SEC.html b/ch9-gui-dev/os/timer/constant.MSEC_PER_SEC.html new file mode 100644 index 00000000..2ee269d2 --- /dev/null +++ b/ch9-gui-dev/os/timer/constant.MSEC_PER_SEC.html @@ -0,0 +1 @@ +MSEC_PER_SEC in os::timer - Rust
const MSEC_PER_SEC: usize = 1000;
\ No newline at end of file diff --git a/ch9-gui-dev/os/timer/constant.TICKS_PER_SEC.html b/ch9-gui-dev/os/timer/constant.TICKS_PER_SEC.html new file mode 100644 index 00000000..ca881576 --- /dev/null +++ b/ch9-gui-dev/os/timer/constant.TICKS_PER_SEC.html @@ -0,0 +1 @@ +TICKS_PER_SEC in os::timer - Rust
const TICKS_PER_SEC: usize = 100;
\ No newline at end of file diff --git a/ch9-gui-dev/os/timer/fn.add_timer.html b/ch9-gui-dev/os/timer/fn.add_timer.html new file mode 100644 index 00000000..45e23a0b --- /dev/null +++ b/ch9-gui-dev/os/timer/fn.add_timer.html @@ -0,0 +1 @@ +add_timer in os::timer - Rust
pub fn add_timer(expire_ms: usize, task: Arc<TaskControlBlock>)
\ No newline at end of file diff --git a/ch9-gui-dev/os/timer/fn.check_timer.html b/ch9-gui-dev/os/timer/fn.check_timer.html new file mode 100644 index 00000000..51890d47 --- /dev/null +++ b/ch9-gui-dev/os/timer/fn.check_timer.html @@ -0,0 +1 @@ +check_timer in os::timer - Rust
pub fn check_timer()
\ No newline at end of file diff --git a/ch9-gui-dev/os/timer/fn.get_time.html b/ch9-gui-dev/os/timer/fn.get_time.html new file mode 100644 index 00000000..f513fe44 --- /dev/null +++ b/ch9-gui-dev/os/timer/fn.get_time.html @@ -0,0 +1 @@ +get_time in os::timer - Rust
pub fn get_time() -> usize
\ No newline at end of file diff --git a/ch9-gui-dev/os/timer/fn.get_time_ms.html b/ch9-gui-dev/os/timer/fn.get_time_ms.html new file mode 100644 index 00000000..f78192ad --- /dev/null +++ b/ch9-gui-dev/os/timer/fn.get_time_ms.html @@ -0,0 +1 @@ +get_time_ms in os::timer - Rust
pub fn get_time_ms() -> usize
\ No newline at end of file diff --git a/ch9-gui-dev/os/timer/fn.set_next_trigger.html b/ch9-gui-dev/os/timer/fn.set_next_trigger.html new file mode 100644 index 00000000..e95229b4 --- /dev/null +++ b/ch9-gui-dev/os/timer/fn.set_next_trigger.html @@ -0,0 +1 @@ +set_next_trigger in os::timer - Rust
pub fn set_next_trigger()
\ No newline at end of file diff --git a/ch9-gui-dev/os/timer/index.html b/ch9-gui-dev/os/timer/index.html new file mode 100644 index 00000000..ce43651f --- /dev/null +++ b/ch9-gui-dev/os/timer/index.html @@ -0,0 +1 @@ +os::timer - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/timer/sidebar-items.js b/ch9-gui-dev/os/timer/sidebar-items.js new file mode 100644 index 00000000..717ceb7b --- /dev/null +++ b/ch9-gui-dev/os/timer/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":[["MSEC_PER_SEC",""],["TICKS_PER_SEC",""]],"fn":[["add_timer",""],["check_timer",""],["get_time",""],["get_time_ms",""],["set_next_trigger",""]],"struct":[["TIMERS",""],["TimerCondVar",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/timer/struct.TIMERS.html b/ch9-gui-dev/os/timer/struct.TIMERS.html new file mode 100644 index 00000000..473a276e --- /dev/null +++ b/ch9-gui-dev/os/timer/struct.TIMERS.html @@ -0,0 +1,29 @@ +TIMERS in os::timer - Rust
struct TIMERS {
+    __private_field: (),
+}

Fields

__private_field: ()

Methods from Deref<Target = UPIntrFreeCell<BinaryHeap<TimerCondVar>>>

Panic if the data has been borrowed.

+

Trait Implementations

The resulting type after dereferencing.

+

Dereferences the value.

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/timer/struct.TimerCondVar.html b/ch9-gui-dev/os/timer/struct.TimerCondVar.html new file mode 100644 index 00000000..aec08413 --- /dev/null +++ b/ch9-gui-dev/os/timer/struct.TimerCondVar.html @@ -0,0 +1,41 @@ +TimerCondVar in os::timer - Rust
pub struct TimerCondVar {
+    pub expire_ms: usize,
+    pub task: Arc<TaskControlBlock>,
+}

Fields

expire_ms: usizetask: Arc<TaskControlBlock>

Trait Implementations

This method returns an Ordering between self and other. Read more

+

Compares and returns the maximum of two values. Read more

+

Compares and returns the minimum of two values. Read more

+

Restrict a value to a certain interval. Read more

+

This method tests for self and other values to be equal, and is used +by ==. Read more

+

This method tests for !=.

+

This method returns an ordering between self and other values if one exists. Read more

+

This method tests less than (for self and other) and is used by the < operator. Read more

+

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more

+

This method tests greater than (for self and other) and is used by the > operator. Read more

+

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/trap/context/index.html b/ch9-gui-dev/os/trap/context/index.html new file mode 100644 index 00000000..8713bccb --- /dev/null +++ b/ch9-gui-dev/os/trap/context/index.html @@ -0,0 +1 @@ +os::trap::context - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/trap/context/sidebar-items.js b/ch9-gui-dev/os/trap/context/sidebar-items.js new file mode 100644 index 00000000..1ab0eace --- /dev/null +++ b/ch9-gui-dev/os/trap/context/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":[["TrapContext",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/os/trap/context/struct.TrapContext.html b/ch9-gui-dev/os/trap/context/struct.TrapContext.html new file mode 100644 index 00000000..f60db3d4 --- /dev/null +++ b/ch9-gui-dev/os/trap/context/struct.TrapContext.html @@ -0,0 +1,32 @@ +TrapContext in os::trap::context - Rust
#[repr(C)]
pub struct TrapContext { + pub x: [usize; 32], + pub sstatus: Sstatus, + pub sepc: usize, + pub kernel_satp: usize, + pub kernel_sp: usize, + pub trap_handler: usize, +}

Fields

x: [usize; 32]sstatus: Sstatussepc: usizekernel_satp: usizekernel_sp: usizetrap_handler: usize

Implementations

Trait Implementations

Formats the value using the given formatter. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

+

Casts the value.

+

Immutably borrows from an owned value. Read more

+

Mutably borrows from an owned value. Read more

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Returns the argument unchanged.

+

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

The type returned in the event of a conversion error.

+

Performs the conversion.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+

Casts the value.

+
\ No newline at end of file diff --git a/ch9-gui-dev/os/trap/fn.disable_supervisor_interrupt.html b/ch9-gui-dev/os/trap/fn.disable_supervisor_interrupt.html new file mode 100644 index 00000000..231d51d3 --- /dev/null +++ b/ch9-gui-dev/os/trap/fn.disable_supervisor_interrupt.html @@ -0,0 +1 @@ +disable_supervisor_interrupt in os::trap - Rust
fn disable_supervisor_interrupt()
\ No newline at end of file diff --git a/ch9-gui-dev/os/trap/fn.enable_supervisor_interrupt.html b/ch9-gui-dev/os/trap/fn.enable_supervisor_interrupt.html new file mode 100644 index 00000000..bf3b1d35 --- /dev/null +++ b/ch9-gui-dev/os/trap/fn.enable_supervisor_interrupt.html @@ -0,0 +1 @@ +enable_supervisor_interrupt in os::trap - Rust
fn enable_supervisor_interrupt()
\ No newline at end of file diff --git a/ch9-gui-dev/os/trap/fn.enable_timer_interrupt.html b/ch9-gui-dev/os/trap/fn.enable_timer_interrupt.html new file mode 100644 index 00000000..8b23c0fa --- /dev/null +++ b/ch9-gui-dev/os/trap/fn.enable_timer_interrupt.html @@ -0,0 +1 @@ +enable_timer_interrupt in os::trap - Rust
pub fn enable_timer_interrupt()
\ No newline at end of file diff --git a/ch9-gui-dev/os/trap/fn.init.html b/ch9-gui-dev/os/trap/fn.init.html new file mode 100644 index 00000000..e85abde8 --- /dev/null +++ b/ch9-gui-dev/os/trap/fn.init.html @@ -0,0 +1 @@ +init in os::trap - Rust

Function os::trap::init

source · []
pub fn init()
\ No newline at end of file diff --git a/ch9-gui-dev/os/trap/fn.set_kernel_trap_entry.html b/ch9-gui-dev/os/trap/fn.set_kernel_trap_entry.html new file mode 100644 index 00000000..0c23b6a1 --- /dev/null +++ b/ch9-gui-dev/os/trap/fn.set_kernel_trap_entry.html @@ -0,0 +1 @@ +set_kernel_trap_entry in os::trap - Rust
fn set_kernel_trap_entry()
\ No newline at end of file diff --git a/ch9-gui-dev/os/trap/fn.set_user_trap_entry.html b/ch9-gui-dev/os/trap/fn.set_user_trap_entry.html new file mode 100644 index 00000000..994b857b --- /dev/null +++ b/ch9-gui-dev/os/trap/fn.set_user_trap_entry.html @@ -0,0 +1 @@ +set_user_trap_entry in os::trap - Rust
fn set_user_trap_entry()
\ No newline at end of file diff --git a/ch9-gui-dev/os/trap/fn.trap_from_kernel.html b/ch9-gui-dev/os/trap/fn.trap_from_kernel.html new file mode 100644 index 00000000..2fe47cad --- /dev/null +++ b/ch9-gui-dev/os/trap/fn.trap_from_kernel.html @@ -0,0 +1,2 @@ +trap_from_kernel in os::trap - Rust
#[no_mangle]
+pub fn trap_from_kernel(_trap_cx: &TrapContext)
\ No newline at end of file diff --git a/ch9-gui-dev/os/trap/fn.trap_handler.html b/ch9-gui-dev/os/trap/fn.trap_handler.html new file mode 100644 index 00000000..1e82d168 --- /dev/null +++ b/ch9-gui-dev/os/trap/fn.trap_handler.html @@ -0,0 +1,2 @@ +trap_handler in os::trap - Rust
#[no_mangle]
+pub fn trap_handler() -> !
\ No newline at end of file diff --git a/ch9-gui-dev/os/trap/fn.trap_return.html b/ch9-gui-dev/os/trap/fn.trap_return.html new file mode 100644 index 00000000..75fddb93 --- /dev/null +++ b/ch9-gui-dev/os/trap/fn.trap_return.html @@ -0,0 +1,2 @@ +trap_return in os::trap - Rust
#[no_mangle]
+pub fn trap_return() -> !
\ No newline at end of file diff --git a/ch9-gui-dev/os/trap/index.html b/ch9-gui-dev/os/trap/index.html new file mode 100644 index 00000000..3c4e5e5a --- /dev/null +++ b/ch9-gui-dev/os/trap/index.html @@ -0,0 +1 @@ +os::trap - Rust
\ No newline at end of file diff --git a/ch9-gui-dev/os/trap/sidebar-items.js b/ch9-gui-dev/os/trap/sidebar-items.js new file mode 100644 index 00000000..2d5908b8 --- /dev/null +++ b/ch9-gui-dev/os/trap/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":[["disable_supervisor_interrupt",""],["enable_supervisor_interrupt",""],["enable_timer_interrupt",""],["init",""],["set_kernel_trap_entry",""],["set_user_trap_entry",""],["trap_from_kernel",""],["trap_handler",""],["trap_return",""]],"mod":[["context",""]]}; \ No newline at end of file diff --git a/ch9-gui-dev/rust-logo.svg b/ch9-gui-dev/rust-logo.svg new file mode 100644 index 00000000..62424d8f --- /dev/null +++ b/ch9-gui-dev/rust-logo.svg @@ -0,0 +1,61 @@ + + + diff --git a/ch9-gui-dev/rustdoc.css b/ch9-gui-dev/rustdoc.css new file mode 100644 index 00000000..2e22b4cf --- /dev/null +++ b/ch9-gui-dev/rustdoc.css @@ -0,0 +1 @@ + @font-face {font-family:'Fira Sans';font-style:normal;font-weight:400;src:local('Fira Sans'),url("FiraSans-Regular.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:500;src:local('Fira Sans Medium'),url("FiraSans-Medium.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:400;src:local('Source Serif 4'),url("SourceSerif4-Regular.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:italic;font-weight:400;src:local('Source Serif 4 Italic'),url("SourceSerif4-It.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:700;src:local('Source Serif 4 Bold'),url("SourceSerif4-Bold.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url("SourceCodePro-Regular.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:italic;font-weight:400;src:url("SourceCodePro-It.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:600;src:url("SourceCodePro-Semibold.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'NanumBarunGothic';src:url("NanumBarunGothic.ttf.woff2") format("woff2");font-display:swap;unicode-range:U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF;}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}html{content:"";}@media (prefers-color-scheme:light){html{content:"light";}}@media (prefers-color-scheme:dark){html{content:"dark";}}body{font:1rem/1.5 "Source Serif 4",NanumBarunGothic,serif;margin:0;position:relative;overflow-wrap:break-word;overflow-wrap:anywhere;-webkit-font-feature-settings:"kern","liga";-moz-font-feature-settings:"kern","liga";font-feature-settings:"kern","liga";background-color:var(--main-background-color);color:var(--main-color);}h1{font-size:1.5rem;}h2{font-size:1.375rem;}h3{font-size:1.25rem;}h1,h2,h3,h4,h5,h6{font-weight:500;}h1,h2,h3,h4{margin:20px 0 15px 0;padding-bottom:6px;}.docblock h3,.docblock h4,h5,h6{margin:15px 0 5px 0;}h1.fqn{margin:0;padding:0;border-bottom-color:var(--headings-border-bottom-color);}h2,h3,h4{border-bottom-color:var(--headings-border-bottom-color);}.main-heading{display:flex;flex-wrap:wrap;justify-content:space-between;padding-bottom:6px;margin-bottom:15px;}.main-heading a:hover{text-decoration:underline;}#toggle-all-docs{text-decoration:none;}h2,.top-doc .docblock>h3,.top-doc .docblock>h4{border-bottom:1px solid var(--headings-border-bottom-color);}h3.code-header{font-size:1.125rem;}h4.code-header{font-size:1rem;}.code-header{font-weight:600;border-bottom-style:none;margin:0;padding:0;margin-top:0.6em;margin-bottom:0.4em;}.impl,.impl-items .method,.methods .method,.impl-items .type,.methods .type,.impl-items .associatedconstant,.methods .associatedconstant,.impl-items .associatedtype,.methods .associatedtype{flex-basis:100%;font-weight:600;position:relative;}div.impl-items>div{padding-left:0;}h1,h2,h3,h4,h5,h6,.sidebar,.mobile-topbar,a.source,.search-input,.search-results .result-name,.content table td:first-child>a,.item-left>a,.out-of-band,span.since,#source-sidebar,#sidebar-toggle,details.rustdoc-toggle>summary::before,div.impl-items>div:not(.docblock):not(.item-info),.content ul.crate a.crate,a.srclink,#main-content>.since,#help-button>button,details.rustdoc-toggle.top-doc>summary,details.rustdoc-toggle.top-doc>summary::before,details.rustdoc-toggle.non-exhaustive>summary,details.rustdoc-toggle.non-exhaustive>summary::before,.scraped-example-title,.more-examples-toggle summary,.more-examples-toggle .hide-more,.example-links a,#main-content>ul.docblock>li>a{font-family:"Fira Sans",Arial,NanumBarunGothic,sans-serif;}h1,h2,h3,h4,a#toggle-all-docs,a.anchor,.small-section-header a,#source-sidebar a,pre.rust a,.sidebar h2 a,.sidebar h3 a,.mobile-topbar h2 a,.in-band a,.search-results a,.module-item .stab,.import-item .stab,.result-name .primitive>i,.result-name .keyword>i,.content .method .where,.content .fn .where,.content .where.fmt-newline{color:var(--main-color);}ol,ul{padding-left:24px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:.625em;}p{margin:0 0 .75em 0;}summary{outline:none;}td,th{padding:0;}table{border-collapse:collapse;}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0;}button{padding:1px 6px;}.rustdoc{display:flex;flex-direction:row;flex-wrap:nowrap;}main{position:relative;flex-grow:1;padding:10px 15px 40px 45px;min-width:0;}.source main{padding:15px;}.width-limiter{max-width:960px;margin-right:auto;}.source .width-limiter{max-width:unset;}details:not(.rustdoc-toggle) summary{margin-bottom:.6em;}code,pre,a.test-arrow,.code-header{font-family:"Source Code Pro",monospace;}.docblock code,.docblock-short code{border-radius:3px;padding:0 0.125em;}.docblock pre code,.docblock-short pre code{padding:0;}pre{padding:14px;}.docblock.item-decl{margin-left:0;}.item-decl pre{overflow-x:auto;}.source .content pre{padding:20px;}img{max-width:100%;}li{position:relative;}.source .content{max-width:none;overflow:visible;margin-left:0px;}nav.sub{position:relative;font-size:1rem;}.sub-container{display:flex;flex-direction:row;flex-wrap:nowrap;}.sub-logo-container{display:none;margin-right:20px;}.source .sub-logo-container{display:block;}.source .sub-logo-container>img{height:60px;width:60px;object-fit:contain;}.sidebar,.mobile-topbar,.sidebar-menu-toggle{background-color:var(--sidebar-background-color);}.sidebar{font-size:0.875rem;width:250px;min-width:200px;overflow-y:scroll;position:sticky;height:100vh;top:0;left:0;}.sidebar-elems,.sidebar>.location{padding-left:24px;}.sidebar .location{overflow-wrap:anywhere;}.rustdoc.source .sidebar{width:50px;min-width:0px;max-width:300px;flex-grow:0;flex-shrink:0;flex-basis:auto;border-right:1px solid;overflow-x:hidden;overflow-y:hidden;}.rustdoc.source .sidebar .sidebar-logo{display:none;}.source .sidebar,#sidebar-toggle,#source-sidebar{background-color:var(--sidebar-background-color);}#sidebar-toggle>button:hover,#sidebar-toggle>button:focus{background-color:var(--sidebar-background-color-hover);}.source .sidebar>*:not(#sidebar-toggle){opacity:0;visibility:hidden;}.source-sidebar-expanded .source .sidebar{overflow-y:auto;}.source-sidebar-expanded .source .sidebar>*:not(#sidebar-toggle){opacity:1;visibility:visible;}#all-types{margin-top:1em;}*{scrollbar-width:initial;scrollbar-color:var(--scrollbar-color);}.sidebar{scrollbar-width:thin;scrollbar-color:var(--scrollbar-color);}::-webkit-scrollbar{width:12px;}.sidebar::-webkit-scrollbar{width:8px;}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0;background-color:var(--scrollbar-track-background-color);}.sidebar::-webkit-scrollbar-track{background-color:var(--scrollbar-track-background-color);}::-webkit-scrollbar-thumb,.sidebar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-background-color);}.hidden{display:none !important;}.sidebar .logo-container{display:flex;margin-top:10px;margin-bottom:10px;justify-content:center;}.version{overflow-wrap:break-word;}.logo-container>img{height:100px;width:100px;}.location:empty{border:none;}.location a:first-of-type{font-weight:500;}.block{padding:0;}.block ul,.block li{padding:0;margin:0;list-style:none;}.block a,h2.location a{display:block;padding:0.25rem;margin-left:-0.25rem;text-overflow:ellipsis;overflow:hidden;}.sidebar h2{border-bottom:none;font-weight:500;padding:0;margin:0;margin-top:0.7rem;margin-bottom:0.7rem;}.sidebar h3{font-size:1.125rem;font-weight:500;padding:0;margin:0;}.sidebar-elems .block{margin-bottom:2em;}.sidebar-elems .block li a{white-space:nowrap;}.mobile-topbar{display:none;}.source .content pre.rust{white-space:pre;overflow:auto;padding-left:0;}.rustdoc .example-wrap{display:inline-flex;margin-bottom:10px;}.example-wrap{position:relative;width:100%;}.example-wrap>pre.line-number{overflow:initial;border:1px solid;padding:13px 8px;text-align:right;border-top-left-radius:5px;border-bottom-left-radius:5px;}.example-wrap>pre.rust a:hover{text-decoration:underline;}.line-numbers{text-align:right;}.rustdoc:not(.source) .example-wrap>pre:not(.line-number){width:100%;overflow-x:auto;}.rustdoc:not(.source) .example-wrap>pre.line-numbers{width:auto;overflow-x:visible;}.rustdoc .example-wrap>pre{margin:0;}#search{position:relative;}.search-loading{text-align:center;}#results>table{width:100%;table-layout:fixed;}.content>.example-wrap pre.line-numbers{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.line-numbers span{cursor:pointer;}.docblock-short{overflow-wrap:break-word;overflow-wrap:anywhere;}.docblock-short p{display:inline;}.docblock-short p{overflow:hidden;text-overflow:ellipsis;margin:0;}.docblock>:not(pre)>code,.docblock-short>:not(pre)>code{white-space:pre-wrap;}.top-doc .docblock h2{font-size:1.375rem;}.top-doc .docblock h3{font-size:1.25rem;}.top-doc .docblock h4,.top-doc .docblock h5{font-size:1.125rem;}.top-doc .docblock h6{font-size:1rem;}.docblock h5{font-size:1rem;}.docblock h6{font-size:0.875rem;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5,.docblock h6{border-bottom-color:var(--headings-border-bottom-color);}.docblock{margin-left:24px;position:relative;}.docblock>:not(.information):not(.more-examples-toggle){max-width:100%;overflow-x:auto;}.content .out-of-band{flex-grow:0;font-size:1.125rem;font-weight:normal;float:right;}.method>.code-header,.trait-impl>.code-header{max-width:calc(100% - 41px);display:block;}.content .in-band{flex-grow:1;margin:0px;padding:0px;overflow-wrap:break-word;overflow-wrap:anywhere;}.in-band>code,.in-band>.code-header{display:inline-block;}.docblock code,.docblock-short code,pre,.rustdoc.source .example-wrap{background-color:var(--code-block-background-color);}#main-content{position:relative;}#main-content>.since{top:inherit;}.content table:not(.table-display){border-spacing:0 5px;}.content td{vertical-align:top;}.content td:first-child{padding-right:20px;}.content td p:first-child{margin-top:0;}.content td h1,.content td h2{margin-left:0;font-size:1.125rem;}.content tr:first-child td{border-top:0;}.docblock table{margin:.5em 0;width:calc(100% - 2px);overflow-x:auto;display:block;}.docblock table td{padding:.5em;border:1px dashed;}.docblock table th{padding:.5em;text-align:left;border:1px solid;}.fields+table{margin-bottom:1em;}.content .item-list{list-style-type:none;padding:0;}.content .multi-column{-moz-column-count:5;-moz-column-gap:2.5em;-webkit-column-count:5;-webkit-column-gap:2.5em;column-count:5;column-gap:2.5em;}.content .multi-column li{width:100%;display:inline-block;}.content>.methods>.method{font-size:1rem;position:relative;}.content .method .where,.content .fn .where,.content .where.fmt-newline{display:block;font-size:0.875rem;}.content .methods>div:not(.notable-traits):not(.method){margin-left:40px;margin-bottom:15px;}.content .docblock>.impl-items{margin-left:20px;margin-top:-34px;}.content .docblock>.impl-items .table-display{margin:0;}.content .docblock>.impl-items table td{padding:0;}.content .docblock>.impl-items .table-display,.impl-items table td{border:none;}.item-info{display:block;}.content .item-info code{font-size:0.875rem;}.content .item-info{position:relative;margin-left:24px;}.sub-variant>div>.item-info{margin-top:initial;}.content .impl-items .docblock,.content .impl-items .item-info{margin-bottom:.6em;}.content .impl-items>.item-info{margin-left:40px;}.methods>.item-info,.content .impl-items>.item-info{margin-top:-8px;}.impl-items{flex-basis:100%;}#main-content>.item-info{margin-top:0;margin-left:0;}nav.sub{flex-grow:1;margin-bottom:25px;}.source nav.sub{margin-left:32px;}nav.main{padding:20px 0;text-align:center;}nav.main .current{border-top:1px solid;border-bottom:1px solid;}nav.main .separator{border:1px solid;display:inline-block;height:23px;margin:0 20px;}nav.sum{text-align:right;}nav.sub form{display:inline;}a{text-decoration:none;background:transparent;}.small-section-header{display:flex;justify-content:space-between;position:relative;}.small-section-header:hover>.anchor{display:initial;}.in-band:hover>.anchor,.impl:hover>.anchor,.method.trait-impl:hover>.anchor,.type.trait-impl:hover>.anchor,.associatedconstant.trait-impl:hover>.anchor,.associatedtype.trait-impl:hover>.anchor{display:inline-block;position:absolute;}.anchor{display:none;position:absolute;left:-0.5em;background:none !important;}.anchor.field{left:-5px;}.small-section-header>.anchor{left:-15px;padding-right:8px;}h2.small-section-header>.anchor{padding-right:6px;}.anchor::before{content:'§';}.docblock a:not(.srclink):not(.test-arrow):not(.scrape-help):hover,.docblock-short a:not(.srclink):not(.test-arrow):not(.scrape-help):hover,.item-info a{text-decoration:underline;}.block a.current.crate{font-weight:500;}table,.item-table{overflow-wrap:break-word;}.item-table{display:table;}.item-row{display:table-row;}.item-left,.item-right{display:table-cell;}.item-left{padding-right:1.25rem;}.search-container{position:relative;display:flex;height:34px;}.search-container>*{height:100%;}.search-results-title{display:inline;}#search-settings{font-size:1.5rem;font-weight:500;margin-bottom:20px;}#crate-search{min-width:115px;margin-top:5px;padding-left:0.15em;padding-right:23px;border:1px solid;border-radius:4px;outline:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;background-repeat:no-repeat;background-color:transparent;background-size:20px;background-position:calc(100% - 1px) 56%;background-image:url("down-arrow.svg");max-width:100%;text-overflow:ellipsis;}.search-container{margin-top:4px;}.search-input{-webkit-appearance:none;-moz-box-sizing:border-box !important;box-sizing:border-box !important;outline:none;border:1px solid;border-radius:2px;padding:8px;font-size:1rem;width:100%;}.search-results{display:none;padding-bottom:2em;}.search-results.active{display:block;clear:both;}.search-results .desc>span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;display:block;}.search-results>a{display:block;width:100%;margin-left:2px;margin-right:2px;border-bottom:1px solid #aaa3;}.search-results>a>div{display:flex;flex-flow:row wrap;}.search-results .result-name,.search-results div.desc,.search-results .result-description{width:50%;}.search-results .result-name{padding-right:1em;}.search-results .result-name>span{display:inline-block;margin:0;font-weight:normal;}.popover{font-size:1rem;position:absolute;right:0;z-index:2;display:block;margin-top:7px;border-radius:3px;border:1px solid;font-size:1rem;}.popover::before{content:'';position:absolute;right:11px;border:solid;border-width:1px 1px 0 0;display:inline-block;padding:4px;transform:rotate(-45deg);top:-5px;}.popover,.popover::before{background-color:var(--main-background-color);color:var(--main-color);}#help-button .popover{max-width:600px;}#help-button .popover::before{right:48px;}#help-button dt{float:left;clear:left;display:block;margin-right:0.5rem;}#help-button span.top,#help-button span.bottom{text-align:center;display:block;font-size:1.125rem;}#help-button span.top{text-align:center;display:block;margin:10px 0;border-bottom:1px solid;padding-bottom:4px;margin-bottom:6px;}#help-button span.bottom{clear:both;border-top:1px solid;}.side-by-side{text-align:initial;}.side-by-side>div{width:50%;float:left;padding:0 20px 20px 17px;}.item-info .stab{width:fit-content;min-height:36px;display:flex;align-items:center;white-space:pre-wrap;}.stab{padding:3px;margin-bottom:5px;font-size:0.875rem;font-weight:normal;}.stab p{display:inline;margin:0;}.stab .emoji{font-size:1.25rem;}.emoji{text-shadow:1px 0 0 black,-1px 0 0 black,0 1px 0 black,0 -1px 0 black;}.module-item .stab,.import-item .stab{border-radius:3px;display:inline-block;font-size:0.875rem;line-height:1.2;margin-bottom:0;margin-left:0.3125em;padding:2px;vertical-align:text-bottom;}.module-item.unstable,.import-item.unstable{opacity:0.65;}.since{font-weight:normal;font-size:initial;}.rightside{padding-left:12px;padding-right:2px;position:initial;}.impl-items .srclink,.impl .srclink,.methods .srclink{font-weight:normal;font-size:1rem;}.rightside{float:right;}.variants_table{width:100%;}.variants_table tbody tr td:first-child{width:1%;}td.summary-column{width:100%;}.summary{padding-right:0px;}pre.rust .question-mark{font-weight:bold;}a.test-arrow{display:inline-block;visibility:hidden;position:absolute;padding:5px 10px 5px 10px;border-radius:5px;font-size:1.375rem;top:5px;right:5px;z-index:1;}.example-wrap:hover .test-arrow{visibility:visible;}a.test-arrow:hover{text-decoration:none;}.code-attribute{font-weight:300;}.item-spacer{width:100%;height:12px;}.out-of-band>span.since{position:initial;font-size:1.25rem;}h3.variant{font-weight:600;font-size:1.125rem;margin-bottom:10px;border-bottom:none;}.sub-variant h4{font-size:1rem;font-weight:400;border-bottom:none;margin-top:0;margin-bottom:0;}.sub-variant{margin-left:24px;margin-bottom:40px;}.sub-variant>.sub-variant-field{margin-left:24px;}.toggle-label{display:inline-block;margin-left:4px;margin-top:3px;}:target>code,:target>.code-header{opacity:1;}:target{padding-right:3px;}.information{position:absolute;left:-25px;margin-top:7px;z-index:1;}.tooltip{position:relative;display:inline-block;cursor:pointer;}.tooltip::after{display:none;text-align:center;padding:5px 3px 3px 3px;border-radius:6px;margin-left:5px;font-size:1rem;}.tooltip.ignore::after{content:"This example is not tested";}.tooltip.compile_fail::after{content:"This example deliberately fails to compile";}.tooltip.should_panic::after{content:"This example panics";}.tooltip.edition::after{content:"This code runs with edition " attr(data-edition);}.tooltip::before{content:" ";position:absolute;top:50%;left:16px;margin-top:-5px;border-width:5px;border-style:solid;display:none;}.tooltip:hover::before,.tooltip:hover::after{display:inline;}.tooltip.compile_fail,.tooltip.should_panic,.tooltip.ignore{font-weight:bold;font-size:1.25rem;}.notable-traits-tooltip{display:inline-block;cursor:pointer;}.notable-traits:hover .notable-traits-tooltiptext,.notable-traits .notable-traits-tooltiptext.force-tooltip{display:inline-block;}.notable-traits .notable-traits-tooltiptext{display:none;padding:5px 3px 3px 3px;border-radius:6px;margin-left:5px;z-index:10;font-size:1rem;cursor:default;position:absolute;border:1px solid;}.notable-traits-tooltip::after{content:"\00a0\00a0\00a0";}.notable-traits .notable,.notable-traits .docblock{margin:0;}.notable-traits .notable{margin:0;margin-bottom:13px;font-size:1.1875rem;font-weight:600;display:block;}.notable-traits .docblock code.content{margin:0;padding:0;font-size:1.25rem;}pre.rust.rust-example-rendered{position:relative;}pre.rust{tab-size:4;-moz-tab-size:4;}.search-failed{text-align:center;margin-top:20px;display:none;}.search-failed.active{display:block;}.search-failed>ul{text-align:left;max-width:570px;margin-left:auto;margin-right:auto;}#titles{height:35px;}#titles>button{float:left;width:33.3%;text-align:center;font-size:1.125rem;cursor:pointer;border:0;border-top:2px solid;}#titles>button:first-child:last-child{margin-right:1px;width:calc(100% - 1px);}#titles>button:not(:last-child){margin-right:1px;width:calc(33.3% - 1px);}#titles>button>div.count{display:inline-block;font-size:1rem;}.notable-traits{cursor:pointer;z-index:2;margin-left:5px;}#sidebar-toggle{position:sticky;top:0;left:0;font-weight:bold;font-size:1.25rem;border-bottom:1px solid;display:flex;height:40px;justify-content:center;align-items:center;z-index:10;}#source-sidebar{width:100%;z-index:1;overflow:auto;}#source-sidebar>.title{font-size:1.5rem;text-align:center;border-bottom:1px solid;margin-bottom:6px;}#sidebar-toggle>button{background:none;color:inherit;cursor:pointer;text-align:center;border:none;outline:none;position:absolute;top:0;bottom:0;left:0;right:0;width:100%;-webkit-appearance:none;opacity:1;}#settings-menu,#help-button{margin-left:4px;outline:none;}#copy-path{height:34px;}#settings-menu>a,#help-button>button,#copy-path{padding:5px;width:33px;border:1px solid;border-radius:2px;cursor:pointer;}#settings-menu{padding:0;}#settings-menu>a,#help-button>button{padding:5px;height:100%;display:block;}@keyframes rotating{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}#settings-menu.rotate>a img{animation:rotating 2s linear infinite;}.setting-line .radio-line input:checked{box-shadow:inset 0 0 0 3px var(--main-background-color);background-color:var(--settings-input-color);}.setting-line .radio-line input:focus{box-shadow:0 0 1px 1px var(--settings-input-color);}.setting-line .radio-line input:checked:focus{box-shadow:inset 0 0 0 3px var(--main-background-color),0 0 2px 2px var(--settings-input-color);}.setting-line .radio-line input:hover{border-color:var(--settings-input-color) !important;}input:checked+.slider{background-color:var(--settings-input-color);}#help-button>button{text-align:center;font-size:20px;padding-top:2px;}#copy-path{background:initial;margin-left:10px;padding:0;padding-left:2px;border:0;}#theme-choices{display:none;position:absolute;left:0;top:28px;border:1px solid;border-radius:3px;z-index:1;cursor:pointer;}#theme-choices>button{border:none;width:100%;padding:4px 8px;text-align:center;background:rgba(0,0,0,0);overflow-wrap:normal;}#theme-choices>button:not(:first-child){border-top:1px solid;}kbd{display:inline-block;padding:3px 5px;font:15px monospace;line-height:10px;vertical-align:middle;border:solid 1px;border-radius:3px;cursor:default;}.hidden-by-impl-hider,.hidden-by-usual-hider{display:none !important;}#implementations-list>h3>span.in-band{width:100%;}.table-display{width:100%;border:0;border-collapse:collapse;border-spacing:0;font-size:1rem;}.table-display tr td:first-child{padding-right:0;}.table-display tr td:last-child{float:right;}.table-display .out-of-band{position:relative;font-size:1.125rem;display:block;}.table-display td:hover .anchor{display:block;top:2px;left:-5px;}#main-content>ul{padding-left:10px;}#main-content>ul>li{list-style:none;}.non-exhaustive{margin-bottom:1em;}details.dir-entry{padding-left:4px;}details.dir-entry>summary{margin:0 0 0 13px;list-style-position:outside;cursor:pointer;}details.dir-entry div.folders,details.dir-entry div.files{padding-left:23px;}details.dir-entry a{display:block;}details.rustdoc-toggle>summary.hideme{cursor:pointer;}details.rustdoc-toggle>summary{list-style:none;}details.rustdoc-toggle>summary::-webkit-details-marker,details.rustdoc-toggle>summary::marker{display:none;}details.rustdoc-toggle>summary.hideme>span{margin-left:9px;}details.rustdoc-toggle>summary::before{content:"";cursor:pointer;width:16px;height:16px;background-repeat:no-repeat;background-position:top left;display:inline-block;vertical-align:middle;opacity:.5;}details.rustdoc-toggle>summary::after{content:"Expand";overflow:hidden;width:0;height:0;position:absolute;}details.rustdoc-toggle>summary.hideme::after{content:"";}details.rustdoc-toggle>summary:focus::before,details.rustdoc-toggle>summary:hover::before{opacity:1;}details.rustdoc-toggle.top-doc>summary,details.rustdoc-toggle.top-doc>summary::before,details.rustdoc-toggle.non-exhaustive>summary,details.rustdoc-toggle.non-exhaustive>summary::before{font-size:1rem;}details.non-exhaustive{margin-bottom:8px;}details.rustdoc-toggle>summary.hideme::before{position:relative;}details.rustdoc-toggle>summary:not(.hideme)::before{position:absolute;left:-24px;top:4px;}.impl-items>details.rustdoc-toggle>summary:not(.hideme)::before{position:absolute;left:-24px;}details.rustdoc-toggle[open] >summary.hideme{position:absolute;}details.rustdoc-toggle{position:relative;}details.rustdoc-toggle[open] >summary.hideme>span{display:none;}details.rustdoc-toggle[open] >summary::before,details.rustdoc-toggle[open] >summary.hideme::before{background-image:url("toggle-minus.svg");}details.rustdoc-toggle>summary::before{background-image:url("toggle-plus.svg");}details.rustdoc-toggle[open] >summary::before,details.rustdoc-toggle[open] >summary.hideme::before{width:16px;height:16px;background-repeat:no-repeat;background-position:top left;display:inline-block;content:"";}details.rustdoc-toggle[open] >summary::after,details.rustdoc-toggle[open] >summary.hideme::after{content:"Collapse";}.docblock summary>*{display:inline-block;}@media (min-width:701px){.docblock>.information:first-child>.tooltip{margin-top:16px;}.source-sidebar-expanded .source .sidebar+main .width-limiter .sub-logo-container.rust-logo{display:none;}.source-sidebar-expanded .source .sidebar{width:300px;}}@media (max-width:700px){*[id]{scroll-margin-top:45px;}.rustdoc{padding-top:0px;display:block;}main{padding-left:15px;padding-top:0px;}.rustdoc,.main-heading{flex-direction:column;}.content .out-of-band{text-align:left;margin-left:initial;padding:initial;}.content .out-of-band .since::before{content:"Since ";}#copy-path{display:none;}.sidebar .sidebar-logo,.sidebar .location{display:none;}.sidebar-elems{margin-top:1em;}.sidebar{position:fixed;top:45px;left:-1000px;margin-left:0;margin:0;padding:0;z-index:11;height:calc(100vh - 45px);}.source main,.rustdoc.source .sidebar{top:0;padding:0;height:100vh;border:0;}.sidebar.shown,.source-sidebar-expanded .source .sidebar,.sidebar:focus-within{left:0;}.rustdoc.source>.sidebar{position:fixed;margin:0;z-index:11;width:0;}.mobile-topbar .location a{padding:0;margin:0;}.mobile-topbar .location{border:none;padding:0;margin:auto 0.5em auto auto;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:24px;}.mobile-topbar .logo-container{max-height:45px;}.mobile-topbar .logo-container>img{max-width:35px;max-height:35px;margin-left:20px;margin-top:5px;margin-bottom:5px;}.mobile-topbar{display:flex;flex-direction:row;position:sticky;z-index:10;font-size:2rem;height:45px;width:100%;left:0;top:0;}.source .mobile-topbar{display:none;}.sidebar-menu-toggle{width:45px;font-size:32px;border:none;}.sidebar-elems{background-color:var(--sidebar-background-color);}.source nav:not(.sidebar).sub{margin-left:32px;}.content{margin-left:0px;}.source .content{margin-top:10px;}#search{margin-left:0;padding:0;}.anchor{display:none !important;}.notable-traits{position:absolute;left:-22px;top:24px;}#titles>button>div.count{float:left;width:100%;}#titles{height:50px;}#sidebar-filler{position:fixed;left:45px;width:calc(100% - 45px);top:0;height:45px;z-index:-1;border-bottom:1px solid;}#main-content>details.rustdoc-toggle>summary::before,#main-content>div>details.rustdoc-toggle>summary::before{left:-11px;}#sidebar-toggle{position:fixed;left:1px;top:100px;width:30px;font-size:1.5rem;text-align:center;padding:0;z-index:10;border-top-right-radius:3px;border-bottom-right-radius:3px;cursor:pointer;font-weight:bold;border:1px solid;border-left:0;}.source-sidebar-expanded #sidebar-toggle{left:unset;top:unset;width:unset;border-top-right-radius:unset;border-bottom-right-radius:unset;position:sticky;border:0;border-bottom:1px solid;}#source-sidebar{z-index:11;}#main-content>.line-numbers{margin-top:0;}.notable-traits .notable-traits-tooltiptext{left:0;top:100%;}#help-button{display:none;}.item-table{display:block;}.item-row{display:flex;flex-flow:column wrap;}.item-left,.item-right{width:100%;}.search-results>a{border-bottom:1px solid #aaa9;padding:5px 0px;}.search-results .result-name,.search-results div.desc,.search-results .result-description{width:100%;}.search-results div.desc,.search-results .result-description,.item-right{padding-left:2em;}.source-sidebar-expanded .source .sidebar{max-width:100vw;width:100vw;}details.rustdoc-toggle:not(.top-doc)>summary{margin-left:10px;}.impl-items>details.rustdoc-toggle>summary:not(.hideme)::before,#main-content>details.rustdoc-toggle:not(.top-doc)>summary::before,#main-content>div>details.rustdoc-toggle>summary::before{left:-11px;}}@media print{nav.sidebar,nav.sub,.content .out-of-band,a.srclink,#copy-path,details.rustdoc-toggle[open] >summary::before,details.rustdoc-toggle>summary::before,details.rustdoc-toggle.top-doc>summary{display:none;}.docblock{margin-left:0;}main{padding:10px;}}@media (max-width:464px){#titles,#titles>button{height:73px;}#main-content>table:not(.table-display) td{word-break:break-word;width:50%;}#crate-search{border-radius:4px;}.docblock{margin-left:12px;}.docblock code{overflow-wrap:break-word;overflow-wrap:anywhere;}.sub-container{flex-direction:column;}.sub-logo-container{align-self:center;}.source .sub-logo-container>img{height:35px;width:35px;}#sidebar-toggle{top:10px;}.source-sidebar-expanded #sidebar-toggle{top:unset;}}.method-toggle summary,.implementors-toggle summary,.impl{margin-bottom:0.75em;}.method-toggle[open]{margin-bottom:2em;}.implementors-toggle[open]{margin-bottom:2em;}#trait-implementations-list .method-toggle,#synthetic-implementations-list .method-toggle,#blanket-implementations-list .method-toggle{margin-bottom:1em;}.scraped-example-list .scrape-help{margin-left:10px;padding:0 4px;font-weight:normal;font-size:12px;position:relative;bottom:1px;background:transparent;border-width:1px;border-style:solid;border-radius:50px;}.scraped-example .code-wrapper{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;}.scraped-example:not(.expanded) .code-wrapper{max-height:240px;}.scraped-example:not(.expanded) .code-wrapper pre{overflow-y:hidden;max-height:240px;padding-bottom:0;}.scraped-example:not(.expanded) .code-wrapper pre.line-numbers{overflow-x:hidden;}.scraped-example .code-wrapper .prev{position:absolute;top:0.25em;right:2.25em;z-index:100;cursor:pointer;}.scraped-example .code-wrapper .next{position:absolute;top:0.25em;right:1.25em;z-index:100;cursor:pointer;}.scraped-example .code-wrapper .expand{position:absolute;top:0.25em;right:0.25em;z-index:100;cursor:pointer;}.scraped-example:not(.expanded) .code-wrapper:before{content:" ";width:100%;height:5px;position:absolute;z-index:100;top:0;}.scraped-example:not(.expanded) .code-wrapper:after{content:" ";width:100%;height:5px;position:absolute;z-index:100;bottom:0;}.scraped-example .code-wrapper .line-numbers{margin:0;padding:14px 0;}.scraped-example .code-wrapper .line-numbers span{padding:0 14px;}.scraped-example .code-wrapper .example-wrap{flex:1;overflow-x:auto;overflow-y:hidden;margin-bottom:0;}.scraped-example:not(.expanded) .code-wrapper .example-wrap{overflow-x:hidden;}.scraped-example .code-wrapper .example-wrap pre.rust{overflow-x:inherit;width:inherit;overflow-y:hidden;}.more-examples-toggle{max-width:calc(100% + 25px);margin-top:10px;margin-left:-25px;}.more-examples-toggle .hide-more{margin-left:25px;margin-bottom:5px;cursor:pointer;}.more-scraped-examples{margin-left:5px;display:flex;flex-direction:row;}.more-scraped-examples-inner{width:calc(100% - 20px);}.toggle-line{align-self:stretch;margin-right:10px;margin-top:5px;padding:0 4px;cursor:pointer;}.toggle-line-inner{min-width:2px;height:100%;}.more-scraped-examples .scraped-example{margin-bottom:20px;}.more-scraped-examples .scraped-example:last-child{margin-bottom:0;}.example-links a{margin-top:20px;}.example-links ul{margin-bottom:0;} \ No newline at end of file diff --git a/ch9-gui-dev/search-index.js b/ch9-gui-dev/search-index.js new file mode 100644 index 00000000..b5cf766f --- /dev/null +++ b/ch9-gui-dev/search-index.js @@ -0,0 +1,5 @@ +var searchIndex = JSON.parse('{\ +"os":{"doc":"","t":[3,12,11,0,11,11,11,11,11,5,0,0,11,0,11,0,0,11,0,0,11,11,14,14,5,11,11,0,0,0,0,0,0,11,11,11,11,11,11,11,6,17,6,17,17,17,17,17,8,17,3,17,17,17,17,17,12,11,11,11,11,11,11,5,10,11,5,10,11,10,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,2,17,17,17,2,17,17,17,17,17,3,11,11,11,11,11,11,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,2,2,2,2,0,0,0,0,0,0,3,2,12,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,11,11,17,3,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,0,3,3,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,8,2,3,12,11,11,11,11,11,11,11,11,10,10,11,0,11,11,10,11,11,11,11,11,11,11,11,11,10,18,18,18,18,3,3,3,3,3,3,18,18,3,18,18,3,12,12,12,12,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,7,3,8,17,3,12,11,11,11,11,11,11,11,11,11,11,11,11,11,12,10,11,11,11,10,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,12,8,3,3,17,17,3,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,4,13,3,13,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,8,2,2,2,2,2,2,2,0,2,2,2,0,10,10,0,10,10,18,3,3,3,18,18,3,18,18,12,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,11,11,11,5,11,11,11,12,5,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,13,13,13,3,3,17,4,11,12,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,12,11,3,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,2,2,0,2,3,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,12,11,11,11,11,12,11,11,11,11,11,11,11,11,11,3,3,17,17,17,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,5,11,11,12,5,11,11,11,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,5,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,0,2,0,5,2,0,0,2,2,2,2,2,12,12,12,12,17,6,17,3,3,3,3,8,17,6,17,3,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,3,8,6,3,3,12,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,10,11,11,11,12,11,5,5,5,11,11,11,11,5,11,11,11,10,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,7,7,5,5,5,13,13,3,3,3,4,3,18,18,18,18,12,11,11,12,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,5,5,5,11,11,11,5,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,11,11,11,12,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,5,11,11,11,11,11,11,11,11,11,11,11,11,5,5,11,5,5,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,18,18,18,3,3,3,18,18,3,3,18,18,18,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,5,5,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,17,17,17,17,17,17,17,17,17,5,5,5,5,5,2,2,2,2,2,2,2,0,0,0,0,3,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,8,3,3,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,10,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,3,3,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,12,3,3,3,3,3,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,0,0,0,0,5,0,5,5,5,5,5,5,17,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,2,3,2,2,2,2,2,2,12,5,2,11,5,5,11,11,11,5,11,11,0,5,2,2,2,2,2,2,11,5,11,0,11,2,0,11,11,2,2,0,0,2,2,11,11,2,0,5,0,2,0,11,11,11,11,11,11,11,3,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,12,11,11,11,11,11,11,11,11,12,12,17,3,3,3,3,3,3,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,12,11,12,11,11,11,11,11,11,11,11,11,11,11,11,12,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,5,11,11,11,11,11,11,11,11,11,11,11,11,11,3,3,3,12,12,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,11,11,11,5,11,11,11,11,11,11,11,11,11,11,5,12,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,3,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,12,12,11,11,11,11,11,11,12,11,11,11,12,12,12,11,11,11,11,11,12,12,11,11,11,11,12,12,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,3,3,12,11,11,11,11,11,11,11,11,11,11,11,11,11,12,5,5,5,5,5,5,11,11,11,11,12,11,11,11,11,11,11,11,5,11,11,11,11,5,11,5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,18,18,18,18,18,3,11,11,11,11,11,11,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,5,13,13,13,3,3,4,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,11,11,11,11,11,11,12,11,11,11,11,12,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,12,12,11,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,17,17,3,3,12,5,11,11,11,11,11,11,11,11,5,11,11,11,11,11,11,11,12,11,11,5,5,11,11,11,11,11,11,11,11,11,11,11,5,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,2,0,5,5,5,5,5,5,5,5,5,3,11,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,12,11,12,12,11,11,11,11,11,11,11,12],"n":["DEV_NON_BLOCKING_ACCESS","__private_field","az","board","borrow","borrow_mut","cast_from","checked_as","checked_cast_from","clear_bss","config","console","deref","drivers","from","fs","gui","into","lang_items","mm","overflowing_as","overflowing_cast_from","print","println","rust_main","saturating_as","saturating_cast_from","sbi","sync","syscall","task","timer","trap","try_from","try_into","type_id","unwrapped_as","unwrapped_cast_from","wrapping_as","wrapping_cast_from","BlockDeviceImpl","CLOCK_FREQ","CharDeviceImpl","EXIT_FAILURE","EXIT_FAILURE_FLAG","EXIT_RESET","EXIT_SUCCESS","MMIO","QEMUExit","QEMU_EXIT_HANDLE","RISCV64","VIRTGPU_XRES","VIRTGPU_YRES","VIRT_PLIC","VIRT_TEST","VIRT_UART","addr","az","borrow","borrow_mut","cast_from","checked_as","checked_cast_from","device_init","exit","exit","exit_code_encode","exit_failure","exit_failure","exit_success","exit_success","from","into","irq_handler","new","overflowing_as","overflowing_cast_from","saturating_as","saturating_cast_from","try_from","try_into","type_id","unwrapped_as","unwrapped_cast_from","wrapping_as","wrapping_cast_from","CLOCK_FREQ","KERNEL_HEAP_SIZE","KERNEL_STACK_SIZE","MEMORY_END","MMIO","PAGE_SIZE","PAGE_SIZE_BITS","TRAMPOLINE","TRAP_CONTEXT_BASE","USER_STACK_SIZE","Stdout","az","borrow","borrow_mut","cast_from","checked_as","checked_cast_from","from","into","overflowing_as","overflowing_cast_from","print","saturating_as","saturating_cast_from","try_from","try_into","type_id","unwrapped_as","unwrapped_cast_from","wrapping_as","wrapping_cast_from","write_str","BLOCK_DEVICE","BLOCK_DEVICE","UART","UART","block","bus","chardev","gpu","input","plic","BLOCK_DEVICE","VirtIOBlock","__private_field","az","block_device_test","borrow","borrow_mut","cast_from","checked_as","checked_cast_from","deref","from","into","overflowing_as","overflowing_cast_from","saturating_as","saturating_cast_from","try_from","try_into","type_id","unwrapped_as","unwrapped_cast_from","virtio_blk","wrapping_as","wrapping_cast_from","VIRTIO0","VirtIOBlock","az","borrow","borrow_mut","cast_from","checked_as","checked_cast_from","condvars","from","handle_irq","into","new","overflowing_as","overflowing_cast_from","read_block","saturating_as","saturating_cast_from","try_from","try_into","type_id","unwrapped_as","unwrapped_cast_from","virtio_blk","wrapping_as","wrapping_cast_from","write_block","virtio","QUEUE_FRAMES","VirtioHal","__private_field","az","az","borrow","borrow","borrow_mut","borrow_mut","cast_from","cast_from","checked_as","checked_as","checked_cast_from","checked_cast_from","deref","dma_alloc","dma_dealloc","from","from","into","into","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","phys_to_virt","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","try_from","try_from","try_into","try_into","type_id","type_id","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","virt_to_phys","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","CharDevice","NS16550a","UART","__private_field","az","borrow","borrow_mut","cast_from","checked_as","checked_cast_from","deref","from","handle_irq","init","into","ns16550a","overflowing_as","overflowing_cast_from","read","saturating_as","saturating_cast_from","try_from","try_into","type_id","unwrapped_as","unwrapped_cast_from","wrapping_as","wrapping_cast_from","write","AUX_OUTPUT1","AUX_OUTPUT2","DATA_AVAILABLE","DATA_TERMINAL_READY","IER","LSR","MCR","NS16550a","NS16550aInner","NS16550aRaw","REQUEST_TO_SEND","RX_AVAILABLE","ReadWithoutDLAB","THR_EMPTY","TX_EMPTY","WriteWithoutDLAB","_padding0","_padding1","_padding1","_padding2","all","all","all","az","az","az","az","az","az","az","az","base_addr","bitand","bitand","bitand","bitand_assign","bitand_assign","bitand_assign","bitor","bitor","bitor","bitor_assign","bitor_assign","bitor_assign","bits","bits","bits","bits","bits","bits","bitxor","bitxor","bitxor","bitxor_assign","bitxor_assign","bitxor_assign","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","cast_from","cast_from","cast_from","cast_from","cast_from","cast_from","cast_from","cast_from","checked_as","checked_as","checked_as","checked_as","checked_as","checked_as","checked_as","checked_as","checked_cast_from","checked_cast_from","checked_cast_from","checked_cast_from","checked_cast_from","checked_cast_from","checked_cast_from","checked_cast_from","clone","clone","clone","clone_into","clone_into","clone_into","cmp","cmp","cmp","complement","complement","complement","condvar","contains","contains","contains","difference","difference","difference","empty","empty","empty","eq","eq","eq","extend","extend","extend","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from_bits","from_bits","from_bits","from_bits_truncate","from_bits_truncate","from_bits_truncate","from_bits_unchecked","from_bits_unchecked","from_bits_unchecked","from_iter","from_iter","from_iter","handle_irq","hash","hash","hash","ier","ier","iir","init","init","inner","insert","insert","insert","intersection","intersection","intersection","intersects","intersects","intersects","into","into","into","into","into","into","into","into","is_all","is_all","is_all","is_empty","is_empty","is_empty","lcr","lcr","lsr","lsr","mcr","mcr","ne","ne","ne","new","new","not","not","not","ns16550a","overflowing_as","overflowing_as","overflowing_as","overflowing_as","overflowing_as","overflowing_as","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","partial_cmp","partial_cmp","partial_cmp","rbr","read","read","read_buffer","read_end","remove","remove","remove","saturating_as","saturating_as","saturating_as","saturating_as","saturating_as","saturating_as","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","saturating_cast_from","saturating_cast_from","saturating_cast_from","saturating_cast_from","saturating_cast_from","saturating_cast_from","set","set","set","sub","sub","sub","sub_assign","sub_assign","sub_assign","symmetric_difference","symmetric_difference","symmetric_difference","thr","to_owned","to_owned","to_owned","toggle","toggle","toggle","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","union","union","union","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","wrapping_as","wrapping_as","wrapping_as","wrapping_as","wrapping_as","wrapping_as","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","write","write","write_end","BMP_DATA","GPU_DEVICE","GpuDevice","VIRTIO7","VirtIOGpuWrapper","__private_field","az","az","borrow","borrow","borrow_mut","borrow_mut","cast_from","cast_from","checked_as","checked_as","checked_cast_from","checked_cast_from","deref","fb","flush","flush","from","from","get_framebuffer","get_framebuffer","gpu","into","into","new","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","try_from","try_from","try_into","try_into","type_id","type_id","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","update_cursor","update_cursor","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","0","InputDevice","KEYBOARD_DEVICE","MOUSE_DEVICE","VIRTIO5","VIRTIO6","VirtIOInputWrapper","__private_field","__private_field","az","az","az","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","cast_from","cast_from","cast_from","checked_as","checked_as","checked_as","checked_cast_from","checked_cast_from","checked_cast_from","deref","deref","from","from","from","handle_irq","handle_irq","into","into","into","new","overflowing_as","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","saturating_as","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","saturating_cast_from","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","wrapping_as","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","IntrTargetPriority","Machine","PLIC","Supervisor","az","az","base_addr","borrow","borrow","borrow_mut","borrow_mut","cast_from","cast_from","checked_as","checked_as","checked_cast_from","checked_cast_from","claim","claim_comp_ptr_of_hart_with_priority","clone","clone_into","complete","disable","enable","enable_ptr","from","from","get_priority","get_threshold","hart_id_with_priority","into","into","new","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","priority_ptr","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","set_priority","set_threshold","supported_number","threshold_ptr_of_hart_with_priority","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","File","OSInode","OpenFlags","Pipe","ROOT_INODE","ROOT_INODE","Stdin","Stdout","inode","list_apps","make_pipe","open_file","pipe","read","readable","stdio","writable","write","CREATE","OSInode","OSInodeInner","OpenFlags","RDONLY","RDWR","ROOT_INODE","TRUNC","WRONLY","__private_field","all","az","az","az","az","bitand","bitand_assign","bitor","bitor_assign","bits","bits","bitxor","bitxor_assign","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","cast_from","cast_from","cast_from","cast_from","checked_as","checked_as","checked_as","checked_as","checked_cast_from","checked_cast_from","checked_cast_from","checked_cast_from","clone","clone_into","cmp","complement","contains","deref","difference","empty","eq","extend","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from_bits","from_bits_truncate","from_bits_unchecked","from_iter","hash","inner","inode","insert","intersection","intersects","into","into","into","into","is_all","is_empty","list_apps","ne","new","not","offset","open_file","overflowing_as","overflowing_as","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","partial_cmp","read","read_all","read_write","readable","readable","remove","saturating_as","saturating_as","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","saturating_cast_from","saturating_cast_from","set","sub","sub_assign","symmetric_difference","to_owned","toggle","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","union","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","wrapping_as","wrapping_as","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","writable","writable","write","Empty","Full","Normal","Pipe","PipeRingBuffer","RING_BUFFER_SIZE","RingBufferStatus","all_write_ends_closed","arr","available_read","available_write","az","az","az","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","buffer","cast_from","cast_from","cast_from","checked_as","checked_as","checked_as","checked_cast_from","checked_cast_from","checked_cast_from","clone","clone_into","eq","from","from","from","head","into","into","into","make_pipe","new","overflowing_as","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","read","read_byte","read_end_with_buffer","readable","readable","saturating_as","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","saturating_cast_from","set_write_end","status","tail","to_owned","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","wrapping_as","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","writable","writable","write","write_byte","write_end","write_end_with_buffer","Stdin","Stdout","az","az","borrow","borrow","borrow_mut","borrow_mut","cast_from","cast_from","checked_as","checked_as","checked_cast_from","checked_cast_from","from","from","into","into","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","read","read","readable","readable","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","try_from","try_from","try_into","try_into","type_id","type_id","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","writable","writable","write","write","graphic","init_paint","move_rect","paint","reset","Graphics","az","borrow","borrow_mut","bounding_box","cast_from","checked_as","checked_cast_from","clipped","clone","clone_into","color_converted","cropped","draw_iter","drv","from","get_framebuffer","into","new","overflowing_as","overflowing_cast_from","point","reset","saturating_as","saturating_cast_from","size","size","to_owned","translated","try_from","try_into","type_id","unwrapped_as","unwrapped_cast_from","wrapping_as","wrapping_cast_from","DRAWING_BOARD","DrawingBoard","INIT_X","INIT_Y","RECT_SIZE","__private_field","az","az","borrow","borrow","borrow_mut","borrow_mut","cast_from","cast_from","checked_as","checked_as","checked_cast_from","checked_cast_from","deref","from","from","graphics","init_paint","into","into","latest_pos","move_rect","move_rect","new","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","paint","reset","reset","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","try_from","try_from","try_into","try_into","type_id","type_id","unpaint","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","backtrace","panic","FrameTracker","KERNEL_SPACE","KERNEL_SPACE","MapArea","MapPermission","MapType","MemorySet","PPNRange","PageTable","PageTableEntry","PhysAddr","PhysPageNum","StepByOne","UserBuffer","UserBufferIterator","VPNRange","VirtAddr","VirtPageNum","address","frame_alloc","frame_allocator","frame_dealloc","heap_allocator","init","kernel_token","memory_set","page_table","remap_test","translated_byte_buffer","translated_ref","translated_refmut","translated_str","0","0","0","0","PA_WIDTH_SV39","PPNRange","PPN_WIDTH_SV39","PhysAddr","PhysPageNum","SimpleRange","SimpleRangeIterator","StepByOne","VA_WIDTH_SV39","VPNRange","VPN_WIDTH_SV39","VirtAddr","VirtPageNum","aligned","aligned","az","az","az","az","az","az","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","cast_from","cast_from","cast_from","cast_from","cast_from","cast_from","ceil","ceil","checked_as","checked_as","checked_as","checked_as","checked_as","checked_as","checked_cast_from","checked_cast_from","checked_cast_from","checked_cast_from","checked_cast_from","checked_cast_from","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","cmp","cmp","cmp","current","draw","end","eq","eq","eq","eq","floor","floor","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","get_bytes_array","get_end","get_mut","get_mut","get_pte_array","get_ref","get_start","indexes","into","into","into","into","into","into","into_iter","into_iter","l","ne","ne","ne","ne","new","new","next","overflowing_as","overflowing_as","overflowing_as","overflowing_as","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","page_offset","page_offset","partial_cmp","partial_cmp","partial_cmp","partial_cmp","r","saturating_as","saturating_as","saturating_as","saturating_as","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","saturating_cast_from","saturating_cast_from","saturating_cast_from","saturating_cast_from","step","step","step","to_owned","to_owned","to_owned","to_owned","to_owned","translated","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","wrapping_as","wrapping_as","wrapping_as","wrapping_as","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","FRAME_ALLOCATOR","FrameAllocator","FrameAllocatorImpl","FrameTracker","StackFrameAllocator","__private_field","alloc","alloc","az","az","az","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","cast_from","cast_from","cast_from","checked_as","checked_as","checked_as","checked_cast_from","checked_cast_from","checked_cast_from","current","dealloc","dealloc","deref","drop","end","fmt","frame_alloc","frame_allocator_test","frame_dealloc","from","from","from","init","init_frame_allocator","into","into","into","new","new","new","new_nowrite","overflowing_as","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","ppn","recycled","saturating_as","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","saturating_cast_from","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","wrapping_as","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","HEAP_ALLOCATOR","HEAP_SPACE","handle_alloc_error","heap_test","init_heap","Framed","Identical","KERNEL_SPACE","MapArea","MapPermission","MapType","MemorySet","R","U","W","X","__private_field","activate","all","areas","az","az","az","az","az","bitand","bitand_assign","bitor","bitor_assign","bits","bits","bitxor","bitxor_assign","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","cast_from","cast_from","cast_from","cast_from","cast_from","checked_as","checked_as","checked_as","checked_as","checked_as","checked_cast_from","checked_cast_from","checked_cast_from","checked_cast_from","checked_cast_from","clone","clone","clone_into","clone_into","cmp","complement","contains","copy_data","data_frames","deref","difference","ebss","edata","ekernel","empty","eq","eq","erodata","etext","extend","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from_another","from_bits","from_bits_truncate","from_bits_unchecked","from_elf","from_existed_user","from_iter","hash","insert","insert_framed_area","intersection","intersects","into","into","into","into","into","is_all","is_empty","kernel_token","map","map_noalloc","map_one","map_perm","map_trampoline","map_type","ne","new","new_bare","new_kernel","not","overflowing_as","overflowing_as","overflowing_as","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","page_table","partial_cmp","push","push_noalloc","recycle_data_pages","remap_test","remove","remove_area_with_start_vpn","saturating_as","saturating_as","saturating_as","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","saturating_cast_from","saturating_cast_from","saturating_cast_from","sbss_with_stack","sdata","set","srodata","stext","strampoline","sub","sub_assign","symmetric_difference","to_owned","to_owned","toggle","token","translate","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","union","unmap","unmap_one","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","vpn_range","wrapping_as","wrapping_as","wrapping_as","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","A","D","G","PTEFlags","PageTable","PageTableEntry","R","U","UserBuffer","UserBufferIterator","V","W","X","all","az","az","az","az","az","bitand","bitand_assign","bitor","bitor_assign","bits","bits","bits","bitxor","bitxor_assign","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","buffers","buffers","cast_from","cast_from","cast_from","cast_from","cast_from","checked_as","checked_as","checked_as","checked_as","checked_as","checked_cast_from","checked_cast_from","checked_cast_from","checked_cast_from","checked_cast_from","clone","clone","clone_into","clone_into","cmp","complement","contains","current_buffer","current_idx","difference","empty","empty","eq","executable","extend","find_pte","find_pte_create","flags","fmt","fmt","fmt","fmt","fmt","frames","from","from","from","from","from","from_bits","from_bits_truncate","from_bits_unchecked","from_iter","from_token","hash","insert","intersection","intersects","into","into","into","into","into","into_iter","into_iter","is_all","is_empty","is_valid","len","map","ne","new","new","new","next","not","overflowing_as","overflowing_as","overflowing_as","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","partial_cmp","ppn","readable","remove","root_ppn","saturating_as","saturating_as","saturating_as","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","saturating_cast_from","saturating_cast_from","saturating_cast_from","set","sub","sub_assign","symmetric_difference","to_owned","to_owned","toggle","token","translate","translate_va","translated_byte_buffer","translated_ref","translated_refmut","translated_str","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","union","unmap","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","wrapping_as","wrapping_as","wrapping_as","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","writable","SBI_CLEAR_IPI","SBI_CONSOLE_GETCHAR","SBI_CONSOLE_PUTCHAR","SBI_REMOTE_FENCE_I","SBI_REMOTE_SFENCE_VMA","SBI_REMOTE_SFENCE_VMA_ASID","SBI_SEND_IPI","SBI_SET_TIMER","SBI_SHUTDOWN","console_getchar","console_putchar","sbi_call","set_timer","shutdown","Condvar","Mutex","MutexBlocking","MutexSpin","Semaphore","UPIntrFreeCell","UPIntrRefMut","condvar","mutex","semaphore","up","Condvar","CondvarInner","az","az","borrow","borrow","borrow_mut","borrow_mut","cast_from","cast_from","checked_as","checked_as","checked_cast_from","checked_cast_from","from","from","inner","into","into","new","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","signal","try_from","try_from","try_into","try_into","type_id","type_id","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","wait_no_sched","wait_queue","wait_with_mutex","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","Mutex","MutexBlocking","MutexBlockingInner","MutexSpin","az","az","az","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","cast_from","cast_from","cast_from","checked_as","checked_as","checked_as","checked_cast_from","checked_cast_from","checked_cast_from","from","from","from","inner","into","into","into","lock","lock","lock","locked","locked","new","new","overflowing_as","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","saturating_as","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","saturating_cast_from","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","unlock","unlock","unlock","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","wait_queue","wrapping_as","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","Semaphore","SemaphoreInner","az","az","borrow","borrow","borrow_mut","borrow_mut","cast_from","cast_from","checked_as","checked_as","checked_cast_from","checked_cast_from","count","down","from","from","inner","into","into","new","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","try_from","try_from","try_into","try_into","type_id","type_id","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","up","wait_queue","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","0","INTR_MASKING_INFO","IntrMaskingInfo","UPIntrFreeCell","UPIntrRefMut","UPSafeCellRaw","__private_field","az","az","az","az","az","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","cast_from","cast_from","cast_from","cast_from","cast_from","checked_as","checked_as","checked_as","checked_as","checked_as","checked_cast_from","checked_cast_from","checked_cast_from","checked_cast_from","checked_cast_from","deref","deref","deref_mut","drop","enter","exclusive_access","exclusive_session","exit","from","from","from","from","from","get_mut","inner","inner","into","into","into","into","into","nested_level","new","new","new","overflowing_as","overflowing_as","overflowing_as","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","saturating_as","saturating_as","saturating_as","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","saturating_cast_from","saturating_cast_from","saturating_cast_from","sie_before_masking","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","wrapping_as","wrapping_as","wrapping_as","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","SYSCALL_CLOSE","SYSCALL_CONDVAR_CREATE","SYSCALL_CONDVAR_SIGNAL","SYSCALL_CONDVAR_WAIT","SYSCALL_DUP","SYSCALL_EXEC","SYSCALL_EXIT","SYSCALL_FORK","SYSCALL_FRAMEBUFFER","SYSCALL_FRAMEBUFFER_FLUSH","SYSCALL_GETPID","SYSCALL_GETTID","SYSCALL_GET_TIME","SYSCALL_KILL","SYSCALL_MUTEX_CREATE","SYSCALL_MUTEX_LOCK","SYSCALL_MUTEX_UNLOCK","SYSCALL_OPEN","SYSCALL_PIPE","SYSCALL_READ","SYSCALL_SEMAPHORE_CREATE","SYSCALL_SEMAPHORE_DOWN","SYSCALL_SEMAPHORE_UP","SYSCALL_SLEEP","SYSCALL_THREAD_CREATE","SYSCALL_WAITPID","SYSCALL_WAITTID","SYSCALL_WRITE","SYSCALL_YIELD","fs","gui","process","sync","syscall","thread","sys_close","sys_dup","sys_open","sys_pipe","sys_read","sys_write","FB_VADDR","sys_framebuffer","sys_framebuffer_flush","sys_exec","sys_exit","sys_fork","sys_get_time","sys_getpid","sys_kill","sys_waitpid","sys_yield","sys_condvar_create","sys_condvar_signal","sys_condvar_wait","sys_mutex_create","sys_mutex_lock","sys_mutex_unlock","sys_semaphore_create","sys_semaphore_down","sys_semaphore_up","sys_sleep","sys_gettid","sys_thread_create","sys_waittid","IDLE_PID","INITPROC","KernelStack","PidHandle","SignalFlags","TaskContext","TaskControlBlock","TaskStatus","__private_field","add_initproc","add_task","az","block_current_and_run_next","block_current_task","borrow","borrow_mut","cast_from","check_signals_of_current","checked_as","checked_cast_from","context","current_add_signal","current_kstack_top","current_process","current_task","current_trap_cx","current_trap_cx_user_va","current_user_token","deref","exit_current_and_run_next","from","id","into","kstack_alloc","manager","overflowing_as","overflowing_cast_from","pid2process","pid_alloc","process","processor","remove_from_pid2process","run_tasks","saturating_as","saturating_cast_from","schedule","signal","suspend_current_and_run_next","switch","take_current_task","task","try_from","try_into","type_id","unwrapped_as","unwrapped_cast_from","wrapping_as","wrapping_cast_from","TaskContext","az","borrow","borrow_mut","cast_from","checked_as","checked_cast_from","from","goto_trap_return","into","overflowing_as","overflowing_cast_from","ra","s","saturating_as","saturating_cast_from","sp","try_from","try_into","type_id","unwrapped_as","unwrapped_cast_from","wrapping_as","wrapping_cast_from","zero_init","0","0","IDLE_PID","KSTACK_ALLOCATOR","KernelStack","PID_ALLOCATOR","PidHandle","RecycleAllocator","TaskUserRes","__private_field","__private_field","alloc","alloc_tid","alloc_user_res","az","az","az","az","az","az","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","cast_from","cast_from","cast_from","cast_from","cast_from","cast_from","checked_as","checked_as","checked_as","checked_as","checked_as","checked_as","checked_cast_from","checked_cast_from","checked_cast_from","checked_cast_from","checked_cast_from","checked_cast_from","current","dealloc","dealloc_tid","dealloc_user_res","deref","deref","drop","drop","drop","from","from","from","from","from","from","get_top","into","into","into","into","into","into","kernel_stack_position","kstack_alloc","new","new","overflowing_as","overflowing_as","overflowing_as","overflowing_as","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","pid_alloc","process","push_on_top","recycled","saturating_as","saturating_as","saturating_as","saturating_as","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","saturating_cast_from","saturating_cast_from","saturating_cast_from","saturating_cast_from","tid","trap_cx_bottom_from_tid","trap_cx_ppn","trap_cx_user_va","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","ustack_base","ustack_base","ustack_bottom_from_tid","ustack_top","wrapping_as","wrapping_as","wrapping_as","wrapping_as","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","PID2PCB","TASK_MANAGER","TaskManager","__private_field","__private_field","add","add_task","az","az","az","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","cast_from","cast_from","cast_from","checked_as","checked_as","checked_as","checked_cast_from","checked_cast_from","checked_cast_from","deref","deref","fetch","fetch_task","from","from","from","insert_into_pid2process","into","into","into","new","overflowing_as","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","pid2process","ready_queue","remove_from_pid2process","saturating_as","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","saturating_cast_from","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","wrapping_as","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","ProcessControlBlock","ProcessControlBlockInner","alloc_fd","alloc_tid","az","az","borrow","borrow","borrow_mut","borrow_mut","cast_from","cast_from","checked_as","checked_as","checked_cast_from","checked_cast_from","children","condvar_list","dealloc_tid","exec","exit_code","fd_table","fork","from","from","get_task","get_user_token","getpid","inner","inner_exclusive_access","into","into","is_zombie","memory_set","mutex_list","new","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","parent","pid","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","semaphore_list","signals","task_res_allocator","tasks","thread_count","try_from","try_from","try_into","try_into","type_id","type_id","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","PROCESSOR","Processor","__private_field","az","az","borrow","borrow","borrow_mut","borrow_mut","cast_from","cast_from","checked_as","checked_as","checked_cast_from","checked_cast_from","current","current","current_kstack_top","current_process","current_task","current_trap_cx","current_trap_cx_user_va","current_user_token","deref","from","from","get_idle_task_cx_ptr","idle_task_cx","into","into","new","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","run_tasks","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","schedule","take_current","take_current_task","try_from","try_from","try_into","try_into","type_id","type_id","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","SIGABRT","SIGFPE","SIGILL","SIGINT","SIGSEGV","SignalFlags","all","az","bitand","bitand_assign","bitor","bitor_assign","bits","bits","bitxor","bitxor_assign","borrow","borrow_mut","cast_from","check_error","checked_as","checked_cast_from","clone","clone_into","cmp","complement","contains","difference","empty","eq","extend","fmt","fmt","fmt","fmt","fmt","from","from_bits","from_bits_truncate","from_bits_unchecked","from_iter","hash","insert","intersection","intersects","into","is_all","is_empty","ne","not","overflowing_as","overflowing_cast_from","partial_cmp","remove","saturating_as","saturating_cast_from","set","sub","sub_assign","symmetric_difference","to_owned","toggle","try_from","try_into","type_id","union","unwrapped_as","unwrapped_cast_from","wrapping_as","wrapping_cast_from","__switch","Blocking","Ready","Running","TaskControlBlock","TaskControlBlockInner","TaskStatus","az","az","az","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","cast_from","cast_from","cast_from","checked_as","checked_as","checked_as","checked_cast_from","checked_cast_from","checked_cast_from","clone","clone_into","eq","exit_code","from","from","from","get_status","get_trap_cx","get_user_token","inner","inner_exclusive_access","into","into","into","kstack","new","overflowing_as","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","overflowing_cast_from","process","res","saturating_as","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","saturating_cast_from","task_cx","task_status","to_owned","trap_cx_ppn","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","unwrapped_as","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","unwrapped_cast_from","wrapping_as","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","wrapping_cast_from","MSEC_PER_SEC","TICKS_PER_SEC","TIMERS","TimerCondVar","__private_field","add_timer","az","az","borrow","borrow","borrow_mut","borrow_mut","cast_from","cast_from","check_timer","checked_as","checked_as","checked_cast_from","checked_cast_from","cmp","deref","eq","expire_ms","from","from","get_time","get_time_ms","into","into","overflowing_as","overflowing_as","overflowing_cast_from","overflowing_cast_from","partial_cmp","saturating_as","saturating_as","saturating_cast_from","saturating_cast_from","set_next_trigger","task","try_from","try_from","try_into","try_into","type_id","type_id","unwrapped_as","unwrapped_as","unwrapped_cast_from","unwrapped_cast_from","wrapping_as","wrapping_as","wrapping_cast_from","wrapping_cast_from","TrapContext","context","disable_supervisor_interrupt","enable_supervisor_interrupt","enable_timer_interrupt","init","set_kernel_trap_entry","set_user_trap_entry","trap_from_kernel","trap_handler","trap_return","TrapContext","app_init_context","az","borrow","borrow_mut","cast_from","checked_as","checked_cast_from","fmt","from","into","kernel_satp","kernel_sp","overflowing_as","overflowing_cast_from","saturating_as","saturating_cast_from","sepc","set_sp","sstatus","trap_handler","try_from","try_into","type_id","unwrapped_as","unwrapped_cast_from","wrapping_as","wrapping_cast_from","x"],"q":["os","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::board","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::config","","","","","","","","","","os::console","","","","","","","","","","","","","","","","","","","","","","os::drivers","","","","","","","","","","os::drivers::block","","","","","","","","","","","","","","","","","","","","","","","","","os::drivers::block::virtio_blk","","","","","","","","","","","","","","","","","","","","","","","","","","","os::drivers::bus","os::drivers::bus::virtio","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::drivers::chardev","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::drivers::chardev::ns16550a","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::drivers::gpu","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::drivers::input","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::drivers::plic","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::fs","","","","","","","","","","","","","","","","","","os::fs::inode","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::fs::pipe","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::fs::stdio","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::gui","","","","","os::gui::graphic","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::gui::paint","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::lang_items","","os::mm","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::mm::address","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::mm::frame_allocator","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::mm::heap_allocator","","","","","os::mm::memory_set","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::mm::page_table","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::sbi","","","","","","","","","","","","","","os::sync","","","","","","","","","","","os::sync::condvar","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::sync::mutex","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::sync::semaphore","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::sync::up","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::syscall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::syscall::fs","","","","","","os::syscall::gui","","","os::syscall::process","","","","","","","","os::syscall::sync","","","","","","","","","","os::syscall::thread","","","os::task","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::task::context","","","","","","","","","","","","","","","","","","","","","","","","","os::task::id","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::task::manager","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::task::process","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::task::processor","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::task::signal","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::task::switch","os::task::task","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::timer","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","os::trap","","","","","","","","","","","os::trap::context","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["","","","","","","","","","","","","","","Returns the argument unchanged.","","","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","RISCV64 configuration","","","","","","Address of the sifive_test mapped device.","","","","","","","","Exit with specified return code.","Exit qemu with specified exit code.","Encode the exit code using EXIT_FAILURE_FLAG.","Exit QEMU using EXIT_FAILURE, aka 1.","","Exit QEMU using EXIT_SUCCESS, aka 0, if possible.","","Returns the argument unchanged.","Calls U::from(self).","","Create an instance.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","","Calls U::from(self).","","","","","","","","","","","","","","","","","","","InterruptEnableRegister","LineStatusRegister","Model Control Register","","","","","","","","","","ignore FCR","ignore MSR","ignore other registers","ignore SCR","Returns the set containing all flags.","Returns the set containing all flags.","Returns the set containing all flags.","","","","","","","","","","Returns the intersection between the two sets of flags.","Returns the intersection between the two sets of flags.","Returns the intersection between the two sets of flags.","Disables all flags disabled in the set.","Disables all flags disabled in the set.","Disables all flags disabled in the set.","Returns the union of the two sets of flags.","Returns the union of the two sets of flags.","Returns the union of the two sets of flags.","Adds the set of flags.","Adds the set of flags.","Adds the set of flags.","Returns the raw value of the flags currently stored.","Returns the raw value of the flags currently stored.","Returns the raw value of the flags currently stored.","","","","Returns the left flags, but with all the right flags …","Returns the left flags, but with all the right flags …","Returns the left flags, but with all the right flags …","Toggles the set of flags.","Toggles the set of flags.","Toggles the set of flags.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the complement of this set of flags.","Returns the complement of this set of flags.","Returns the complement of this set of flags.","","Returns true if all of the flags in other are contained …","Returns true if all of the flags in other are contained …","Returns true if all of the flags in other are contained …","Returns the difference between the flags in self and other.","Returns the difference between the flags in self and other.","Returns the difference between the flags in self and other.","Returns an empty set of flags.","Returns an empty set of flags.","Returns an empty set of flags.","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Convert from underlying bit representation, unless that …","Convert from underlying bit representation, unless that …","Convert from underlying bit representation, unless that …","Convert from underlying bit representation, dropping any …","Convert from underlying bit representation, dropping any …","Convert from underlying bit representation, dropping any …","Convert from underlying bit representation, preserving all …","Convert from underlying bit representation, preserving all …","Convert from underlying bit representation, preserving all …","","","","","","","","interrupt enable register","interrupt enable register","interrupt identification register","","","","Inserts the specified flags in-place.","Inserts the specified flags in-place.","Inserts the specified flags in-place.","Returns the intersection between the flags in self and …","Returns the intersection between the flags in self and …","Returns the intersection between the flags in self and …","Returns true if there are flags common to both self and …","Returns true if there are flags common to both self and …","Returns true if there are flags common to both self and …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Returns true if all flags are currently set.","Returns true if all flags are currently set.","Returns true if all flags are currently set.","Returns true if no flags are currently stored.","Returns true if no flags are currently stored.","Returns true if no flags are currently stored.","line control register","line control register","line status register","line status register","model control register","modem control register","","","","","","Returns the complement of this set of flags.","Returns the complement of this set of flags.","Returns the complement of this set of flags.","","","","","","","","","","","","","","","","","","","","","receiver buffer register","","","","","Removes the specified flags in-place.","Removes the specified flags in-place.","Removes the specified flags in-place.","","","","","","","","","","","","","","","","","Inserts or removes the specified flags depending on the …","Inserts or removes the specified flags depending on the …","Inserts or removes the specified flags depending on the …","Returns the set difference of the two sets of flags.","Returns the set difference of the two sets of flags.","Returns the set difference of the two sets of flags.","Disables all flags enabled in the set.","Disables all flags enabled in the set.","Disables all flags enabled in the set.","Returns the symmetric difference between the flags in self …","Returns the symmetric difference between the flags in self …","Returns the symmetric difference between the flags in self …","transmitter holding register","","","","Toggles the specified flags in-place.","Toggles the specified flags in-place.","Toggles the specified flags in-place.","","","","","","","","","","","","","","","","","","","","","","","","","Returns the union of between the flags in self and other.","Returns the union of between the flags in self and other.","Returns the union of between the flags in self and other.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the set containing all flags.","","","","","Returns the intersection between the two sets of flags.","Disables all flags disabled in the set.","Returns the union of the two sets of flags.","Adds the set of flags.","Returns the raw value of the flags currently stored.","","Returns the left flags, but with all the right flags …","Toggles the set of flags.","","","","","","","","","","","","","","","","","","","","","","","","Returns the complement of this set of flags.","Returns true if all of the flags in other are contained …","","Returns the difference between the flags in self and other.","Returns an empty set of flags.","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Convert from underlying bit representation, unless that …","Convert from underlying bit representation, dropping any …","Convert from underlying bit representation, preserving all …","","","","","Inserts the specified flags in-place.","Returns the intersection between the flags in self and …","Returns true if there are flags common to both self and …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Returns true if all flags are currently set.","Returns true if no flags are currently stored.","","","","Returns the complement of this set of flags.","","","","","","","","","","","","","","Do not check validity for simplicity Return (readable, …","","","Removes the specified flags in-place.","","","","","","","","","Inserts or removes the specified flags depending on the …","Returns the set difference of the two sets of flags.","Disables all flags enabled in the set.","Returns the symmetric difference between the flags in self …","","Toggles the specified flags in-place.","","","","","","","","","","","","","Returns the union of between the flags in self and other.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Return (read_end, write_end)","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Definitions","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","","","","Returns the argument unchanged.","","Returns the argument unchanged.","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the set containing all flags.","","","","","","","Returns the intersection between the two sets of flags.","Disables all flags disabled in the set.","Returns the union of the two sets of flags.","Adds the set of flags.","Returns the raw value of the flags currently stored.","","Returns the left flags, but with all the right flags …","Toggles the set of flags.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the complement of this set of flags.","Returns true if all of the flags in other are contained …","data: start-aligned but maybe with shorter length assume …","","","Returns the difference between the flags in self and other.","","","","Returns an empty set of flags.","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Convert from underlying bit representation, unless that …","Convert from underlying bit representation, dropping any …","Convert from underlying bit representation, preserving all …","Include sections in elf and trampoline, also returns …","","","","Inserts the specified flags in-place.","Assume that no conflicts.","Returns the intersection between the flags in self and …","Returns true if there are flags common to both self and …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Returns true if all flags are currently set.","Returns true if no flags are currently stored.","","","","","","Mention that trampoline is not collected by areas.","","","","","Without kernel stacks.","Returns the complement of this set of flags.","","","","","","","","","","","","","","","","","Removes the specified flags in-place.","","","","","","","","","","","","","","Inserts or removes the specified flags depending on the …","","","","Returns the set difference of the two sets of flags.","Disables all flags enabled in the set.","Returns the symmetric difference between the flags in self …","","","Toggles the specified flags in-place.","","","","","","","","","","","","","","","","","","Returns the union of between the flags in self and other.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the set containing all flags.","","","","","","Returns the intersection between the two sets of flags.","Disables all flags disabled in the set.","Returns the union of the two sets of flags.","Adds the set of flags.","Returns the raw value of the flags currently stored.","","","Returns the left flags, but with all the right flags …","Toggles the set of flags.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the complement of this set of flags.","Returns true if all of the flags in other are contained …","","","Returns the difference between the flags in self and other.","Returns an empty set of flags.","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Convert from underlying bit representation, unless that …","Convert from underlying bit representation, dropping any …","Convert from underlying bit representation, preserving all …","","Temporarily used to get arguments from user space.","","Inserts the specified flags in-place.","Returns the intersection between the flags in self and …","Returns true if there are flags common to both self and …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","Returns true if all flags are currently set.","Returns true if no flags are currently stored.","","","","","","","","","Returns the complement of this set of flags.","","","","","","","","","","","","","","Removes the specified flags in-place.","","","","","","","","","","","","Inserts or removes the specified flags depending on the …","Returns the set difference of the two sets of flags.","Disables all flags enabled in the set.","Returns the symmetric difference between the flags in self …","","","Toggles the specified flags in-place.","","","","","","","Load a string from other address spaces into kernel space …","","","","","","","","","","","","","","","","Returns the union of between the flags in self and other.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Panic if the data has been borrowed.","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","inner data","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","If there is not a child process whose pid is same as …","","","","","","","","","","","","","","thread does not exist, return -1 thread has not exited …","","","","","","","","","","","","","","This function must be followed by a schedule","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Return (bottom, top) of a kernel stack in kernel space.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Only support processes with a single thread.","","","Only support processes with a single thread.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the set containing all flags.","","Returns the intersection between the two sets of flags.","Disables all flags disabled in the set.","Returns the union of the two sets of flags.","Adds the set of flags.","Returns the raw value of the flags currently stored.","","Returns the left flags, but with all the right flags …","Toggles the set of flags.","","","","","","","","","","Returns the complement of this set of flags.","Returns true if all of the flags in other are contained …","Returns the difference between the flags in self and other.","Returns an empty set of flags.","","","","","","","","Returns the argument unchanged.","Convert from underlying bit representation, unless that …","Convert from underlying bit representation, dropping any …","Convert from underlying bit representation, preserving all …","","","Inserts the specified flags in-place.","Returns the intersection between the flags in self and …","Returns true if there are flags common to both self and …","Calls U::from(self).","Returns true if all flags are currently set.","Returns true if no flags are currently stored.","","Returns the complement of this set of flags.","","","","Removes the specified flags in-place.","","","Inserts or removes the specified flags depending on the …","Returns the set difference of the two sets of flags.","Disables all flags enabled in the set.","Returns the symmetric difference between the flags in self …","","Toggles the specified flags in-place.","","","","Returns the union of between the flags in self and other.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Calls U::from(self).","","","","","","","","","","","","","","","","","",""],"i":[0,2,2,0,2,2,2,2,2,0,0,0,2,0,2,0,0,2,0,0,2,2,0,0,0,2,2,0,0,0,0,0,0,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8,8,8,8,8,8,0,116,8,0,116,8,116,8,8,8,0,8,8,8,8,8,8,8,8,8,8,8,8,0,0,0,0,0,0,0,0,0,0,0,11,11,11,11,11,11,11,11,11,11,0,11,11,11,11,11,11,11,11,11,11,0,0,0,0,0,0,0,0,0,0,0,0,14,14,0,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,0,14,14,0,0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0,18,117,18,117,18,117,18,117,18,117,18,117,18,18,117,117,117,18,117,18,117,18,117,18,117,117,18,117,18,117,18,117,18,117,18,117,18,117,18,117,117,18,117,18,0,0,0,20,20,20,20,20,20,20,20,20,118,118,20,0,20,20,118,20,20,20,20,20,20,20,20,20,118,24,24,23,24,0,0,0,0,0,0,24,22,0,23,22,0,32,31,32,31,22,23,24,31,32,30,119,29,22,23,24,30,22,23,24,22,23,24,22,23,24,22,23,24,22,23,24,22,23,24,22,23,24,22,23,24,31,32,30,119,29,22,23,24,31,32,30,119,29,22,23,24,31,32,30,119,29,22,23,24,31,32,30,119,29,22,23,24,31,32,30,119,29,22,23,24,22,23,24,22,23,24,22,23,24,22,23,24,29,22,23,24,22,23,24,22,23,24,22,23,24,22,23,24,22,22,22,22,22,23,23,23,23,23,24,24,24,24,24,31,32,30,119,29,22,23,24,22,23,24,22,23,24,22,23,24,22,23,24,29,22,23,24,31,32,31,30,29,29,22,23,24,22,23,24,22,23,24,31,32,30,119,29,22,23,24,22,23,24,22,23,24,31,32,31,32,31,32,22,23,24,30,29,22,23,24,119,31,32,30,119,29,22,23,24,31,32,30,119,29,22,23,24,22,23,24,31,30,29,119,30,22,23,24,31,32,30,119,29,22,23,24,31,32,30,119,29,22,23,24,22,23,24,22,23,24,22,23,24,22,23,24,32,22,23,24,22,23,24,31,32,30,119,29,22,23,24,31,32,30,119,29,22,23,24,31,32,30,119,29,22,23,24,22,23,24,31,32,30,119,29,22,23,24,31,32,30,119,29,22,23,24,31,32,30,119,29,22,23,24,31,32,30,119,29,22,23,24,30,29,30,0,0,0,0,0,33,34,33,34,33,34,33,34,33,34,33,34,33,33,34,120,34,34,33,120,34,34,34,33,34,34,33,34,33,34,33,34,33,34,33,34,33,34,33,34,33,34,33,120,34,34,33,34,33,37,0,0,0,0,0,0,35,36,37,35,36,37,35,36,37,35,36,37,35,36,37,35,36,37,35,36,35,36,37,35,36,121,37,37,35,36,37,37,35,36,37,35,36,37,35,36,37,35,36,37,35,36,37,35,36,37,35,36,37,35,36,37,35,36,37,35,36,37,35,36,0,39,0,39,38,39,38,38,39,38,39,38,39,38,39,38,39,38,38,39,39,38,38,38,38,38,39,38,38,38,38,39,38,38,39,38,39,38,38,39,38,39,38,38,39,38,39,38,39,38,39,38,39,38,39,38,39,38,39,38,39,0,0,0,0,0,0,0,0,0,0,0,0,0,122,122,0,122,122,41,0,0,0,41,41,0,41,41,42,41,44,123,42,41,41,41,41,41,41,41,41,41,44,123,42,41,44,123,42,41,44,123,42,41,44,123,42,41,44,123,42,41,41,41,41,41,41,42,41,41,41,41,41,41,41,41,41,44,123,42,41,41,41,41,41,41,44,123,41,41,41,44,123,42,41,41,41,0,41,44,41,123,0,44,123,42,41,44,123,42,41,41,44,44,41,44,44,41,44,123,42,41,44,123,42,41,41,41,41,41,41,41,44,123,42,41,44,123,42,41,44,123,42,41,41,44,123,42,41,44,123,42,41,44,123,42,41,44,123,42,41,44,44,44,47,47,47,0,0,0,0,46,46,46,46,48,46,47,48,46,47,48,46,47,48,48,46,47,48,46,47,48,46,47,47,47,47,48,46,47,46,48,46,47,0,46,48,46,47,48,46,47,48,46,48,48,48,48,46,47,48,46,47,46,46,46,47,48,46,47,48,46,47,48,46,47,48,46,47,48,46,47,48,46,47,48,46,47,48,48,48,46,46,48,0,0,49,50,49,50,49,50,49,50,49,50,49,50,49,50,49,50,49,50,49,50,49,50,49,50,49,50,49,50,49,50,49,50,49,50,49,50,49,50,49,50,49,50,49,50,49,50,0,0,0,0,0,0,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,0,0,0,0,0,59,60,59,60,59,60,59,60,59,60,59,60,59,59,60,59,60,0,60,59,60,0,60,60,60,59,60,59,60,0,60,60,59,60,59,60,59,60,59,60,59,60,60,59,60,59,60,59,60,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,63,64,65,0,0,0,0,0,0,0,0,0,0,0,0,0,62,63,68,62,63,64,65,67,68,62,63,64,65,67,68,62,63,64,65,67,68,62,63,64,65,67,62,63,68,62,63,64,65,67,68,62,63,64,65,67,62,63,64,65,67,62,63,64,65,67,62,63,64,65,68,68,68,62,63,64,65,62,63,62,63,64,65,68,62,62,62,63,63,63,64,64,64,65,65,65,67,64,67,62,64,64,62,67,65,68,62,63,64,65,67,68,67,67,62,63,64,65,68,67,68,68,62,63,64,65,67,68,62,63,64,65,67,62,63,62,63,64,65,67,68,62,63,64,65,67,68,62,63,64,65,67,124,64,65,62,63,64,65,67,68,68,62,63,64,65,67,68,62,63,64,65,67,68,62,63,64,65,67,68,62,63,64,65,67,68,62,63,64,65,67,68,62,63,64,65,67,68,62,63,64,65,67,0,0,0,0,0,71,125,70,72,70,71,72,70,71,72,70,71,72,70,71,72,70,71,72,70,71,70,125,70,71,72,70,72,0,0,0,72,70,71,70,0,72,70,71,125,72,70,72,72,70,71,72,70,71,72,70,72,70,71,72,70,71,72,70,71,72,70,71,72,70,71,72,70,71,72,70,71,72,70,71,72,70,71,0,0,0,0,0,76,76,0,0,0,0,0,75,75,75,75,79,74,75,74,74,77,79,76,75,75,75,75,75,75,75,75,75,74,77,79,76,75,74,77,79,76,75,74,77,79,76,75,74,77,79,76,75,74,77,79,76,75,76,75,76,75,75,75,75,77,77,79,75,0,0,0,75,76,75,0,0,75,76,75,75,75,75,75,74,77,79,76,75,77,75,75,75,74,74,75,75,75,74,75,75,74,77,79,76,75,75,75,0,77,77,77,77,74,77,75,77,74,74,75,74,77,79,76,75,74,77,79,76,75,74,75,74,74,74,0,75,74,74,77,79,76,75,74,77,79,76,75,0,0,75,0,0,0,75,75,75,76,75,75,74,74,74,77,79,76,75,74,77,79,76,75,74,77,79,76,75,75,77,77,74,77,79,76,75,74,77,79,76,75,77,74,77,79,76,75,74,77,79,76,75,81,81,81,0,0,0,81,81,0,0,81,81,81,81,78,40,82,81,80,81,81,81,81,81,81,80,81,81,78,40,82,81,80,78,40,82,81,80,40,82,78,40,82,81,80,78,40,82,81,80,78,40,82,81,80,81,80,81,80,81,81,81,82,82,81,81,80,81,80,81,78,78,80,81,81,81,81,81,78,78,40,82,81,80,81,81,81,81,78,81,81,81,81,78,40,82,81,80,40,82,81,81,80,40,78,81,78,40,80,82,81,78,40,82,81,80,78,40,82,81,80,81,80,80,81,78,78,40,82,81,80,78,40,82,81,80,81,81,81,81,81,80,81,78,78,78,0,0,0,0,78,40,82,81,80,78,40,82,81,80,78,40,82,81,80,81,78,78,40,82,81,80,78,40,82,81,80,78,40,82,81,80,78,40,82,81,80,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,84,126,84,126,84,126,84,126,84,126,84,126,84,126,84,84,126,84,84,126,84,126,84,126,84,126,84,84,126,84,126,84,126,84,126,84,126,84,126,84,84,126,84,126,0,0,0,0,87,88,127,87,88,127,87,88,127,87,88,127,87,88,127,87,88,127,87,88,127,88,87,88,127,86,87,88,87,127,87,88,87,88,127,87,88,127,87,88,127,87,88,127,87,88,127,87,88,127,87,88,127,86,87,88,87,88,127,87,88,127,127,87,88,127,87,88,127,0,0,89,128,89,128,89,128,89,128,89,128,89,128,128,89,89,128,89,89,128,89,89,128,89,128,89,128,89,128,89,128,89,128,89,128,89,128,89,128,89,128,89,128,89,128,90,0,0,0,0,0,91,92,93,3,90,91,92,93,3,90,91,92,93,3,90,91,92,93,3,90,91,92,93,3,90,91,92,93,3,90,91,90,91,90,90,93,3,3,93,92,93,3,90,91,92,92,3,92,93,3,90,91,93,92,93,3,92,93,3,90,91,92,93,3,90,91,92,93,3,90,91,92,93,3,90,91,93,92,93,3,90,91,92,93,3,90,91,92,93,3,90,91,92,93,3,90,91,92,93,3,90,91,92,93,3,90,91,92,93,3,90,91,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,96,0,0,96,96,96,0,96,96,0,0,0,0,0,0,0,0,96,0,96,0,96,0,0,96,96,0,0,0,0,0,0,96,96,0,0,0,0,0,0,96,96,96,96,96,96,96,0,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,101,102,0,0,0,0,0,0,0,99,100,97,98,98,97,101,102,98,99,100,97,101,102,98,99,100,97,101,102,98,99,100,97,101,102,98,99,100,97,101,102,98,99,100,97,101,102,98,99,100,97,97,98,98,99,100,101,102,98,97,101,102,98,99,100,102,97,101,102,98,99,100,0,0,97,98,97,101,102,98,99,100,97,101,102,98,99,100,0,98,102,97,97,101,102,98,99,100,97,101,102,98,99,100,98,0,98,98,97,101,102,98,99,100,97,101,102,98,99,100,97,101,102,98,99,100,97,101,102,98,99,100,97,101,102,98,99,100,98,98,0,98,97,101,102,98,99,100,97,101,102,98,99,100,0,0,0,106,107,104,0,104,106,107,104,106,107,104,106,107,104,106,107,104,106,107,104,106,107,106,107,104,0,104,106,107,0,104,106,107,104,104,106,107,104,106,107,0,104,0,104,106,107,104,106,107,104,106,107,104,106,107,104,106,107,104,106,107,104,106,107,104,106,107,104,106,107,0,0,108,108,103,108,103,108,103,108,103,108,103,108,103,108,108,108,108,103,108,108,103,103,108,108,108,103,103,103,103,108,108,108,108,103,103,108,103,108,108,103,103,108,103,108,108,108,108,108,108,103,108,103,108,103,108,103,108,103,108,103,108,103,108,0,0,111,109,111,109,111,109,111,109,111,109,111,109,111,109,109,0,0,0,0,0,0,111,109,111,109,109,109,111,109,109,111,109,111,0,109,111,109,111,0,109,0,109,111,109,111,109,111,109,111,109,111,109,111,109,111,95,95,95,95,95,0,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,0,112,112,112,0,0,0,105,113,112,105,113,112,105,113,112,105,113,112,105,113,112,105,113,112,112,112,112,113,105,113,112,113,113,105,105,105,105,113,112,105,105,105,113,112,105,113,112,105,113,105,113,112,105,113,112,113,113,112,113,105,113,112,105,113,112,105,113,112,105,113,112,105,113,112,105,113,112,105,113,112,0,0,0,0,115,0,114,115,114,115,114,115,114,115,0,114,115,114,115,114,115,114,114,114,115,0,0,114,115,114,115,114,115,114,114,115,114,115,0,114,114,115,114,115,114,115,114,115,114,115,114,115,114,115,0,0,0,0,0,0,0,0,0,0,0,0,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110,110],"f":[0,0,[[]],0,[[]],[[]],[[]],[[],1],[[],1],[[]],0,0,[2,3],0,[[]],0,0,[[]],0,0,[[]],[[]],0,0,[[],4],[[]],[[]],0,0,0,0,0,0,[[],5],[[],5],[[],6],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[],1],[[],1],[[]],[7,4],[[8,7],4],[7,7],[[],4],[8,4],[[],4],[8,4],[[]],[[]],[[]],[9,8],[[]],[[]],[[]],[[]],[[],5],[[],5],[[],6],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[],1],[[],1],[[]],[[]],[[]],[[]],[10],[[]],[[]],[[],5],[[],5],[[],6],[[]],[[]],[[]],[[]],[[11,12],13],0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[14,15],[[]],[[]],[[]],[[]],[[]],[[]],[[],5],[[],5],[[],6],[[]],[[]],0,[[]],[[]],0,0,[[]],[[]],[[]],[[]],[[],1],[[],1],0,[[]],[16],[[]],[[],16],[[]],[[]],[[16,17]],[[]],[[]],[[],5],[[],5],[[],6],[[]],[[]],0,[[]],[[]],[[16,17]],0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[18,3],[17,17],[[17,17],19],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[17,17],[[]],[[]],[[]],[[]],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[]],[[]],[[]],[[]],[17,17],[[]],[[]],[[]],[[]],0,0,0,0,[[]],[[]],[[]],[[]],[[],1],[[],1],[20,15],[[]],[[]],[[]],[[]],0,[[]],[[]],[[],21],[[]],[[]],[[],5],[[],5],[[],6],[[]],[[]],[[]],[[]],[21],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[],22],[[],23],[[],24],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,[[22,22],22],[[23,23],23],[[24,24],24],[[22,22]],[[23,23]],[[24,24]],[[22,22],22],[[23,23],23],[[24,24],24],[[22,22]],[[23,23]],[[24,24]],[22,21],[23,21],[24,21],0,0,0,[[22,22],22],[[23,23],23],[[24,24],24],[[22,22]],[[23,23]],[[24,24]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[22,22],[23,23],[24,24],[[]],[[]],[[]],[[22,22],25],[[23,23],25],[[24,24],25],[22,22],[23,23],[24,24],0,[[22,22],26],[[23,23],26],[[24,24],26],[[22,22],22],[[23,23],23],[[24,24],24],[[],22],[[],23],[[],24],[[22,22],26],[[23,23],26],[[24,24],26],[[22,27]],[[23,27]],[[24,27]],[[22,28],13],[[22,28],13],[[22,28],13],[[22,28],13],[[22,28],13],[[23,28],13],[[23,28],13],[[23,28],13],[[23,28],13],[[23,28],13],[[24,28],13],[[24,28],13],[[24,28],13],[[24,28],13],[[24,28],13],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[21,[[1,[22]]]],[21,[[1,[23]]]],[21,[[1,[24]]]],[21,22],[21,23],[21,24],[21,22],[21,23],[21,24],[27,22],[27,23],[27,24],[29],[22],[23],[24],0,0,0,[30],[29],0,[[22,22]],[[23,23]],[[24,24]],[[22,22],22],[[23,23],23],[[24,24],24],[[22,22],26],[[23,23],26],[[24,24],26],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[22,26],[23,26],[24,26],[22,26],[23,26],[24,26],0,0,0,0,0,0,[[22,22],26],[[23,23],26],[[24,24],26],[17,30],[[],29],[22,22],[23,23],[24,24],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[22,22],[[1,[25]]]],[[23,23],[[1,[25]]]],[[24,24],[[1,[25]]]],0,[30,[[1,[21]]]],[29,21],0,[30,31],[[22,22]],[[23,23]],[[24,24]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[22,22,26]],[[23,23,26]],[[24,24,26]],[[22,22],22],[[23,23],23],[[24,24],24],[[22,22]],[[23,23]],[[24,24]],[[22,22],22],[[23,23],23],[[24,24],24],0,[[]],[[]],[[]],[[22,22]],[[23,23]],[[24,24]],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[],6],[[],6],[[],6],[[],6],[[],6],[[],6],[[22,22],22],[[23,23],23],[[24,24],24],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[30,21]],[[29,21]],[30,32],0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[33,15],0,[[]],[34],[[]],[[]],[[]],[34],0,[[]],[[]],[[],34],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[]],[[]],[[]],[[]],[[]],[34],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[35,15],[36,15],[[]],[[]],[[]],[[]],[37],[[]],[[]],[[]],[17,37],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[],6],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,[[]],[[]],0,[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[38,17,39],7],[[38,17,39],7],[39,39],[[]],[[38,17,39,7]],[[38,17,39,17]],[[38,17,39,17]],[[38,17,39,17]],[[]],[[]],[[38,17],7],[[38,17,39],7],[[17,39],17],[[]],[[]],[17,38],[[]],[[]],[[]],[[]],[[38,17],7],[[]],[[]],[[]],[[]],[[38,17,7]],[[38,17,39,7]],[[],17],[[38,17,39],7],[[]],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,[40,17],[[],26],0,[[],26],[40,17],0,0,0,0,0,0,0,0,0,0,[[],41],[[]],[[]],[[]],[[]],[[41,41],41],[[41,41]],[[41,41],41],[[41,41]],[41,7],0,[[41,41],41],[[41,41]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[41,41],[[]],[[41,41],25],[41,41],[[41,41],26],[42,15],[[41,41],41],[[],41],[[41,41],26],[[41,27]],[[41,28],13],[[41,28],13],[[41,28],13],[[41,28],13],[[41,28],13],[[]],[[]],[[]],[[]],[7,[[1,[41]]]],[7,41],[7,41],[27,41],[41],0,0,[[41,41]],[[41,41],41],[[41,41],26],[[]],[[]],[[]],[[]],[41,26],[41,26],[[]],[[41,41],26],[[26,26,[15,[43]]],44],[41,41],0,[[12,41],[[1,[[15,[44]]]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[41,41],[[1,[25]]]],[[44,40],17],[44,[[45,[21]]]],[41],[44,26],0,[[41,41]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[41,41,26]],[[41,41],41],[[41,41]],[[41,41],41],[[]],[[41,41]],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[],6],[[],6],[[41,41],41],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[44,26],0,[[44,40],17],0,0,0,0,0,0,0,[46,26],0,[46,17],[46,17],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[47,47],[[]],[[47,47],26],[[]],[[]],[[]],0,[[]],[[]],[[]],[[]],[[],46],[[]],[[]],[[]],[[]],[[]],[[]],[[48,40],17],[46,21],[[[15,[[3,[46]]]]],48],[48,26],0,[[]],[[]],[[]],[[]],[[]],[[]],[[46,15]],0,0,[[]],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[],6],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[48,26],0,[[48,40],17],[[46,21]],0,[[[15,[[3,[46]]]]],48],0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[49,40],17],[[50,40],17],[49,26],[50,26],[[]],[[]],[[]],[[]],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[49,26],[50,26],[[49,40],17],[[50,40],17],0,0,0,0,0,0,[[]],[[]],[[]],[[],51],[[]],[[],1],[[],1],[51,52],[53,53],[[]],[[],54],[51,55],[53,5],0,[[]],[53],[[]],[[56,57],53],[[]],[[]],0,[53],[[]],[[]],[53,56],0,[[]],[57,58],[[],5],[[],5],[[],6],[[]],[[]],[[]],[[]],0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[59,3],[[]],[[]],0,[[]],[[]],[[]],0,[[19,19]],[[60,19,19]],[[],60],[[]],[[]],[[]],[[]],[60],[[]],[60],[[]],[[]],[[]],[[]],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[60],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[61,4],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[62,26],[63,26],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[62,64],[63,65],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[62,62],[63,63],[64,64],[65,65],[[[67,[66]]],[[67,[66]]]],[[]],[[]],[[]],[[]],[[]],[[62,62],25],[[63,63],25],[[64,64],25],[[65,65],25],0,[[],5],0,[[62,62],26],[[63,63],26],[[64,64],26],[[65,65],26],[62,64],[63,65],[[62,28],13],[[63,28],13],[[64,28],13],[[65,28],13],[[]],[17,62],[64,62],[[]],[[]],[65,63],[17,63],[[]],[62,64],[17,64],[17,65],[[]],[63,65],[[]],[64],[67],[62],[64],[64],[62],[67],[65],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[67],0,[[62,62],26],[[63,63],26],[[64,64],26],[[65,65],26],[[],68],[[],67],[68,1],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[62,17],[63,17],[[62,62],[[1,[25]]]],[[63,63],[[1,[25]]]],[[64,64],[[1,[25]]]],[[65,65],[[1,[25]]]],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[64],[65],[[]],[[]],[[]],[[]],[[]],[57,69],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[],6],[[],6],[[],6],[[],6],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,[[],[[1,[64]]]],[70,[[1,[64]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],0,[64],[[70,64]],[71,3],[72],0,[[72,28],13],[[],[[1,[72]]]],[[]],[64],[[]],[[]],[[]],[[70,64,64]],[[]],[[]],[[]],[[]],[[]],[64,72],[[],70],[64,72],[[]],[[]],[[]],[[]],[[]],[[]],0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[],6],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,[73,4],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,[74],[[],75],0,[[]],[[]],[[]],[[]],[[]],[[75,75],75],[[75,75]],[[75,75],75],[[75,75]],[75,21],0,[[75,75],75],[[75,75]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[76,76],[75,75],[[]],[[]],[[75,75],25],[75,75],[[75,75],26],[[77,78]],0,[79,15],[[75,75],75],0,0,0,[[],75],[[76,76],26],[[75,75],26],0,0,[[75,27]],[[76,28],13],[[75,28],13],[[75,28],13],[[75,28],13],[[75,28],13],[[75,28],13],[[]],[[]],[[]],[[]],[[]],[77,77],[21,[[1,[75]]]],[21,75],[21,75],[[]],[74,74],[27,75],[75],[[75,75]],[[74,63,63,75]],[[75,75],75],[[75,75],26],[[]],[[]],[[]],[[]],[[]],[75,26],[75,26],[[],17],[[77,78]],[[77,78,[67,[64]]]],[[77,78,65]],0,[74],0,[[75,75],26],[[63,63,76,75],77],[[],74],[[],74],[75,75],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,[[75,75],[[1,[25]]]],[[74,77,1]],[[74,77,[67,[64]]]],[74],[[]],[[75,75]],[[74,65]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,[[75,75,26]],0,0,0,[[75,75],75],[[75,75]],[[75,75],75],[[]],[[]],[[75,75]],[74,17],[[74,65],[[1,[80]]]],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[],6],[[],6],[[],6],[[75,75],75],[[77,78]],[[77,78,65]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,[[],81],[[]],[[]],[[]],[[]],[[]],[[81,81],81],[[81,81]],[[81,81],81],[[81,81]],[81,21],0,0,[[81,81],81],[[81,81]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[81,81],[80,80],[[]],[[]],[[81,81],25],[81,81],[[81,81],26],0,0,[[81,81],81],[[],81],[[],80],[[81,81],26],[80,26],[[81,27]],[[78,65],[[1,[80]]]],[[78,65],[[1,[80]]]],[80,81],[[81,28],13],[[81,28],13],[[81,28],13],[[81,28],13],[[81,28],13],0,[[]],[[]],[[]],[[]],[[]],[21,[[1,[81]]]],[21,81],[21,81],[27,81],[17,78],[81],[[81,81]],[[81,81],81],[[81,81],26],[[]],[[]],[[]],[[]],[[]],[40],[[]],[81,26],[81,26],[80,26],[40,17],[[78,65,64,81]],[[81,81],26],[[],78],[45,40],[[64,81],80],[82,1],[81,81],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[81,81],[[1,[25]]]],[80,64],[80,26],[[81,81]],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[81,81,26]],[[81,81],81],[[81,81]],[[81,81],81],[[]],[[]],[[81,81]],[78,17],[[78,65],[[1,[80]]]],[[78,63],[[1,[62]]]],[[17,21,17],45],[17],[17],[[17,21],83],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[],6],[[],6],[[],6],[[81,81],81],[[78,65]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[80,26],0,0,0,0,0,0,0,0,0,[[],17],[17],[[17,17,17,17],17],[17],[17,4],0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[]],[[]],0,[[]],[[]],[[],84],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[84],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[]],[[]],[[]],[[]],[84,85],0,[[84,[15,[86]]]],[[]],[[]],[[]],[[]],0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[]],[[]],[[]],0,[[]],[[]],[[]],[[]],[87],[88],0,0,[[],87],[[],88],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[],6],[[]],[87],[88],[[]],[[]],[[]],[[]],[[]],[[]],0,[[]],[[]],[[]],[[]],[[]],[[]],0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],0,[89],[[]],[[]],0,[[]],[[]],[17,89],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[]],[[]],[[]],[[]],[89],0,[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[90],[91,92],[90],[90],[93],[3,90],[3],[93],[[]],[[]],[[]],[[]],[[]],[92],0,0,[[]],[[]],[[]],[[]],[[]],0,[[],92],[[],93],[[],3],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[],6],[[],6],[[],6],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[17,94],0,[17,94],[17,94],[[21,7],94],[17,94],[[17,21,17],94],[[17,21,17],94],0,[[],94],[[],94],[[21,17],94],[19,4],[[],94],[[],94],[[],94],[[17,7],94],[[94,19],94],[[],94],[17,94],[17,94],[[17,17],94],[26,94],[17,94],[17,94],[17,94],[17,94],[17,94],[17,94],[[],94],[[17,17],94],[17,19],0,0,0,0,0,0,0,0,0,[[]],0,[[]],[[]],[[],85],[[]],[[]],[[]],[[],1],[[],1],[[],1],0,[95],0,0,0,0,0,0,[96,15],[19],[[]],0,[[]],0,0,[[]],[[]],0,0,0,0,0,0,[[]],[[]],0,0,[[]],0,0,0,[[],5],[[],5],[[],6],[[]],[[]],[[]],[[]],0,[[]],[[]],[[]],[[]],[[],1],[[],1],[[]],[17,85],[[]],[[]],[[]],0,0,[[]],[[]],0,[[],5],[[],5],[[],6],[[]],[[]],[[]],[[]],[[],85],0,0,0,0,0,0,0,0,0,0,0,[97,17],[98],[98],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],0,[[97,17]],[98],[98],[99,3],[100,3],[101],[102],[98],[[]],[[]],[[]],[[]],[[]],[[]],[102,17],[[]],[[]],[[]],[[]],[[]],[[]],[17],[[],102],[[],97],[[[15,[103]],17,26],98],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],101],0,[102],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,[17,17],[98,64],[98,17],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[],6],[[],6],[[],6],[[],6],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[98,17],0,[[17,17],17],[98,17],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,[[104,[15,[105]]]],[[[15,[105]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[106,3],[107,3],[104,[[1,[[15,[105]]]]]],[[],[[1,[[15,[105]]]]]],[[]],[[]],[[]],[[17,[15,[103]]]],[[]],[[]],[[]],[[],104],[[]],[[]],[[]],[[]],[[]],[[]],[17,[[1,[[15,[103]]]]]],0,[17],[[]],[[]],[[]],[[]],[[]],[[]],[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[],6],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,[108,17],[108,17],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],0,0,[[108,17]],[[15,[45,[83]]]],0,0,[15,[[15,[103]]]],[[]],[[]],[[108,17],[[15,[105]]]],[108,17],[103,17],0,[103,[[90,[108]]]],[[]],[[]],0,0,0,[[],[[15,[103]]]],[[]],[[]],[[]],[[]],0,0,[[]],[[]],[[]],[[]],0,0,0,0,[108,17],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[109,[[1,[[15,[105]]]]]],0,[[],17],[[],[[15,[103]]]],[[],[[1,[[15,[105]]]]]],[[],110],[[],17],[[],17],[111,3],[[]],[[]],[109,85],0,[[]],[[]],[[],109],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[85],[109,[[1,[[15,[105]]]]]],[[],[[1,[[15,[105]]]]]],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,[[],95],[[]],[[95,95],95],[[95,95]],[[95,95],95],[[95,95]],[95,7],0,[[95,95],95],[[95,95]],[[]],[[]],[[]],[95,1],[[],1],[[],1],[95,95],[[]],[[95,95],25],[95,95],[[95,95],26],[[95,95],95],[[],95],[[95,95],26],[[95,27]],[[95,28],13],[[95,28],13],[[95,28],13],[[95,28],13],[[95,28],13],[[]],[7,[[1,[95]]]],[7,95],[7,95],[27,95],[95],[[95,95]],[[95,95],95],[[95,95],26],[[]],[95,26],[95,26],[[95,95],26],[95,95],[[]],[[]],[[95,95],[[1,[25]]]],[[95,95]],[[]],[[]],[[95,95,26]],[[95,95],95],[[95,95]],[[95,95],95],[[]],[[95,95]],[[],5],[[],5],[[],6],[[95,95],95],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[],1],[[],1],[112,112],[[]],[[112,112],26],0,[[]],[[]],[[]],[113,112],[113,110],[105,17],0,[105,[[90,[113]]]],[[]],[[]],[[]],0,[[[15,[103]],17,26],105],[[]],[[]],[[]],[[]],[[]],[[]],0,0,[[]],[[]],[[]],[[]],[[]],[[]],0,0,[[]],0,[[],5],[[],5],[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[],6],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,[[17,[15,[105]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[],1],[[],1],[[],1],[[114,114],25],[115,3],[[114,114],26],0,[[]],[[]],[[],17],[[],17],[[]],[[]],[[]],[[]],[[]],[[]],[[114,114],[[1,[25]]]],[[]],[[]],[[]],[[]],[[]],0,[[],5],[[],5],[[],5],[[],5],[[],6],[[],6],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,[[]],[[]],[[]],[[]],[[]],[[]],[110],[[],4],[[],4],0,[[17,17,17,17,17],110],[[]],[[]],[[]],[[]],[[],1],[[],1],[[110,28],13],[[]],[[]],0,0,[[]],[[]],[[]],[[]],0,[[110,17]],0,0,[[],5],[[],5],[[],6],[[]],[[]],[[]],[[]],0],"p":[[4,"Option"],[3,"DEV_NON_BLOCKING_ACCESS"],[3,"UPIntrFreeCell"],[15,"never"],[4,"Result"],[3,"TypeId"],[15,"u32"],[3,"RISCV64"],[15,"u64"],[3,"Arguments"],[3,"Stdout"],[15,"str"],[6,"Result"],[3,"BLOCK_DEVICE"],[3,"Arc"],[3,"VirtIOBlock"],[15,"usize"],[3,"QUEUE_FRAMES"],[15,"i32"],[3,"UART"],[15,"u8"],[3,"IER"],[3,"LSR"],[3,"MCR"],[4,"Ordering"],[15,"bool"],[8,"IntoIterator"],[3,"Formatter"],[3,"NS16550a"],[3,"NS16550aRaw"],[3,"ReadWithoutDLAB"],[3,"WriteWithoutDLAB"],[3,"GPU_DEVICE"],[3,"VirtIOGpuWrapper"],[3,"KEYBOARD_DEVICE"],[3,"MOUSE_DEVICE"],[3,"VirtIOInputWrapper"],[3,"PLIC"],[4,"IntrTargetPriority"],[3,"UserBuffer"],[3,"OpenFlags"],[3,"ROOT_INODE"],[3,"Inode"],[3,"OSInode"],[3,"Vec"],[3,"PipeRingBuffer"],[4,"RingBufferStatus"],[3,"Pipe"],[3,"Stdin"],[3,"Stdout"],[3,"Rectangle"],[3,"Clipped"],[3,"Graphics"],[3,"ColorConverted"],[3,"Cropped"],[3,"Size"],[3,"Point"],[3,"Translated"],[3,"DRAWING_BOARD"],[3,"DrawingBoard"],[3,"PanicInfo"],[3,"PhysAddr"],[3,"VirtAddr"],[3,"PhysPageNum"],[3,"VirtPageNum"],[8,"Clone"],[3,"SimpleRange"],[3,"SimpleRangeIterator"],[3,"Translated"],[3,"StackFrameAllocator"],[3,"FRAME_ALLOCATOR"],[3,"FrameTracker"],[3,"Layout"],[3,"MemorySet"],[3,"MapPermission"],[4,"MapType"],[3,"MapArea"],[3,"PageTable"],[3,"KERNEL_SPACE"],[3,"PageTableEntry"],[3,"PTEFlags"],[3,"UserBufferIterator"],[3,"String"],[3,"Condvar"],[3,"TaskContext"],[8,"Mutex"],[3,"MutexSpin"],[3,"MutexBlocking"],[3,"Semaphore"],[3,"UPIntrRefMut"],[3,"INTR_MASKING_INFO"],[3,"UPSafeCellRaw"],[3,"IntrMaskingInfo"],[15,"isize"],[3,"SignalFlags"],[3,"INITPROC"],[3,"RecycleAllocator"],[3,"TaskUserRes"],[3,"PID_ALLOCATOR"],[3,"KSTACK_ALLOCATOR"],[3,"PidHandle"],[3,"KernelStack"],[3,"ProcessControlBlock"],[3,"TaskManager"],[3,"TaskControlBlock"],[3,"TASK_MANAGER"],[3,"PID2PCB"],[3,"ProcessControlBlockInner"],[3,"Processor"],[3,"TrapContext"],[3,"PROCESSOR"],[4,"TaskStatus"],[3,"TaskControlBlockInner"],[3,"TimerCondVar"],[3,"TIMERS"],[8,"QEMUExit"],[3,"VirtioHal"],[8,"CharDevice"],[3,"NS16550aInner"],[8,"GpuDevice"],[8,"InputDevice"],[8,"File"],[3,"OSInodeInner"],[8,"StepByOne"],[8,"FrameAllocator"],[3,"CondvarInner"],[3,"MutexBlockingInner"],[3,"SemaphoreInner"]]}\ +}'); +if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)}; +if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex}; diff --git a/ch9-gui-dev/search.js b/ch9-gui-dev/search.js new file mode 100644 index 00000000..d35a7db8 --- /dev/null +++ b/ch9-gui-dev/search.js @@ -0,0 +1 @@ +"use strict";(function(){const itemTypes=["mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","primitive","associatedtype","constant","associatedconstant","union","foreigntype","keyword","existential","attr","derive","traitalias",];const TY_PRIMITIVE=itemTypes.indexOf("primitive");const TY_KEYWORD=itemTypes.indexOf("keyword");const ROOT_PATH=typeof window!=="undefined"?window.rootPath:"../";function hasOwnPropertyRustdoc(obj,property){return Object.prototype.hasOwnProperty.call(obj,property)}function printTab(nb){let iter=0;let foundCurrentTab=false;let foundCurrentResultSet=false;onEachLazy(document.getElementById("titles").childNodes,elem=>{if(nb===iter){addClass(elem,"selected");foundCurrentTab=true}else{removeClass(elem,"selected")}iter+=1});iter=0;onEachLazy(document.getElementById("results").childNodes,elem=>{if(nb===iter){addClass(elem,"active");foundCurrentResultSet=true}else{removeClass(elem,"active")}iter+=1});if(foundCurrentTab&&foundCurrentResultSet){searchState.currentTab=nb}else if(nb!==0){printTab(0)}}const levenshtein_row2=[];function levenshtein(s1,s2){if(s1===s2){return 0}const s1_len=s1.length,s2_len=s2.length;if(s1_len&&s2_len){let i1=0,i2=0,a,b,c,c2;const row=levenshtein_row2;while(i1-".indexOf(c)!==-1}function isStopCharacter(c){return isWhitespace(c)||isEndCharacter(c)}function isErrorCharacter(c){return"()".indexOf(c)!==-1}function itemTypeFromName(typename){for(let i=0,len=itemTypes.length;i0){throw new Error("Cannot use literal search when there is more than one element")}parserState.pos+=1;const start=parserState.pos;const end=getIdentEndPosition(parserState);if(parserState.pos>=parserState.length){throw new Error("Unclosed `\"`")}else if(parserState.userQuery[end]!=="\""){throw new Error(`Unexpected \`${parserState.userQuery[end]}\` in a string element`)}else if(start===end){throw new Error("Cannot have empty string element")}parserState.pos+=1;query.literalSearch=true}function isPathStart(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="::"}function isReturnArrow(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="->"}function isIdentCharacter(c){return(c==="_"||(c>="0"&&c<="9")||(c>="a"&&c<="z")||(c>="A"&&c<="Z"))}function isSeparatorCharacter(c){return c===","||isWhitespaceCharacter(c)}function isWhitespaceCharacter(c){return c===" "||c==="\t"}function createQueryElement(query,parserState,name,generics,isInGenerics){if(name==="*"||(name.length===0&&generics.length===0)){return}if(query.literalSearch&&parserState.totalElems-parserState.genericsElems>0){throw new Error("You cannot have more than one element if you use quotes")}const pathSegments=name.split("::");if(pathSegments.length>1){for(let i=0,len=pathSegments.length;i=end){throw new Error("Found generics without a path")}parserState.pos+=1;getItemsBefore(query,parserState,generics,">")}if(start>=end&&generics.length===0){return}elems.push(createQueryElement(query,parserState,parserState.userQuery.slice(start,end),generics,isInGenerics))}function getItemsBefore(query,parserState,elems,endChar){let foundStopChar=true;while(parserState.pos"){extra="`<`"}else if(endChar===""){extra="`->`"}throw new Error("Unexpected `"+c+"` after "+extra)}if(!foundStopChar){if(endChar!==""){throw new Error(`Expected \`,\`, \` \` or \`${endChar}\`, found \`${c}\``)}throw new Error(`Expected \`,\` or \` \`, found \`${c}\``)}const posBefore=parserState.pos;getNextElem(query,parserState,elems,endChar===">");if(posBefore===parserState.pos){parserState.pos+=1}foundStopChar=false}parserState.pos+=1}function checkExtraTypeFilterCharacters(parserState){const query=parserState.userQuery;for(let pos=0;pos"){if(isReturnArrow(parserState)){break}throw new Error(`Unexpected \`${c}\` (did you mean \`->\`?)`)}throw new Error(`Unexpected \`${c}\``)}else if(c===":"&&!isPathStart(parserState)){if(parserState.typeFilter!==null){throw new Error("Unexpected `:`")}if(query.elems.length===0){throw new Error("Expected type filter before `:`")}else if(query.elems.length!==1||parserState.totalElems!==1){throw new Error("Unexpected `:`")}else if(query.literalSearch){throw new Error("You cannot use quotes on type filter")}checkExtraTypeFilterCharacters(parserState);parserState.typeFilter=query.elems.pop().name;parserState.pos+=1;parserState.totalElems=0;query.literalSearch=false;foundStopChar=true;continue}if(!foundStopChar){if(parserState.typeFilter!==null){throw new Error(`Expected \`,\`, \` \` or \`->\`, found \`${c}\``)}throw new Error(`Expected \`,\`, \` \`, \`:\` or \`->\`, found \`${c}\``)}before=query.elems.length;getNextElem(query,parserState,query.elems,false);if(query.elems.length===before){parserState.pos+=1}foundStopChar=false}while(parserState.pos`")}break}else{parserState.pos+=1}}}function newParsedQuery(userQuery){return{original:userQuery,userQuery:userQuery.toLowerCase(),typeFilter:NO_TYPE_FILTER,elems:[],returned:[],foundElems:0,literalSearch:false,error:null,}}function buildUrl(search,filterCrates){let extra="?search="+encodeURIComponent(search);if(filterCrates!==null){extra+="&filter-crate="+encodeURIComponent(filterCrates)}return getNakedUrl()+extra+window.location.hash}function getFilterCrates(){const elem=document.getElementById("crate-search");if(elem&&elem.value!=="All crates"&&hasOwnPropertyRustdoc(rawSearchIndex,elem.value)){return elem.value}return null}function parseQuery(userQuery){userQuery=userQuery.trim();const parserState={length:userQuery.length,pos:0,totalElems:0,genericsElems:0,typeFilter:null,userQuery:userQuery.toLowerCase(),};let query=newParsedQuery(userQuery);try{parseInput(query,parserState);if(parserState.typeFilter!==null){let typeFilter=parserState.typeFilter;if(typeFilter==="const"){typeFilter="constant"}query.typeFilter=itemTypeFromName(typeFilter)}}catch(err){query=newParsedQuery(userQuery);query.error=err.message;query.typeFilter=-1;return query}if(!query.literalSearch){query.literalSearch=parserState.totalElems>1}query.foundElems=query.elems.length+query.returned.length;return query}function createQueryResults(results_in_args,results_returned,results_others,parsedQuery){return{"in_args":results_in_args,"returned":results_returned,"others":results_others,"query":parsedQuery,}}function execQuery(parsedQuery,searchWords,filterCrates,currentCrate){const results_others={},results_in_args={},results_returned={};function transformResults(results){const duplicates={};const out=[];for(const result of results){if(result.id>-1){const obj=searchIndex[result.id];obj.lev=result.lev;const res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=obj.displayPath+obj.name;obj.fullPath+="|"+obj.ty;if(duplicates[obj.fullPath]){continue}duplicates[obj.fullPath]=true;obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}return out}function sortResults(results,isType,preferredCrate){const userQuery=parsedQuery.userQuery;const ar=[];for(const entry in results){if(hasOwnPropertyRustdoc(results,entry)){const result=results[entry];result.word=searchWords[result.id];result.item=searchIndex[result.id]||{};ar.push(result)}}results=ar;if(results.length===0){return[]}results.sort((aaa,bbb)=>{let a,b;a=(aaa.word!==userQuery);b=(bbb.word!==userQuery);if(a!==b){return a-b}a=(aaa.lev);b=(bbb.lev);if(a!==b){return a-b}a=(aaa.item.crate!==preferredCrate);b=(bbb.item.crate!==preferredCrate);if(a!==b){return a-b}a=aaa.word.length;b=bbb.word.length;if(a!==b){return a-b}a=aaa.word;b=bbb.word;if(a!==b){return(a>b?+1:-1)}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}if((aaa.item.ty===TY_PRIMITIVE&&bbb.item.ty!==TY_KEYWORD)||(aaa.item.ty===TY_KEYWORD&&bbb.item.ty!==TY_PRIMITIVE)){return-1}if((bbb.item.ty===TY_PRIMITIVE&&aaa.item.ty!==TY_PRIMITIVE)||(bbb.item.ty===TY_KEYWORD&&aaa.item.ty!==TY_KEYWORD)){return 1}a=(aaa.item.desc==="");b=(bbb.item.desc==="");if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});let nameSplit=null;if(parsedQuery.elems.length===1){const hasPath=typeof parsedQuery.elems[0].path==="undefined";nameSplit=hasPath?null:parsedQuery.elems[0].path}for(const result of results){if(result.dontValidate){continue}const name=result.item.name.toLowerCase(),path=result.item.path.toLowerCase(),parent=result.item.parent;if(!isType&&!validateResult(name,path,nameSplit,parent)){result.id=-1}}return transformResults(results)}function checkGenerics(row,elem,defaultLev){if(row.generics.length===0){return elem.generics.length===0?defaultLev:MAX_LEV_DISTANCE+1}else if(row.generics.length>0&&row.generics[0].name===null){return checkGenerics(row.generics[0],elem,defaultLev)}let elem_name;if(elem.generics.length>0&&row.generics.length>=elem.generics.length){const elems=Object.create(null);for(const entry of row.generics){elem_name=entry.name;if(elem_name===""){if(checkGenerics(entry,elem,MAX_LEV_DISTANCE+1)!==0){return MAX_LEV_DISTANCE+1}continue}if(elems[elem_name]===undefined){elems[elem_name]=0}elems[elem_name]+=1}for(const generic of elem.generics){let match=null;if(elems[generic.name]){match=generic.name}else{for(elem_name in elems){if(!hasOwnPropertyRustdoc(elems,elem_name)){continue}if(elem_name===generic){match=elem_name;break}}}if(match===null){return MAX_LEV_DISTANCE+1}elems[match]-=1;if(elems[match]===0){delete elems[match]}}return 0}return MAX_LEV_DISTANCE+1}function checkIfInGenerics(row,elem){let lev=MAX_LEV_DISTANCE+1;for(const entry of row.generics){lev=Math.min(checkType(entry,elem,true),lev);if(lev===0){break}}return lev}function checkType(row,elem,literalSearch){if(row.name===null){if(row.generics.length>0){return checkIfInGenerics(row,elem)}return MAX_LEV_DISTANCE+1}let lev=levenshtein(row.name,elem.name);if(literalSearch){if(lev!==0){if(elem.generics.length===0){const checkGeneric=row.generics.length>0;if(checkGeneric&&row.generics.findIndex(tmp_elem=>tmp_elem.name===elem.name)!==-1){return 0}}return MAX_LEV_DISTANCE+1}else if(elem.generics.length>0){return checkGenerics(row,elem,MAX_LEV_DISTANCE+1)}return 0}else if(row.generics.length>0){if(elem.generics.length===0){if(lev===0){return 0}lev=checkIfInGenerics(row,elem);return lev+0.5}else if(lev>MAX_LEV_DISTANCE){return checkIfInGenerics(row,elem)}else{const tmp_lev=checkGenerics(row,elem,lev);if(tmp_lev>MAX_LEV_DISTANCE){return MAX_LEV_DISTANCE+1}return(tmp_lev+lev)/2}}else if(elem.generics.length>0){return MAX_LEV_DISTANCE+1}return lev}function findArg(row,elem,typeFilter){let lev=MAX_LEV_DISTANCE+1;if(row&&row.type&&row.type.inputs&&row.type.inputs.length>0){for(const input of row.type.inputs){if(!typePassesFilter(typeFilter,input.ty)){continue}lev=Math.min(lev,checkType(input,elem,parsedQuery.literalSearch));if(lev===0){return 0}}}return parsedQuery.literalSearch?MAX_LEV_DISTANCE+1:lev}function checkReturned(row,elem,typeFilter){let lev=MAX_LEV_DISTANCE+1;if(row&&row.type&&row.type.output.length>0){const ret=row.type.output;for(const ret_ty of ret){if(!typePassesFilter(typeFilter,ret_ty.ty)){continue}lev=Math.min(lev,checkType(ret_ty,elem,parsedQuery.literalSearch));if(lev===0){return 0}}}return parsedQuery.literalSearch?MAX_LEV_DISTANCE+1:lev}function checkPath(contains,ty){if(contains.length===0){return 0}let ret_lev=MAX_LEV_DISTANCE+1;const path=ty.path.split("::");if(ty.parent&&ty.parent.name){path.push(ty.parent.name.toLowerCase())}const length=path.length;const clength=contains.length;if(clength>length){return MAX_LEV_DISTANCE+1}for(let i=0;ilength){break}let lev_total=0;let aborted=false;for(let x=0;xMAX_LEV_DISTANCE){aborted=true;break}lev_total+=lev}if(!aborted){ret_lev=Math.min(ret_lev,Math.round(lev_total/clength))}}return ret_lev}function typePassesFilter(filter,type){if(filter<=NO_TYPE_FILTER||filter===type)return true;const name=itemTypes[type];switch(itemTypes[filter]){case"constant":return name==="associatedconstant";case"fn":return name==="method"||name==="tymethod";case"type":return name==="primitive"||name==="associatedtype";case"trait":return name==="traitalias"}return false}function createAliasFromItem(item){return{crate:item.crate,name:item.name,path:item.path,desc:item.desc,ty:item.ty,parent:item.parent,type:item.type,is_alias:true,}}function handleAliases(ret,query,filterCrates,currentCrate){const lowerQuery=query.toLowerCase();const aliases=[];const crateAliases=[];if(filterCrates!==null){if(ALIASES[filterCrates]&&ALIASES[filterCrates][lowerQuery]){const query_aliases=ALIASES[filterCrates][lowerQuery];for(const alias of query_aliases){aliases.push(createAliasFromItem(searchIndex[alias]))}}}else{Object.keys(ALIASES).forEach(crate=>{if(ALIASES[crate][lowerQuery]){const pushTo=crate===currentCrate?crateAliases:aliases;const query_aliases=ALIASES[crate][lowerQuery];for(const alias of query_aliases){pushTo.push(createAliasFromItem(searchIndex[alias]))}}})}const sortFunc=(aaa,bbb)=>{if(aaa.path{alias.alias=query;const res=buildHrefAndPath(alias);alias.displayPath=pathSplitter(res[0]);alias.fullPath=alias.displayPath+alias.name;alias.href=res[1];ret.others.unshift(alias);if(ret.others.length>MAX_RESULTS){ret.others.pop()}};aliases.forEach(pushFunc);crateAliases.forEach(pushFunc)}function addIntoResults(results,fullId,id,index,lev){if(lev===0||(!parsedQuery.literalSearch&&lev<=MAX_LEV_DISTANCE)){if(results[fullId]!==undefined){const result=results[fullId];if(result.dontValidate||result.lev<=lev){return}}results[fullId]={id:id,index:index,dontValidate:parsedQuery.literalSearch,lev:lev,}}}function handleSingleArg(row,pos,elem,results_others,results_in_args,results_returned){if(!row||(filterCrates!==null&&row.crate!==filterCrates)){return}let lev,lev_add=0,index=-1;const fullId=row.id;const in_args=findArg(row,elem,parsedQuery.typeFilter);const returned=checkReturned(row,elem,parsedQuery.typeFilter);addIntoResults(results_in_args,fullId,pos,index,in_args);addIntoResults(results_returned,fullId,pos,index,returned);if(!typePassesFilter(parsedQuery.typeFilter,row.ty)){return}const searchWord=searchWords[pos];if(parsedQuery.literalSearch){if(searchWord===elem.name){addIntoResults(results_others,fullId,pos,-1,0)}return}if(elem.name.length===0){if(row.type!==null){lev=checkGenerics(row.type,elem,MAX_LEV_DISTANCE+1);addIntoResults(results_others,fullId,pos,index,lev)}return}if(elem.fullPath.length>1){lev=checkPath(elem.pathWithoutLast,row);if(lev>MAX_LEV_DISTANCE||(parsedQuery.literalSearch&&lev!==0)){return}else if(lev>0){lev_add=lev/10}}if(searchWord.indexOf(elem.pathLast)>-1||row.normalizedName.indexOf(elem.pathLast)>-1){index=row.normalizedName.indexOf(elem.pathLast)}lev=levenshtein(searchWord,elem.pathLast);if(lev>0&&elem.pathLast.length>2&&searchWord.indexOf(elem.pathLast)>-1){if(elem.pathLast.length<6){lev=1}else{lev=0}}lev+=lev_add;if(lev>MAX_LEV_DISTANCE){return}else if(index!==-1&&elem.fullPath.length<2){lev-=1}if(lev<0){lev=0}addIntoResults(results_others,fullId,pos,index,lev)}function handleArgs(row,pos,results){if(!row||(filterCrates!==null&&row.crate!==filterCrates)){return}let totalLev=0;let nbLev=0;function checkArgs(elems,callback){for(const elem of elems){const lev=callback(row,elem,NO_TYPE_FILTER);if(lev<=1){nbLev+=1;totalLev+=lev}else{return false}}return true}if(!checkArgs(parsedQuery.elems,findArg)){return}if(!checkArgs(parsedQuery.returned,checkReturned)){return}if(nbLev===0){return}const lev=Math.round(totalLev/nbLev);addIntoResults(results,row.id,pos,0,lev)}function innerRunQuery(){let elem,i,nSearchWords,in_returned,row;if(parsedQuery.foundElems===1){if(parsedQuery.elems.length===1){elem=parsedQuery.elems[0];for(i=0,nSearchWords=searchWords.length;i0){for(i=0,nSearchWords=searchWords.length;i-1||path.indexOf(key)>-1||(parent!==undefined&&parent.name!==undefined&&parent.name.toLowerCase().indexOf(key)>-1)||levenshtein(name,key)<=MAX_LEV_DISTANCE)){return false}}return true}function nextTab(direction){const next=(searchState.currentTab+direction+3)%searchState.focusedByTab.length;searchState.focusedByTab[searchState.currentTab]=document.activeElement;printTab(next);focusSearchResult()}function focusSearchResult(){const target=searchState.focusedByTab[searchState.currentTab]||document.querySelectorAll(".search-results.active a").item(0)||document.querySelectorAll("#titles > button").item(searchState.currentTab);if(target){target.focus()}}function buildHrefAndPath(item){let displayPath;let href;const type=itemTypes[item.ty];const name=item.name;let path=item.path;if(type==="mod"){displayPath=path+"::";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+name+"/index.html"}else if(type==="import"){displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/index.html#reexport."+name}else if(type==="primitive"||type==="keyword"){displayPath="";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+type+"."+name+".html"}else if(type==="externcrate"){displayPath="";href=ROOT_PATH+name+"/index.html"}else if(item.parent!==undefined){const myparent=item.parent;let anchor="#"+type+"."+name;const parentType=itemTypes[myparent.ty];let pageType=parentType;let pageName=myparent.name;if(parentType==="primitive"){displayPath=myparent.name+"::"}else if(type==="structfield"&&parentType==="variant"){const enumNameIdx=item.path.lastIndexOf("::");const enumName=item.path.substr(enumNameIdx+2);path=item.path.substr(0,enumNameIdx);displayPath=path+"::"+enumName+"::"+myparent.name+"::";anchor="#variant."+myparent.name+".field."+name;pageType="enum";pageName=enumName}else{displayPath=path+"::"+myparent.name+"::"}href=ROOT_PATH+path.replace(/::/g,"/")+"/"+pageType+"."+pageName+".html"+anchor}else{displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}return[displayPath,href]}function escape(content){const h1=document.createElement("h1");h1.textContent=content;return h1.innerHTML}function pathSplitter(path){const tmp=""+path.replace(/::/g,"::");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}function addTab(array,query,display){let extraClass="";if(display===true){extraClass=" active"}const output=document.createElement("div");let length=0;if(array.length>0){output.className="search-results "+extraClass;array.forEach(item=>{const name=item.name;const type=itemTypes[item.ty];length+=1;let extra="";if(type==="primitive"){extra=" (primitive type)"}else if(type==="keyword"){extra=" (keyword)"}const link=document.createElement("a");link.className="result-"+type;link.href=item.href;const wrapper=document.createElement("div");const resultName=document.createElement("div");resultName.className="result-name";if(item.is_alias){const alias=document.createElement("span");alias.className="alias";const bold=document.createElement("b");bold.innerText=item.alias;alias.appendChild(bold);alias.insertAdjacentHTML("beforeend"," - see ");resultName.appendChild(alias)}resultName.insertAdjacentHTML("beforeend",item.displayPath+""+name+extra+"");wrapper.appendChild(resultName);const description=document.createElement("div");description.className="desc";const spanDesc=document.createElement("span");spanDesc.insertAdjacentHTML("beforeend",item.desc);description.appendChild(spanDesc);wrapper.appendChild(description);link.appendChild(wrapper);output.appendChild(link)})}else if(query.error===null){output.className="search-failed"+extraClass;output.innerHTML="No results :(
"+"Try on DuckDuckGo?

"+"Or try looking in one of these:"}return[output,length]}function makeTabHeader(tabNb,text,nbElems){if(searchState.currentTab===tabNb){return""}return""}function showResults(results,go_to_first,filterCrates){const search=searchState.outputElement();if(go_to_first||(results.others.length===1&&getSettingValue("go-to-only-result")==="true"&&(!search.firstChild||search.firstChild.innerText!==searchState.loadingText))){const elem=document.createElement("a");elem.href=results.others[0].href;removeClass(elem,"active");document.body.appendChild(elem);elem.click();return}if(results.query===undefined){results.query=parseQuery(searchState.input.value)}currentResults=results.query.userQuery;const ret_others=addTab(results.others,results.query,true);const ret_in_args=addTab(results.in_args,results.query,false);const ret_returned=addTab(results.returned,results.query,false);let currentTab=searchState.currentTab;if((currentTab===0&&ret_others[1]===0)||(currentTab===1&&ret_in_args[1]===0)||(currentTab===2&&ret_returned[1]===0)){if(ret_others[1]!==0){currentTab=0}else if(ret_in_args[1]!==0){currentTab=1}else if(ret_returned[1]!==0){currentTab=2}}let crates="";const crates_list=Object.keys(rawSearchIndex);if(crates_list.length>1){crates=" in "}let typeFilter="";if(results.query.typeFilter!==NO_TYPE_FILTER){typeFilter=" (type: "+escape(itemTypes[results.query.typeFilter])+")"}let output="
"+`

Results for ${escape(results.query.userQuery)}`+`${typeFilter}

${crates}
`;if(results.query.error!==null){output+=`

Query parser error: "${results.query.error}".

`;output+="
"+makeTabHeader(0,"In Names",ret_others[1])+"
";currentTab=0}else if(results.query.foundElems<=1&&results.query.returned.length===0){output+="
"+makeTabHeader(0,"In Names",ret_others[1])+makeTabHeader(1,"In Parameters",ret_in_args[1])+makeTabHeader(2,"In Return Types",ret_returned[1])+"
"}else{const signatureTabTitle=results.query.elems.length===0?"In Function Return Types":results.query.returned.length===0?"In Function Parameters":"In Function Signatures";output+="
"+makeTabHeader(0,signatureTabTitle,ret_others[1])+"
";currentTab=0}const resultsElem=document.createElement("div");resultsElem.id="results";resultsElem.appendChild(ret_others[0]);resultsElem.appendChild(ret_in_args[0]);resultsElem.appendChild(ret_returned[0]);search.innerHTML=output;const crateSearch=document.getElementById("crate-search");if(crateSearch){crateSearch.addEventListener("input",updateCrate)}search.appendChild(resultsElem);searchState.showResults(search);const elems=document.getElementById("titles").childNodes;searchState.focusedByTab=[];let i=0;for(const elem of elems){const j=i;elem.onclick=()=>printTab(j);searchState.focusedByTab.push(null);i+=1}printTab(currentTab)}function search(e,forced){const params=searchState.getQueryStringParams();const query=parseQuery(searchState.input.value.trim());if(e){e.preventDefault()}if(!forced&&query.userQuery===currentResults){if(query.userQuery.length>0){putBackSearch()}return}let filterCrates=getFilterCrates();if(filterCrates===null&¶ms["filter-crate"]!==undefined){filterCrates=params["filter-crate"]}searchState.title="Results for "+query.original+" - Rust";if(browserSupportsHistoryApi()){const newURL=buildUrl(query.original,filterCrates);if(!history.state&&!params.search){history.pushState(null,"",newURL)}else{history.replaceState(null,"",newURL)}}showResults(execQuery(query,searchWords,filterCrates,window.currentCrate),params.go_to_first,filterCrates)}function buildItemSearchTypeAll(types,lowercasePaths){const PATH_INDEX_DATA=0;const GENERICS_DATA=1;return types.map(type=>{let pathIndex,generics;if(typeof type==="number"){pathIndex=type;generics=[]}else{pathIndex=type[PATH_INDEX_DATA];generics=buildItemSearchTypeAll(type[GENERICS_DATA],lowercasePaths)}return{name:pathIndex===0?null:lowercasePaths[pathIndex-1].name,ty:pathIndex===0?null:lowercasePaths[pathIndex-1].ty,generics:generics,}})}function buildFunctionSearchType(functionSearchType,lowercasePaths){const INPUTS_DATA=0;const OUTPUT_DATA=1;if(functionSearchType===0){return null}let inputs,output;if(typeof functionSearchType[INPUTS_DATA]==="number"){const pathIndex=functionSearchType[INPUTS_DATA];inputs=[{name:pathIndex===0?null:lowercasePaths[pathIndex-1].name,ty:pathIndex===0?null:lowercasePaths[pathIndex-1].ty,generics:[],}]}else{inputs=buildItemSearchTypeAll(functionSearchType[INPUTS_DATA],lowercasePaths)}if(functionSearchType.length>1){if(typeof functionSearchType[OUTPUT_DATA]==="number"){const pathIndex=functionSearchType[OUTPUT_DATA];output=[{name:pathIndex===0?null:lowercasePaths[pathIndex-1].name,ty:pathIndex===0?null:lowercasePaths[pathIndex-1].ty,generics:[],}]}else{output=buildItemSearchTypeAll(functionSearchType[OUTPUT_DATA],lowercasePaths)}}else{output=[]}return{inputs,output,}}function buildIndex(rawSearchIndex){searchIndex=[];const searchWords=[];let i,word;let currentIndex=0;let id=0;for(const crate in rawSearchIndex){if(!hasOwnPropertyRustdoc(rawSearchIndex,crate)){continue}let crateSize=0;const crateCorpus=rawSearchIndex[crate];searchWords.push(crate);const crateRow={crate:crate,ty:1,name:crate,path:"",desc:crateCorpus.doc,parent:undefined,type:null,id:id,normalizedName:crate.indexOf("_")===-1?crate:crate.replace(/_/g,""),};id+=1;searchIndex.push(crateRow);currentIndex+=1;const itemTypes=crateCorpus.t;const itemNames=crateCorpus.n;const itemPaths=crateCorpus.q;const itemDescs=crateCorpus.d;const itemParentIdxs=crateCorpus.i;const itemFunctionSearchTypes=crateCorpus.f;const paths=crateCorpus.p;const aliases=crateCorpus.a;const lowercasePaths=[];let len=paths.length;for(i=0;i0?paths[itemParentIdxs[i]-1]:undefined,type:buildFunctionSearchType(itemFunctionSearchTypes[i],lowercasePaths),id:id,normalizedName:word.indexOf("_")===-1?word:word.replace(/_/g,""),};id+=1;searchIndex.push(row);lastPath=row.path;crateSize+=1}if(aliases){ALIASES[crate]=Object.create(null);for(const alias_name in aliases){if(!hasOwnPropertyRustdoc(aliases,alias_name)){continue}if(!hasOwnPropertyRustdoc(ALIASES[crate],alias_name)){ALIASES[crate][alias_name]=[]}for(const local_alias of aliases[alias_name]){ALIASES[crate][alias_name].push(local_alias+currentIndex)}}}currentIndex+=crateSize}return searchWords}function onSearchSubmit(e){e.preventDefault();searchState.clearInputTimeout();search()}function putBackSearch(){const search_input=searchState.input;if(!searchState.input){return}if(search_input.value!==""&&!searchState.isDisplayed()){searchState.showResults();if(browserSupportsHistoryApi()){history.replaceState(null,"",buildUrl(search_input.value,getFilterCrates()))}document.title=searchState.title}}function registerSearchEvents(){const params=searchState.getQueryStringParams();if(searchState.input.value===""){searchState.input.value=params.search||""}const searchAfter500ms=()=>{searchState.clearInputTimeout();if(searchState.input.value.length===0){if(browserSupportsHistoryApi()){history.replaceState(null,window.currentCrate+" - Rust",getNakedUrl()+window.location.hash)}searchState.hideResults()}else{searchState.timeout=setTimeout(search,500)}};searchState.input.onkeyup=searchAfter500ms;searchState.input.oninput=searchAfter500ms;document.getElementsByClassName("search-form")[0].onsubmit=onSearchSubmit;searchState.input.onchange=e=>{if(e.target!==document.activeElement){return}searchState.clearInputTimeout();setTimeout(search,0)};searchState.input.onpaste=searchState.input.onchange;searchState.outputElement().addEventListener("keydown",e=>{if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey){return}if(e.which===38){const previous=document.activeElement.previousElementSibling;if(previous){previous.focus()}else{searchState.focus()}e.preventDefault()}else if(e.which===40){const next=document.activeElement.nextElementSibling;if(next){next.focus()}const rect=document.activeElement.getBoundingClientRect();if(window.innerHeight-rect.bottom{if(e.which===40){focusSearchResult();e.preventDefault()}});searchState.input.addEventListener("focus",()=>{putBackSearch()});searchState.input.addEventListener("blur",()=>{searchState.input.placeholder=searchState.input.origPlaceholder});if(browserSupportsHistoryApi()){const previousTitle=document.title;window.addEventListener("popstate",e=>{const params=searchState.getQueryStringParams();document.title=previousTitle;currentResults=null;if(params.search&¶ms.search.length>0){searchState.input.value=params.search;search(e)}else{searchState.input.value="";searchState.hideResults()}})}window.onpageshow=()=>{const qSearch=searchState.getQueryStringParams().search;if(searchState.input.value===""&&qSearch){searchState.input.value=qSearch}search()}}function updateCrate(ev){if(ev.target.value==="All crates"){const params=searchState.getQueryStringParams();const query=searchState.input.value.trim();if(!history.state&&!params.search){history.pushState(null,"",buildUrl(query,null))}else{history.replaceState(null,"",buildUrl(query,null))}}currentResults=null;search(undefined,true)}const searchWords=buildIndex(rawSearchIndex);if(typeof window!=="undefined"){registerSearchEvents();if(window.searchState.getQueryStringParams().search){search()}}if(typeof exports!=="undefined"){exports.initSearch=initSearch;exports.execQuery=execQuery;exports.parseQuery=parseQuery}return searchWords}if(typeof window!=="undefined"){window.initSearch=initSearch;if(window.searchIndex!==undefined){initSearch(window.searchIndex)}}else{initSearch({})}})() \ No newline at end of file diff --git a/ch9-gui-dev/settings.css b/ch9-gui-dev/settings.css new file mode 100644 index 00000000..a142e14f --- /dev/null +++ b/ch9-gui-dev/settings.css @@ -0,0 +1 @@ +.setting-line{margin:0.6em 0 0.6em 0.3em;position:relative;}.setting-line .choices{display:flex;flex-wrap:wrap;}.setting-line .radio-line input{margin-right:0.3em;height:1.2rem;width:1.2rem;border:1px solid;outline:none;-webkit-appearance:none;cursor:pointer;border-radius:50%;}.setting-line .radio-line input+span{padding-bottom:1px;}.radio-line .setting-name{width:100%;}.radio-line .choice{margin-top:0.1em;margin-bottom:0.1em;min-width:3.8em;padding:0.3em;display:flex;align-items:center;cursor:pointer;}.radio-line .choice+.choice{margin-left:0.5em;}.toggle{position:relative;width:100%;margin-right:20px;display:flex;align-items:center;cursor:pointer;}.toggle input{opacity:0;position:absolute;}.slider{position:relative;width:45px;min-width:45px;display:block;height:28px;margin-right:20px;cursor:pointer;background-color:#ccc;transition:.3s;}.slider:before{position:absolute;content:"";height:19px;width:19px;left:4px;bottom:4px;transition:.3s;}input:checked+.slider:before{transform:translateX(19px);}.setting-line>.sub-settings{padding-left:42px;width:100%;display:block;}#settings .setting-line{margin:1.2em 0.6em;} \ No newline at end of file diff --git a/ch9-gui-dev/settings.html b/ch9-gui-dev/settings.html new file mode 100644 index 00000000..ecb27c50 --- /dev/null +++ b/ch9-gui-dev/settings.html @@ -0,0 +1 @@ +Rustdoc settings

Rustdoc settings

Back
\ No newline at end of file diff --git a/ch9-gui-dev/settings.js b/ch9-gui-dev/settings.js new file mode 100644 index 00000000..df27fca4 --- /dev/null +++ b/ch9-gui-dev/settings.js @@ -0,0 +1,11 @@ +"use strict";(function(){const isSettingsPage=window.location.pathname.endsWith("/settings.html");function changeSetting(settingName,value){updateLocalStorage(settingName,value);switch(settingName){case"theme":case"preferred-dark-theme":case"preferred-light-theme":case"use-system-theme":updateSystemTheme();updateLightAndDark();break}}function handleKey(ev){if(ev.ctrlKey||ev.altKey||ev.metaKey){return}switch(getVirtualKey(ev)){case"Enter":case"Return":case"Space":ev.target.checked=!ev.target.checked;ev.preventDefault();break}}function showLightAndDark(){addClass(document.getElementById("theme").parentElement,"hidden");removeClass(document.getElementById("preferred-light-theme").parentElement,"hidden");removeClass(document.getElementById("preferred-dark-theme").parentElement,"hidden")}function hideLightAndDark(){addClass(document.getElementById("preferred-light-theme").parentElement,"hidden");addClass(document.getElementById("preferred-dark-theme").parentElement,"hidden");removeClass(document.getElementById("theme").parentElement,"hidden")}function updateLightAndDark(){if(getSettingValue("use-system-theme")!=="false"){showLightAndDark()}else{hideLightAndDark()}}function setEvents(settingsElement){updateLightAndDark();onEachLazy(settingsElement.getElementsByClassName("slider"),elem=>{const toggle=elem.previousElementSibling;const settingId=toggle.id;const settingValue=getSettingValue(settingId);if(settingValue!==null){toggle.checked=settingValue==="true"}toggle.onchange=function(){changeSetting(this.id,this.checked)};toggle.onkeyup=handleKey;toggle.onkeyrelease=handleKey});onEachLazy(settingsElement.getElementsByClassName("select-wrapper"),elem=>{const select=elem.getElementsByTagName("select")[0];const settingId=select.id;const settingValue=getSettingValue(settingId);if(settingValue!==null){select.value=settingValue}select.onchange=function(){changeSetting(this.id,this.value)}});onEachLazy(settingsElement.querySelectorAll("input[type=\"radio\"]"),elem=>{const settingId=elem.name;const settingValue=getSettingValue(settingId);if(settingValue!==null&&settingValue!=="null"){elem.checked=settingValue===elem.value}elem.addEventListener("change",ev=>{changeSetting(ev.target.name,ev.target.value)})})}function buildSettingsPageSections(settings){let output="";for(const setting of settings){output+="
";const js_data_name=setting["js_name"];const setting_name=setting["name"];if(setting["options"]!==undefined){output+=`
\ + ${setting_name}\ +
`;onEach(setting["options"],option=>{const checked=option===setting["default"]?" checked":"";output+=``});output+="
"}else{const checked=setting["default"]===true?" checked":"";output+=``}output+="
"}return output}function buildSettingsPage(){const themes=getVar("themes").split(",");const settings=[{"name":"Use system theme","js_name":"use-system-theme","default":true,},{"name":"Theme","js_name":"theme","default":"light","options":themes,},{"name":"Preferred light theme","js_name":"preferred-light-theme","default":"light","options":themes,},{"name":"Preferred dark theme","js_name":"preferred-dark-theme","default":"dark","options":themes,},{"name":"Auto-hide item contents for large items","js_name":"auto-hide-large-items","default":true,},{"name":"Auto-hide item methods' documentation","js_name":"auto-hide-method-docs","default":false,},{"name":"Auto-hide trait implementation documentation","js_name":"auto-hide-trait-implementations","default":false,},{"name":"Directly go to item in search if there is only one result","js_name":"go-to-only-result","default":false,},{"name":"Show line numbers on code examples","js_name":"line-numbers","default":false,},{"name":"Disable keyboard shortcuts","js_name":"disable-shortcuts","default":false,},];const elementKind=isSettingsPage?"section":"div";const innerHTML=`
${buildSettingsPageSections(settings)}
`;const el=document.createElement(elementKind);el.id="settings";el.className="popover";el.innerHTML=innerHTML;if(isSettingsPage){document.getElementById(MAIN_ID).appendChild(el)}else{el.setAttribute("tabindex","-1");getSettingsButton().appendChild(el)}return el}const settingsMenu=buildSettingsPage();function displaySettings(){settingsMenu.style.display=""}function settingsBlurHandler(event){blurHandler(event,getSettingsButton(),window.hidePopoverMenus)}if(isSettingsPage){getSettingsButton().onclick=function(event){event.preventDefault()}}else{const settingsButton=getSettingsButton();const settingsMenu=document.getElementById("settings");settingsButton.onclick=function(event){if(elemIsInParent(event.target,settingsMenu)){return}event.preventDefault();const shouldDisplaySettings=settingsMenu.style.display==="none";window.hidePopoverMenus();if(shouldDisplaySettings){displaySettings()}};settingsButton.onblur=settingsBlurHandler;settingsButton.querySelector("a").onblur=settingsBlurHandler;onEachLazy(settingsMenu.querySelectorAll("input"),el=>{el.onblur=settingsBlurHandler});settingsMenu.onblur=settingsBlurHandler}setTimeout(()=>{setEvents(settingsMenu);if(!isSettingsPage){displaySettings()}removeClass(getSettingsButton(),"rotate")},0)})() \ No newline at end of file diff --git a/ch9-gui-dev/source-files.js b/ch9-gui-dev/source-files.js new file mode 100644 index 00000000..d9c92132 --- /dev/null +++ b/ch9-gui-dev/source-files.js @@ -0,0 +1,4 @@ +var sourcesIndex = JSON.parse('{\ +"os":["",[["boards",[],["qemu.rs"]],["drivers",[["block",[],["mod.rs","virtio_blk.rs"]],["bus",[],["mod.rs","virtio.rs"]],["chardev",[],["mod.rs","ns16550a.rs"]],["gpu",[],["mod.rs"]],["input",[],["mod.rs"]]],["mod.rs","plic.rs"]],["fs",[],["inode.rs","mod.rs","pipe.rs","stdio.rs"]],["gui",[],["graphic.rs","mod.rs","paint.rs"]],["mm",[],["address.rs","frame_allocator.rs","heap_allocator.rs","memory_set.rs","mod.rs","page_table.rs"]],["sync",[],["condvar.rs","mod.rs","mutex.rs","semaphore.rs","up.rs"]],["syscall",[],["fs.rs","gui.rs","mod.rs","process.rs","sync.rs","thread.rs"]],["task",[],["context.rs","id.rs","manager.rs","mod.rs","process.rs","processor.rs","signal.rs","switch.rs","task.rs"]],["trap",[],["context.rs","mod.rs"]]],["config.rs","console.rs","lang_items.rs","main.rs","sbi.rs","timer.rs"]]\ +}'); +createSourceSidebar(); diff --git a/ch9-gui-dev/source-script.js b/ch9-gui-dev/source-script.js new file mode 100644 index 00000000..e0fac073 --- /dev/null +++ b/ch9-gui-dev/source-script.js @@ -0,0 +1 @@ +"use strict";(function(){const rootPath=document.getElementById("rustdoc-vars").attributes["data-root-path"].value;let oldScrollPosition=0;const NAME_OFFSET=0;const DIRS_OFFSET=1;const FILES_OFFSET=2;function closeSidebarIfMobile(){if(window.innerWidth"){if(window.innerWidth";updateLocalStorage("source-sidebar-show","false")}}function createSidebarToggle(){const sidebarToggle=document.createElement("div");sidebarToggle.id="sidebar-toggle";const inner=document.createElement("button");if(getCurrentValue("source-sidebar-show")==="true"){inner.innerText="<"}else{inner.innerText=">"}inner.onclick=toggleSidebar;sidebarToggle.appendChild(inner);return sidebarToggle}function createSourceSidebar(){const container=document.querySelector("nav.sidebar");const sidebarToggle=createSidebarToggle();container.insertBefore(sidebarToggle,container.firstChild);const sidebar=document.createElement("div");sidebar.id="source-sidebar";let hasFoundFile=false;const title=document.createElement("div");title.className="title";title.innerText="Files";sidebar.appendChild(title);Object.keys(sourcesIndex).forEach(key=>{sourcesIndex[key][NAME_OFFSET]=key;hasFoundFile=createDirEntry(sourcesIndex[key],sidebar,"",hasFoundFile)});container.appendChild(sidebar);const selected_elem=sidebar.getElementsByClassName("selected")[0];if(typeof selected_elem!=="undefined"){selected_elem.focus()}}const lineNumbersRegex=/^#?(\d+)(?:-(\d+))?$/;function highlightSourceLines(match){if(typeof match==="undefined"){match=window.location.hash.match(lineNumbersRegex)}if(!match){return}let from=parseInt(match[1],10);let to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10)}if(to{onEachLazy(e.getElementsByTagName("span"),i_e=>{removeClass(i_e,"line-highlighted")})});for(let i=from;i<=to;++i){elem=document.getElementById(i);if(!elem){break}addClass(elem,"line-highlighted")}}const handleSourceHighlight=(function(){let prev_line_id=0;const set_fragment=name=>{const x=window.scrollX,y=window.scrollY;if(browserSupportsHistoryApi()){history.replaceState(null,null,"#"+name);highlightSourceLines()}else{location.replace("#"+name)}window.scrollTo(x,y)};return ev=>{let cur_line_id=parseInt(ev.target.id,10);if(isNaN(cur_line_id)){return}ev.preventDefault();if(ev.shiftKey&&prev_line_id){if(prev_line_id>cur_line_id){const tmp=prev_line_id;prev_line_id=cur_line_id;cur_line_id=tmp}set_fragment(prev_line_id+"-"+cur_line_id)}else{prev_line_id=cur_line_id;set_fragment(cur_line_id)}}}());window.addEventListener("hashchange",()=>{const match=window.location.hash.match(lineNumbersRegex);if(match){return highlightSourceLines(match)}});onEachLazy(document.getElementsByClassName("line-numbers"),el=>{el.addEventListener("click",handleSourceHighlight)});highlightSourceLines();window.createSourceSidebar=createSourceSidebar})() \ No newline at end of file diff --git a/ch9-gui-dev/src/os/boards/qemu.rs.html b/ch9-gui-dev/src/os/boards/qemu.rs.html new file mode 100644 index 00000000..048f99d6 --- /dev/null +++ b/ch9-gui-dev/src/os/boards/qemu.rs.html @@ -0,0 +1,270 @@ +qemu.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+
pub const CLOCK_FREQ: usize = 12500000;
+
+pub const MMIO: &[(usize, usize)] = &[
+    (0x0010_0000, 0x00_2000), // VIRT_TEST/RTC  in virt machine
+    (0x2000000, 0x10000),
+    (0xc000000, 0x210000), // VIRT_PLIC in virt machine
+    (0x10000000, 0x9000),  // VIRT_UART0 with GPU  in virt machine
+];
+
+pub type BlockDeviceImpl = crate::drivers::block::VirtIOBlock;
+pub type CharDeviceImpl = crate::drivers::chardev::NS16550a<VIRT_UART>;
+
+pub const VIRT_PLIC: usize = 0xC00_0000;
+pub const VIRT_UART: usize = 0x1000_0000;
+
+pub const VIRTGPU_XRES: u32 = 1280;
+#[allow(unused)]
+pub const VIRTGPU_YRES: u32 = 800;
+
+use crate::drivers::block::BLOCK_DEVICE;
+use crate::drivers::chardev::{CharDevice, UART};
+use crate::drivers::plic::{IntrTargetPriority, PLIC};
+use crate::drivers::{KEYBOARD_DEVICE, MOUSE_DEVICE};
+
+pub fn device_init() {
+    use riscv::register::sie;
+    let mut plic = unsafe { PLIC::new(VIRT_PLIC) };
+    let hart_id: usize = 0;
+    let supervisor = IntrTargetPriority::Supervisor;
+    let machine = IntrTargetPriority::Machine;
+    plic.set_threshold(hart_id, supervisor, 0);
+    plic.set_threshold(hart_id, machine, 1);
+    //irq nums: 5 keyboard, 6 mouse, 8 block, 10 uart
+    for intr_src_id in [5usize, 6, 8, 10] {
+        plic.enable(hart_id, supervisor, intr_src_id);
+        plic.set_priority(intr_src_id, 1);
+    }
+    unsafe {
+        sie::set_sext();
+    }
+}
+
+pub fn irq_handler() {
+    let mut plic = unsafe { PLIC::new(VIRT_PLIC) };
+    let intr_src_id = plic.claim(0, IntrTargetPriority::Supervisor);
+    match intr_src_id {
+        5 => KEYBOARD_DEVICE.handle_irq(),
+        6 => MOUSE_DEVICE.handle_irq(),
+        8 => BLOCK_DEVICE.handle_irq(),
+        10 => UART.handle_irq(),
+        _ => panic!("unsupported IRQ {}", intr_src_id),
+    }
+    plic.complete(0, IntrTargetPriority::Supervisor, intr_src_id);
+}
+
+//ref:: https://github.com/andre-richter/qemu-exit
+use core::arch::asm;
+
+const EXIT_SUCCESS: u32 = 0x5555; // Equals `exit(0)`. qemu successful exit
+
+const EXIT_FAILURE_FLAG: u32 = 0x3333;
+const EXIT_FAILURE: u32 = exit_code_encode(1); // Equals `exit(1)`. qemu failed exit
+const EXIT_RESET: u32 = 0x7777; // qemu reset
+
+pub trait QEMUExit {
+    /// Exit with specified return code.
+    ///
+    /// Note: For `X86`, code is binary-OR'ed with `0x1` inside QEMU.
+    fn exit(&self, code: u32) -> !;
+
+    /// Exit QEMU using `EXIT_SUCCESS`, aka `0`, if possible.
+    ///
+    /// Note: Not possible for `X86`.
+    fn exit_success(&self) -> !;
+
+    /// Exit QEMU using `EXIT_FAILURE`, aka `1`.
+    fn exit_failure(&self) -> !;
+}
+
+/// RISCV64 configuration
+pub struct RISCV64 {
+    /// Address of the sifive_test mapped device.
+    addr: u64,
+}
+
+/// Encode the exit code using EXIT_FAILURE_FLAG.
+const fn exit_code_encode(code: u32) -> u32 {
+    (code << 16) | EXIT_FAILURE_FLAG
+}
+
+impl RISCV64 {
+    /// Create an instance.
+    pub const fn new(addr: u64) -> Self {
+        RISCV64 { addr }
+    }
+}
+
+impl QEMUExit for RISCV64 {
+    /// Exit qemu with specified exit code.
+    fn exit(&self, code: u32) -> ! {
+        // If code is not a special value, we need to encode it with EXIT_FAILURE_FLAG.
+        let code_new = match code {
+            EXIT_SUCCESS | EXIT_FAILURE | EXIT_RESET => code,
+            _ => exit_code_encode(code),
+        };
+
+        unsafe {
+            asm!(
+                "sw {0}, 0({1})",
+                in(reg)code_new, in(reg)self.addr
+            );
+
+            // For the case that the QEMU exit attempt did not work, transition into an infinite
+            // loop. Calling `panic!()` here is unfeasible, since there is a good chance
+            // this function here is the last expression in the `panic!()` handler
+            // itself. This prevents a possible infinite loop.
+            loop {
+                asm!("wfi", options(nomem, nostack));
+            }
+        }
+    }
+
+    fn exit_success(&self) -> ! {
+        self.exit(EXIT_SUCCESS);
+    }
+
+    fn exit_failure(&self) -> ! {
+        self.exit(EXIT_FAILURE);
+    }
+}
+
+const VIRT_TEST: u64 = 0x100000;
+
+pub const QEMU_EXIT_HANDLE: RISCV64 = RISCV64::new(VIRT_TEST);
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/config.rs.html b/ch9-gui-dev/src/os/config.rs.html new file mode 100644 index 00000000..54c7274d --- /dev/null +++ b/ch9-gui-dev/src/os/config.rs.html @@ -0,0 +1,28 @@ +config.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+
#[allow(unused)]
+
+pub const USER_STACK_SIZE: usize = 4096 * 2;
+pub const KERNEL_STACK_SIZE: usize = 4096 * 2;
+pub const KERNEL_HEAP_SIZE: usize = 0x100_0000;
+pub const MEMORY_END: usize = 0x88000000;
+pub const PAGE_SIZE: usize = 0x1000;
+pub const PAGE_SIZE_BITS: usize = 0xc;
+
+pub const TRAMPOLINE: usize = usize::MAX - PAGE_SIZE + 1;
+pub const TRAP_CONTEXT_BASE: usize = TRAMPOLINE - PAGE_SIZE;
+
+pub use crate::board::{CLOCK_FREQ, MMIO};
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/console.rs.html b/ch9-gui-dev/src/os/console.rs.html new file mode 100644 index 00000000..96b7bdd4 --- /dev/null +++ b/ch9-gui-dev/src/os/console.rs.html @@ -0,0 +1,66 @@ +console.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+
use crate::drivers::chardev::CharDevice;
+use crate::drivers::chardev::UART;
+use core::fmt::{self, Write};
+
+struct Stdout;
+
+impl Write for Stdout {
+    fn write_str(&mut self, s: &str) -> fmt::Result {
+        for c in s.chars() {
+            UART.write(c as u8);
+        }
+        Ok(())
+    }
+}
+
+pub fn print(args: fmt::Arguments) {
+    Stdout.write_fmt(args).unwrap();
+}
+
+#[macro_export]
+macro_rules! print {
+    ($fmt: literal $(, $($arg: tt)+)?) => {
+        $crate::console::print(format_args!($fmt $(, $($arg)+)?))
+    }
+}
+
+#[macro_export]
+macro_rules! println {
+    ($fmt: literal $(, $($arg: tt)+)?) => {
+        $crate::console::print(format_args!(concat!($fmt, "\n") $(, $($arg)+)?))
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/drivers/block/mod.rs.html b/ch9-gui-dev/src/os/drivers/block/mod.rs.html new file mode 100644 index 00000000..064b9795 --- /dev/null +++ b/ch9-gui-dev/src/os/drivers/block/mod.rs.html @@ -0,0 +1,58 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
mod virtio_blk;
+
+pub use virtio_blk::VirtIOBlock;
+
+use crate::board::BlockDeviceImpl;
+use alloc::sync::Arc;
+use easy_fs::BlockDevice;
+use lazy_static::*;
+
+lazy_static! {
+    pub static ref BLOCK_DEVICE: Arc<dyn BlockDevice> = Arc::new(BlockDeviceImpl::new());
+}
+
+#[allow(unused)]
+pub fn block_device_test() {
+    let block_device = BLOCK_DEVICE.clone();
+    let mut write_buffer = [0u8; 512];
+    let mut read_buffer = [0u8; 512];
+    for i in 0..512 {
+        for byte in write_buffer.iter_mut() {
+            *byte = i as u8;
+        }
+        block_device.write_block(i as usize, &write_buffer);
+        block_device.read_block(i as usize, &mut read_buffer);
+        assert_eq!(write_buffer, read_buffer);
+    }
+    println!("block device test passed!");
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/drivers/block/virtio_blk.rs.html b/ch9-gui-dev/src/os/drivers/block/virtio_blk.rs.html new file mode 100644 index 00000000..02dfbf26 --- /dev/null +++ b/ch9-gui-dev/src/os/drivers/block/virtio_blk.rs.html @@ -0,0 +1,176 @@ +virtio_blk.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+
use super::BlockDevice;
+use crate::drivers::bus::virtio::VirtioHal;
+use crate::sync::{Condvar, UPIntrFreeCell};
+use crate::task::schedule;
+use crate::DEV_NON_BLOCKING_ACCESS;
+use alloc::collections::BTreeMap;
+use virtio_drivers::{BlkResp, RespStatus, VirtIOBlk, VirtIOHeader};
+
+#[allow(unused)]
+const VIRTIO0: usize = 0x10008000;
+
+pub struct VirtIOBlock {
+    virtio_blk: UPIntrFreeCell<VirtIOBlk<'static, VirtioHal>>,
+    condvars: BTreeMap<u16, Condvar>,
+}
+
+impl BlockDevice for VirtIOBlock {
+    fn read_block(&self, block_id: usize, buf: &mut [u8]) {
+        let nb = *DEV_NON_BLOCKING_ACCESS.exclusive_access();
+        if nb {
+            let mut resp = BlkResp::default();
+            let task_cx_ptr = self.virtio_blk.exclusive_session(|blk| {
+                let token = unsafe { blk.read_block_nb(block_id, buf, &mut resp).unwrap() };
+                self.condvars.get(&token).unwrap().wait_no_sched()
+            });
+            schedule(task_cx_ptr);
+            assert_eq!(
+                resp.status(),
+                RespStatus::Ok,
+                "Error when reading VirtIOBlk"
+            );
+        } else {
+            self.virtio_blk
+                .exclusive_access()
+                .read_block(block_id, buf)
+                .expect("Error when reading VirtIOBlk");
+        }
+    }
+    fn write_block(&self, block_id: usize, buf: &[u8]) {
+        let nb = *DEV_NON_BLOCKING_ACCESS.exclusive_access();
+        if nb {
+            let mut resp = BlkResp::default();
+            let task_cx_ptr = self.virtio_blk.exclusive_session(|blk| {
+                let token = unsafe { blk.write_block_nb(block_id, buf, &mut resp).unwrap() };
+                self.condvars.get(&token).unwrap().wait_no_sched()
+            });
+            schedule(task_cx_ptr);
+            assert_eq!(
+                resp.status(),
+                RespStatus::Ok,
+                "Error when writing VirtIOBlk"
+            );
+        } else {
+            self.virtio_blk
+                .exclusive_access()
+                .write_block(block_id, buf)
+                .expect("Error when writing VirtIOBlk");
+        }
+    }
+    fn handle_irq(&self) {
+        self.virtio_blk.exclusive_session(|blk| {
+            while let Ok(token) = blk.pop_used() {
+                self.condvars.get(&token).unwrap().signal();
+            }
+        });
+    }
+}
+
+impl VirtIOBlock {
+    pub fn new() -> Self {
+        let virtio_blk = unsafe {
+            UPIntrFreeCell::new(
+                VirtIOBlk::<VirtioHal>::new(&mut *(VIRTIO0 as *mut VirtIOHeader)).unwrap(),
+            )
+        };
+        let mut condvars = BTreeMap::new();
+        let channels = virtio_blk.exclusive_access().virt_queue_size();
+        for i in 0..channels {
+            let condvar = Condvar::new();
+            condvars.insert(i, condvar);
+        }
+        Self {
+            virtio_blk,
+            condvars,
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/drivers/bus/mod.rs.html b/ch9-gui-dev/src/os/drivers/bus/mod.rs.html new file mode 100644 index 00000000..47d35b17 --- /dev/null +++ b/ch9-gui-dev/src/os/drivers/bus/mod.rs.html @@ -0,0 +1,4 @@ +mod.rs - source
1
+
pub mod virtio;
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/drivers/bus/virtio.rs.html b/ch9-gui-dev/src/os/drivers/bus/virtio.rs.html new file mode 100644 index 00000000..bd5adea6 --- /dev/null +++ b/ch9-gui-dev/src/os/drivers/bus/virtio.rs.html @@ -0,0 +1,106 @@ +virtio.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+
use crate::mm::{
+    frame_alloc, frame_dealloc, kernel_token, FrameTracker, PageTable, PhysAddr, PhysPageNum,
+    StepByOne, VirtAddr,
+};
+use crate::sync::UPIntrFreeCell;
+use alloc::vec::Vec;
+use lazy_static::*;
+use virtio_drivers::Hal;
+
+lazy_static! {
+    static ref QUEUE_FRAMES: UPIntrFreeCell<Vec<FrameTracker>> =
+        unsafe { UPIntrFreeCell::new(Vec::new()) };
+}
+
+pub struct VirtioHal;
+
+impl Hal for VirtioHal {
+    fn dma_alloc(pages: usize) -> usize {
+        let mut ppn_base = PhysPageNum(0);
+        for i in 0..pages {
+            let frame = frame_alloc().unwrap();
+            if i == 0 {
+                ppn_base = frame.ppn;
+            }
+            assert_eq!(frame.ppn.0, ppn_base.0 + i);
+            QUEUE_FRAMES.exclusive_access().push(frame);
+        }
+        let pa: PhysAddr = ppn_base.into();
+        pa.0
+    }
+
+    fn dma_dealloc(pa: usize, pages: usize) -> i32 {
+        let pa = PhysAddr::from(pa);
+        let mut ppn_base: PhysPageNum = pa.into();
+        for _ in 0..pages {
+            frame_dealloc(ppn_base);
+            ppn_base.step();
+        }
+        0
+    }
+
+    fn phys_to_virt(addr: usize) -> usize {
+        addr
+    }
+
+    fn virt_to_phys(vaddr: usize) -> usize {
+        PageTable::from_token(kernel_token())
+            .translate_va(VirtAddr::from(vaddr))
+            .unwrap()
+            .0
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/drivers/chardev/mod.rs.html b/ch9-gui-dev/src/os/drivers/chardev/mod.rs.html new file mode 100644 index 00000000..156c3474 --- /dev/null +++ b/ch9-gui-dev/src/os/drivers/chardev/mod.rs.html @@ -0,0 +1,36 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+
mod ns16550a;
+
+use crate::board::CharDeviceImpl;
+use alloc::sync::Arc;
+use lazy_static::*;
+pub use ns16550a::NS16550a;
+
+pub trait CharDevice {
+    fn init(&self);
+    fn read(&self) -> u8;
+    fn write(&self, ch: u8);
+    fn handle_irq(&self);
+}
+
+lazy_static! {
+    pub static ref UART: Arc<CharDeviceImpl> = Arc::new(CharDeviceImpl::new());
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/drivers/chardev/ns16550a.rs.html b/ch9-gui-dev/src/os/drivers/chardev/ns16550a.rs.html new file mode 100644 index 00000000..3a1c351a --- /dev/null +++ b/ch9-gui-dev/src/os/drivers/chardev/ns16550a.rs.html @@ -0,0 +1,364 @@ +ns16550a.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+
///! Ref: https://www.lammertbies.nl/comm/info/serial-uart
+///! Ref: ns16550a datasheet: https://datasheetspdf.com/pdf-file/605590/NationalSemiconductor/NS16550A/1
+///! Ref: ns16450 datasheet: https://datasheetspdf.com/pdf-file/1311818/NationalSemiconductor/NS16450/1
+use super::CharDevice;
+use crate::sync::{Condvar, UPIntrFreeCell};
+use crate::task::schedule;
+use alloc::collections::VecDeque;
+use bitflags::*;
+use volatile::{ReadOnly, Volatile, WriteOnly};
+
+bitflags! {
+    /// InterruptEnableRegister
+    pub struct IER: u8 {
+        const RX_AVAILABLE = 1 << 0;
+        const TX_EMPTY = 1 << 1;
+    }
+
+    /// LineStatusRegister
+    pub struct LSR: u8 {
+        const DATA_AVAILABLE = 1 << 0;
+        const THR_EMPTY = 1 << 5;
+    }
+
+    /// Model Control Register
+    pub struct MCR: u8 {
+        const DATA_TERMINAL_READY = 1 << 0;
+        const REQUEST_TO_SEND = 1 << 1;
+        const AUX_OUTPUT1 = 1 << 2;
+        const AUX_OUTPUT2 = 1 << 3;
+    }
+}
+
+#[repr(C)]
+#[allow(dead_code)]
+struct ReadWithoutDLAB {
+    /// receiver buffer register
+    pub rbr: ReadOnly<u8>,
+    /// interrupt enable register
+    pub ier: Volatile<IER>,
+    /// interrupt identification register
+    pub iir: ReadOnly<u8>,
+    /// line control register
+    pub lcr: Volatile<u8>,
+    /// model control register
+    pub mcr: Volatile<MCR>,
+    /// line status register
+    pub lsr: ReadOnly<LSR>,
+    /// ignore MSR
+    _padding1: ReadOnly<u8>,
+    /// ignore SCR
+    _padding2: ReadOnly<u8>,
+}
+
+#[repr(C)]
+#[allow(dead_code)]
+struct WriteWithoutDLAB {
+    /// transmitter holding register
+    pub thr: WriteOnly<u8>,
+    /// interrupt enable register
+    pub ier: Volatile<IER>,
+    /// ignore FCR
+    _padding0: ReadOnly<u8>,
+    /// line control register
+    pub lcr: Volatile<u8>,
+    /// modem control register
+    pub mcr: Volatile<MCR>,
+    /// line status register
+    pub lsr: ReadOnly<LSR>,
+    /// ignore other registers
+    _padding1: ReadOnly<u16>,
+}
+
+pub struct NS16550aRaw {
+    base_addr: usize,
+}
+
+impl NS16550aRaw {
+    fn read_end(&mut self) -> &mut ReadWithoutDLAB {
+        unsafe { &mut *(self.base_addr as *mut ReadWithoutDLAB) }
+    }
+
+    fn write_end(&mut self) -> &mut WriteWithoutDLAB {
+        unsafe { &mut *(self.base_addr as *mut WriteWithoutDLAB) }
+    }
+
+    pub fn new(base_addr: usize) -> Self {
+        Self { base_addr }
+    }
+
+    pub fn init(&mut self) {
+        let read_end = self.read_end();
+        let mut mcr = MCR::empty();
+        mcr |= MCR::DATA_TERMINAL_READY;
+        mcr |= MCR::REQUEST_TO_SEND;
+        mcr |= MCR::AUX_OUTPUT2;
+        read_end.mcr.write(mcr);
+        let ier = IER::RX_AVAILABLE;
+        read_end.ier.write(ier);
+    }
+
+    pub fn read(&mut self) -> Option<u8> {
+        let read_end = self.read_end();
+        let lsr = read_end.lsr.read();
+        if lsr.contains(LSR::DATA_AVAILABLE) {
+            Some(read_end.rbr.read())
+        } else {
+            None
+        }
+    }
+
+    pub fn write(&mut self, ch: u8) {
+        let write_end = self.write_end();
+        loop {
+            if write_end.lsr.read().contains(LSR::THR_EMPTY) {
+                write_end.thr.write(ch);
+                break;
+            }
+        }
+    }
+}
+
+struct NS16550aInner {
+    ns16550a: NS16550aRaw,
+    read_buffer: VecDeque<u8>,
+}
+
+pub struct NS16550a<const BASE_ADDR: usize> {
+    inner: UPIntrFreeCell<NS16550aInner>,
+    condvar: Condvar,
+}
+
+impl<const BASE_ADDR: usize> NS16550a<BASE_ADDR> {
+    pub fn new() -> Self {
+        let mut inner = NS16550aInner {
+            ns16550a: NS16550aRaw::new(BASE_ADDR),
+            read_buffer: VecDeque::new(),
+        };
+        //inner.ns16550a.init();
+        Self {
+            inner: unsafe { UPIntrFreeCell::new(inner) },
+            condvar: Condvar::new(),
+        }
+    }
+}
+
+impl<const BASE_ADDR: usize> CharDevice for NS16550a<BASE_ADDR> {
+    fn init(&self){
+        let mut inner = self.inner.exclusive_access();
+        inner.ns16550a.init();
+        drop(inner);
+    }
+
+    fn read(&self) -> u8 {
+        loop {
+            let mut inner = self.inner.exclusive_access();
+            if let Some(ch) = inner.read_buffer.pop_front() {
+                return ch;
+            } else {
+                let task_cx_ptr = self.condvar.wait_no_sched();
+                drop(inner);
+                schedule(task_cx_ptr);
+            }
+        }
+    }
+    fn write(&self, ch: u8) {
+        let mut inner = self.inner.exclusive_access();
+        inner.ns16550a.write(ch);
+    }
+    fn handle_irq(&self) {
+        let mut count = 0;
+        self.inner.exclusive_session(|inner| {
+            while let Some(ch) = inner.ns16550a.read() {
+                count += 1;
+                inner.read_buffer.push_back(ch);
+            }
+        });
+        if count > 0 {
+            self.condvar.signal();
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/drivers/gpu/mod.rs.html b/ch9-gui-dev/src/os/drivers/gpu/mod.rs.html new file mode 100644 index 00000000..56175a79 --- /dev/null +++ b/ch9-gui-dev/src/os/drivers/gpu/mod.rs.html @@ -0,0 +1,138 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+
use crate::drivers::bus::virtio::VirtioHal;
+use crate::sync::UPIntrFreeCell;
+use alloc::{sync::Arc, vec::Vec};
+use core::any::Any;
+use embedded_graphics::pixelcolor::Rgb888;
+use tinybmp::Bmp;
+use virtio_drivers::{VirtIOGpu, VirtIOHeader};
+const VIRTIO7: usize = 0x10007000;
+pub trait GpuDevice: Send + Sync + Any {
+    fn update_cursor(&self);
+    fn get_framebuffer(&self) -> &mut [u8];
+    fn flush(&self);
+}
+
+lazy_static::lazy_static!(
+    pub static ref GPU_DEVICE: Arc<dyn GpuDevice> = Arc::new(VirtIOGpuWrapper::new());
+);
+
+pub struct VirtIOGpuWrapper {
+    gpu: UPIntrFreeCell<VirtIOGpu<'static, VirtioHal>>,
+    fb: &'static [u8],
+}
+static BMP_DATA: &[u8] = include_bytes!("../../assert/mouse.bmp");
+impl VirtIOGpuWrapper {
+    pub fn new() -> Self {
+        unsafe {
+            let mut virtio =
+                VirtIOGpu::<VirtioHal>::new(&mut *(VIRTIO7 as *mut VirtIOHeader)).unwrap();
+
+            let fbuffer = virtio.setup_framebuffer().unwrap();
+            let len = fbuffer.len();
+            let ptr = fbuffer.as_mut_ptr();
+            let fb = core::slice::from_raw_parts_mut(ptr, len);
+
+            let bmp = Bmp::<Rgb888>::from_slice(BMP_DATA).unwrap();
+            let raw = bmp.as_raw();
+            let mut b = Vec::new();
+            for i in raw.image_data().chunks(3) {
+                let mut v = i.to_vec();
+                b.append(&mut v);
+                if i == [255, 255, 255] {
+                    b.push(0x0)
+                } else {
+                    b.push(0xff)
+                }
+            }
+            virtio.setup_cursor(b.as_slice(), 50, 50, 50, 50).unwrap();
+
+            Self {
+                gpu: UPIntrFreeCell::new(virtio),
+                fb,
+            }
+        }
+    }
+}
+
+impl GpuDevice for VirtIOGpuWrapper {
+    fn flush(&self) {
+        self.gpu.exclusive_access().flush().unwrap();
+    }
+    fn get_framebuffer(&self) -> &mut [u8] {
+        unsafe {
+            let ptr = self.fb.as_ptr() as *const _ as *mut u8;
+            core::slice::from_raw_parts_mut(ptr, self.fb.len())
+        }
+    }
+    fn update_cursor(&self) {}
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/drivers/input/mod.rs.html b/ch9-gui-dev/src/os/drivers/input/mod.rs.html new file mode 100644 index 00000000..0a1f6aa8 --- /dev/null +++ b/ch9-gui-dev/src/os/drivers/input/mod.rs.html @@ -0,0 +1,152 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+
use crate::drivers::bus::virtio::VirtioHal;
+use crate::{
+    gui::{move_rect, reset},
+    sync::UPIntrFreeCell,
+};
+use alloc::sync::Arc;
+use core::any::Any;
+use virtio_drivers::{VirtIOHeader, VirtIOInput};
+use virtio_input_decoder::{Decoder, Key, KeyType};
+
+const VIRTIO5: usize = 0x10005000;
+const VIRTIO6: usize = 0x10006000;
+
+struct VirtIOInputWrapper(UPIntrFreeCell<VirtIOInput<'static, VirtioHal>>);
+
+pub trait InputDevice: Send + Sync + Any {
+    fn handle_irq(&self);
+}
+
+lazy_static::lazy_static!(
+    pub static ref KEYBOARD_DEVICE: Arc<dyn InputDevice> = Arc::new(VirtIOInputWrapper::new(VIRTIO5));
+    pub static ref MOUSE_DEVICE: Arc<dyn InputDevice> = Arc::new(VirtIOInputWrapper::new(VIRTIO6));
+);
+
+impl VirtIOInputWrapper {
+    pub fn new(addr: usize) -> Self {
+        Self(unsafe {
+            UPIntrFreeCell::new(
+                VirtIOInput::<VirtioHal>::new(&mut *(addr as *mut VirtIOHeader)).unwrap(),
+            )
+        })
+    }
+}
+
+impl InputDevice for VirtIOInputWrapper {
+    fn handle_irq(&self) {
+        let mut input = self.0.exclusive_access();
+        input.ack_interrupt();
+        while let Some(event) = input.pop_pending_event() {
+            let dtype = match Decoder::decode(
+                event.event_type as usize,
+                event.code as usize,
+                event.value as usize,
+            ) {
+                Ok(dtype) => dtype,
+                Err(_) => break,
+            };
+            match dtype {
+                virtio_input_decoder::DecodeType::Key(key, r#type) => {
+                    if r#type == KeyType::Press {
+                        match key {
+                            Key::C | Key::MouseLeft => {
+                                reset();
+                            }
+                            Key::W => {
+                                move_rect(0, -10);
+                            }
+                            Key::S => {
+                                move_rect(0, 10);
+                            }
+                            Key::A => {
+                                move_rect(-10, 0);
+                            }
+                            Key::D => {
+                                move_rect(10, 0);
+                            }
+                            _ => {}
+                        }
+                    }
+                }
+                _ => {}
+            }
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/drivers/mod.rs.html b/ch9-gui-dev/src/os/drivers/mod.rs.html new file mode 100644 index 00000000..fc30aa13 --- /dev/null +++ b/ch9-gui-dev/src/os/drivers/mod.rs.html @@ -0,0 +1,26 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
pub mod block;
+pub mod bus;
+pub mod chardev;
+pub mod gpu;
+pub mod input;
+pub mod plic;
+
+pub use block::BLOCK_DEVICE;
+pub use bus::*;
+pub use chardev::UART;
+pub use gpu::*;
+pub use input::*;
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/drivers/plic.rs.html b/ch9-gui-dev/src/os/drivers/plic.rs.html new file mode 100644 index 00000000..4f3bfa2f --- /dev/null +++ b/ch9-gui-dev/src/os/drivers/plic.rs.html @@ -0,0 +1,250 @@ +plic.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+
#[allow(clippy::upper_case_acronyms)]
+pub struct PLIC {
+    base_addr: usize,
+}
+
+#[derive(Copy, Clone)]
+pub enum IntrTargetPriority {
+    Machine = 0,
+    Supervisor = 1,
+}
+
+impl IntrTargetPriority {
+    pub fn supported_number() -> usize {
+        2
+    }
+}
+
+impl PLIC {
+    fn priority_ptr(&self, intr_source_id: usize) -> *mut u32 {
+        assert!(intr_source_id > 0 && intr_source_id <= 132);
+        (self.base_addr + intr_source_id * 4) as *mut u32
+    }
+    fn hart_id_with_priority(hart_id: usize, target_priority: IntrTargetPriority) -> usize {
+        let priority_num = IntrTargetPriority::supported_number();
+        hart_id * priority_num + target_priority as usize
+    }
+    fn enable_ptr(
+        &self,
+        hart_id: usize,
+        target_priority: IntrTargetPriority,
+        intr_source_id: usize,
+    ) -> (*mut u32, usize) {
+        let id = Self::hart_id_with_priority(hart_id, target_priority);
+        let (reg_id, reg_shift) = (intr_source_id / 32, intr_source_id % 32);
+        (
+            (self.base_addr + 0x2000 + 0x80 * id + 0x4 * reg_id) as *mut u32,
+            reg_shift,
+        )
+    }
+    fn threshold_ptr_of_hart_with_priority(
+        &self,
+        hart_id: usize,
+        target_priority: IntrTargetPriority,
+    ) -> *mut u32 {
+        let id = Self::hart_id_with_priority(hart_id, target_priority);
+        (self.base_addr + 0x20_0000 + 0x1000 * id) as *mut u32
+    }
+    fn claim_comp_ptr_of_hart_with_priority(
+        &self,
+        hart_id: usize,
+        target_priority: IntrTargetPriority,
+    ) -> *mut u32 {
+        let id = Self::hart_id_with_priority(hart_id, target_priority);
+        (self.base_addr + 0x20_0004 + 0x1000 * id) as *mut u32
+    }
+    pub unsafe fn new(base_addr: usize) -> Self {
+        Self { base_addr }
+    }
+    pub fn set_priority(&mut self, intr_source_id: usize, priority: u32) {
+        assert!(priority < 8);
+        unsafe {
+            self.priority_ptr(intr_source_id).write_volatile(priority);
+        }
+    }
+    #[allow(unused)]
+    pub fn get_priority(&mut self, intr_source_id: usize) -> u32 {
+        unsafe { self.priority_ptr(intr_source_id).read_volatile() & 7 }
+    }
+    pub fn enable(
+        &mut self,
+        hart_id: usize,
+        target_priority: IntrTargetPriority,
+        intr_source_id: usize,
+    ) {
+        let (reg_ptr, shift) = self.enable_ptr(hart_id, target_priority, intr_source_id);
+        unsafe {
+            reg_ptr.write_volatile(reg_ptr.read_volatile() | 1 << shift);
+        }
+    }
+    #[allow(unused)]
+    pub fn disable(
+        &mut self,
+        hart_id: usize,
+        target_priority: IntrTargetPriority,
+        intr_source_id: usize,
+    ) {
+        let (reg_ptr, shift) = self.enable_ptr(hart_id, target_priority, intr_source_id);
+        unsafe {
+            reg_ptr.write_volatile(reg_ptr.read_volatile() & (!(1u32 << shift)));
+        }
+    }
+    pub fn set_threshold(
+        &mut self,
+        hart_id: usize,
+        target_priority: IntrTargetPriority,
+        threshold: u32,
+    ) {
+        assert!(threshold < 8);
+        let threshold_ptr = self.threshold_ptr_of_hart_with_priority(hart_id, target_priority);
+        unsafe {
+            threshold_ptr.write_volatile(threshold);
+        }
+    }
+    #[allow(unused)]
+    pub fn get_threshold(&mut self, hart_id: usize, target_priority: IntrTargetPriority) -> u32 {
+        let threshold_ptr = self.threshold_ptr_of_hart_with_priority(hart_id, target_priority);
+        unsafe { threshold_ptr.read_volatile() & 7 }
+    }
+    pub fn claim(&mut self, hart_id: usize, target_priority: IntrTargetPriority) -> u32 {
+        let claim_comp_ptr = self.claim_comp_ptr_of_hart_with_priority(hart_id, target_priority);
+        unsafe { claim_comp_ptr.read_volatile() }
+    }
+    pub fn complete(
+        &mut self,
+        hart_id: usize,
+        target_priority: IntrTargetPriority,
+        completion: u32,
+    ) {
+        let claim_comp_ptr = self.claim_comp_ptr_of_hart_with_priority(hart_id, target_priority);
+        unsafe {
+            claim_comp_ptr.write_volatile(completion);
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/fs/inode.rs.html b/ch9-gui-dev/src/os/fs/inode.rs.html new file mode 100644 index 00000000..3d8fbdf9 --- /dev/null +++ b/ch9-gui-dev/src/os/fs/inode.rs.html @@ -0,0 +1,280 @@ +inode.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+
use super::File;
+use crate::drivers::BLOCK_DEVICE;
+use crate::mm::UserBuffer;
+use crate::sync::UPIntrFreeCell;
+use alloc::sync::Arc;
+use alloc::vec::Vec;
+use bitflags::*;
+use easy_fs::{EasyFileSystem, Inode};
+use lazy_static::*;
+
+pub struct OSInode {
+    readable: bool,
+    writable: bool,
+    inner: UPIntrFreeCell<OSInodeInner>,
+}
+
+pub struct OSInodeInner {
+    offset: usize,
+    inode: Arc<Inode>,
+}
+
+impl OSInode {
+    pub fn new(readable: bool, writable: bool, inode: Arc<Inode>) -> Self {
+        Self {
+            readable,
+            writable,
+            inner: unsafe { UPIntrFreeCell::new(OSInodeInner { offset: 0, inode }) },
+        }
+    }
+    pub fn read_all(&self) -> Vec<u8> {
+        let mut inner = self.inner.exclusive_access();
+        let mut buffer = [0u8; 512];
+        let mut v: Vec<u8> = Vec::new();
+        loop {
+            let len = inner.inode.read_at(inner.offset, &mut buffer);
+            if len == 0 {
+                break;
+            }
+            inner.offset += len;
+            v.extend_from_slice(&buffer[..len]);
+        }
+        v
+    }
+}
+
+lazy_static! {
+    pub static ref ROOT_INODE: Arc<Inode> = {
+        let efs = EasyFileSystem::open(BLOCK_DEVICE.clone());
+        Arc::new(EasyFileSystem::root_inode(&efs))
+    };
+}
+
+pub fn list_apps() {
+    println!("/**** APPS ****");
+    for app in ROOT_INODE.ls() {
+        println!("{}", app);
+    }
+    println!("**************/")
+}
+
+bitflags! {
+    pub struct OpenFlags: u32 {
+        const RDONLY = 0;
+        const WRONLY = 1 << 0;
+        const RDWR = 1 << 1;
+        const CREATE = 1 << 9;
+        const TRUNC = 1 << 10;
+    }
+}
+
+impl OpenFlags {
+    /// Do not check validity for simplicity
+    /// Return (readable, writable)
+    pub fn read_write(&self) -> (bool, bool) {
+        if self.is_empty() {
+            (true, false)
+        } else if self.contains(Self::WRONLY) {
+            (false, true)
+        } else {
+            (true, true)
+        }
+    }
+}
+
+pub fn open_file(name: &str, flags: OpenFlags) -> Option<Arc<OSInode>> {
+    let (readable, writable) = flags.read_write();
+    if flags.contains(OpenFlags::CREATE) {
+        if let Some(inode) = ROOT_INODE.find(name) {
+            // clear size
+            inode.clear();
+            Some(Arc::new(OSInode::new(readable, writable, inode)))
+        } else {
+            // create file
+            ROOT_INODE
+                .create(name)
+                .map(|inode| Arc::new(OSInode::new(readable, writable, inode)))
+        }
+    } else {
+        ROOT_INODE.find(name).map(|inode| {
+            if flags.contains(OpenFlags::TRUNC) {
+                inode.clear();
+            }
+            Arc::new(OSInode::new(readable, writable, inode))
+        })
+    }
+}
+
+impl File for OSInode {
+    fn readable(&self) -> bool {
+        self.readable
+    }
+    fn writable(&self) -> bool {
+        self.writable
+    }
+    fn read(&self, mut buf: UserBuffer) -> usize {
+        let mut inner = self.inner.exclusive_access();
+        let mut total_read_size = 0usize;
+        for slice in buf.buffers.iter_mut() {
+            let read_size = inner.inode.read_at(inner.offset, *slice);
+            if read_size == 0 {
+                break;
+            }
+            inner.offset += read_size;
+            total_read_size += read_size;
+        }
+        total_read_size
+    }
+    fn write(&self, buf: UserBuffer) -> usize {
+        let mut inner = self.inner.exclusive_access();
+        let mut total_write_size = 0usize;
+        for slice in buf.buffers.iter() {
+            let write_size = inner.inode.write_at(inner.offset, *slice);
+            assert_eq!(write_size, slice.len());
+            inner.offset += write_size;
+            total_write_size += write_size;
+        }
+        total_write_size
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/fs/mod.rs.html b/ch9-gui-dev/src/os/fs/mod.rs.html new file mode 100644 index 00000000..82d38fbc --- /dev/null +++ b/ch9-gui-dev/src/os/fs/mod.rs.html @@ -0,0 +1,34 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+
mod inode;
+mod pipe;
+mod stdio;
+
+use crate::mm::UserBuffer;
+
+pub trait File: Send + Sync {
+    fn readable(&self) -> bool;
+    fn writable(&self) -> bool;
+    fn read(&self, buf: UserBuffer) -> usize;
+    fn write(&self, buf: UserBuffer) -> usize;
+}
+
+pub use inode::{list_apps, open_file, OSInode, OpenFlags, ROOT_INODE};
+pub use pipe::{make_pipe, Pipe};
+pub use stdio::{Stdin, Stdout};
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/fs/pipe.rs.html b/ch9-gui-dev/src/os/fs/pipe.rs.html new file mode 100644 index 00000000..4c435aff --- /dev/null +++ b/ch9-gui-dev/src/os/fs/pipe.rs.html @@ -0,0 +1,347 @@ +pipe.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+
use super::File;
+use crate::mm::UserBuffer;
+use crate::sync::UPIntrFreeCell;
+use alloc::sync::{Arc, Weak};
+
+use crate::task::suspend_current_and_run_next;
+
+pub struct Pipe {
+    readable: bool,
+    writable: bool,
+    buffer: Arc<UPIntrFreeCell<PipeRingBuffer>>,
+}
+
+impl Pipe {
+    pub fn read_end_with_buffer(buffer: Arc<UPIntrFreeCell<PipeRingBuffer>>) -> Self {
+        Self {
+            readable: true,
+            writable: false,
+            buffer,
+        }
+    }
+    pub fn write_end_with_buffer(buffer: Arc<UPIntrFreeCell<PipeRingBuffer>>) -> Self {
+        Self {
+            readable: false,
+            writable: true,
+            buffer,
+        }
+    }
+}
+
+const RING_BUFFER_SIZE: usize = 32;
+
+#[derive(Copy, Clone, PartialEq)]
+enum RingBufferStatus {
+    Full,
+    Empty,
+    Normal,
+}
+
+pub struct PipeRingBuffer {
+    arr: [u8; RING_BUFFER_SIZE],
+    head: usize,
+    tail: usize,
+    status: RingBufferStatus,
+    write_end: Option<Weak<Pipe>>,
+}
+
+impl PipeRingBuffer {
+    pub fn new() -> Self {
+        Self {
+            arr: [0; RING_BUFFER_SIZE],
+            head: 0,
+            tail: 0,
+            status: RingBufferStatus::Empty,
+            write_end: None,
+        }
+    }
+    pub fn set_write_end(&mut self, write_end: &Arc<Pipe>) {
+        self.write_end = Some(Arc::downgrade(write_end));
+    }
+    pub fn write_byte(&mut self, byte: u8) {
+        self.status = RingBufferStatus::Normal;
+        self.arr[self.tail] = byte;
+        self.tail = (self.tail + 1) % RING_BUFFER_SIZE;
+        if self.tail == self.head {
+            self.status = RingBufferStatus::Full;
+        }
+    }
+    pub fn read_byte(&mut self) -> u8 {
+        self.status = RingBufferStatus::Normal;
+        let c = self.arr[self.head];
+        self.head = (self.head + 1) % RING_BUFFER_SIZE;
+        if self.head == self.tail {
+            self.status = RingBufferStatus::Empty;
+        }
+        c
+    }
+    pub fn available_read(&self) -> usize {
+        if self.status == RingBufferStatus::Empty {
+            0
+        } else if self.tail > self.head {
+            self.tail - self.head
+        } else {
+            self.tail + RING_BUFFER_SIZE - self.head
+        }
+    }
+    pub fn available_write(&self) -> usize {
+        if self.status == RingBufferStatus::Full {
+            0
+        } else {
+            RING_BUFFER_SIZE - self.available_read()
+        }
+    }
+    pub fn all_write_ends_closed(&self) -> bool {
+        self.write_end.as_ref().unwrap().upgrade().is_none()
+    }
+}
+
+/// Return (read_end, write_end)
+pub fn make_pipe() -> (Arc<Pipe>, Arc<Pipe>) {
+    let buffer = Arc::new(unsafe { UPIntrFreeCell::new(PipeRingBuffer::new()) });
+    let read_end = Arc::new(Pipe::read_end_with_buffer(buffer.clone()));
+    let write_end = Arc::new(Pipe::write_end_with_buffer(buffer.clone()));
+    buffer.exclusive_access().set_write_end(&write_end);
+    (read_end, write_end)
+}
+
+impl File for Pipe {
+    fn readable(&self) -> bool {
+        self.readable
+    }
+    fn writable(&self) -> bool {
+        self.writable
+    }
+    fn read(&self, buf: UserBuffer) -> usize {
+        assert!(self.readable());
+        let want_to_read = buf.len();
+        let mut buf_iter = buf.into_iter();
+        let mut already_read = 0usize;
+        loop {
+            let mut ring_buffer = self.buffer.exclusive_access();
+            let loop_read = ring_buffer.available_read();
+            if loop_read == 0 {
+                if ring_buffer.all_write_ends_closed() {
+                    return already_read;
+                }
+                drop(ring_buffer);
+                suspend_current_and_run_next();
+                continue;
+            }
+            for _ in 0..loop_read {
+                if let Some(byte_ref) = buf_iter.next() {
+                    unsafe {
+                        *byte_ref = ring_buffer.read_byte();
+                    }
+                    already_read += 1;
+                    if already_read == want_to_read {
+                        return want_to_read;
+                    }
+                } else {
+                    return already_read;
+                }
+            }
+        }
+    }
+    fn write(&self, buf: UserBuffer) -> usize {
+        assert!(self.writable());
+        let want_to_write = buf.len();
+        let mut buf_iter = buf.into_iter();
+        let mut already_write = 0usize;
+        loop {
+            let mut ring_buffer = self.buffer.exclusive_access();
+            let loop_write = ring_buffer.available_write();
+            if loop_write == 0 {
+                drop(ring_buffer);
+                suspend_current_and_run_next();
+                continue;
+            }
+            // write at most loop_write bytes
+            for _ in 0..loop_write {
+                if let Some(byte_ref) = buf_iter.next() {
+                    ring_buffer.write_byte(unsafe { *byte_ref });
+                    already_write += 1;
+                    if already_write == want_to_write {
+                        return want_to_write;
+                    }
+                } else {
+                    return already_write;
+                }
+            }
+        }
+    }
+}
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/fs/stdio.rs.html b/ch9-gui-dev/src/os/fs/stdio.rs.html new file mode 100644 index 00000000..2d27ebab --- /dev/null +++ b/ch9-gui-dev/src/os/fs/stdio.rs.html @@ -0,0 +1,94 @@ +stdio.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
use super::File;
+use crate::drivers::chardev::CharDevice;
+use crate::drivers::chardev::UART;
+use crate::mm::UserBuffer;
+
+pub struct Stdin;
+pub struct Stdout;
+
+impl File for Stdin {
+    fn readable(&self) -> bool {
+        true
+    }
+    fn writable(&self) -> bool {
+        false
+    }
+    fn read(&self, mut user_buf: UserBuffer) -> usize {
+        assert_eq!(user_buf.len(), 1);
+        //println!("before UART.read() in Stdin::read()");
+        let ch = UART.read();
+        unsafe {
+            user_buf.buffers[0].as_mut_ptr().write_volatile(ch);
+        }
+        1
+    }
+    fn write(&self, _user_buf: UserBuffer) -> usize {
+        panic!("Cannot write to stdin!");
+    }
+}
+
+impl File for Stdout {
+    fn readable(&self) -> bool {
+        false
+    }
+    fn writable(&self) -> bool {
+        true
+    }
+    fn read(&self, _user_buf: UserBuffer) -> usize {
+        panic!("Cannot read from stdout!");
+    }
+    fn write(&self, user_buf: UserBuffer) -> usize {
+        for buffer in user_buf.buffers.iter() {
+            print!("{}", core::str::from_utf8(*buffer).unwrap());
+        }
+        user_buf.len()
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/gui/graphic.rs.html b/ch9-gui-dev/src/os/gui/graphic.rs.html new file mode 100644 index 00000000..8ba7ffa2 --- /dev/null +++ b/ch9-gui-dev/src/os/gui/graphic.rs.html @@ -0,0 +1,136 @@ +graphic.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+
use alloc::sync::Arc;
+use embedded_graphics::{
+    draw_target::DrawTarget,
+    pixelcolor::Rgb888,
+    prelude::{OriginDimensions, Point, RgbColor, Size},
+};
+
+use crate::board::VIRTGPU_XRES;
+use crate::drivers::{GpuDevice, GPU_DEVICE};
+
+#[derive(Clone)]
+pub struct Graphics {
+    pub size: Size,
+    pub point: Point,
+    pub drv: Arc<dyn GpuDevice>,
+}
+
+impl Graphics {
+    pub fn new(size: Size, point: Point) -> Self {
+        Self {
+            size,
+            point,
+            drv: GPU_DEVICE.clone(),
+        }
+    }
+    pub fn reset(&self) {
+        let fb = self.drv.get_framebuffer();
+        fb.fill(0u8);
+    }
+
+    pub fn get_framebuffer(&self)-> &mut [u8] {
+        self.drv.get_framebuffer()
+    }
+}
+
+impl OriginDimensions for Graphics {
+    fn size(&self) -> Size {
+        self.size
+    }
+}
+
+impl DrawTarget for Graphics {
+    type Color = Rgb888;
+
+    type Error = core::convert::Infallible;
+
+    fn draw_iter<I>(&mut self, pixels: I) -> Result<(), Self::Error>
+    where
+        I: IntoIterator<Item = embedded_graphics::Pixel<Self::Color>>,
+    {
+        let fb = self.drv.get_framebuffer();
+
+        pixels.into_iter().for_each(|px| {
+            let idx = ((self.point.y + px.0.y) * VIRTGPU_XRES as i32 + self.point.x + px.0.x)
+                as usize
+                * 4;
+            if idx + 2 >= fb.len() {
+                return;
+            }
+            fb[idx] = px.1.b();
+            fb[idx + 1] = px.1.g();
+            fb[idx + 2] = px.1.r();
+        });
+        self.drv.flush();
+        Ok(())
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/gui/mod.rs.html b/ch9-gui-dev/src/os/gui/mod.rs.html new file mode 100644 index 00000000..4562ea0f --- /dev/null +++ b/ch9-gui-dev/src/os/gui/mod.rs.html @@ -0,0 +1,12 @@ +mod.rs - source
1
+2
+3
+4
+5
+
mod graphic;
+mod paint;
+
+use graphic::Graphics;
+pub use paint::{init_paint, move_rect, reset};
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/gui/paint.rs.html b/ch9-gui-dev/src/os/gui/paint.rs.html new file mode 100644 index 00000000..ebab7df8 --- /dev/null +++ b/ch9-gui-dev/src/os/gui/paint.rs.html @@ -0,0 +1,140 @@ +paint.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+
use super::Graphics;
+use crate::sync::UPIntrFreeCell;
+use embedded_graphics::pixelcolor::Rgb888;
+use embedded_graphics::prelude::{Drawable, Point, RgbColor, Size};
+use embedded_graphics::primitives::Primitive;
+use embedded_graphics::primitives::{PrimitiveStyle, Rectangle};
+use lazy_static::*;
+
+const INIT_X: i32 = 640;
+const INIT_Y: i32 = 400;
+const RECT_SIZE: u32 = 40;
+
+pub struct DrawingBoard {
+    graphics: Graphics,
+    latest_pos: Point,
+}
+
+impl DrawingBoard {
+    pub fn new() -> Self {
+        Self {
+            graphics: Graphics::new(Size::new(1280, 800), Point::new(0, 0)),
+            latest_pos: Point::new(INIT_X, INIT_Y),
+        }
+    }
+    fn paint(&mut self) {
+        Rectangle::with_center(self.latest_pos, Size::new(RECT_SIZE, RECT_SIZE))
+            .into_styled(PrimitiveStyle::with_stroke(Rgb888::WHITE, 1))
+            .draw(&mut self.graphics)
+            .ok();
+    }
+    fn unpaint(&mut self) {
+        Rectangle::with_center(self.latest_pos, Size::new(RECT_SIZE, RECT_SIZE))
+            .into_styled(PrimitiveStyle::with_stroke(Rgb888::BLACK, 1))
+            .draw(&mut self.graphics)
+            .ok();
+    }
+    pub fn move_rect(&mut self, dx: i32, dy: i32) {
+        self.unpaint();
+        self.latest_pos.x += dx;
+        self.latest_pos.y += dy;
+        self.paint();
+    }
+    pub fn reset(&mut self) {
+        self.latest_pos = Point::new(INIT_X, INIT_Y);
+        self.graphics.reset();
+    }
+}
+
+lazy_static! {
+    pub static ref DRAWING_BOARD: UPIntrFreeCell<DrawingBoard> = unsafe { UPIntrFreeCell::new(DrawingBoard::new()) };
+}
+
+pub fn init_paint() {
+    DRAWING_BOARD.exclusive_session(|ripple| {
+        ripple.paint();
+    });
+}
+
+pub fn move_rect(dx: i32, dy: i32) {
+    DRAWING_BOARD.exclusive_session(|ripple| {
+        ripple.move_rect(dx, dy);
+    });
+}
+
+pub fn reset() {
+    DRAWING_BOARD.exclusive_session(|ripple| {
+        ripple.reset();
+    });
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/lang_items.rs.html b/ch9-gui-dev/src/os/lang_items.rs.html new file mode 100644 index 00000000..a9b8a860 --- /dev/null +++ b/ch9-gui-dev/src/os/lang_items.rs.html @@ -0,0 +1,76 @@ +lang_items.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+
use crate::sbi::shutdown;
+use crate::task::current_kstack_top;
+use core::arch::asm;
+use core::panic::PanicInfo;
+
+#[panic_handler]
+fn panic(info: &PanicInfo) -> ! {
+    if let Some(location) = info.location() {
+        println!(
+            "[kernel] Panicked at {}:{} {}",
+            location.file(),
+            location.line(),
+            info.message().unwrap()
+        );
+    } else {
+        println!("[kernel] Panicked: {}", info.message().unwrap());
+    }
+    unsafe {
+        backtrace();
+    }
+    shutdown(255)
+}
+
+unsafe fn backtrace() {
+    let mut fp: usize;
+    let stop = current_kstack_top();
+    asm!("mv {}, s0", out(reg) fp);
+    println!("---START BACKTRACE---");
+    for i in 0..10 {
+        if fp == stop {
+            break;
+        }
+        println!("#{}:ra={:#x}", i, *((fp - 8) as *const usize));
+        fp = *((fp - 16) as *const usize);
+    }
+    println!("---END   BACKTRACE---");
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/main.rs.html b/ch9-gui-dev/src/os/main.rs.html new file mode 100644 index 00000000..357046ea --- /dev/null +++ b/ch9-gui-dev/src/os/main.rs.html @@ -0,0 +1,158 @@ +main.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+
#![no_std]
+#![no_main]
+#![feature(panic_info_message)]
+#![feature(alloc_error_handler)]
+
+use crate::drivers::{GPU_DEVICE, KEYBOARD_DEVICE, MOUSE_DEVICE};
+
+extern crate alloc;
+
+#[macro_use]
+extern crate bitflags;
+
+#[path = "boards/qemu.rs"]
+mod board;
+
+#[macro_use]
+mod console;
+mod config;
+mod drivers;
+mod fs;
+mod gui;
+mod lang_items;
+mod mm;
+mod sbi;
+mod sync;
+mod syscall;
+mod task;
+mod timer;
+mod trap;
+
+use crate::drivers::chardev::CharDevice;
+use crate::drivers::chardev::UART;
+//use syscall::create_desktop; //for test
+
+core::arch::global_asm!(include_str!("entry.asm"));
+
+fn clear_bss() {
+    extern "C" {
+        fn sbss();
+        fn ebss();
+    }
+    unsafe {
+        core::slice::from_raw_parts_mut(sbss as usize as *mut u8, ebss as usize - sbss as usize)
+            .fill(0);
+    }
+}
+
+use lazy_static::*;
+use sync::UPIntrFreeCell;
+
+lazy_static! {
+    pub static ref DEV_NON_BLOCKING_ACCESS: UPIntrFreeCell<bool> =
+        unsafe { UPIntrFreeCell::new(false) };
+}
+
+#[no_mangle]
+pub fn rust_main() -> ! {
+    clear_bss();
+    mm::init();
+    UART.init();
+    println!("KERN: init gpu");
+    let _gpu = GPU_DEVICE.clone();
+    println!("KERN: init keyboard");
+    let _keyboard = KEYBOARD_DEVICE.clone();
+    println!("KERN: init mouse");
+    let _mouse = MOUSE_DEVICE.clone();
+    println!("KERN: init trap");
+    trap::init();
+    trap::enable_timer_interrupt();
+    timer::set_next_trigger();
+    board::device_init();
+    fs::list_apps();
+    gui::init_paint();
+    task::add_initproc();
+    *DEV_NON_BLOCKING_ACCESS.exclusive_access() = true;
+    task::run_tasks();
+    panic!("Unreachable in rust_main!");
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/mm/address.rs.html b/ch9-gui-dev/src/os/mm/address.rs.html new file mode 100644 index 00000000..4f1057b1 --- /dev/null +++ b/ch9-gui-dev/src/os/mm/address.rs.html @@ -0,0 +1,528 @@ +address.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+
use super::PageTableEntry;
+use crate::config::{PAGE_SIZE, PAGE_SIZE_BITS};
+use core::fmt::{self, Debug, Formatter};
+
+const PA_WIDTH_SV39: usize = 56;
+const VA_WIDTH_SV39: usize = 39;
+const PPN_WIDTH_SV39: usize = PA_WIDTH_SV39 - PAGE_SIZE_BITS;
+const VPN_WIDTH_SV39: usize = VA_WIDTH_SV39 - PAGE_SIZE_BITS;
+
+/// Definitions
+#[repr(C)]
+#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq)]
+pub struct PhysAddr(pub usize);
+
+#[repr(C)]
+#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq)]
+pub struct VirtAddr(pub usize);
+
+#[repr(C)]
+#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq)]
+pub struct PhysPageNum(pub usize);
+
+#[repr(C)]
+#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq)]
+pub struct VirtPageNum(pub usize);
+
+/// Debugging
+
+impl Debug for VirtAddr {
+    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
+        f.write_fmt(format_args!("VA:{:#x}", self.0))
+    }
+}
+impl Debug for VirtPageNum {
+    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
+        f.write_fmt(format_args!("VPN:{:#x}", self.0))
+    }
+}
+impl Debug for PhysAddr {
+    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
+        f.write_fmt(format_args!("PA:{:#x}", self.0))
+    }
+}
+impl Debug for PhysPageNum {
+    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
+        f.write_fmt(format_args!("PPN:{:#x}", self.0))
+    }
+}
+
+/// T: {PhysAddr, VirtAddr, PhysPageNum, VirtPageNum}
+/// T -> usize: T.0
+/// usize -> T: usize.into()
+
+impl From<usize> for PhysAddr {
+    fn from(v: usize) -> Self {
+        Self(v & ((1 << PA_WIDTH_SV39) - 1))
+    }
+}
+impl From<usize> for PhysPageNum {
+    fn from(v: usize) -> Self {
+        Self(v & ((1 << PPN_WIDTH_SV39) - 1))
+    }
+}
+impl From<usize> for VirtAddr {
+    fn from(v: usize) -> Self {
+        Self(v & ((1 << VA_WIDTH_SV39) - 1))
+    }
+}
+impl From<usize> for VirtPageNum {
+    fn from(v: usize) -> Self {
+        Self(v & ((1 << VPN_WIDTH_SV39) - 1))
+    }
+}
+impl From<PhysAddr> for usize {
+    fn from(v: PhysAddr) -> Self {
+        v.0
+    }
+}
+impl From<PhysPageNum> for usize {
+    fn from(v: PhysPageNum) -> Self {
+        v.0
+    }
+}
+impl From<VirtAddr> for usize {
+    fn from(v: VirtAddr) -> Self {
+        if v.0 >= (1 << (VA_WIDTH_SV39 - 1)) {
+            v.0 | (!((1 << VA_WIDTH_SV39) - 1))
+        } else {
+            v.0
+        }
+    }
+}
+impl From<VirtPageNum> for usize {
+    fn from(v: VirtPageNum) -> Self {
+        v.0
+    }
+}
+
+impl VirtAddr {
+    pub fn floor(&self) -> VirtPageNum {
+        VirtPageNum(self.0 / PAGE_SIZE)
+    }
+    pub fn ceil(&self) -> VirtPageNum {
+        VirtPageNum((self.0 - 1 + PAGE_SIZE) / PAGE_SIZE)
+    }
+    pub fn page_offset(&self) -> usize {
+        self.0 & (PAGE_SIZE - 1)
+    }
+    pub fn aligned(&self) -> bool {
+        self.page_offset() == 0
+    }
+}
+impl From<VirtAddr> for VirtPageNum {
+    fn from(v: VirtAddr) -> Self {
+        assert_eq!(v.page_offset(), 0);
+        v.floor()
+    }
+}
+impl From<VirtPageNum> for VirtAddr {
+    fn from(v: VirtPageNum) -> Self {
+        Self(v.0 << PAGE_SIZE_BITS)
+    }
+}
+impl PhysAddr {
+    pub fn floor(&self) -> PhysPageNum {
+        PhysPageNum(self.0 / PAGE_SIZE)
+    }
+    pub fn ceil(&self) -> PhysPageNum {
+        PhysPageNum((self.0 - 1 + PAGE_SIZE) / PAGE_SIZE)
+    }
+    pub fn page_offset(&self) -> usize {
+        self.0 & (PAGE_SIZE - 1)
+    }
+    pub fn aligned(&self) -> bool {
+        self.page_offset() == 0
+    }
+}
+impl From<PhysAddr> for PhysPageNum {
+    fn from(v: PhysAddr) -> Self {
+        assert_eq!(v.page_offset(), 0);
+        v.floor()
+    }
+}
+impl From<PhysPageNum> for PhysAddr {
+    fn from(v: PhysPageNum) -> Self {
+        Self(v.0 << PAGE_SIZE_BITS)
+    }
+}
+
+impl VirtPageNum {
+    pub fn indexes(&self) -> [usize; 3] {
+        let mut vpn = self.0;
+        let mut idx = [0usize; 3];
+        for i in (0..3).rev() {
+            idx[i] = vpn & 511;
+            vpn >>= 9;
+        }
+        idx
+    }
+}
+
+impl PhysAddr {
+    pub fn get_ref<T>(&self) -> &'static T {
+        unsafe { (self.0 as *const T).as_ref().unwrap() }
+    }
+    pub fn get_mut<T>(&self) -> &'static mut T {
+        unsafe { (self.0 as *mut T).as_mut().unwrap() }
+    }
+}
+impl PhysPageNum {
+    pub fn get_pte_array(&self) -> &'static mut [PageTableEntry] {
+        let pa: PhysAddr = (*self).into();
+        unsafe { core::slice::from_raw_parts_mut(pa.0 as *mut PageTableEntry, 512) }
+    }
+    pub fn get_bytes_array(&self) -> &'static mut [u8] {
+        let pa: PhysAddr = (*self).into();
+        unsafe { core::slice::from_raw_parts_mut(pa.0 as *mut u8, 4096) }
+    }
+    pub fn get_mut<T>(&self) -> &'static mut T {
+        let pa: PhysAddr = (*self).into();
+        pa.get_mut()
+    }
+}
+
+pub trait StepByOne {
+    fn step(&mut self);
+}
+impl StepByOne for VirtPageNum {
+    fn step(&mut self) {
+        self.0 += 1;
+    }
+}
+impl StepByOne for PhysPageNum {
+    fn step(&mut self) {
+        self.0 += 1;
+    }
+}
+
+#[derive(Copy, Clone)]
+pub struct SimpleRange<T>
+where
+    T: StepByOne + Copy + PartialEq + PartialOrd + Debug,
+{
+    l: T,
+    r: T,
+}
+impl<T> SimpleRange<T>
+where
+    T: StepByOne + Copy + PartialEq + PartialOrd + Debug,
+{
+    pub fn new(start: T, end: T) -> Self {
+        assert!(start <= end, "start {:?} > end {:?}!", start, end);
+        Self { l: start, r: end }
+    }
+    pub fn get_start(&self) -> T {
+        self.l
+    }
+    pub fn get_end(&self) -> T {
+        self.r
+    }
+}
+impl<T> IntoIterator for SimpleRange<T>
+where
+    T: StepByOne + Copy + PartialEq + PartialOrd + Debug,
+{
+    type Item = T;
+    type IntoIter = SimpleRangeIterator<T>;
+    fn into_iter(self) -> Self::IntoIter {
+        SimpleRangeIterator::new(self.l, self.r)
+    }
+}
+pub struct SimpleRangeIterator<T>
+where
+    T: StepByOne + Copy + PartialEq + PartialOrd + Debug,
+{
+    current: T,
+    end: T,
+}
+impl<T> SimpleRangeIterator<T>
+where
+    T: StepByOne + Copy + PartialEq + PartialOrd + Debug,
+{
+    pub fn new(l: T, r: T) -> Self {
+        Self { current: l, end: r }
+    }
+}
+impl<T> Iterator for SimpleRangeIterator<T>
+where
+    T: StepByOne + Copy + PartialEq + PartialOrd + Debug,
+{
+    type Item = T;
+    fn next(&mut self) -> Option<Self::Item> {
+        if self.current == self.end {
+            None
+        } else {
+            let t = self.current;
+            self.current.step();
+            Some(t)
+        }
+    }
+}
+pub type VPNRange = SimpleRange<VirtPageNum>;
+pub type PPNRange = SimpleRange<PhysPageNum>;
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/mm/frame_allocator.rs.html b/ch9-gui-dev/src/os/mm/frame_allocator.rs.html new file mode 100644 index 00000000..afffa6b6 --- /dev/null +++ b/ch9-gui-dev/src/os/mm/frame_allocator.rs.html @@ -0,0 +1,262 @@ +frame_allocator.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+
use super::{PhysAddr, PhysPageNum};
+use crate::config::MEMORY_END;
+use crate::sync::UPIntrFreeCell;
+use alloc::vec::Vec;
+use core::fmt::{self, Debug, Formatter};
+use lazy_static::*;
+
+pub struct FrameTracker {
+    pub ppn: PhysPageNum,
+}
+
+impl FrameTracker {
+    pub fn new(ppn: PhysPageNum) -> Self {
+        // page cleaning
+        let bytes_array = ppn.get_bytes_array();
+        for i in bytes_array {
+            *i = 0;
+        }
+        Self { ppn }
+    }
+    pub fn new_nowrite(ppn: PhysPageNum) -> Self {
+        Self { ppn }
+    }
+}
+
+impl Debug for FrameTracker {
+    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
+        f.write_fmt(format_args!("FrameTracker:PPN={:#x}", self.ppn.0))
+    }
+}
+
+impl Drop for FrameTracker {
+    fn drop(&mut self) {
+        frame_dealloc(self.ppn);
+    }
+}
+
+trait FrameAllocator {
+    fn new() -> Self;
+    fn alloc(&mut self) -> Option<PhysPageNum>;
+    fn dealloc(&mut self, ppn: PhysPageNum);
+}
+
+pub struct StackFrameAllocator {
+    current: usize,
+    end: usize,
+    recycled: Vec<usize>,
+}
+
+impl StackFrameAllocator {
+    pub fn init(&mut self, l: PhysPageNum, r: PhysPageNum) {
+        self.current = l.0;
+        self.end = r.0;
+        // println!("last {} Physical Frames.", self.end - self.current);
+    }
+}
+impl FrameAllocator for StackFrameAllocator {
+    fn new() -> Self {
+        Self {
+            current: 0,
+            end: 0,
+            recycled: Vec::new(),
+        }
+    }
+    fn alloc(&mut self) -> Option<PhysPageNum> {
+        if let Some(ppn) = self.recycled.pop() {
+            Some(ppn.into())
+        } else if self.current == self.end {
+            None
+        } else {
+            self.current += 1;
+            Some((self.current - 1).into())
+        }
+    }
+    fn dealloc(&mut self, ppn: PhysPageNum) {
+        let ppn = ppn.0;
+        // validity check
+        if ppn >= self.current || self.recycled.iter().any(|&v| v == ppn) {
+            panic!("Frame ppn={:#x} has not been allocated!", ppn);
+        }
+        // recycle
+        self.recycled.push(ppn);
+    }
+}
+
+type FrameAllocatorImpl = StackFrameAllocator;
+
+lazy_static! {
+    pub static ref FRAME_ALLOCATOR: UPIntrFreeCell<FrameAllocatorImpl> =
+        unsafe { UPIntrFreeCell::new(FrameAllocatorImpl::new()) };
+}
+
+pub fn init_frame_allocator() {
+    extern "C" {
+        fn ekernel();
+    }
+    FRAME_ALLOCATOR.exclusive_access().init(
+        PhysAddr::from(ekernel as usize).ceil(),
+        PhysAddr::from(MEMORY_END).floor(),
+    );
+}
+
+pub fn frame_alloc() -> Option<FrameTracker> {
+    FRAME_ALLOCATOR
+        .exclusive_access()
+        .alloc()
+        .map(FrameTracker::new)
+}
+
+pub fn frame_dealloc(ppn: PhysPageNum) {
+    FRAME_ALLOCATOR.exclusive_access().dealloc(ppn);
+}
+
+#[allow(unused)]
+pub fn frame_allocator_test() {
+    let mut v: Vec<FrameTracker> = Vec::new();
+    for i in 0..5 {
+        let frame = frame_alloc().unwrap();
+        println!("{:?}", frame);
+        v.push(frame);
+    }
+    v.clear();
+    for i in 0..5 {
+        let frame = frame_alloc().unwrap();
+        println!("{:?}", frame);
+        v.push(frame);
+    }
+    drop(v);
+    println!("frame_allocator_test passed!");
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/mm/heap_allocator.rs.html b/ch9-gui-dev/src/os/mm/heap_allocator.rs.html new file mode 100644 index 00000000..0054936e --- /dev/null +++ b/ch9-gui-dev/src/os/mm/heap_allocator.rs.html @@ -0,0 +1,92 @@ +heap_allocator.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+
use crate::config::KERNEL_HEAP_SIZE;
+use buddy_system_allocator::LockedHeap;
+
+#[global_allocator]
+static HEAP_ALLOCATOR: LockedHeap = LockedHeap::empty();
+
+#[alloc_error_handler]
+pub fn handle_alloc_error(layout: core::alloc::Layout) -> ! {
+    panic!("Heap allocation error, layout = {:?}", layout);
+}
+
+static mut HEAP_SPACE: [u8; KERNEL_HEAP_SIZE] = [0; KERNEL_HEAP_SIZE];
+
+pub fn init_heap() {
+    unsafe {
+        HEAP_ALLOCATOR
+            .lock()
+            .init(HEAP_SPACE.as_ptr() as usize, KERNEL_HEAP_SIZE);
+    }
+}
+
+#[allow(unused)]
+pub fn heap_test() {
+    use alloc::boxed::Box;
+    use alloc::vec::Vec;
+    extern "C" {
+        fn sbss();
+        fn ebss();
+    }
+    let bss_range = sbss as usize..ebss as usize;
+    let a = Box::new(5);
+    assert_eq!(*a, 5);
+    assert!(bss_range.contains(&(a.as_ref() as *const _ as usize)));
+    drop(a);
+    let mut v: Vec<usize> = Vec::new();
+    for i in 0..500 {
+        v.push(i);
+    }
+    for (i, val) in v.iter().take(500).enumerate() {
+        assert_eq!(*val, i);
+    }
+    assert!(bss_range.contains(&(v.as_ptr() as usize)));
+    drop(v);
+    println!("heap_test passed!");
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/mm/memory_set.rs.html b/ch9-gui-dev/src/os/mm/memory_set.rs.html new file mode 100644 index 00000000..a476e999 --- /dev/null +++ b/ch9-gui-dev/src/os/mm/memory_set.rs.html @@ -0,0 +1,766 @@ +memory_set.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+
use super::{frame_alloc, FrameTracker};
+use super::{PTEFlags, PageTable, PageTableEntry};
+use super::{PhysAddr, PhysPageNum, VirtAddr, VirtPageNum};
+use super::{StepByOne, VPNRange, PPNRange};
+use crate::config::{MEMORY_END, MMIO, PAGE_SIZE, TRAMPOLINE};
+use crate::sync::UPIntrFreeCell;
+use alloc::collections::BTreeMap;
+use alloc::sync::Arc;
+use alloc::vec::Vec;
+use core::arch::asm;
+use lazy_static::*;
+use riscv::register::satp;
+
+extern "C" {
+    fn stext();
+    fn etext();
+    fn srodata();
+    fn erodata();
+    fn sdata();
+    fn edata();
+    fn sbss_with_stack();
+    fn ebss();
+    fn ekernel();
+    fn strampoline();
+}
+
+lazy_static! {
+    pub static ref KERNEL_SPACE: Arc<UPIntrFreeCell<MemorySet>> =
+        Arc::new(unsafe { UPIntrFreeCell::new(MemorySet::new_kernel()) });
+}
+
+pub fn kernel_token() -> usize {
+    KERNEL_SPACE.exclusive_access().token()
+}
+
+pub struct MemorySet {
+    page_table: PageTable,
+    areas: Vec<MapArea>,
+}
+
+impl MemorySet {
+    pub fn new_bare() -> Self {
+        Self {
+            page_table: PageTable::new(),
+            areas: Vec::new(),
+        }
+    }
+    pub fn token(&self) -> usize {
+        self.page_table.token()
+    }
+    /// Assume that no conflicts.
+    pub fn insert_framed_area(
+        &mut self,
+        start_va: VirtAddr,
+        end_va: VirtAddr,
+        permission: MapPermission,
+    ) {
+        self.push(
+            MapArea::new(start_va, end_va, MapType::Framed, permission),
+            None,
+        );
+    }
+    pub fn remove_area_with_start_vpn(&mut self, start_vpn: VirtPageNum) {
+        if let Some((idx, area)) = self
+            .areas
+            .iter_mut()
+            .enumerate()
+            .find(|(_, area)| area.vpn_range.get_start() == start_vpn)
+        {
+            area.unmap(&mut self.page_table);
+            self.areas.remove(idx);
+        }
+    }
+    fn push(&mut self, mut map_area: MapArea, data: Option<&[u8]>) {
+        map_area.map(&mut self.page_table);
+        if let Some(data) = data {
+            map_area.copy_data(&mut self.page_table, data);
+        }
+        self.areas.push(map_area);
+    }
+    pub fn push_noalloc(&mut self, mut map_area: MapArea, ppn_range: PPNRange) {
+        map_area.map_noalloc(&mut self.page_table, ppn_range);
+        self.areas.push(map_area);
+    }    
+    /// Mention that trampoline is not collected by areas.
+    fn map_trampoline(&mut self) {
+        self.page_table.map(
+            VirtAddr::from(TRAMPOLINE).into(),
+            PhysAddr::from(strampoline as usize).into(),
+            PTEFlags::R | PTEFlags::X,
+        );
+    }
+    /// Without kernel stacks.
+    pub fn new_kernel() -> Self {
+        let mut memory_set = Self::new_bare();
+        // map trampoline
+        memory_set.map_trampoline();
+        // map kernel sections
+        // println!(".text [{:#x}, {:#x})", stext as usize, etext as usize);
+        // println!(".rodata [{:#x}, {:#x})", srodata as usize, erodata as usize);
+        // println!(".data [{:#x}, {:#x})", sdata as usize, edata as usize);
+        // println!(
+        //     ".bss [{:#x}, {:#x})",
+        //     sbss_with_stack as usize, ebss as usize
+        // );
+        // println!("mapping .text section");
+        memory_set.push(
+            MapArea::new(
+                (stext as usize).into(),
+                (etext as usize).into(),
+                MapType::Identical,
+                MapPermission::R | MapPermission::X,
+            ),
+            None,
+        );
+        // println!("mapping .rodata section");
+        memory_set.push(
+            MapArea::new(
+                (srodata as usize).into(),
+                (erodata as usize).into(),
+                MapType::Identical,
+                MapPermission::R,
+            ),
+            None,
+        );
+        // println!("mapping .data section");
+        memory_set.push(
+            MapArea::new(
+                (sdata as usize).into(),
+                (edata as usize).into(),
+                MapType::Identical,
+                MapPermission::R | MapPermission::W,
+            ),
+            None,
+        );
+        // println!("mapping .bss section");
+        memory_set.push(
+            MapArea::new(
+                (sbss_with_stack as usize).into(),
+                (ebss as usize).into(),
+                MapType::Identical,
+                MapPermission::R | MapPermission::W,
+            ),
+            None,
+        );
+        // println!("mapping physical memory");
+        memory_set.push(
+            MapArea::new(
+                (ekernel as usize).into(),
+                MEMORY_END.into(),
+                MapType::Identical,
+                MapPermission::R | MapPermission::W,
+            ),
+            None,
+        );
+        //println!("mapping memory-mapped registers");
+        for pair in MMIO {
+            memory_set.push(
+                MapArea::new(
+                    (*pair).0.into(),
+                    ((*pair).0 + (*pair).1).into(),
+                    MapType::Identical,
+                    MapPermission::R | MapPermission::W,
+                ),
+                None,
+            );
+        }
+        memory_set
+    }
+    /// Include sections in elf and trampoline,
+    /// also returns user_sp_base and entry point.
+    pub fn from_elf(elf_data: &[u8]) -> (Self, usize, usize) {
+        let mut memory_set = Self::new_bare();
+        // map trampoline
+        memory_set.map_trampoline();
+        // map program headers of elf, with U flag
+        let elf = xmas_elf::ElfFile::new(elf_data).unwrap();
+        let elf_header = elf.header;
+        let magic = elf_header.pt1.magic;
+        assert_eq!(magic, [0x7f, 0x45, 0x4c, 0x46], "invalid elf!");
+        let ph_count = elf_header.pt2.ph_count();
+        let mut max_end_vpn = VirtPageNum(0);
+        for i in 0..ph_count {
+            let ph = elf.program_header(i).unwrap();
+            if ph.get_type().unwrap() == xmas_elf::program::Type::Load {
+                let start_va: VirtAddr = (ph.virtual_addr() as usize).into();
+                let end_va: VirtAddr = ((ph.virtual_addr() + ph.mem_size()) as usize).into();
+                let mut map_perm = MapPermission::U;
+                let ph_flags = ph.flags();
+                if ph_flags.is_read() {
+                    map_perm |= MapPermission::R;
+                }
+                if ph_flags.is_write() {
+                    map_perm |= MapPermission::W;
+                }
+                if ph_flags.is_execute() {
+                    map_perm |= MapPermission::X;
+                }
+                let map_area = MapArea::new(start_va, end_va, MapType::Framed, map_perm);
+                max_end_vpn = map_area.vpn_range.get_end();
+                memory_set.push(
+                    map_area,
+                    Some(&elf.input[ph.offset() as usize..(ph.offset() + ph.file_size()) as usize]),
+                );
+            }
+        }
+        let max_end_va: VirtAddr = max_end_vpn.into();
+        let mut user_stack_base: usize = max_end_va.into();
+        user_stack_base += PAGE_SIZE;
+        (
+            memory_set,
+            user_stack_base,
+            elf.header.pt2.entry_point() as usize,
+        )
+    }
+    pub fn from_existed_user(user_space: &MemorySet) -> MemorySet {
+        let mut memory_set = Self::new_bare();
+        // map trampoline
+        memory_set.map_trampoline();
+        // copy data sections/trap_context/user_stack
+        for area in user_space.areas.iter() {
+            let new_area = MapArea::from_another(area);
+            memory_set.push(new_area, None);
+            // copy data from another space
+            for vpn in area.vpn_range {
+                let src_ppn = user_space.translate(vpn).unwrap().ppn();
+                let dst_ppn = memory_set.translate(vpn).unwrap().ppn();
+                dst_ppn
+                    .get_bytes_array()
+                    .copy_from_slice(src_ppn.get_bytes_array());
+            }
+        }
+        memory_set
+    }
+    pub fn activate(&self) {
+        let satp = self.page_table.token();
+        unsafe {
+            satp::write(satp);
+            asm!("sfence.vma");
+        }
+    }
+    pub fn translate(&self, vpn: VirtPageNum) -> Option<PageTableEntry> {
+        self.page_table.translate(vpn)
+    }
+    pub fn recycle_data_pages(&mut self) {
+        //*self = Self::new_bare();
+        self.areas.clear();
+    }
+}
+
+pub struct MapArea {
+    vpn_range: VPNRange,
+    data_frames: BTreeMap<VirtPageNum, FrameTracker>,
+    map_type: MapType,
+    map_perm: MapPermission,
+}
+
+impl MapArea {
+    pub fn new(
+        start_va: VirtAddr,
+        end_va: VirtAddr,
+        map_type: MapType,
+        map_perm: MapPermission,
+    ) -> Self {
+        let start_vpn: VirtPageNum = start_va.floor();
+        let end_vpn: VirtPageNum = end_va.ceil();
+        Self {
+            vpn_range: VPNRange::new(start_vpn, end_vpn),
+            data_frames: BTreeMap::new(),
+            map_type,
+            map_perm,
+        }
+    }
+    pub fn from_another(another: &MapArea) -> Self {
+        Self {
+            vpn_range: VPNRange::new(another.vpn_range.get_start(), another.vpn_range.get_end()),
+            data_frames: BTreeMap::new(),
+            map_type: another.map_type,
+            map_perm: another.map_perm,
+        }
+    }
+    pub fn map_one(&mut self, page_table: &mut PageTable, vpn: VirtPageNum) {
+        let ppn: PhysPageNum;
+        match self.map_type {
+            MapType::Identical => {
+                ppn = PhysPageNum(vpn.0);
+            }
+            MapType::Framed => {
+                let frame = frame_alloc().unwrap();
+                ppn = frame.ppn;
+                self.data_frames.insert(vpn, frame);
+            }
+        }
+        let pte_flags = PTEFlags::from_bits(self.map_perm.bits).unwrap();
+        page_table.map(vpn, ppn, pte_flags);
+    }
+    pub fn unmap_one(&mut self, page_table: &mut PageTable, vpn: VirtPageNum) {
+        if self.map_type == MapType::Framed {
+            self.data_frames.remove(&vpn);
+        }
+        page_table.unmap(vpn);
+    }
+    pub fn map(&mut self, page_table: &mut PageTable) {
+        for vpn in self.vpn_range {
+            self.map_one(page_table, vpn);
+        }
+    }
+    pub fn map_noalloc(&mut self, page_table: &mut PageTable,ppn_range:PPNRange) {
+        for (vpn,ppn) in core::iter::zip(self.vpn_range,ppn_range) {
+            self.data_frames.insert(vpn, FrameTracker::new_nowrite(ppn));
+            let pte_flags = PTEFlags::from_bits(self.map_perm.bits).unwrap();
+            page_table.map(vpn, ppn, pte_flags);
+        }
+    }
+
+    pub fn unmap(&mut self, page_table: &mut PageTable) {
+        for vpn in self.vpn_range {
+            self.unmap_one(page_table, vpn);
+        }
+    }
+    /// data: start-aligned but maybe with shorter length
+    /// assume that all frames were cleared before
+    pub fn copy_data(&mut self, page_table: &mut PageTable, data: &[u8]) {
+        assert_eq!(self.map_type, MapType::Framed);
+        let mut start: usize = 0;
+        let mut current_vpn = self.vpn_range.get_start();
+        let len = data.len();
+        loop {
+            let src = &data[start..len.min(start + PAGE_SIZE)];
+            let dst = &mut page_table
+                .translate(current_vpn)
+                .unwrap()
+                .ppn()
+                .get_bytes_array()[..src.len()];
+            dst.copy_from_slice(src);
+            start += PAGE_SIZE;
+            if start >= len {
+                break;
+            }
+            current_vpn.step();
+        }
+    }
+}
+
+#[derive(Copy, Clone, PartialEq, Debug)]
+pub enum MapType {
+    Identical,
+    Framed,
+}
+
+bitflags! {
+    pub struct MapPermission: u8 {
+        const R = 1 << 1;
+        const W = 1 << 2;
+        const X = 1 << 3;
+        const U = 1 << 4;
+    }
+}
+
+#[allow(unused)]
+pub fn remap_test() {
+    let mut kernel_space = KERNEL_SPACE.exclusive_access();
+    let mid_text: VirtAddr = ((stext as usize + etext as usize) / 2).into();
+    let mid_rodata: VirtAddr = ((srodata as usize + erodata as usize) / 2).into();
+    let mid_data: VirtAddr = ((sdata as usize + edata as usize) / 2).into();
+    assert!(!kernel_space
+        .page_table
+        .translate(mid_text.floor())
+        .unwrap()
+        .writable(),);
+    assert!(!kernel_space
+        .page_table
+        .translate(mid_rodata.floor())
+        .unwrap()
+        .writable(),);
+    assert!(!kernel_space
+        .page_table
+        .translate(mid_data.floor())
+        .unwrap()
+        .executable(),);
+    println!("remap_test passed!");
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/mm/mod.rs.html b/ch9-gui-dev/src/os/mm/mod.rs.html new file mode 100644 index 00000000..30c8b949 --- /dev/null +++ b/ch9-gui-dev/src/os/mm/mod.rs.html @@ -0,0 +1,46 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
mod address;
+mod frame_allocator;
+mod heap_allocator;
+mod memory_set;
+mod page_table;
+
+pub use address::{VPNRange, PPNRange};
+pub use address::{PhysAddr, PhysPageNum, StepByOne, VirtAddr, VirtPageNum};
+pub use frame_allocator::{frame_alloc, frame_dealloc, FrameTracker};
+pub use memory_set::remap_test;
+pub use memory_set::{kernel_token, MapPermission, MemorySet, MapArea, MapType, KERNEL_SPACE};
+use page_table::PTEFlags;
+pub use page_table::{
+    translated_byte_buffer, translated_ref, translated_refmut, translated_str, PageTable,
+    PageTableEntry, UserBuffer, UserBufferIterator,
+};
+
+pub fn init() {
+    heap_allocator::init_heap();
+    frame_allocator::init_frame_allocator();
+    KERNEL_SPACE.exclusive_access().activate();
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/mm/page_table.rs.html b/ch9-gui-dev/src/os/mm/page_table.rs.html new file mode 100644 index 00000000..0451e8e7 --- /dev/null +++ b/ch9-gui-dev/src/os/mm/page_table.rs.html @@ -0,0 +1,500 @@ +page_table.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+
use super::{frame_alloc, FrameTracker, PhysAddr, PhysPageNum, StepByOne, VirtAddr, VirtPageNum};
+use alloc::string::String;
+use alloc::vec;
+use alloc::vec::Vec;
+use bitflags::*;
+
+bitflags! {
+    pub struct PTEFlags: u8 {
+        const V = 1 << 0;
+        const R = 1 << 1;
+        const W = 1 << 2;
+        const X = 1 << 3;
+        const U = 1 << 4;
+        const G = 1 << 5;
+        const A = 1 << 6;
+        const D = 1 << 7;
+    }
+}
+
+#[derive(Copy, Clone)]
+#[repr(C)]
+pub struct PageTableEntry {
+    pub bits: usize,
+}
+
+impl PageTableEntry {
+    pub fn new(ppn: PhysPageNum, flags: PTEFlags) -> Self {
+        PageTableEntry {
+            bits: ppn.0 << 10 | flags.bits as usize,
+        }
+    }
+    pub fn empty() -> Self {
+        PageTableEntry { bits: 0 }
+    }
+    pub fn ppn(&self) -> PhysPageNum {
+        (self.bits >> 10 & ((1usize << 44) - 1)).into()
+    }
+    pub fn flags(&self) -> PTEFlags {
+        PTEFlags::from_bits(self.bits as u8).unwrap()
+    }
+    pub fn is_valid(&self) -> bool {
+        (self.flags() & PTEFlags::V) != PTEFlags::empty()
+    }
+    pub fn readable(&self) -> bool {
+        (self.flags() & PTEFlags::R) != PTEFlags::empty()
+    }
+    pub fn writable(&self) -> bool {
+        (self.flags() & PTEFlags::W) != PTEFlags::empty()
+    }
+    pub fn executable(&self) -> bool {
+        (self.flags() & PTEFlags::X) != PTEFlags::empty()
+    }
+}
+
+pub struct PageTable {
+    root_ppn: PhysPageNum,
+    frames: Vec<FrameTracker>,
+}
+
+/// Assume that it won't oom when creating/mapping.
+impl PageTable {
+    pub fn new() -> Self {
+        let frame = frame_alloc().unwrap();
+        PageTable {
+            root_ppn: frame.ppn,
+            frames: vec![frame],
+        }
+    }
+    /// Temporarily used to get arguments from user space.
+    pub fn from_token(satp: usize) -> Self {
+        Self {
+            root_ppn: PhysPageNum::from(satp & ((1usize << 44) - 1)),
+            frames: Vec::new(),
+        }
+    }
+    fn find_pte_create(&mut self, vpn: VirtPageNum) -> Option<&mut PageTableEntry> {
+        let idxs = vpn.indexes();
+        let mut ppn = self.root_ppn;
+        let mut result: Option<&mut PageTableEntry> = None;
+        for (i, idx) in idxs.iter().enumerate() {
+            let pte = &mut ppn.get_pte_array()[*idx];
+            if i == 2 {
+                result = Some(pte);
+                break;
+            }
+            if !pte.is_valid() {
+                let frame = frame_alloc().unwrap();
+                *pte = PageTableEntry::new(frame.ppn, PTEFlags::V);
+                self.frames.push(frame);
+            }
+            ppn = pte.ppn();
+        }
+        result
+    }
+    fn find_pte(&self, vpn: VirtPageNum) -> Option<&mut PageTableEntry> {
+        let idxs = vpn.indexes();
+        let mut ppn = self.root_ppn;
+        let mut result: Option<&mut PageTableEntry> = None;
+        for (i, idx) in idxs.iter().enumerate() {
+            let pte = &mut ppn.get_pte_array()[*idx];
+            if i == 2 {
+                result = Some(pte);
+                break;
+            }
+            if !pte.is_valid() {
+                return None;
+            }
+            ppn = pte.ppn();
+        }
+        result
+    }
+    #[allow(unused)]
+    pub fn map(&mut self, vpn: VirtPageNum, ppn: PhysPageNum, flags: PTEFlags) {
+        let pte = self.find_pte_create(vpn).unwrap();
+        assert!(!pte.is_valid(), "vpn {:?} is mapped before mapping", vpn);
+        *pte = PageTableEntry::new(ppn, flags | PTEFlags::V);
+    }
+    #[allow(unused)]
+    pub fn unmap(&mut self, vpn: VirtPageNum) {
+        let pte = self.find_pte(vpn).unwrap();
+        assert!(pte.is_valid(), "vpn {:?} is invalid before unmapping", vpn);
+        *pte = PageTableEntry::empty();
+    }
+    pub fn translate(&self, vpn: VirtPageNum) -> Option<PageTableEntry> {
+        self.find_pte(vpn).map(|pte| *pte)
+    }
+    pub fn translate_va(&self, va: VirtAddr) -> Option<PhysAddr> {
+        self.find_pte(va.clone().floor()).map(|pte| {
+            let aligned_pa: PhysAddr = pte.ppn().into();
+            let offset = va.page_offset();
+            let aligned_pa_usize: usize = aligned_pa.into();
+            (aligned_pa_usize + offset).into()
+        })
+    }
+    pub fn token(&self) -> usize {
+        8usize << 60 | self.root_ppn.0
+    }
+}
+
+pub fn translated_byte_buffer(token: usize, ptr: *const u8, len: usize) -> Vec<&'static mut [u8]> {
+    let page_table = PageTable::from_token(token);
+    let mut start = ptr as usize;
+    let end = start + len;
+    let mut v = Vec::new();
+    while start < end {
+        let start_va = VirtAddr::from(start);
+        let mut vpn = start_va.floor();
+        let ppn = page_table.translate(vpn).unwrap().ppn();
+        vpn.step();
+        let mut end_va: VirtAddr = vpn.into();
+        end_va = end_va.min(VirtAddr::from(end));
+        if end_va.page_offset() == 0 {
+            v.push(&mut ppn.get_bytes_array()[start_va.page_offset()..]);
+        } else {
+            v.push(&mut ppn.get_bytes_array()[start_va.page_offset()..end_va.page_offset()]);
+        }
+        start = end_va.into();
+    }
+    v
+}
+
+/// Load a string from other address spaces into kernel space without an end `\0`.
+pub fn translated_str(token: usize, ptr: *const u8) -> String {
+    let page_table = PageTable::from_token(token);
+    let mut string = String::new();
+    let mut va = ptr as usize;
+    loop {
+        let ch: u8 = *(page_table
+            .translate_va(VirtAddr::from(va))
+            .unwrap()
+            .get_mut());
+        if ch == 0 {
+            break;
+        }
+        string.push(ch as char);
+        va += 1;
+    }
+    string
+}
+
+pub fn translated_ref<T>(token: usize, ptr: *const T) -> &'static T {
+    let page_table = PageTable::from_token(token);
+    page_table
+        .translate_va(VirtAddr::from(ptr as usize))
+        .unwrap()
+        .get_ref()
+}
+
+pub fn translated_refmut<T>(token: usize, ptr: *mut T) -> &'static mut T {
+    let page_table = PageTable::from_token(token);
+    let va = ptr as usize;
+    page_table
+        .translate_va(VirtAddr::from(va))
+        .unwrap()
+        .get_mut()
+}
+
+pub struct UserBuffer {
+    pub buffers: Vec<&'static mut [u8]>,
+}
+
+impl UserBuffer {
+    pub fn new(buffers: Vec<&'static mut [u8]>) -> Self {
+        Self { buffers }
+    }
+    pub fn len(&self) -> usize {
+        let mut total: usize = 0;
+        for b in self.buffers.iter() {
+            total += b.len();
+        }
+        total
+    }
+}
+
+impl IntoIterator for UserBuffer {
+    type Item = *mut u8;
+    type IntoIter = UserBufferIterator;
+    fn into_iter(self) -> Self::IntoIter {
+        UserBufferIterator {
+            buffers: self.buffers,
+            current_buffer: 0,
+            current_idx: 0,
+        }
+    }
+}
+
+pub struct UserBufferIterator {
+    buffers: Vec<&'static mut [u8]>,
+    current_buffer: usize,
+    current_idx: usize,
+}
+
+impl Iterator for UserBufferIterator {
+    type Item = *mut u8;
+    fn next(&mut self) -> Option<Self::Item> {
+        if self.current_buffer >= self.buffers.len() {
+            None
+        } else {
+            let r = &mut self.buffers[self.current_buffer][self.current_idx] as *mut _;
+            if self.current_idx + 1 == self.buffers[self.current_buffer].len() {
+                self.current_idx = 0;
+                self.current_buffer += 1;
+            } else {
+                self.current_idx += 1;
+            }
+            Some(r)
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/sbi.rs.html b/ch9-gui-dev/src/os/sbi.rs.html new file mode 100644 index 00000000..73936429 --- /dev/null +++ b/ch9-gui-dev/src/os/sbi.rs.html @@ -0,0 +1,94 @@ +sbi.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
#![allow(unused)]
+
+use core::arch::asm;
+
+const SBI_SET_TIMER: usize = 0;
+const SBI_CONSOLE_PUTCHAR: usize = 1;
+const SBI_CONSOLE_GETCHAR: usize = 2;
+const SBI_CLEAR_IPI: usize = 3;
+const SBI_SEND_IPI: usize = 4;
+const SBI_REMOTE_FENCE_I: usize = 5;
+const SBI_REMOTE_SFENCE_VMA: usize = 6;
+const SBI_REMOTE_SFENCE_VMA_ASID: usize = 7;
+const SBI_SHUTDOWN: usize = 8;
+
+#[inline(always)]
+fn sbi_call(which: usize, arg0: usize, arg1: usize, arg2: usize) -> usize {
+    let mut ret;
+    unsafe {
+        core::arch::asm!(
+            "li x16, 0",
+            "ecall",
+            inlateout("x10") arg0 => ret,
+            in("x11") arg1,
+            in("x12") arg2,
+            in("x17") which,
+        );
+    }
+    ret
+}
+
+pub fn set_timer(timer: usize) {
+    sbi_call(SBI_SET_TIMER, timer, 0, 0);
+}
+
+pub fn console_putchar(c: usize) {
+    sbi_call(SBI_CONSOLE_PUTCHAR, c, 0, 0);
+}
+
+pub fn console_getchar() -> usize {
+    sbi_call(SBI_CONSOLE_GETCHAR, 0, 0, 0)
+}
+
+use crate::board::QEMUExit;
+pub fn shutdown(exit_code: usize) -> ! {
+    crate::board::QEMU_EXIT_HANDLE.exit_failure()
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/sync/condvar.rs.html b/ch9-gui-dev/src/os/sync/condvar.rs.html new file mode 100644 index 00000000..c7fcb946 --- /dev/null +++ b/ch9-gui-dev/src/os/sync/condvar.rs.html @@ -0,0 +1,118 @@ +condvar.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
use crate::sync::{Mutex, UPIntrFreeCell};
+use crate::task::{
+    add_task, block_current_and_run_next, block_current_task, current_task, TaskContext,
+    TaskControlBlock,
+};
+use alloc::{collections::VecDeque, sync::Arc};
+
+pub struct Condvar {
+    pub inner: UPIntrFreeCell<CondvarInner>,
+}
+
+pub struct CondvarInner {
+    pub wait_queue: VecDeque<Arc<TaskControlBlock>>,
+}
+
+impl Condvar {
+    pub fn new() -> Self {
+        Self {
+            inner: unsafe {
+                UPIntrFreeCell::new(CondvarInner {
+                    wait_queue: VecDeque::new(),
+                })
+            },
+        }
+    }
+
+    pub fn signal(&self) {
+        let mut inner = self.inner.exclusive_access();
+        if let Some(task) = inner.wait_queue.pop_front() {
+            add_task(task);
+        }
+    }
+
+    /*
+    pub fn wait(&self) {
+        let mut inner = self.inner.exclusive_access();
+        inner.wait_queue.push_back(current_task().unwrap());
+        drop(inner);
+        block_current_and_run_next();
+    }
+    */
+
+    pub fn wait_no_sched(&self) -> *mut TaskContext {
+        self.inner.exclusive_session(|inner| {
+            inner.wait_queue.push_back(current_task().unwrap());
+        });
+        block_current_task()
+    }
+
+    pub fn wait_with_mutex(&self, mutex: Arc<dyn Mutex>) {
+        mutex.unlock();
+        self.inner.exclusive_session(|inner| {
+            inner.wait_queue.push_back(current_task().unwrap());
+        });
+        block_current_and_run_next();
+        mutex.lock();
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/sync/mod.rs.html b/ch9-gui-dev/src/os/sync/mod.rs.html new file mode 100644 index 00000000..adfa3523 --- /dev/null +++ b/ch9-gui-dev/src/os/sync/mod.rs.html @@ -0,0 +1,20 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+
mod condvar;
+mod mutex;
+mod semaphore;
+mod up;
+
+pub use condvar::Condvar;
+pub use mutex::{Mutex, MutexBlocking, MutexSpin};
+pub use semaphore::Semaphore;
+pub use up::{UPIntrFreeCell, UPIntrRefMut};
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/sync/mutex.rs.html b/ch9-gui-dev/src/os/sync/mutex.rs.html new file mode 100644 index 00000000..50c48536 --- /dev/null +++ b/ch9-gui-dev/src/os/sync/mutex.rs.html @@ -0,0 +1,178 @@ +mutex.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+
use super::UPIntrFreeCell;
+use crate::task::TaskControlBlock;
+use crate::task::{add_task, current_task};
+use crate::task::{block_current_and_run_next, suspend_current_and_run_next};
+use alloc::{collections::VecDeque, sync::Arc};
+
+pub trait Mutex: Sync + Send {
+    fn lock(&self);
+    fn unlock(&self);
+}
+
+pub struct MutexSpin {
+    locked: UPIntrFreeCell<bool>,
+}
+
+impl MutexSpin {
+    pub fn new() -> Self {
+        Self {
+            locked: unsafe { UPIntrFreeCell::new(false) },
+        }
+    }
+}
+
+impl Mutex for MutexSpin {
+    fn lock(&self) {
+        loop {
+            let mut locked = self.locked.exclusive_access();
+            if *locked {
+                drop(locked);
+                suspend_current_and_run_next();
+                continue;
+            } else {
+                *locked = true;
+                return;
+            }
+        }
+    }
+
+    fn unlock(&self) {
+        let mut locked = self.locked.exclusive_access();
+        *locked = false;
+    }
+}
+
+pub struct MutexBlocking {
+    inner: UPIntrFreeCell<MutexBlockingInner>,
+}
+
+pub struct MutexBlockingInner {
+    locked: bool,
+    wait_queue: VecDeque<Arc<TaskControlBlock>>,
+}
+
+impl MutexBlocking {
+    pub fn new() -> Self {
+        Self {
+            inner: unsafe {
+                UPIntrFreeCell::new(MutexBlockingInner {
+                    locked: false,
+                    wait_queue: VecDeque::new(),
+                })
+            },
+        }
+    }
+}
+
+impl Mutex for MutexBlocking {
+    fn lock(&self) {
+        let mut mutex_inner = self.inner.exclusive_access();
+        if mutex_inner.locked {
+            mutex_inner.wait_queue.push_back(current_task().unwrap());
+            drop(mutex_inner);
+            block_current_and_run_next();
+        } else {
+            mutex_inner.locked = true;
+        }
+    }
+
+    fn unlock(&self) {
+        let mut mutex_inner = self.inner.exclusive_access();
+        assert!(mutex_inner.locked);
+        if let Some(waking_task) = mutex_inner.wait_queue.pop_front() {
+            add_task(waking_task);
+        } else {
+            mutex_inner.locked = false;
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/sync/semaphore.rs.html b/ch9-gui-dev/src/os/sync/semaphore.rs.html new file mode 100644 index 00000000..ac7adb53 --- /dev/null +++ b/ch9-gui-dev/src/os/sync/semaphore.rs.html @@ -0,0 +1,92 @@ +semaphore.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+
use crate::sync::UPIntrFreeCell;
+use crate::task::{add_task, block_current_and_run_next, current_task, TaskControlBlock};
+use alloc::{collections::VecDeque, sync::Arc};
+
+pub struct Semaphore {
+    pub inner: UPIntrFreeCell<SemaphoreInner>,
+}
+
+pub struct SemaphoreInner {
+    pub count: isize,
+    pub wait_queue: VecDeque<Arc<TaskControlBlock>>,
+}
+
+impl Semaphore {
+    pub fn new(res_count: usize) -> Self {
+        Self {
+            inner: unsafe {
+                UPIntrFreeCell::new(SemaphoreInner {
+                    count: res_count as isize,
+                    wait_queue: VecDeque::new(),
+                })
+            },
+        }
+    }
+
+    pub fn up(&self) {
+        let mut inner = self.inner.exclusive_access();
+        inner.count += 1;
+        if inner.count <= 0 {
+            if let Some(task) = inner.wait_queue.pop_front() {
+                add_task(task);
+            }
+        }
+    }
+
+    pub fn down(&self) {
+        let mut inner = self.inner.exclusive_access();
+        inner.count -= 1;
+        if inner.count < 0 {
+            inner.wait_queue.push_back(current_task().unwrap());
+            drop(inner);
+            block_current_and_run_next();
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/sync/up.rs.html b/ch9-gui-dev/src/os/sync/up.rs.html new file mode 100644 index 00000000..e6c94cb0 --- /dev/null +++ b/ch9-gui-dev/src/os/sync/up.rs.html @@ -0,0 +1,282 @@ +up.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+
use core::cell::{RefCell, RefMut, UnsafeCell};
+use core::ops::{Deref, DerefMut};
+use lazy_static::*;
+use riscv::register::sstatus;
+
+/*
+/// Wrap a static data structure inside it so that we are
+/// able to access it without any `unsafe`.
+///
+/// We should only use it in uniprocessor.
+///
+/// In order to get mutable reference of inner data, call
+/// `exclusive_access`.
+pub struct UPSafeCell<T> {
+    /// inner data
+    inner: RefCell<T>,
+}
+
+unsafe impl<T> Sync for UPSafeCell<T> {}
+
+impl<T> UPSafeCell<T> {
+    /// User is responsible to guarantee that inner struct is only used in
+    /// uniprocessor.
+    pub unsafe fn new(value: T) -> Self {
+        Self {
+            inner: RefCell::new(value),
+        }
+    }
+    /// Panic if the data has been borrowed.
+    pub fn exclusive_access(&self) -> RefMut<'_, T> {
+        self.inner.borrow_mut()
+    }
+}
+*/
+
+pub struct UPSafeCellRaw<T> {
+    inner: UnsafeCell<T>,
+}
+
+unsafe impl<T> Sync for UPSafeCellRaw<T> {}
+
+impl<T> UPSafeCellRaw<T> {
+    pub unsafe fn new(value: T) -> Self {
+        Self {
+            inner: UnsafeCell::new(value),
+        }
+    }
+    pub fn get_mut(&self) -> &mut T {
+        unsafe { &mut (*self.inner.get()) }
+    }
+}
+
+pub struct IntrMaskingInfo {
+    nested_level: usize,
+    sie_before_masking: bool,
+}
+
+lazy_static! {
+    static ref INTR_MASKING_INFO: UPSafeCellRaw<IntrMaskingInfo> =
+        unsafe { UPSafeCellRaw::new(IntrMaskingInfo::new()) };
+}
+
+impl IntrMaskingInfo {
+    pub fn new() -> Self {
+        Self {
+            nested_level: 0,
+            sie_before_masking: false,
+        }
+    }
+
+    pub fn enter(&mut self) {
+        let sie = sstatus::read().sie();
+        unsafe {
+            sstatus::clear_sie();
+        }
+        if self.nested_level == 0 {
+            self.sie_before_masking = sie;
+        }
+        self.nested_level += 1;
+    }
+
+    pub fn exit(&mut self) {
+        self.nested_level -= 1;
+        if self.nested_level == 0 && self.sie_before_masking {
+            unsafe {
+                sstatus::set_sie();
+            }
+        }
+    }
+}
+
+pub struct UPIntrFreeCell<T> {
+    /// inner data
+    inner: RefCell<T>,
+}
+
+unsafe impl<T> Sync for UPIntrFreeCell<T> {}
+
+pub struct UPIntrRefMut<'a, T>(Option<RefMut<'a, T>>);
+
+impl<T> UPIntrFreeCell<T> {
+    pub unsafe fn new(value: T) -> Self {
+        Self {
+            inner: RefCell::new(value),
+        }
+    }
+
+    /// Panic if the data has been borrowed.
+    pub fn exclusive_access(&self) -> UPIntrRefMut<'_, T> {
+        INTR_MASKING_INFO.get_mut().enter();
+        UPIntrRefMut(Some(self.inner.borrow_mut()))
+    }
+
+    pub fn exclusive_session<F, V>(&self, f: F) -> V
+    where
+        F: FnOnce(&mut T) -> V,
+    {
+        let mut inner = self.exclusive_access();
+        f(inner.deref_mut())
+    }
+}
+
+impl<'a, T> Drop for UPIntrRefMut<'a, T> {
+    fn drop(&mut self) {
+        self.0 = None;
+        INTR_MASKING_INFO.get_mut().exit();
+    }
+}
+
+impl<'a, T> Deref for UPIntrRefMut<'a, T> {
+    type Target = T;
+    fn deref(&self) -> &Self::Target {
+        self.0.as_ref().unwrap().deref()
+    }
+}
+impl<'a, T> DerefMut for UPIntrRefMut<'a, T> {
+    fn deref_mut(&mut self) -> &mut Self::Target {
+        self.0.as_mut().unwrap().deref_mut()
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/syscall/fs.rs.html b/ch9-gui-dev/src/os/syscall/fs.rs.html new file mode 100644 index 00000000..cdc43e57 --- /dev/null +++ b/ch9-gui-dev/src/os/syscall/fs.rs.html @@ -0,0 +1,200 @@ +fs.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+
use crate::fs::{make_pipe, open_file, OpenFlags};
+use crate::mm::{translated_byte_buffer, translated_refmut, translated_str, UserBuffer};
+use crate::task::{current_process, current_user_token};
+use alloc::sync::Arc;
+
+pub fn sys_write(fd: usize, buf: *const u8, len: usize) -> isize {
+    let token = current_user_token();
+    let process = current_process();
+    let inner = process.inner_exclusive_access();
+    if fd >= inner.fd_table.len() {
+        return -1;
+    }
+    if let Some(file) = &inner.fd_table[fd] {
+        if !file.writable() {
+            return -1;
+        }
+        let file = file.clone();
+        // release current task TCB manually to avoid multi-borrow
+        drop(inner);
+        file.write(UserBuffer::new(translated_byte_buffer(token, buf, len))) as isize
+    } else {
+        -1
+    }
+}
+
+pub fn sys_read(fd: usize, buf: *const u8, len: usize) -> isize {
+    let token = current_user_token();
+    let process = current_process();
+    let inner = process.inner_exclusive_access();
+    if fd >= inner.fd_table.len() {
+        return -1;
+    }
+    if let Some(file) = &inner.fd_table[fd] {
+        let file = file.clone();
+        if !file.readable() {
+            return -1;
+        }
+        // release current task TCB manually to avoid multi-borrow
+        drop(inner);
+        file.read(UserBuffer::new(translated_byte_buffer(token, buf, len))) as isize
+    } else {
+        -1
+    }
+}
+
+pub fn sys_open(path: *const u8, flags: u32) -> isize {
+    let process = current_process();
+    let token = current_user_token();
+    let path = translated_str(token, path);
+    if let Some(inode) = open_file(path.as_str(), OpenFlags::from_bits(flags).unwrap()) {
+        let mut inner = process.inner_exclusive_access();
+        let fd = inner.alloc_fd();
+        inner.fd_table[fd] = Some(inode);
+        fd as isize
+    } else {
+        -1
+    }
+}
+
+pub fn sys_close(fd: usize) -> isize {
+    let process = current_process();
+    let mut inner = process.inner_exclusive_access();
+    if fd >= inner.fd_table.len() {
+        return -1;
+    }
+    if inner.fd_table[fd].is_none() {
+        return -1;
+    }
+    inner.fd_table[fd].take();
+    0
+}
+
+pub fn sys_pipe(pipe: *mut usize) -> isize {
+    let process = current_process();
+    let token = current_user_token();
+    let mut inner = process.inner_exclusive_access();
+    let (pipe_read, pipe_write) = make_pipe();
+    let read_fd = inner.alloc_fd();
+    inner.fd_table[read_fd] = Some(pipe_read);
+    let write_fd = inner.alloc_fd();
+    inner.fd_table[write_fd] = Some(pipe_write);
+    *translated_refmut(token, pipe) = read_fd;
+    *translated_refmut(token, unsafe { pipe.add(1) }) = write_fd;
+    0
+}
+
+pub fn sys_dup(fd: usize) -> isize {
+    let process = current_process();
+    let mut inner = process.inner_exclusive_access();
+    if fd >= inner.fd_table.len() {
+        return -1;
+    }
+    if inner.fd_table[fd].is_none() {
+        return -1;
+    }
+    let new_fd = inner.alloc_fd();
+    inner.fd_table[new_fd] = Some(Arc::clone(inner.fd_table[fd].as_ref().unwrap()));
+    new_fd as isize
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/syscall/gui.rs.html b/ch9-gui-dev/src/os/syscall/gui.rs.html new file mode 100644 index 00000000..87e19142 --- /dev/null +++ b/ch9-gui-dev/src/os/syscall/gui.rs.html @@ -0,0 +1,75 @@ +gui.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+
use crate::mm::{MapArea, MapPermission, MapType, PPNRange, PhysAddr};
+use crate::task::current_process;
+
+//use crate::gui::*;
+use crate::drivers::GPU_DEVICE;
+
+const FB_VADDR: usize = 0x10000000;
+
+pub fn sys_framebuffer() -> isize {
+    let gpu = GPU_DEVICE.clone();
+    let fb = gpu.get_framebuffer();
+    let len = fb.len();
+    println!("[kernel] FrameBuffer: addr 0x{:X}, len {}", fb.as_ptr() as usize , len);
+    let fb_ppn = PhysAddr::from(fb.as_ptr() as usize).floor();
+    let fb_end_ppn = PhysAddr::from(fb.as_ptr() as usize + len).ceil();
+
+    let current_process = current_process();
+    let mut inner = current_process.inner_exclusive_access();
+    let mem_set = &mut inner.memory_set;
+
+    mem_set.push_noalloc(
+        MapArea::new(
+            (FB_VADDR as usize).into(),
+            (FB_VADDR + len as usize).into(),
+            MapType::Framed,
+            MapPermission::R | MapPermission::W | MapPermission::U,
+        ),
+        PPNRange::new(fb_ppn, fb_end_ppn),
+    );
+    FB_VADDR as isize
+}
+
+pub fn sys_framebuffer_flush() -> isize {
+    let gpu = GPU_DEVICE.clone();
+    gpu.flush();
+    0
+}
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/syscall/mod.rs.html b/ch9-gui-dev/src/os/syscall/mod.rs.html new file mode 100644 index 00000000..a332b960 --- /dev/null +++ b/ch9-gui-dev/src/os/syscall/mod.rs.html @@ -0,0 +1,154 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+
const SYSCALL_DUP: usize = 24;
+const SYSCALL_OPEN: usize = 56;
+const SYSCALL_CLOSE: usize = 57;
+const SYSCALL_PIPE: usize = 59;
+const SYSCALL_READ: usize = 63;
+const SYSCALL_WRITE: usize = 64;
+const SYSCALL_EXIT: usize = 93;
+const SYSCALL_SLEEP: usize = 101;
+const SYSCALL_YIELD: usize = 124;
+const SYSCALL_KILL: usize = 129;
+const SYSCALL_GET_TIME: usize = 169;
+const SYSCALL_GETPID: usize = 172;
+const SYSCALL_FORK: usize = 220;
+const SYSCALL_EXEC: usize = 221;
+const SYSCALL_WAITPID: usize = 260;
+const SYSCALL_THREAD_CREATE: usize = 1000;
+const SYSCALL_GETTID: usize = 1001;
+const SYSCALL_WAITTID: usize = 1002;
+const SYSCALL_MUTEX_CREATE: usize = 1010;
+const SYSCALL_MUTEX_LOCK: usize = 1011;
+const SYSCALL_MUTEX_UNLOCK: usize = 1012;
+const SYSCALL_SEMAPHORE_CREATE: usize = 1020;
+const SYSCALL_SEMAPHORE_UP: usize = 1021;
+const SYSCALL_SEMAPHORE_DOWN: usize = 1022;
+const SYSCALL_CONDVAR_CREATE: usize = 1030;
+const SYSCALL_CONDVAR_SIGNAL: usize = 1031;
+const SYSCALL_CONDVAR_WAIT: usize = 1032;
+const SYSCALL_FRAMEBUFFER: usize = 2000;
+const SYSCALL_FRAMEBUFFER_FLUSH: usize = 2001;
+
+mod fs;
+mod process;
+mod sync;
+mod thread;
+mod gui;
+
+use fs::*;
+use process::*;
+use sync::*;
+use thread::*;
+use gui::*;
+
+pub fn syscall(syscall_id: usize, args: [usize; 3]) -> isize {
+    match syscall_id {
+        SYSCALL_DUP => sys_dup(args[0]),
+        SYSCALL_OPEN => sys_open(args[0] as *const u8, args[1] as u32),
+        SYSCALL_CLOSE => sys_close(args[0]),
+        SYSCALL_PIPE => sys_pipe(args[0] as *mut usize),
+        SYSCALL_READ => sys_read(args[0], args[1] as *const u8, args[2]),
+        SYSCALL_WRITE => sys_write(args[0], args[1] as *const u8, args[2]),
+        SYSCALL_EXIT => sys_exit(args[0] as i32),
+        SYSCALL_SLEEP => sys_sleep(args[0]),
+        SYSCALL_YIELD => sys_yield(),
+        SYSCALL_KILL => sys_kill(args[0], args[1] as u32),
+        SYSCALL_GET_TIME => sys_get_time(),
+        SYSCALL_GETPID => sys_getpid(),
+        SYSCALL_FORK => sys_fork(),
+        SYSCALL_EXEC => sys_exec(args[0] as *const u8, args[1] as *const usize),
+        SYSCALL_WAITPID => sys_waitpid(args[0] as isize, args[1] as *mut i32),
+        SYSCALL_THREAD_CREATE => sys_thread_create(args[0], args[1]),
+        SYSCALL_GETTID => sys_gettid(),
+        SYSCALL_WAITTID => sys_waittid(args[0]) as isize,
+        SYSCALL_MUTEX_CREATE => sys_mutex_create(args[0] == 1),
+        SYSCALL_MUTEX_LOCK => sys_mutex_lock(args[0]),
+        SYSCALL_MUTEX_UNLOCK => sys_mutex_unlock(args[0]),
+        SYSCALL_SEMAPHORE_CREATE => sys_semaphore_create(args[0]),
+        SYSCALL_SEMAPHORE_UP => sys_semaphore_up(args[0]),
+        SYSCALL_SEMAPHORE_DOWN => sys_semaphore_down(args[0]),
+        SYSCALL_CONDVAR_CREATE => sys_condvar_create(args[0]),
+        SYSCALL_CONDVAR_SIGNAL => sys_condvar_signal(args[0]),
+        SYSCALL_CONDVAR_WAIT => sys_condvar_wait(args[0], args[1]),
+        SYSCALL_FRAMEBUFFER => sys_framebuffer(),
+        SYSCALL_FRAMEBUFFER_FLUSH => sys_framebuffer_flush(),
+        _ => panic!("Unsupported syscall_id: {}", syscall_id),
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/syscall/process.rs.html b/ch9-gui-dev/src/os/syscall/process.rs.html new file mode 100644 index 00000000..651bbe77 --- /dev/null +++ b/ch9-gui-dev/src/os/syscall/process.rs.html @@ -0,0 +1,236 @@ +process.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+
use crate::fs::{open_file, OpenFlags};
+use crate::mm::{translated_ref, translated_refmut, translated_str};
+use crate::task::{
+    current_process, current_task, current_user_token, exit_current_and_run_next, pid2process,
+    suspend_current_and_run_next, SignalFlags,
+};
+use crate::timer::get_time_ms;
+use alloc::string::String;
+use alloc::sync::Arc;
+use alloc::vec::Vec;
+
+pub fn sys_exit(exit_code: i32) -> ! {
+    exit_current_and_run_next(exit_code);
+    panic!("Unreachable in sys_exit!");
+}
+
+pub fn sys_yield() -> isize {
+    suspend_current_and_run_next();
+    0
+}
+
+pub fn sys_get_time() -> isize {
+    get_time_ms() as isize
+}
+
+pub fn sys_getpid() -> isize {
+    current_task().unwrap().process.upgrade().unwrap().getpid() as isize
+}
+
+pub fn sys_fork() -> isize {
+    let current_process = current_process();
+    let new_process = current_process.fork();
+    let new_pid = new_process.getpid();
+    // modify trap context of new_task, because it returns immediately after switching
+    let new_process_inner = new_process.inner_exclusive_access();
+    let task = new_process_inner.tasks[0].as_ref().unwrap();
+    let trap_cx = task.inner_exclusive_access().get_trap_cx();
+    // we do not have to move to next instruction since we have done it before
+    // for child process, fork returns 0
+    trap_cx.x[10] = 0;
+    new_pid as isize
+}
+
+pub fn sys_exec(path: *const u8, mut args: *const usize) -> isize {
+    let token = current_user_token();
+    let path = translated_str(token, path);
+    let mut args_vec: Vec<String> = Vec::new();
+    loop {
+        let arg_str_ptr = *translated_ref(token, args);
+        if arg_str_ptr == 0 {
+            break;
+        }
+        args_vec.push(translated_str(token, arg_str_ptr as *const u8));
+        unsafe {
+            args = args.add(1);
+        }
+    }
+    if let Some(app_inode) = open_file(path.as_str(), OpenFlags::RDONLY) {
+        let all_data = app_inode.read_all();
+        let process = current_process();
+        let argc = args_vec.len();
+        process.exec(all_data.as_slice(), args_vec);
+        // return argc because cx.x[10] will be covered with it later
+        argc as isize
+    } else {
+        -1
+    }
+}
+
+/// If there is not a child process whose pid is same as given, return -1.
+/// Else if there is a child process but it is still running, return -2.
+pub fn sys_waitpid(pid: isize, exit_code_ptr: *mut i32) -> isize {
+    let process = current_process();
+    // find a child process
+
+    let mut inner = process.inner_exclusive_access();
+    if !inner
+        .children
+        .iter()
+        .any(|p| pid == -1 || pid as usize == p.getpid())
+    {
+        return -1;
+        // ---- release current PCB
+    }
+    let pair = inner.children.iter().enumerate().find(|(_, p)| {
+        // ++++ temporarily access child PCB exclusively
+        p.inner_exclusive_access().is_zombie && (pid == -1 || pid as usize == p.getpid())
+        // ++++ release child PCB
+    });
+    if let Some((idx, _)) = pair {
+        let child = inner.children.remove(idx);
+        // confirm that child will be deallocated after being removed from children list
+        assert_eq!(Arc::strong_count(&child), 1);
+        let found_pid = child.getpid();
+        // ++++ temporarily access child PCB exclusively
+        let exit_code = child.inner_exclusive_access().exit_code;
+        // ++++ release child PCB
+        *translated_refmut(inner.memory_set.token(), exit_code_ptr) = exit_code;
+        found_pid as isize
+    } else {
+        -2
+    }
+    // ---- release current PCB automatically
+}
+
+pub fn sys_kill(pid: usize, signal: u32) -> isize {
+    if let Some(process) = pid2process(pid) {
+        if let Some(flag) = SignalFlags::from_bits(signal) {
+            process.inner_exclusive_access().signals |= flag;
+            0
+        } else {
+            -1
+        }
+    } else {
+        -1
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/syscall/sync.rs.html b/ch9-gui-dev/src/os/syscall/sync.rs.html new file mode 100644 index 00000000..ddaef287 --- /dev/null +++ b/ch9-gui-dev/src/os/syscall/sync.rs.html @@ -0,0 +1,270 @@ +sync.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+
use crate::sync::{Condvar, Mutex, MutexBlocking, MutexSpin, Semaphore};
+use crate::task::{block_current_and_run_next, current_process, current_task};
+use crate::timer::{add_timer, get_time_ms};
+use alloc::sync::Arc;
+
+pub fn sys_sleep(ms: usize) -> isize {
+    let expire_ms = get_time_ms() + ms;
+    let task = current_task().unwrap();
+    add_timer(expire_ms, task);
+    block_current_and_run_next();
+    0
+}
+
+pub fn sys_mutex_create(blocking: bool) -> isize {
+    let process = current_process();
+    let mutex: Option<Arc<dyn Mutex>> = if !blocking {
+        Some(Arc::new(MutexSpin::new()))
+    } else {
+        Some(Arc::new(MutexBlocking::new()))
+    };
+    let mut process_inner = process.inner_exclusive_access();
+    if let Some(id) = process_inner
+        .mutex_list
+        .iter()
+        .enumerate()
+        .find(|(_, item)| item.is_none())
+        .map(|(id, _)| id)
+    {
+        process_inner.mutex_list[id] = mutex;
+        id as isize
+    } else {
+        process_inner.mutex_list.push(mutex);
+        process_inner.mutex_list.len() as isize - 1
+    }
+}
+
+pub fn sys_mutex_lock(mutex_id: usize) -> isize {
+    let process = current_process();
+    let process_inner = process.inner_exclusive_access();
+    let mutex = Arc::clone(process_inner.mutex_list[mutex_id].as_ref().unwrap());
+    drop(process_inner);
+    drop(process);
+    mutex.lock();
+    0
+}
+
+pub fn sys_mutex_unlock(mutex_id: usize) -> isize {
+    let process = current_process();
+    let process_inner = process.inner_exclusive_access();
+    let mutex = Arc::clone(process_inner.mutex_list[mutex_id].as_ref().unwrap());
+    drop(process_inner);
+    drop(process);
+    mutex.unlock();
+    0
+}
+
+pub fn sys_semaphore_create(res_count: usize) -> isize {
+    let process = current_process();
+    let mut process_inner = process.inner_exclusive_access();
+    let id = if let Some(id) = process_inner
+        .semaphore_list
+        .iter()
+        .enumerate()
+        .find(|(_, item)| item.is_none())
+        .map(|(id, _)| id)
+    {
+        process_inner.semaphore_list[id] = Some(Arc::new(Semaphore::new(res_count)));
+        id
+    } else {
+        process_inner
+            .semaphore_list
+            .push(Some(Arc::new(Semaphore::new(res_count))));
+        process_inner.semaphore_list.len() - 1
+    };
+    id as isize
+}
+
+pub fn sys_semaphore_up(sem_id: usize) -> isize {
+    let process = current_process();
+    let process_inner = process.inner_exclusive_access();
+    let sem = Arc::clone(process_inner.semaphore_list[sem_id].as_ref().unwrap());
+    drop(process_inner);
+    sem.up();
+    0
+}
+
+pub fn sys_semaphore_down(sem_id: usize) -> isize {
+    let process = current_process();
+    let process_inner = process.inner_exclusive_access();
+    let sem = Arc::clone(process_inner.semaphore_list[sem_id].as_ref().unwrap());
+    drop(process_inner);
+    sem.down();
+    0
+}
+
+pub fn sys_condvar_create(_arg: usize) -> isize {
+    let process = current_process();
+    let mut process_inner = process.inner_exclusive_access();
+    let id = if let Some(id) = process_inner
+        .condvar_list
+        .iter()
+        .enumerate()
+        .find(|(_, item)| item.is_none())
+        .map(|(id, _)| id)
+    {
+        process_inner.condvar_list[id] = Some(Arc::new(Condvar::new()));
+        id
+    } else {
+        process_inner
+            .condvar_list
+            .push(Some(Arc::new(Condvar::new())));
+        process_inner.condvar_list.len() - 1
+    };
+    id as isize
+}
+
+pub fn sys_condvar_signal(condvar_id: usize) -> isize {
+    let process = current_process();
+    let process_inner = process.inner_exclusive_access();
+    let condvar = Arc::clone(process_inner.condvar_list[condvar_id].as_ref().unwrap());
+    drop(process_inner);
+    condvar.signal();
+    0
+}
+
+pub fn sys_condvar_wait(condvar_id: usize, mutex_id: usize) -> isize {
+    let process = current_process();
+    let process_inner = process.inner_exclusive_access();
+    let condvar = Arc::clone(process_inner.condvar_list[condvar_id].as_ref().unwrap());
+    let mutex = Arc::clone(process_inner.mutex_list[mutex_id].as_ref().unwrap());
+    drop(process_inner);
+    condvar.wait_with_mutex(mutex);
+    0
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/syscall/thread.rs.html b/ch9-gui-dev/src/os/syscall/thread.rs.html new file mode 100644 index 00000000..149974da --- /dev/null +++ b/ch9-gui-dev/src/os/syscall/thread.rs.html @@ -0,0 +1,172 @@ +thread.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+
use crate::{
+    mm::kernel_token,
+    task::{add_task, current_task, TaskControlBlock},
+    trap::{trap_handler, TrapContext},
+};
+use alloc::sync::Arc;
+
+pub fn sys_thread_create(entry: usize, arg: usize) -> isize {
+    let task = current_task().unwrap();
+    let process = task.process.upgrade().unwrap();
+    // create a new thread
+    let new_task = Arc::new(TaskControlBlock::new(
+        Arc::clone(&process),
+        task.inner_exclusive_access()
+            .res
+            .as_ref()
+            .unwrap()
+            .ustack_base,
+        true,
+    ));
+    // add new task to scheduler
+    add_task(Arc::clone(&new_task));
+    let new_task_inner = new_task.inner_exclusive_access();
+    let new_task_res = new_task_inner.res.as_ref().unwrap();
+    let new_task_tid = new_task_res.tid;
+    let mut process_inner = process.inner_exclusive_access();
+    // add new thread to current process
+    let tasks = &mut process_inner.tasks;
+    while tasks.len() < new_task_tid + 1 {
+        tasks.push(None);
+    }
+    tasks[new_task_tid] = Some(Arc::clone(&new_task));
+    let new_task_trap_cx = new_task_inner.get_trap_cx();
+    *new_task_trap_cx = TrapContext::app_init_context(
+        entry,
+        new_task_res.ustack_top(),
+        kernel_token(),
+        new_task.kstack.get_top(),
+        trap_handler as usize,
+    );
+    (*new_task_trap_cx).x[10] = arg;
+    new_task_tid as isize
+}
+
+pub fn sys_gettid() -> isize {
+    current_task()
+        .unwrap()
+        .inner_exclusive_access()
+        .res
+        .as_ref()
+        .unwrap()
+        .tid as isize
+}
+
+/// thread does not exist, return -1
+/// thread has not exited yet, return -2
+/// otherwise, return thread's exit code
+pub fn sys_waittid(tid: usize) -> i32 {
+    let task = current_task().unwrap();
+    let process = task.process.upgrade().unwrap();
+    let task_inner = task.inner_exclusive_access();
+    let mut process_inner = process.inner_exclusive_access();
+    // a thread cannot wait for itself
+    if task_inner.res.as_ref().unwrap().tid == tid {
+        return -1;
+    }
+    let mut exit_code: Option<i32> = None;
+    let waited_task = process_inner.tasks[tid].as_ref();
+    if let Some(waited_task) = waited_task {
+        if let Some(waited_exit_code) = waited_task.inner_exclusive_access().exit_code {
+            exit_code = Some(waited_exit_code);
+        }
+    } else {
+        // waited thread does not exist
+        return -1;
+    }
+    if let Some(exit_code) = exit_code {
+        // dealloc the exited thread
+        process_inner.tasks[tid] = None;
+        exit_code
+    } else {
+        // waited thread has not exited
+        -2
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/task/context.rs.html b/ch9-gui-dev/src/os/task/context.rs.html new file mode 100644 index 00000000..42740875 --- /dev/null +++ b/ch9-gui-dev/src/os/task/context.rs.html @@ -0,0 +1,52 @@ +context.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
use crate::trap::trap_return;
+
+#[repr(C)]
+pub struct TaskContext {
+    ra: usize,
+    sp: usize,
+    s: [usize; 12],
+}
+
+impl TaskContext {
+    pub fn zero_init() -> Self {
+        Self {
+            ra: 0,
+            sp: 0,
+            s: [0; 12],
+        }
+    }
+    pub fn goto_trap_return(kstack_ptr: usize) -> Self {
+        Self {
+            ra: trap_return as usize,
+            sp: kstack_ptr,
+            s: [0; 12],
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/task/id.rs.html b/ch9-gui-dev/src/os/task/id.rs.html new file mode 100644 index 00000000..3f101e3b --- /dev/null +++ b/ch9-gui-dev/src/os/task/id.rs.html @@ -0,0 +1,452 @@ +id.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+
use super::ProcessControlBlock;
+use crate::config::{KERNEL_STACK_SIZE, PAGE_SIZE, TRAMPOLINE, TRAP_CONTEXT_BASE, USER_STACK_SIZE};
+use crate::mm::{MapPermission, PhysPageNum, VirtAddr, KERNEL_SPACE};
+use crate::sync::UPIntrFreeCell;
+use alloc::{
+    sync::{Arc, Weak},
+    vec::Vec,
+};
+use lazy_static::*;
+
+pub struct RecycleAllocator {
+    current: usize,
+    recycled: Vec<usize>,
+}
+
+impl RecycleAllocator {
+    pub fn new() -> Self {
+        RecycleAllocator {
+            current: 0,
+            recycled: Vec::new(),
+        }
+    }
+    pub fn alloc(&mut self) -> usize {
+        if let Some(id) = self.recycled.pop() {
+            id
+        } else {
+            self.current += 1;
+            self.current - 1
+        }
+    }
+    pub fn dealloc(&mut self, id: usize) {
+        assert!(id < self.current);
+        assert!(
+            !self.recycled.iter().any(|i| *i == id),
+            "id {} has been deallocated!",
+            id
+        );
+        self.recycled.push(id);
+    }
+}
+
+lazy_static! {
+    static ref PID_ALLOCATOR: UPIntrFreeCell<RecycleAllocator> =
+        unsafe { UPIntrFreeCell::new(RecycleAllocator::new()) };
+    static ref KSTACK_ALLOCATOR: UPIntrFreeCell<RecycleAllocator> =
+        unsafe { UPIntrFreeCell::new(RecycleAllocator::new()) };
+}
+
+pub const IDLE_PID: usize = 0;
+
+pub struct PidHandle(pub usize);
+
+pub fn pid_alloc() -> PidHandle {
+    PidHandle(PID_ALLOCATOR.exclusive_access().alloc())
+}
+
+impl Drop for PidHandle {
+    fn drop(&mut self) {
+        PID_ALLOCATOR.exclusive_access().dealloc(self.0);
+    }
+}
+
+/// Return (bottom, top) of a kernel stack in kernel space.
+pub fn kernel_stack_position(kstack_id: usize) -> (usize, usize) {
+    let top = TRAMPOLINE - kstack_id * (KERNEL_STACK_SIZE + PAGE_SIZE);
+    let bottom = top - KERNEL_STACK_SIZE;
+    (bottom, top)
+}
+
+pub struct KernelStack(pub usize);
+
+pub fn kstack_alloc() -> KernelStack {
+    let kstack_id = KSTACK_ALLOCATOR.exclusive_access().alloc();
+    let (kstack_bottom, kstack_top) = kernel_stack_position(kstack_id);
+    KERNEL_SPACE.exclusive_access().insert_framed_area(
+        kstack_bottom.into(),
+        kstack_top.into(),
+        MapPermission::R | MapPermission::W,
+    );
+    KernelStack(kstack_id)
+}
+
+impl Drop for KernelStack {
+    fn drop(&mut self) {
+        let (kernel_stack_bottom, _) = kernel_stack_position(self.0);
+        let kernel_stack_bottom_va: VirtAddr = kernel_stack_bottom.into();
+        KERNEL_SPACE
+            .exclusive_access()
+            .remove_area_with_start_vpn(kernel_stack_bottom_va.into());
+    }
+}
+
+impl KernelStack {
+    #[allow(unused)]
+    pub fn push_on_top<T>(&self, value: T) -> *mut T
+    where
+        T: Sized,
+    {
+        let kernel_stack_top = self.get_top();
+        let ptr_mut = (kernel_stack_top - core::mem::size_of::<T>()) as *mut T;
+        unsafe {
+            *ptr_mut = value;
+        }
+        ptr_mut
+    }
+    pub fn get_top(&self) -> usize {
+        let (_, kernel_stack_top) = kernel_stack_position(self.0);
+        kernel_stack_top
+    }
+}
+
+pub struct TaskUserRes {
+    pub tid: usize,
+    pub ustack_base: usize,
+    pub process: Weak<ProcessControlBlock>,
+}
+
+fn trap_cx_bottom_from_tid(tid: usize) -> usize {
+    TRAP_CONTEXT_BASE - tid * PAGE_SIZE
+}
+
+fn ustack_bottom_from_tid(ustack_base: usize, tid: usize) -> usize {
+    ustack_base + tid * (PAGE_SIZE + USER_STACK_SIZE)
+}
+
+impl TaskUserRes {
+    pub fn new(
+        process: Arc<ProcessControlBlock>,
+        ustack_base: usize,
+        alloc_user_res: bool,
+    ) -> Self {
+        let tid = process.inner_exclusive_access().alloc_tid();
+        let task_user_res = Self {
+            tid,
+            ustack_base,
+            process: Arc::downgrade(&process),
+        };
+        if alloc_user_res {
+            task_user_res.alloc_user_res();
+        }
+        task_user_res
+    }
+
+    pub fn alloc_user_res(&self) {
+        let process = self.process.upgrade().unwrap();
+        let mut process_inner = process.inner_exclusive_access();
+        // alloc user stack
+        let ustack_bottom = ustack_bottom_from_tid(self.ustack_base, self.tid);
+        let ustack_top = ustack_bottom + USER_STACK_SIZE;
+        process_inner.memory_set.insert_framed_area(
+            ustack_bottom.into(),
+            ustack_top.into(),
+            MapPermission::R | MapPermission::W | MapPermission::U,
+        );
+        // alloc trap_cx
+        let trap_cx_bottom = trap_cx_bottom_from_tid(self.tid);
+        let trap_cx_top = trap_cx_bottom + PAGE_SIZE;
+        process_inner.memory_set.insert_framed_area(
+            trap_cx_bottom.into(),
+            trap_cx_top.into(),
+            MapPermission::R | MapPermission::W,
+        );
+    }
+
+    fn dealloc_user_res(&self) {
+        // dealloc tid
+        let process = self.process.upgrade().unwrap();
+        let mut process_inner = process.inner_exclusive_access();
+        // dealloc ustack manually
+        let ustack_bottom_va: VirtAddr = ustack_bottom_from_tid(self.ustack_base, self.tid).into();
+        process_inner
+            .memory_set
+            .remove_area_with_start_vpn(ustack_bottom_va.into());
+        // dealloc trap_cx manually
+        let trap_cx_bottom_va: VirtAddr = trap_cx_bottom_from_tid(self.tid).into();
+        process_inner
+            .memory_set
+            .remove_area_with_start_vpn(trap_cx_bottom_va.into());
+    }
+
+    #[allow(unused)]
+    pub fn alloc_tid(&mut self) {
+        self.tid = self
+            .process
+            .upgrade()
+            .unwrap()
+            .inner_exclusive_access()
+            .alloc_tid();
+    }
+
+    pub fn dealloc_tid(&self) {
+        let process = self.process.upgrade().unwrap();
+        let mut process_inner = process.inner_exclusive_access();
+        process_inner.dealloc_tid(self.tid);
+    }
+
+    pub fn trap_cx_user_va(&self) -> usize {
+        trap_cx_bottom_from_tid(self.tid)
+    }
+
+    pub fn trap_cx_ppn(&self) -> PhysPageNum {
+        let process = self.process.upgrade().unwrap();
+        let process_inner = process.inner_exclusive_access();
+        let trap_cx_bottom_va: VirtAddr = trap_cx_bottom_from_tid(self.tid).into();
+        process_inner
+            .memory_set
+            .translate(trap_cx_bottom_va.into())
+            .unwrap()
+            .ppn()
+    }
+
+    pub fn ustack_base(&self) -> usize {
+        self.ustack_base
+    }
+    pub fn ustack_top(&self) -> usize {
+        ustack_bottom_from_tid(self.ustack_base, self.tid) + USER_STACK_SIZE
+    }
+}
+
+impl Drop for TaskUserRes {
+    fn drop(&mut self) {
+        self.dealloc_tid();
+        self.dealloc_user_res();
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/task/manager.rs.html b/ch9-gui-dev/src/os/task/manager.rs.html new file mode 100644 index 00000000..64714057 --- /dev/null +++ b/ch9-gui-dev/src/os/task/manager.rs.html @@ -0,0 +1,112 @@ +manager.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+
use super::{ProcessControlBlock, TaskControlBlock};
+use crate::sync::UPIntrFreeCell;
+use alloc::collections::{BTreeMap, VecDeque};
+use alloc::sync::Arc;
+use lazy_static::*;
+
+pub struct TaskManager {
+    ready_queue: VecDeque<Arc<TaskControlBlock>>,
+}
+
+/// A simple FIFO scheduler.
+impl TaskManager {
+    pub fn new() -> Self {
+        Self {
+            ready_queue: VecDeque::new(),
+        }
+    }
+    pub fn add(&mut self, task: Arc<TaskControlBlock>) {
+        self.ready_queue.push_back(task);
+    }
+    pub fn fetch(&mut self) -> Option<Arc<TaskControlBlock>> {
+        self.ready_queue.pop_front()
+    }
+}
+
+lazy_static! {
+    pub static ref TASK_MANAGER: UPIntrFreeCell<TaskManager> =
+        unsafe { UPIntrFreeCell::new(TaskManager::new()) };
+    pub static ref PID2PCB: UPIntrFreeCell<BTreeMap<usize, Arc<ProcessControlBlock>>> =
+        unsafe { UPIntrFreeCell::new(BTreeMap::new()) };
+}
+
+pub fn add_task(task: Arc<TaskControlBlock>) {
+    TASK_MANAGER.exclusive_access().add(task);
+}
+
+pub fn fetch_task() -> Option<Arc<TaskControlBlock>> {
+    TASK_MANAGER.exclusive_access().fetch()
+}
+
+pub fn pid2process(pid: usize) -> Option<Arc<ProcessControlBlock>> {
+    let map = PID2PCB.exclusive_access();
+    map.get(&pid).map(Arc::clone)
+}
+
+pub fn insert_into_pid2process(pid: usize, process: Arc<ProcessControlBlock>) {
+    PID2PCB.exclusive_access().insert(pid, process);
+}
+
+pub fn remove_from_pid2process(pid: usize) {
+    let mut map = PID2PCB.exclusive_access();
+    if map.remove(&pid).is_none() {
+        panic!("cannot find pid {} in pid2task!", pid);
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/task/mod.rs.html b/ch9-gui-dev/src/os/task/mod.rs.html new file mode 100644 index 00000000..2a81c710 --- /dev/null +++ b/ch9-gui-dev/src/os/task/mod.rs.html @@ -0,0 +1,318 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+
mod context;
+mod id;
+mod manager;
+mod process;
+mod processor;
+mod signal;
+mod switch;
+#[allow(clippy::module_inception)]
+mod task;
+
+use self::id::TaskUserRes;
+use crate::fs::{open_file, OpenFlags};
+use alloc::{sync::Arc, vec::Vec};
+use lazy_static::*;
+use manager::fetch_task;
+use process::ProcessControlBlock;
+use switch::__switch;
+
+pub use context::TaskContext;
+pub use id::{kstack_alloc, pid_alloc, KernelStack, PidHandle, IDLE_PID};
+pub use manager::{add_task, pid2process, remove_from_pid2process};
+pub use processor::{
+    current_kstack_top, current_process, current_task, current_trap_cx, current_trap_cx_user_va,
+    current_user_token, run_tasks, schedule, take_current_task,
+};
+pub use signal::SignalFlags;
+pub use task::{TaskControlBlock, TaskStatus};
+
+pub fn suspend_current_and_run_next() {
+    // There must be an application running.
+    let task = take_current_task().unwrap();
+
+    // ---- access current TCB exclusively
+    let mut task_inner = task.inner_exclusive_access();
+    let task_cx_ptr = &mut task_inner.task_cx as *mut TaskContext;
+    // Change status to Ready
+    task_inner.task_status = TaskStatus::Ready;
+    drop(task_inner);
+    // ---- release current TCB
+
+    // push back to ready queue.
+    add_task(task);
+    // jump to scheduling cycle
+    schedule(task_cx_ptr);
+}
+
+/// This function must be followed by a schedule
+pub fn block_current_task() -> *mut TaskContext {
+    let task = take_current_task().unwrap();
+    let mut task_inner = task.inner_exclusive_access();
+    task_inner.task_status = TaskStatus::Blocking;
+    &mut task_inner.task_cx as *mut TaskContext
+}
+
+pub fn block_current_and_run_next() {
+    let task_cx_ptr = block_current_task();
+    schedule(task_cx_ptr);
+}
+use crate::board::QEMUExit;
+
+pub fn exit_current_and_run_next(exit_code: i32) {
+    let task = take_current_task().unwrap();
+    let mut task_inner = task.inner_exclusive_access();
+    let process = task.process.upgrade().unwrap();
+    let tid = task_inner.res.as_ref().unwrap().tid;
+    // record exit code
+    task_inner.exit_code = Some(exit_code);
+    task_inner.res = None;
+    // here we do not remove the thread since we are still using the kstack
+    // it will be deallocated when sys_waittid is called
+    drop(task_inner);
+    drop(task);
+    // however, if this is the main thread of current process
+    // the process should terminate at once
+    if tid == 0 {
+        let pid = process.getpid();
+        if pid == IDLE_PID {
+            println!(
+                "[kernel] Idle process exit with exit_code {} ...",
+                exit_code
+            );
+            if exit_code != 0 {
+                //crate::sbi::shutdown(255); //255 == -1 for err hint
+                crate::board::QEMU_EXIT_HANDLE.exit_failure();
+            } else {
+                //crate::sbi::shutdown(0); //0 for success hint
+                crate::board::QEMU_EXIT_HANDLE.exit_success();
+            }
+        }
+        remove_from_pid2process(pid);
+        let mut process_inner = process.inner_exclusive_access();
+        // mark this process as a zombie process
+        process_inner.is_zombie = true;
+        // record exit code of main process
+        process_inner.exit_code = exit_code;
+
+        {
+            // move all child processes under init process
+            let mut initproc_inner = INITPROC.inner_exclusive_access();
+            for child in process_inner.children.iter() {
+                child.inner_exclusive_access().parent = Some(Arc::downgrade(&INITPROC));
+                initproc_inner.children.push(child.clone());
+            }
+        }
+
+        // deallocate user res (including tid/trap_cx/ustack) of all threads
+        // it has to be done before we dealloc the whole memory_set
+        // otherwise they will be deallocated twice
+        let mut recycle_res = Vec::<TaskUserRes>::new();
+        for task in process_inner.tasks.iter().filter(|t| t.is_some()) {
+            let task = task.as_ref().unwrap();
+            let mut task_inner = task.inner_exclusive_access();
+            if let Some(res) = task_inner.res.take() {
+                recycle_res.push(res);
+            }
+        }
+        // dealloc_tid and dealloc_user_res require access to PCB inner, so we
+        // need to collect those user res first, then release process_inner
+        // for now to avoid deadlock/double borrow problem.
+        drop(process_inner);
+        recycle_res.clear();
+
+        let mut process_inner = process.inner_exclusive_access();
+        process_inner.children.clear();
+        // deallocate other data in user space i.e. program code/data section
+        process_inner.memory_set.recycle_data_pages();
+        // drop file descriptors
+        process_inner.fd_table.clear();
+    }
+    drop(process);
+    // we do not have to save task context
+    let mut _unused = TaskContext::zero_init();
+    schedule(&mut _unused as *mut _);
+}
+
+lazy_static! {
+    pub static ref INITPROC: Arc<ProcessControlBlock> = {
+        let inode = open_file("initproc", OpenFlags::RDONLY).unwrap();
+        let v = inode.read_all();
+        ProcessControlBlock::new(v.as_slice())
+    };
+}
+
+pub fn add_initproc() {
+    let _initproc = INITPROC.clone();
+}
+
+pub fn check_signals_of_current() -> Option<(i32, &'static str)> {
+    let process = current_process();
+    let process_inner = process.inner_exclusive_access();
+    process_inner.signals.check_error()
+}
+
+pub fn current_add_signal(signal: SignalFlags) {
+    let process = current_process();
+    let mut process_inner = process.inner_exclusive_access();
+    process_inner.signals |= signal;
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/task/process.rs.html b/ch9-gui-dev/src/os/task/process.rs.html new file mode 100644 index 00000000..eb53f98d --- /dev/null +++ b/ch9-gui-dev/src/os/task/process.rs.html @@ -0,0 +1,518 @@ +process.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+
use super::id::RecycleAllocator;
+use super::manager::insert_into_pid2process;
+use super::TaskControlBlock;
+use super::{add_task, SignalFlags};
+use super::{pid_alloc, PidHandle};
+use crate::fs::{File, Stdin, Stdout};
+use crate::mm::{translated_refmut, MemorySet, KERNEL_SPACE};
+use crate::sync::{Condvar, Mutex, Semaphore, UPIntrFreeCell, UPIntrRefMut};
+use crate::trap::{trap_handler, TrapContext};
+use alloc::string::String;
+use alloc::sync::{Arc, Weak};
+use alloc::vec;
+use alloc::vec::Vec;
+
+pub struct ProcessControlBlock {
+    // immutable
+    pub pid: PidHandle,
+    // mutable
+    inner: UPIntrFreeCell<ProcessControlBlockInner>,
+}
+
+pub struct ProcessControlBlockInner {
+    pub is_zombie: bool,
+    pub memory_set: MemorySet,
+    pub parent: Option<Weak<ProcessControlBlock>>,
+    pub children: Vec<Arc<ProcessControlBlock>>,
+    pub exit_code: i32,
+    pub fd_table: Vec<Option<Arc<dyn File + Send + Sync>>>,
+    pub signals: SignalFlags,
+    pub tasks: Vec<Option<Arc<TaskControlBlock>>>,
+    pub task_res_allocator: RecycleAllocator,
+    pub mutex_list: Vec<Option<Arc<dyn Mutex>>>,
+    pub semaphore_list: Vec<Option<Arc<Semaphore>>>,
+    pub condvar_list: Vec<Option<Arc<Condvar>>>,
+}
+
+impl ProcessControlBlockInner {
+    #[allow(unused)]
+    pub fn get_user_token(&self) -> usize {
+        self.memory_set.token()
+    }
+
+    pub fn alloc_fd(&mut self) -> usize {
+        if let Some(fd) = (0..self.fd_table.len()).find(|fd| self.fd_table[*fd].is_none()) {
+            fd
+        } else {
+            self.fd_table.push(None);
+            self.fd_table.len() - 1
+        }
+    }
+
+    pub fn alloc_tid(&mut self) -> usize {
+        self.task_res_allocator.alloc()
+    }
+
+    pub fn dealloc_tid(&mut self, tid: usize) {
+        self.task_res_allocator.dealloc(tid)
+    }
+
+    pub fn thread_count(&self) -> usize {
+        self.tasks.len()
+    }
+
+    pub fn get_task(&self, tid: usize) -> Arc<TaskControlBlock> {
+        self.tasks[tid].as_ref().unwrap().clone()
+    }
+}
+
+impl ProcessControlBlock {
+    pub fn inner_exclusive_access(&self) -> UPIntrRefMut<'_, ProcessControlBlockInner> {
+        self.inner.exclusive_access()
+    }
+
+    pub fn new(elf_data: &[u8]) -> Arc<Self> {
+        // memory_set with elf program headers/trampoline/trap context/user stack
+        let (memory_set, ustack_base, entry_point) = MemorySet::from_elf(elf_data);
+        // allocate a pid
+        let pid_handle = pid_alloc();
+        let process = Arc::new(Self {
+            pid: pid_handle,
+            inner: unsafe {
+                UPIntrFreeCell::new(ProcessControlBlockInner {
+                    is_zombie: false,
+                    memory_set,
+                    parent: None,
+                    children: Vec::new(),
+                    exit_code: 0,
+                    fd_table: vec![
+                        // 0 -> stdin
+                        Some(Arc::new(Stdin)),
+                        // 1 -> stdout
+                        Some(Arc::new(Stdout)),
+                        // 2 -> stderr
+                        Some(Arc::new(Stdout)),
+                    ],
+                    signals: SignalFlags::empty(),
+                    tasks: Vec::new(),
+                    task_res_allocator: RecycleAllocator::new(),
+                    mutex_list: Vec::new(),
+                    semaphore_list: Vec::new(),
+                    condvar_list: Vec::new(),
+                })
+            },
+        });
+        // create a main thread, we should allocate ustack and trap_cx here
+        let task = Arc::new(TaskControlBlock::new(
+            Arc::clone(&process),
+            ustack_base,
+            true,
+        ));
+        // prepare trap_cx of main thread
+        let task_inner = task.inner_exclusive_access();
+        let trap_cx = task_inner.get_trap_cx();
+        let ustack_top = task_inner.res.as_ref().unwrap().ustack_top();
+        let kstack_top = task.kstack.get_top();
+        drop(task_inner);
+        *trap_cx = TrapContext::app_init_context(
+            entry_point,
+            ustack_top,
+            KERNEL_SPACE.exclusive_access().token(),
+            kstack_top,
+            trap_handler as usize,
+        );
+        // add main thread to the process
+        let mut process_inner = process.inner_exclusive_access();
+        process_inner.tasks.push(Some(Arc::clone(&task)));
+        drop(process_inner);
+        insert_into_pid2process(process.getpid(), Arc::clone(&process));
+        // add main thread to scheduler
+        add_task(task);
+        process
+    }
+
+    /// Only support processes with a single thread.
+    pub fn exec(self: &Arc<Self>, elf_data: &[u8], args: Vec<String>) {
+        assert_eq!(self.inner_exclusive_access().thread_count(), 1);
+        // memory_set with elf program headers/trampoline/trap context/user stack
+        let (memory_set, ustack_base, entry_point) = MemorySet::from_elf(elf_data);
+        let new_token = memory_set.token();
+        // substitute memory_set
+        self.inner_exclusive_access().memory_set = memory_set;
+        // then we alloc user resource for main thread again
+        // since memory_set has been changed
+        let task = self.inner_exclusive_access().get_task(0);
+        let mut task_inner = task.inner_exclusive_access();
+        task_inner.res.as_mut().unwrap().ustack_base = ustack_base;
+        task_inner.res.as_mut().unwrap().alloc_user_res();
+        task_inner.trap_cx_ppn = task_inner.res.as_mut().unwrap().trap_cx_ppn();
+        // push arguments on user stack
+        let mut user_sp = task_inner.res.as_mut().unwrap().ustack_top();
+        user_sp -= (args.len() + 1) * core::mem::size_of::<usize>();
+        let argv_base = user_sp;
+        let mut argv: Vec<_> = (0..=args.len())
+            .map(|arg| {
+                translated_refmut(
+                    new_token,
+                    (argv_base + arg * core::mem::size_of::<usize>()) as *mut usize,
+                )
+            })
+            .collect();
+        *argv[args.len()] = 0;
+        for i in 0..args.len() {
+            user_sp -= args[i].len() + 1;
+            *argv[i] = user_sp;
+            let mut p = user_sp;
+            for c in args[i].as_bytes() {
+                *translated_refmut(new_token, p as *mut u8) = *c;
+                p += 1;
+            }
+            *translated_refmut(new_token, p as *mut u8) = 0;
+        }
+        // make the user_sp aligned to 8B for k210 platform
+        user_sp -= user_sp % core::mem::size_of::<usize>();
+        // initialize trap_cx
+        let mut trap_cx = TrapContext::app_init_context(
+            entry_point,
+            user_sp,
+            KERNEL_SPACE.exclusive_access().token(),
+            task.kstack.get_top(),
+            trap_handler as usize,
+        );
+        trap_cx.x[10] = args.len();
+        trap_cx.x[11] = argv_base;
+        *task_inner.get_trap_cx() = trap_cx;
+    }
+
+    /// Only support processes with a single thread.
+    pub fn fork(self: &Arc<Self>) -> Arc<Self> {
+        let mut parent = self.inner_exclusive_access();
+        assert_eq!(parent.thread_count(), 1);
+        // clone parent's memory_set completely including trampoline/ustacks/trap_cxs
+        let memory_set = MemorySet::from_existed_user(&parent.memory_set);
+        // alloc a pid
+        let pid = pid_alloc();
+        // copy fd table
+        let mut new_fd_table: Vec<Option<Arc<dyn File + Send + Sync>>> = Vec::new();
+        for fd in parent.fd_table.iter() {
+            if let Some(file) = fd {
+                new_fd_table.push(Some(file.clone()));
+            } else {
+                new_fd_table.push(None);
+            }
+        }
+        // create child process pcb
+        let child = Arc::new(Self {
+            pid,
+            inner: unsafe {
+                UPIntrFreeCell::new(ProcessControlBlockInner {
+                    is_zombie: false,
+                    memory_set,
+                    parent: Some(Arc::downgrade(self)),
+                    children: Vec::new(),
+                    exit_code: 0,
+                    fd_table: new_fd_table,
+                    signals: SignalFlags::empty(),
+                    tasks: Vec::new(),
+                    task_res_allocator: RecycleAllocator::new(),
+                    mutex_list: Vec::new(),
+                    semaphore_list: Vec::new(),
+                    condvar_list: Vec::new(),
+                })
+            },
+        });
+        // add child
+        parent.children.push(Arc::clone(&child));
+        // create main thread of child process
+        let task = Arc::new(TaskControlBlock::new(
+            Arc::clone(&child),
+            parent
+                .get_task(0)
+                .inner_exclusive_access()
+                .res
+                .as_ref()
+                .unwrap()
+                .ustack_base(),
+            // here we do not allocate trap_cx or ustack again
+            // but mention that we allocate a new kstack here
+            false,
+        ));
+        // attach task to child process
+        let mut child_inner = child.inner_exclusive_access();
+        child_inner.tasks.push(Some(Arc::clone(&task)));
+        drop(child_inner);
+        // modify kstack_top in trap_cx of this thread
+        let task_inner = task.inner_exclusive_access();
+        let trap_cx = task_inner.get_trap_cx();
+        trap_cx.kernel_sp = task.kstack.get_top();
+        drop(task_inner);
+        insert_into_pid2process(child.getpid(), Arc::clone(&child));
+        // add this thread to scheduler
+        add_task(task);
+        child
+    }
+
+    pub fn getpid(&self) -> usize {
+        self.pid.0
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/task/processor.rs.html b/ch9-gui-dev/src/os/task/processor.rs.html new file mode 100644 index 00000000..534e9751 --- /dev/null +++ b/ch9-gui-dev/src/os/task/processor.rs.html @@ -0,0 +1,208 @@ +processor.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+
use super::__switch;
+use super::{fetch_task, TaskStatus};
+use super::{ProcessControlBlock, TaskContext, TaskControlBlock};
+use crate::sync::UPIntrFreeCell;
+use crate::trap::TrapContext;
+use alloc::sync::Arc;
+use lazy_static::*;
+
+pub struct Processor {
+    current: Option<Arc<TaskControlBlock>>,
+    idle_task_cx: TaskContext,
+}
+
+impl Processor {
+    pub fn new() -> Self {
+        Self {
+            current: None,
+            idle_task_cx: TaskContext::zero_init(),
+        }
+    }
+    fn get_idle_task_cx_ptr(&mut self) -> *mut TaskContext {
+        &mut self.idle_task_cx as *mut _
+    }
+    pub fn take_current(&mut self) -> Option<Arc<TaskControlBlock>> {
+        self.current.take()
+    }
+    pub fn current(&self) -> Option<Arc<TaskControlBlock>> {
+        self.current.as_ref().map(Arc::clone)
+    }
+}
+
+lazy_static! {
+    pub static ref PROCESSOR: UPIntrFreeCell<Processor> =
+        unsafe { UPIntrFreeCell::new(Processor::new()) };
+}
+
+pub fn run_tasks() {
+    loop {
+        let mut processor = PROCESSOR.exclusive_access();
+        if let Some(task) = fetch_task() {
+            let idle_task_cx_ptr = processor.get_idle_task_cx_ptr();
+            // access coming task TCB exclusively
+            let next_task_cx_ptr = task.inner.exclusive_session(|task_inner| {
+                task_inner.task_status = TaskStatus::Running;
+                &task_inner.task_cx as *const TaskContext
+            });
+            processor.current = Some(task);
+            // release processor manually
+            drop(processor);
+            unsafe {
+                __switch(idle_task_cx_ptr, next_task_cx_ptr);
+            }
+        } else {
+            println!("no tasks available in run_tasks");
+        }
+    }
+}
+
+pub fn take_current_task() -> Option<Arc<TaskControlBlock>> {
+    PROCESSOR.exclusive_access().take_current()
+}
+
+pub fn current_task() -> Option<Arc<TaskControlBlock>> {
+    PROCESSOR.exclusive_access().current()
+}
+
+pub fn current_process() -> Arc<ProcessControlBlock> {
+    current_task().unwrap().process.upgrade().unwrap()
+}
+
+pub fn current_user_token() -> usize {
+    let task = current_task().unwrap();
+    task.get_user_token()
+}
+
+pub fn current_trap_cx() -> &'static mut TrapContext {
+    current_task()
+        .unwrap()
+        .inner_exclusive_access()
+        .get_trap_cx()
+}
+
+pub fn current_trap_cx_user_va() -> usize {
+    current_task()
+        .unwrap()
+        .inner_exclusive_access()
+        .res
+        .as_ref()
+        .unwrap()
+        .trap_cx_user_va()
+}
+
+pub fn current_kstack_top() -> usize {
+    current_task().unwrap().kstack.get_top()
+}
+
+pub fn schedule(switched_task_cx_ptr: *mut TaskContext) {
+    let idle_task_cx_ptr =
+        PROCESSOR.exclusive_session(|processor| processor.get_idle_task_cx_ptr());
+    unsafe {
+        __switch(switched_task_cx_ptr, idle_task_cx_ptr);
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/task/signal.rs.html b/ch9-gui-dev/src/os/task/signal.rs.html new file mode 100644 index 00000000..3c565841 --- /dev/null +++ b/ch9-gui-dev/src/os/task/signal.rs.html @@ -0,0 +1,60 @@ +signal.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+
use bitflags::*;
+
+bitflags! {
+    pub struct SignalFlags: u32 {
+        const SIGINT    = 1 << 2;
+        const SIGILL    = 1 << 4;
+        const SIGABRT   = 1 << 6;
+        const SIGFPE    = 1 << 8;
+        const SIGSEGV   = 1 << 11;
+    }
+}
+
+impl SignalFlags {
+    pub fn check_error(&self) -> Option<(i32, &'static str)> {
+        if self.contains(Self::SIGINT) {
+            Some((-2, "Killed, SIGINT=2"))
+        } else if self.contains(Self::SIGILL) {
+            Some((-4, "Illegal Instruction, SIGILL=4"))
+        } else if self.contains(Self::SIGABRT) {
+            Some((-6, "Aborted, SIGABRT=6"))
+        } else if self.contains(Self::SIGFPE) {
+            Some((-8, "Erroneous Arithmetic Operation, SIGFPE=8"))
+        } else if self.contains(Self::SIGSEGV) {
+            Some((-11, "Segmentation Fault, SIGSEGV=11"))
+        } else {
+            None
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/task/switch.rs.html b/ch9-gui-dev/src/os/task/switch.rs.html new file mode 100644 index 00000000..c4cb829b --- /dev/null +++ b/ch9-gui-dev/src/os/task/switch.rs.html @@ -0,0 +1,18 @@ +switch.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+
use super::TaskContext;
+use core::arch::global_asm;
+
+global_asm!(include_str!("switch.S"));
+
+extern "C" {
+    pub fn __switch(current_task_cx_ptr: *mut TaskContext, next_task_cx_ptr: *const TaskContext);
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/task/task.rs.html b/ch9-gui-dev/src/os/task/task.rs.html new file mode 100644 index 00000000..0111ca7d --- /dev/null +++ b/ch9-gui-dev/src/os/task/task.rs.html @@ -0,0 +1,162 @@ +task.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+
use super::id::TaskUserRes;
+use super::{kstack_alloc, KernelStack, ProcessControlBlock, TaskContext};
+use crate::trap::TrapContext;
+use crate::{
+    mm::PhysPageNum,
+    sync::{UPIntrFreeCell, UPIntrRefMut},
+};
+use alloc::sync::{Arc, Weak};
+
+pub struct TaskControlBlock {
+    // immutable
+    pub process: Weak<ProcessControlBlock>,
+    pub kstack: KernelStack,
+    // mutable
+    pub inner: UPIntrFreeCell<TaskControlBlockInner>,
+}
+
+impl TaskControlBlock {
+    pub fn inner_exclusive_access(&self) -> UPIntrRefMut<'_, TaskControlBlockInner> {
+        self.inner.exclusive_access()
+    }
+
+    pub fn get_user_token(&self) -> usize {
+        let process = self.process.upgrade().unwrap();
+        let inner = process.inner_exclusive_access();
+        inner.memory_set.token()
+    }
+}
+
+pub struct TaskControlBlockInner {
+    pub res: Option<TaskUserRes>,
+    pub trap_cx_ppn: PhysPageNum,
+    pub task_cx: TaskContext,
+    pub task_status: TaskStatus,
+    pub exit_code: Option<i32>,
+}
+
+impl TaskControlBlockInner {
+    pub fn get_trap_cx(&self) -> &'static mut TrapContext {
+        self.trap_cx_ppn.get_mut()
+    }
+
+    #[allow(unused)]
+    fn get_status(&self) -> TaskStatus {
+        self.task_status
+    }
+}
+
+impl TaskControlBlock {
+    pub fn new(
+        process: Arc<ProcessControlBlock>,
+        ustack_base: usize,
+        alloc_user_res: bool,
+    ) -> Self {
+        let res = TaskUserRes::new(Arc::clone(&process), ustack_base, alloc_user_res);
+        let trap_cx_ppn = res.trap_cx_ppn();
+        let kstack = kstack_alloc();
+        let kstack_top = kstack.get_top();
+        Self {
+            process: Arc::downgrade(&process),
+            kstack,
+            inner: unsafe {
+                UPIntrFreeCell::new(TaskControlBlockInner {
+                    res: Some(res),
+                    trap_cx_ppn,
+                    task_cx: TaskContext::goto_trap_return(kstack_top),
+                    task_status: TaskStatus::Ready,
+                    exit_code: None,
+                })
+            },
+        }
+    }
+}
+
+#[derive(Copy, Clone, PartialEq)]
+pub enum TaskStatus {
+    Ready,
+    Running,
+    Blocking,
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/timer.rs.html b/ch9-gui-dev/src/os/timer.rs.html new file mode 100644 index 00000000..acec2b8b --- /dev/null +++ b/ch9-gui-dev/src/os/timer.rs.html @@ -0,0 +1,150 @@ +timer.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+
use core::cmp::Ordering;
+
+use crate::config::CLOCK_FREQ;
+use crate::sbi::set_timer;
+use crate::sync::UPIntrFreeCell;
+use crate::task::{add_task, TaskControlBlock};
+use alloc::collections::BinaryHeap;
+use alloc::sync::Arc;
+use lazy_static::*;
+use riscv::register::time;
+
+const TICKS_PER_SEC: usize = 100;
+const MSEC_PER_SEC: usize = 1000;
+
+pub fn get_time() -> usize {
+    time::read()
+}
+
+pub fn get_time_ms() -> usize {
+    time::read() / (CLOCK_FREQ / MSEC_PER_SEC)
+}
+
+pub fn set_next_trigger() {
+    set_timer(get_time() + CLOCK_FREQ / TICKS_PER_SEC);
+}
+
+pub struct TimerCondVar {
+    pub expire_ms: usize,
+    pub task: Arc<TaskControlBlock>,
+}
+
+impl PartialEq for TimerCondVar {
+    fn eq(&self, other: &Self) -> bool {
+        self.expire_ms == other.expire_ms
+    }
+}
+impl Eq for TimerCondVar {}
+impl PartialOrd for TimerCondVar {
+    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
+        let a = -(self.expire_ms as isize);
+        let b = -(other.expire_ms as isize);
+        Some(a.cmp(&b))
+    }
+}
+
+impl Ord for TimerCondVar {
+    fn cmp(&self, other: &Self) -> Ordering {
+        self.partial_cmp(other).unwrap()
+    }
+}
+
+lazy_static! {
+    static ref TIMERS: UPIntrFreeCell<BinaryHeap<TimerCondVar>> =
+        unsafe { UPIntrFreeCell::new(BinaryHeap::<TimerCondVar>::new()) };
+}
+
+pub fn add_timer(expire_ms: usize, task: Arc<TaskControlBlock>) {
+    let mut timers = TIMERS.exclusive_access();
+    timers.push(TimerCondVar { expire_ms, task });
+}
+
+pub fn check_timer() {
+    let current_ms = get_time_ms();
+    TIMERS.exclusive_session(|timers| {
+        while let Some(timer) = timers.peek() {
+            if timer.expire_ms <= current_ms {
+                add_task(Arc::clone(&timer.task));
+                timers.pop();
+            } else {
+                break;
+            }
+        }
+    });
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/trap/context.rs.html b/ch9-gui-dev/src/os/trap/context.rs.html new file mode 100644 index 00000000..72ae4b87 --- /dev/null +++ b/ch9-gui-dev/src/os/trap/context.rs.html @@ -0,0 +1,80 @@ +context.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+
use riscv::register::sstatus::{self, Sstatus, SPP};
+
+#[repr(C)]
+#[derive(Debug)]
+pub struct TrapContext {
+    pub x: [usize; 32],
+    pub sstatus: Sstatus,
+    pub sepc: usize,
+    pub kernel_satp: usize,
+    pub kernel_sp: usize,
+    pub trap_handler: usize,
+}
+
+impl TrapContext {
+    pub fn set_sp(&mut self, sp: usize) {
+        self.x[2] = sp;
+    }
+    pub fn app_init_context(
+        entry: usize,
+        sp: usize,
+        kernel_satp: usize,
+        kernel_sp: usize,
+        trap_handler: usize,
+    ) -> Self {
+        let mut sstatus = sstatus::read();
+        // set CPU privilege to User after trapping back
+        sstatus.set_spp(SPP::User);
+        let mut cx = Self {
+            x: [0; 32],
+            sstatus,
+            sepc: entry,
+            kernel_satp,
+            kernel_sp,
+            trap_handler,
+        };
+        cx.set_sp(sp);
+        cx
+    }
+}
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/src/os/trap/mod.rs.html b/ch9-gui-dev/src/os/trap/mod.rs.html new file mode 100644 index 00000000..061065e3 --- /dev/null +++ b/ch9-gui-dev/src/os/trap/mod.rs.html @@ -0,0 +1,340 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+
mod context;
+
+use crate::config::TRAMPOLINE;
+use crate::syscall::syscall;
+use crate::task::{
+    check_signals_of_current, current_add_signal, current_trap_cx, current_trap_cx_user_va,
+    current_user_token, exit_current_and_run_next, suspend_current_and_run_next, SignalFlags,
+};
+use crate::timer::{check_timer, set_next_trigger};
+use core::arch::{asm, global_asm};
+use riscv::register::{
+    mtvec::TrapMode,
+    scause::{self, Exception, Interrupt, Trap},
+    sie, sscratch, sstatus, stval, stvec,
+};
+
+global_asm!(include_str!("trap.S"));
+
+pub fn init() {
+    set_kernel_trap_entry();
+}
+
+fn set_kernel_trap_entry() {
+    extern "C" {
+        fn __alltraps();
+        fn __alltraps_k();
+    }
+    let __alltraps_k_va = __alltraps_k as usize - __alltraps as usize + TRAMPOLINE;
+    unsafe {
+        stvec::write(__alltraps_k_va, TrapMode::Direct);
+        sscratch::write(trap_from_kernel as usize);
+    }
+}
+
+fn set_user_trap_entry() {
+    unsafe {
+        stvec::write(TRAMPOLINE as usize, TrapMode::Direct);
+    }
+}
+
+pub fn enable_timer_interrupt() {
+    unsafe {
+        sie::set_stimer();
+    }
+}
+
+fn enable_supervisor_interrupt() {
+    unsafe {
+        sstatus::set_sie();
+    }
+}
+
+fn disable_supervisor_interrupt() {
+    unsafe {
+        sstatus::clear_sie();
+    }
+}
+
+#[no_mangle]
+pub fn trap_handler() -> ! {
+    set_kernel_trap_entry();
+    let scause = scause::read();
+    let stval = stval::read();
+    // println!("into {:?}", scause.cause());
+    match scause.cause() {
+        Trap::Exception(Exception::UserEnvCall) => {
+            // jump to next instruction anyway
+            let mut cx = current_trap_cx();
+            cx.sepc += 4;
+
+            enable_supervisor_interrupt();
+
+            // get system call return value
+            let result = syscall(cx.x[17], [cx.x[10], cx.x[11], cx.x[12]]);
+            // cx is changed during sys_exec, so we have to call it again
+            cx = current_trap_cx();
+            cx.x[10] = result as usize;
+        }
+        Trap::Exception(Exception::StoreFault)
+        | Trap::Exception(Exception::StorePageFault)
+        | Trap::Exception(Exception::InstructionFault)
+        | Trap::Exception(Exception::InstructionPageFault)
+        | Trap::Exception(Exception::LoadFault)
+        | Trap::Exception(Exception::LoadPageFault) => {
+            /*
+            println!(
+                "[kernel] {:?} in application, bad addr = {:#x}, bad instruction = {:#x}, kernel killed it.",
+                scause.cause(),
+                stval,
+                current_trap_cx().sepc,
+            );
+            */
+            current_add_signal(SignalFlags::SIGSEGV);
+        }
+        Trap::Exception(Exception::IllegalInstruction) => {
+            current_add_signal(SignalFlags::SIGILL);
+        }
+        Trap::Interrupt(Interrupt::SupervisorTimer) => {
+            set_next_trigger();
+            check_timer();
+            suspend_current_and_run_next();
+        }
+        Trap::Interrupt(Interrupt::SupervisorExternal) => {
+            crate::board::irq_handler();
+        }
+        _ => {
+            panic!(
+                "Unsupported trap {:?}, stval = {:#x}!",
+                scause.cause(),
+                stval
+            );
+        }
+    }
+    // check signals
+    if let Some((errno, msg)) = check_signals_of_current() {
+        println!("[kernel] {}", msg);
+        exit_current_and_run_next(errno);
+    }
+    trap_return();
+}
+
+#[no_mangle]
+pub fn trap_return() -> ! {
+    disable_supervisor_interrupt();
+    set_user_trap_entry();
+    let trap_cx_user_va = current_trap_cx_user_va();
+    let user_satp = current_user_token();
+    extern "C" {
+        fn __alltraps();
+        fn __restore();
+    }
+    let restore_va = __restore as usize - __alltraps as usize + TRAMPOLINE;
+    //println!("before return");
+    unsafe {
+        asm!(
+            "fence.i",
+            "jr {restore_va}",
+            restore_va = in(reg) restore_va,
+            in("a0") trap_cx_user_va,
+            in("a1") user_satp,
+            options(noreturn)
+        );
+    }
+}
+
+#[no_mangle]
+pub fn trap_from_kernel(_trap_cx: &TrapContext) {
+    let scause = scause::read();
+    let stval = stval::read();
+    match scause.cause() {
+        Trap::Interrupt(Interrupt::SupervisorExternal) => {
+            crate::board::irq_handler();
+        }
+        Trap::Interrupt(Interrupt::SupervisorTimer) => {
+            set_next_trigger();
+            check_timer();
+            // do not schedule now
+        }
+        _ => {
+            panic!(
+                "Unsupported trap from kernel: {:?}, stval = {:#x}!",
+                scause.cause(),
+                stval
+            );
+        }
+    }
+}
+
+pub use context::TrapContext;
+
+
\ No newline at end of file diff --git a/ch9-gui-dev/storage.js b/ch9-gui-dev/storage.js new file mode 100644 index 00000000..07f8962f --- /dev/null +++ b/ch9-gui-dev/storage.js @@ -0,0 +1 @@ +"use strict";const darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");window.mainTheme=document.getElementById("mainThemeStyle");window.RUSTDOC_MOBILE_BREAKPOINT=701;const settingsDataset=(function(){const settingsElement=document.getElementById("default-settings");if(settingsElement===null){return null}const dataset=settingsElement.dataset;if(dataset===undefined){return null}return dataset})();function getSettingValue(settingName){const current=getCurrentValue(settingName);if(current!==null){return current}if(settingsDataset!==null){const def=settingsDataset[settingName.replace(/-/g,"_")];if(def!==undefined){return def}}return null}const localStoredTheme=getSettingValue("theme");const savedHref=[];function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(!elem||!elem.classList){return}elem.classList.add(className)}function removeClass(elem,className){if(!elem||!elem.classList){return}elem.classList.remove(className)}function onEach(arr,func,reversed){if(arr&&arr.length>0&&func){if(reversed){const length=arr.length;for(let i=length-1;i>=0;--i){if(func(arr[i])){return true}}}else{for(const elem of arr){if(func(elem)){return true}}}}return false}function onEachLazy(lazyArray,func,reversed){return onEach(Array.prototype.slice.call(lazyArray),func,reversed)}function updateLocalStorage(name,value){try{window.localStorage.setItem("rustdoc-"+name,value)}catch(e){}}function getCurrentValue(name){try{return window.localStorage.getItem("rustdoc-"+name)}catch(e){return null}}function switchTheme(styleElem,mainStyleElem,newTheme,saveTheme){const newHref=mainStyleElem.href.replace(/\/rustdoc([^/]*)\.css/,"/"+newTheme+"$1"+".css");if(saveTheme){updateLocalStorage("theme",newTheme)}if(styleElem.href===newHref){return}let found=false;if(savedHref.length===0){onEachLazy(document.getElementsByTagName("link"),el=>{savedHref.push(el.href)})}onEach(savedHref,el=>{if(el===newHref){found=true;return true}});if(found){styleElem.href=newHref}}function useSystemTheme(value){if(value===undefined){value=true}updateLocalStorage("use-system-theme",value);const toggle=document.getElementById("use-system-theme");if(toggle&&toggle instanceof HTMLInputElement){toggle.checked=value}}const updateSystemTheme=(function(){if(!window.matchMedia){return()=>{const cssTheme=getComputedStyle(document.documentElement).getPropertyValue("content");switchTheme(window.currentTheme,window.mainTheme,JSON.parse(cssTheme)||"light",true)}}const mql=window.matchMedia("(prefers-color-scheme: dark)");function handlePreferenceChange(mql){const use=theme=>{switchTheme(window.currentTheme,window.mainTheme,theme,true)};if(getSettingValue("use-system-theme")!=="false"){const lightTheme=getSettingValue("preferred-light-theme")||"light";const darkTheme=getSettingValue("preferred-dark-theme")||"dark";if(mql.matches){use(darkTheme)}else{use(lightTheme)}}else{use(getSettingValue("theme"))}}mql.addListener(handlePreferenceChange);return()=>{handlePreferenceChange(mql)}})();function switchToSavedTheme(){switchTheme(window.currentTheme,window.mainTheme,getSettingValue("theme")||"light",false)}if(getSettingValue("use-system-theme")!=="false"&&window.matchMedia){if(getSettingValue("use-system-theme")===null&&getSettingValue("preferred-dark-theme")===null&&darkThemes.indexOf(localStoredTheme)>=0){updateLocalStorage("preferred-dark-theme",localStoredTheme)}updateSystemTheme()}else{switchToSavedTheme()}if(getSettingValue("source-sidebar-show")==="true"){addClass(document.documentElement,"source-sidebar-expanded")}window.addEventListener("pageshow",ev=>{if(ev.persisted){setTimeout(switchToSavedTheme,0)}}) \ No newline at end of file diff --git a/ch9-gui-dev/toggle-minus.svg b/ch9-gui-dev/toggle-minus.svg new file mode 100644 index 00000000..73154788 --- /dev/null +++ b/ch9-gui-dev/toggle-minus.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ch9-gui-dev/toggle-plus.svg b/ch9-gui-dev/toggle-plus.svg new file mode 100644 index 00000000..08b17033 --- /dev/null +++ b/ch9-gui-dev/toggle-plus.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ch9-gui-dev/wheel.svg b/ch9-gui-dev/wheel.svg new file mode 100644 index 00000000..01da3b24 --- /dev/null +++ b/ch9-gui-dev/wheel.svg @@ -0,0 +1 @@ + \ No newline at end of file