From 5b1b45bbf990b3f373be9edea8fbd7bcd7811560 Mon Sep 17 00:00:00 2001 From: wyfcyx Date: Fri, 13 May 2022 07:59:46 +0000 Subject: [PATCH] deploy: 326b97a9fa0716b91edb08b4da12dc1365c2e4bc --- ch4/os/mm/address/index.html | 2 +- ch4/os/mm/address/struct.PhysAddr.html | 6 +++--- ch4/os/mm/address/struct.PhysPageNum.html | 6 +++--- ch4/os/mm/address/struct.SimpleRange.html | 10 +++++----- ch4/os/mm/address/struct.SimpleRangeIterator.html | 6 +++--- ch4/os/mm/address/struct.VirtAddr.html | 8 ++++---- ch4/os/mm/address/struct.VirtPageNum.html | 10 +++++----- ch4/os/mm/address/trait.StepByOne.html | 4 ++-- ch4/os/mm/address/type.VPNRange.html | 2 +- ch4/src/os/mm/address.rs.html | 10 +++++++++- 10 files changed, 36 insertions(+), 28 deletions(-) diff --git a/ch4/os/mm/address/index.html b/ch4/os/mm/address/index.html index 8c01c501..2d2a5c30 100644 --- a/ch4/os/mm/address/index.html +++ b/ch4/os/mm/address/index.html @@ -4,7 +4,7 @@
-

Module os::mm::address

source · []
Expand description

Implementation of physical and virtual address and page number.

+

Module os::mm::address

source · []
Expand description

Implementation of physical and virtual address and page number.

Structs

Definitions

physical page number

diff --git a/ch4/os/mm/address/struct.PhysAddr.html b/ch4/os/mm/address/struct.PhysAddr.html index 527d32e5..2b9a11af 100644 --- a/ch4/os/mm/address/struct.PhysAddr.html +++ b/ch4/os/mm/address/struct.PhysAddr.html @@ -5,12 +5,12 @@
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/ch4/os/mm/address/struct.PhysPageNum.html b/ch4/os/mm/address/struct.PhysPageNum.html index 0e3fee07..b6df6bdf 100644 --- a/ch4/os/mm/address/struct.PhysPageNum.html +++ b/ch4/os/mm/address/struct.PhysPageNum.html @@ -5,12 +5,12 @@
pub struct PhysPageNum(pub usize);
Expand description

physical page number

-

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.

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/ch4/os/mm/address/struct.SimpleRange.html b/ch4/os/mm/address/struct.SimpleRange.html index d0a3563a..7590ea6a 100644 --- a/ch4/os/mm/address/struct.SimpleRange.html +++ b/ch4/os/mm/address/struct.SimpleRange.html @@ -4,16 +4,16 @@
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, }
Expand description

a simple range structure for type 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/ch4/os/mm/address/struct.SimpleRangeIterator.html b/ch4/os/mm/address/struct.SimpleRangeIterator.html index db3d7181..5962f942 100644 --- a/ch4/os/mm/address/struct.SimpleRangeIterator.html +++ b/ch4/os/mm/address/struct.SimpleRangeIterator.html @@ -4,12 +4,12 @@
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, }
Expand description

iterator for the simple range structure

-

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/ch4/os/mm/address/struct.VirtAddr.html b/ch4/os/mm/address/struct.VirtAddr.html index 71a46f34..6443f83e 100644 --- a/ch4/os/mm/address/struct.VirtAddr.html +++ b/ch4/os/mm/address/struct.VirtAddr.html @@ -5,13 +5,13 @@
pub struct VirtAddr(pub usize);
Expand description

virtual address

-

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

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/ch4/os/mm/address/struct.VirtPageNum.html b/ch4/os/mm/address/struct.VirtPageNum.html index 5a30f6c1..93c0cab4 100644 --- a/ch4/os/mm/address/struct.VirtPageNum.html +++ b/ch4/os/mm/address/struct.VirtPageNum.html @@ -5,12 +5,12 @@
pub struct VirtPageNum(pub usize);
Expand description

virtual page number

-

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.

+

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

@@ -26,7 +26,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/ch4/os/mm/address/trait.StepByOne.html b/ch4/os/mm/address/trait.StepByOne.html index 93541eb5..eeaa3a0f 100644 --- a/ch4/os/mm/address/trait.StepByOne.html +++ b/ch4/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/ch4/os/mm/address/type.VPNRange.html b/ch4/os/mm/address/type.VPNRange.html index 1bb2610d..daa6ea0f 100644 --- a/ch4/os/mm/address/type.VPNRange.html +++ b/ch4/os/mm/address/type.VPNRange.html @@ -4,6 +4,6 @@
-

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

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

a simple range structure for virtual page number

+

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

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

a simple range structure for virtual page number

\ No newline at end of file diff --git a/ch4/src/os/mm/address.rs.html b/ch4/src/os/mm/address.rs.html index b053aec2..d52f7c79 100644 --- a/ch4/src/os/mm/address.rs.html +++ b/ch4/src/os/mm/address.rs.html @@ -254,6 +254,10 @@ 249 250 251 +252 +253 +254 +255
//! Implementation of physical and virtual address and page number.
 
 use super::PageTableEntry;
@@ -341,7 +345,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 {