From 3cd335d95dbeda70a0e9bd54a86c78bd08aa1726 Mon Sep 17 00:00:00 2001 From: wyfcyx Date: Fri, 13 May 2022 08:04:04 +0000 Subject: [PATCH] deploy: b662f9752d6ee75c78d6068eae7ed8389fee98ff --- ch9/os/mm/address/index.html | 2 +- ch9/os/mm/address/struct.PhysAddr.html | 6 +++--- ch9/os/mm/address/struct.PhysPageNum.html | 8 ++++---- ch9/os/mm/address/struct.SimpleRange.html | 10 +++++----- ch9/os/mm/address/struct.SimpleRangeIterator.html | 6 +++--- ch9/os/mm/address/struct.VirtAddr.html | 8 ++++---- ch9/os/mm/address/struct.VirtPageNum.html | 10 +++++----- ch9/os/mm/address/trait.StepByOne.html | 4 ++-- ch9/os/mm/address/type.VPNRange.html | 2 +- ch9/src/os/mm/address.rs.html | 10 +++++++++- 10 files changed, 37 insertions(+), 29 deletions(-) diff --git a/ch9/os/mm/address/index.html b/ch9/os/mm/address/index.html index 9497d914..0e952582 100644 --- a/ch9/os/mm/address/index.html +++ b/ch9/os/mm/address/index.html @@ -4,7 +4,7 @@
-

Module os::mm::address

source · []

Structs

+

Module os::mm::address

source · []

Structs

Constants

Traits

diff --git a/ch9/os/mm/address/struct.PhysAddr.html b/ch9/os/mm/address/struct.PhysAddr.html index 4cc80990..77d94f1a 100644 --- a/ch9/os/mm/address/struct.PhysAddr.html +++ b/ch9/os/mm/address/struct.PhysAddr.html @@ -5,12 +5,12 @@
#[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

+

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.

+

Converts to this type from the input type.

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

diff --git a/ch9/os/mm/address/struct.PhysPageNum.html b/ch9/os/mm/address/struct.PhysPageNum.html index e47184f1..7e99effe 100644 --- a/ch9/os/mm/address/struct.PhysPageNum.html +++ b/ch9/os/mm/address/struct.PhysPageNum.html @@ -4,12 +4,12 @@
#[repr(C)]
pub struct PhysPageNum(pub usize);

Tuple Fields

0: usize

Implementations

Trait Implementations

Returns a copy of the value. Read more

+

Struct os::mm::address::PhysPageNum

source · []
#[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.

+

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

@@ -25,7 +25,7 @@ operator.

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

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

diff --git a/ch9/os/mm/address/struct.SimpleRange.html b/ch9/os/mm/address/struct.SimpleRange.html index ef54a37f..64873661 100644 --- a/ch9/os/mm/address/struct.SimpleRange.html +++ b/ch9/os/mm/address/struct.SimpleRange.html @@ -4,15 +4,15 @@
pub struct SimpleRange<T> where
    T: StepByOne + Copy + PartialEq + PartialOrd + Debug
{ +

Struct os::mm::address::SimpleRange

source · []
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

+}

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.

+

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

+

Creates an iterator from a value. Read more

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

diff --git a/ch9/os/mm/address/struct.SimpleRangeIterator.html b/ch9/os/mm/address/struct.SimpleRangeIterator.html index 2ff2157c..3449b108 100644 --- a/ch9/os/mm/address/struct.SimpleRangeIterator.html +++ b/ch9/os/mm/address/struct.SimpleRangeIterator.html @@ -4,11 +4,11 @@
pub struct SimpleRangeIterator<T> where
    T: StepByOne + Copy + PartialEq + PartialOrd + Debug
{ +

Struct os::mm::address::SimpleRangeIterator

source · []
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

+}

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

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

diff --git a/ch9/os/mm/address/struct.VirtAddr.html b/ch9/os/mm/address/struct.VirtAddr.html index f9d83ce2..49d2c944 100644 --- a/ch9/os/mm/address/struct.VirtAddr.html +++ b/ch9/os/mm/address/struct.VirtAddr.html @@ -4,13 +4,13 @@
-

Struct os::mm::address::VirtAddr

source · []
#[repr(C)]
pub struct VirtAddr(pub usize);

Tuple Fields

0: usize

Implementations

Trait Implementations

Returns a copy of the value. Read more

+

Struct os::mm::address::VirtAddr

source · []
#[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.

+

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

diff --git a/ch9/os/mm/address/struct.VirtPageNum.html b/ch9/os/mm/address/struct.VirtPageNum.html index 9749bdc5..e609f51f 100644 --- a/ch9/os/mm/address/struct.VirtPageNum.html +++ b/ch9/os/mm/address/struct.VirtPageNum.html @@ -4,12 +4,12 @@
#[repr(C)]
pub struct VirtPageNum(pub usize);

Tuple Fields

0: usize

Implementations

Trait Implementations

Returns a copy of the value. Read more

+

Struct os::mm::address::VirtPageNum

source · []
#[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.

+

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

@@ -25,7 +25,7 @@ operator.

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

+

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

diff --git a/ch9/os/mm/address/trait.StepByOne.html b/ch9/os/mm/address/trait.StepByOne.html index 1e7ad700..91ad1511 100644 --- a/ch9/os/mm/address/trait.StepByOne.html +++ b/ch9/os/mm/address/trait.StepByOne.html @@ -4,7 +4,7 @@
pub trait StepByOne {
+    

Trait os::mm::address::StepByOne

source · []
pub trait StepByOne {
     fn step(&mut self);
-}

Required methods

Implementors

+}

Required methods

Implementors

\ No newline at end of file diff --git a/ch9/os/mm/address/type.VPNRange.html b/ch9/os/mm/address/type.VPNRange.html index cbcf60e8..30f6164b 100644 --- a/ch9/os/mm/address/type.VPNRange.html +++ b/ch9/os/mm/address/type.VPNRange.html @@ -4,5 +4,5 @@
-

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

source · []
pub type VPNRange = SimpleRange<VirtPageNum>;
+

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

source · []
pub type VPNRange = SimpleRange<VirtPageNum>;
\ No newline at end of file diff --git a/ch9/src/os/mm/address.rs.html b/ch9/src/os/mm/address.rs.html index dd3416e5..441aea72 100644 --- a/ch9/src/os/mm/address.rs.html +++ b/ch9/src/os/mm/address.rs.html @@ -261,6 +261,10 @@ 256 257 258 +259 +260 +261 +262
use super::PageTableEntry;
 use crate::config::{PAGE_SIZE, PAGE_SIZE_BITS};
 use core::fmt::{self, Debug, Formatter};
@@ -346,7 +350,11 @@
 }
 impl From<VirtAddr> for usize {
     fn from(v: VirtAddr) -> Self {
-        v.0
+        if v.0 >= (1 << (VA_WIDTH_SV39 - 1)) {
+            v.0 | (!((1 << VA_WIDTH_SV39) - 1))
+        } else {
+            v.0
+        }
     }
 }
 impl From<VirtPageNum> for usize {