diff --git a/.lock b/.lock new file mode 100644 index 0000000..e69de29 diff --git a/crates.js b/crates.js new file mode 100644 index 0000000..ae84c42 --- /dev/null +++ b/crates.js @@ -0,0 +1 @@ +window.ALL_CRATES = ["polyhal"]; \ No newline at end of file diff --git a/help.html b/help.html new file mode 100644 index 0000000..3ea2452 --- /dev/null +++ b/help.html @@ -0,0 +1 @@ +Help

Rustdoc help

Back
\ No newline at end of file diff --git a/polyhal/addr/index.html b/polyhal/addr/index.html new file mode 100644 index 0000000..2f36a05 --- /dev/null +++ b/polyhal/addr/index.html @@ -0,0 +1 @@ +polyhal::addr - Rust

Module polyhal::addr

source ·

Structs

\ No newline at end of file diff --git a/polyhal/addr/sidebar-items.js b/polyhal/addr/sidebar-items.js new file mode 100644 index 0000000..f064274 --- /dev/null +++ b/polyhal/addr/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["PhysAddr","PhysPage","VirtAddr","VirtPage"]}; \ No newline at end of file diff --git a/polyhal/addr/struct.PhysAddr.html b/polyhal/addr/struct.PhysAddr.html new file mode 100644 index 0000000..dd58d62 --- /dev/null +++ b/polyhal/addr/struct.PhysAddr.html @@ -0,0 +1,20 @@ +PhysAddr in polyhal::addr - Rust

Struct polyhal::addr::PhysAddr

source ·
#[repr(C)]
pub struct PhysAddr(/* private fields */);

Implementations§

source§

impl PhysAddr

source

pub fn addr(&self) -> usize

source

pub fn get_ptr<T>(&self) -> *const T

source

pub const fn get_mut_ptr<T>(&self) -> *mut T

source

pub fn write_volatile<T>(&self, v: T)

source

pub fn slice_with_len<T>(&self, len: usize) -> &'static [T]

source

pub fn slice_mut_with_len<T>(&self, len: usize) -> &'static mut [T]

source

pub fn get_cstr(&self) -> &CStr

source§

impl PhysAddr

source

pub const fn new(addr: usize) -> Self

Trait Implementations§

source§

impl Clone for PhysAddr

source§

fn clone(&self) -> PhysAddr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PhysAddr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for PhysAddr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<PhysAddr> for PhysPage

source§

fn from(value: PhysAddr) -> Self

Converts to this type from the input type.
source§

impl From<PhysPage> for PhysAddr

source§

fn from(value: PhysPage) -> Self

Converts to this type from the input type.
source§

impl Ord for PhysAddr

source§

fn cmp(&self, other: &PhysAddr) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for PhysAddr

source§

fn eq(&self, other: &PhysAddr) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PhysAddr

source§

fn partial_cmp(&self, other: &PhysAddr) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl Copy for PhysAddr

source§

impl Eq for PhysAddr

source§

impl StructuralEq for PhysAddr

source§

impl StructuralPartialEq for PhysAddr

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/addr/struct.PhysPage.html b/polyhal/addr/struct.PhysPage.html new file mode 100644 index 0000000..049731a --- /dev/null +++ b/polyhal/addr/struct.PhysPage.html @@ -0,0 +1,20 @@ +PhysPage in polyhal::addr - Rust

Struct polyhal::addr::PhysPage

source ·
pub struct PhysPage(/* private fields */);

Implementations§

source§

impl PhysPage

source

pub const fn new(ppn: usize) -> Self

source

pub const fn from_addr(addr: usize) -> Self

source

pub const fn to_addr(&self) -> usize

source

pub const fn get_buffer(&self) -> &'static mut [u8]

source

pub fn copy_value_from_another(&self, ppn: PhysPage)

source

pub fn drop_clear(&self)

source

pub fn as_num(&self) -> usize

Trait Implementations§

source§

impl Add<usize> for PhysPage

§

type Output = PhysPage

The resulting type after applying the + operator.
source§

fn add(self, rhs: usize) -> Self::Output

Performs the + operation. Read more
source§

impl Add for PhysPage

§

type Output = PhysPage

The resulting type after applying the + operator.
source§

fn add(self, rhs: PhysPage) -> Self::Output

Performs the + operation. Read more
source§

impl Clone for PhysPage

source§

fn clone(&self) -> PhysPage

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PhysPage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for PhysPage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<PhysAddr> for PhysPage

source§

fn from(value: PhysAddr) -> Self

Converts to this type from the input type.
source§

impl From<PhysPage> for PhysAddr

source§

fn from(value: PhysPage) -> Self

Converts to this type from the input type.
source§

impl From<PhysPage> for usize

source§

fn from(value: PhysPage) -> Self

Converts to this type from the input type.
source§

impl From<usize> for PhysPage

source§

fn from(value: usize) -> Self

Converts to this type from the input type.
source§

impl Ord for PhysPage

source§

fn cmp(&self, other: &PhysPage) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for PhysPage

source§

fn eq(&self, other: &PhysPage) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PhysPage

source§

fn partial_cmp(&self, other: &PhysPage) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl Copy for PhysPage

source§

impl Eq for PhysPage

source§

impl StructuralEq for PhysPage

source§

impl StructuralPartialEq for PhysPage

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/addr/struct.VirtAddr.html b/polyhal/addr/struct.VirtAddr.html new file mode 100644 index 0000000..af3f934 --- /dev/null +++ b/polyhal/addr/struct.VirtAddr.html @@ -0,0 +1,21 @@ +VirtAddr in polyhal::addr - Rust

Struct polyhal::addr::VirtAddr

source ·
pub struct VirtAddr(/* private fields */);

Implementations§

source§

impl VirtAddr

source

pub fn addr(&self) -> usize

source

pub fn get_ptr<T>(&self) -> *const T

source

pub fn get_mut_ptr<T>(&self) -> *mut T

source

pub fn get_ref<T>(&self) -> &'static T

source

pub fn get_mut_ref<T>(&self) -> &'static mut T

source

pub fn slice_with_len<T>(&self, len: usize) -> &'static [T]

source

pub fn slice_mut_with_len<T>(&self, len: usize) -> &'static mut [T]

source

pub fn slice_until<T>(&self, is_valid: fn(_: T) -> bool) -> &'static mut [T]

source

pub fn get_cstr(&self) -> &CStr

source

pub fn floor(&self) -> Self

source

pub fn ceil(&self) -> Self

source§

impl VirtAddr

source

pub const fn new(addr: usize) -> Self

source§

impl VirtAddr

source

pub fn pn_offest(&self, n: usize) -> usize

Get n level page table offset of the given virtual address

+

Trait Implementations§

source§

impl Clone for VirtAddr

source§

fn clone(&self) -> VirtAddr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VirtAddr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for VirtAddr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<VirtAddr> for VirtPage

source§

fn from(value: VirtAddr) -> Self

Converts to this type from the input type.
source§

impl From<VirtAddr> for usize

source§

fn from(value: VirtAddr) -> Self

Converts to this type from the input type.
source§

impl From<VirtPage> for VirtAddr

source§

fn from(value: VirtPage) -> Self

Converts to this type from the input type.
source§

impl From<usize> for VirtAddr

source§

fn from(value: usize) -> Self

Converts to this type from the input type.
source§

impl Ord for VirtAddr

source§

fn cmp(&self, other: &VirtAddr) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for VirtAddr

source§

fn eq(&self, other: &VirtAddr) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for VirtAddr

source§

fn partial_cmp(&self, other: &VirtAddr) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl Copy for VirtAddr

source§

impl Eq for VirtAddr

source§

impl StructuralEq for VirtAddr

source§

impl StructuralPartialEq for VirtAddr

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/addr/struct.VirtPage.html b/polyhal/addr/struct.VirtPage.html new file mode 100644 index 0000000..128f4c7 --- /dev/null +++ b/polyhal/addr/struct.VirtPage.html @@ -0,0 +1,21 @@ +VirtPage in polyhal::addr - Rust

Struct polyhal::addr::VirtPage

source ·
pub struct VirtPage(/* private fields */);

Implementations§

source§

impl VirtPage

source

pub const fn new(vpn: usize) -> Self

source

pub const fn from_addr(addr: usize) -> Self

source

pub const fn to_addr(&self) -> usize

source§

impl VirtPage

source

pub fn pn_index(&self, n: usize) -> usize

Get n level page table index of the given virtual address

+

Trait Implementations§

source§

impl Add<usize> for VirtPage

§

type Output = VirtPage

The resulting type after applying the + operator.
source§

fn add(self, rhs: usize) -> Self::Output

Performs the + operation. Read more
source§

impl Clone for VirtPage

source§

fn clone(&self) -> VirtPage

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VirtPage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for VirtPage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<VirtAddr> for VirtPage

source§

fn from(value: VirtAddr) -> Self

Converts to this type from the input type.
source§

impl From<VirtPage> for VirtAddr

source§

fn from(value: VirtPage) -> Self

Converts to this type from the input type.
source§

impl From<usize> for VirtPage

source§

fn from(value: usize) -> Self

Converts to this type from the input type.
source§

impl Ord for VirtPage

source§

fn cmp(&self, other: &VirtPage) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for VirtPage

source§

fn eq(&self, other: &VirtPage) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for VirtPage

source§

fn partial_cmp(&self, other: &VirtPage) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl Copy for VirtPage

source§

impl Eq for VirtPage

source§

impl StructuralEq for VirtPage

source§

impl StructuralPartialEq for VirtPage

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/all.html b/polyhal/all.html new file mode 100644 index 0000000..f724c80 --- /dev/null +++ b/polyhal/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Traits

Macros

Attribute Macros

Functions

Constants

\ No newline at end of file diff --git a/polyhal/attr.arch_entry.html b/polyhal/attr.arch_entry.html new file mode 100644 index 0000000..24f9900 --- /dev/null +++ b/polyhal/attr.arch_entry.html @@ -0,0 +1 @@ +arch_entry in polyhal - Rust

Attribute Macro polyhal::arch_entry

#[arch_entry]
\ No newline at end of file diff --git a/polyhal/attr.arch_interrupt.html b/polyhal/attr.arch_interrupt.html new file mode 100644 index 0000000..bba945a --- /dev/null +++ b/polyhal/attr.arch_interrupt.html @@ -0,0 +1 @@ +arch_interrupt in polyhal - Rust

Attribute Macro polyhal::arch_interrupt

#[arch_interrupt]
\ No newline at end of file diff --git a/polyhal/boot/constant.STACK_SIZE.html b/polyhal/boot/constant.STACK_SIZE.html new file mode 100644 index 0000000..4720d6b --- /dev/null +++ b/polyhal/boot/constant.STACK_SIZE.html @@ -0,0 +1,3 @@ +STACK_SIZE in polyhal::boot - Rust

Constant polyhal::boot::STACK_SIZE

source ·
pub const STACK_SIZE: usize = 0x8_0000;
Expand description

Boot Stack Size. +TODO: reduce the boot stack size. Map stack in boot step.

+
\ No newline at end of file diff --git a/polyhal/boot/fn.boot_page_table.html b/polyhal/boot/fn.boot_page_table.html new file mode 100644 index 0000000..eba4784 --- /dev/null +++ b/polyhal/boot/fn.boot_page_table.html @@ -0,0 +1,2 @@ +boot_page_table in polyhal::boot - Rust

Function polyhal::boot::boot_page_table

source ·
pub fn boot_page_table() -> PageTable
Expand description

Get Boot Page Table.

+
\ No newline at end of file diff --git a/polyhal/boot/index.html b/polyhal/boot/index.html new file mode 100644 index 0000000..52b12e6 --- /dev/null +++ b/polyhal/boot/index.html @@ -0,0 +1,3 @@ +polyhal::boot - Rust

Module polyhal::boot

source ·
Expand description

Boot Components.

+

Constants

  • Boot Stack Size. +TODO: reduce the boot stack size. Map stack in boot step.

Functions

\ No newline at end of file diff --git a/polyhal/boot/sidebar-items.js b/polyhal/boot/sidebar-items.js new file mode 100644 index 0000000..85bda9b --- /dev/null +++ b/polyhal/boot/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["STACK_SIZE"],"fn":["boot_page_table"]}; \ No newline at end of file diff --git a/polyhal/common/fn.get_cpu_num.html b/polyhal/common/fn.get_cpu_num.html new file mode 100644 index 0000000..3e49ba5 --- /dev/null +++ b/polyhal/common/fn.get_cpu_num.html @@ -0,0 +1,2 @@ +get_cpu_num in polyhal::common - Rust

Function polyhal::common::get_cpu_num

source ·
pub fn get_cpu_num() -> usize
Expand description

Get the number of cpus

+
\ No newline at end of file diff --git a/polyhal/common/fn.get_fdt.html b/polyhal/common/fn.get_fdt.html new file mode 100644 index 0000000..7ebd6b9 --- /dev/null +++ b/polyhal/common/fn.get_fdt.html @@ -0,0 +1,2 @@ +get_fdt in polyhal::common - Rust

Function polyhal::common::get_fdt

source ·
pub fn get_fdt() -> Option<Fdt<'static>>
Expand description

Get the fdt

+
\ No newline at end of file diff --git a/polyhal/common/fn.get_mem_areas.html b/polyhal/common/fn.get_mem_areas.html new file mode 100644 index 0000000..6f53f01 --- /dev/null +++ b/polyhal/common/fn.get_mem_areas.html @@ -0,0 +1,2 @@ +get_mem_areas in polyhal::common - Rust

Function polyhal::common::get_mem_areas

source ·
pub fn get_mem_areas() -> Vec<(usize, usize)>
Expand description

Get the memory area, this function should be called after initialization

+
\ No newline at end of file diff --git a/polyhal/common/fn.init.html b/polyhal/common/fn.init.html new file mode 100644 index 0000000..7a1ea80 --- /dev/null +++ b/polyhal/common/fn.init.html @@ -0,0 +1,3 @@ +init in polyhal::common - Rust

Function polyhal::common::init

source ·
pub fn init(page_alloc: &'static dyn PageAlloc)
Expand description

Init arch with page allocator, like log crate +Please initialize the allocator before calling this function.

+
\ No newline at end of file diff --git a/polyhal/common/index.html b/polyhal/common/index.html new file mode 100644 index 0000000..ad27b6a --- /dev/null +++ b/polyhal/common/index.html @@ -0,0 +1,2 @@ +polyhal::common - Rust

Module polyhal::common

source ·

Traits

  • Page Allocation trait for privoids that page allocation

Functions

  • Get the number of cpus
  • Get the fdt
  • Get the memory area, this function should be called after initialization
  • Init arch with page allocator, like log crate +Please initialize the allocator before calling this function.
\ No newline at end of file diff --git a/polyhal/common/sidebar-items.js b/polyhal/common/sidebar-items.js new file mode 100644 index 0000000..98d62dd --- /dev/null +++ b/polyhal/common/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["get_cpu_num","get_fdt","get_mem_areas","init"],"trait":["PageAlloc"]}; \ No newline at end of file diff --git a/polyhal/common/trait.PageAlloc.html b/polyhal/common/trait.PageAlloc.html new file mode 100644 index 0000000..75ed771 --- /dev/null +++ b/polyhal/common/trait.PageAlloc.html @@ -0,0 +1,8 @@ +PageAlloc in polyhal::common - Rust

Trait polyhal::common::PageAlloc

source ·
pub trait PageAlloc: Sync {
+    // Required methods
+    fn alloc(&self) -> PhysPage;
+    fn dealloc(&self, ppn: PhysPage);
+}
Expand description

Page Allocation trait for privoids that page allocation

+

Required Methods§

source

fn alloc(&self) -> PhysPage

Allocate a physical page

+
source

fn dealloc(&self, ppn: PhysPage)

Release a physical page

+

Implementors§

\ No newline at end of file diff --git a/polyhal/components/boot/constant.STACK_SIZE.html b/polyhal/components/boot/constant.STACK_SIZE.html new file mode 100644 index 0000000..b636be1 --- /dev/null +++ b/polyhal/components/boot/constant.STACK_SIZE.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/boot/constant.STACK_SIZE.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/boot/index.html b/polyhal/components/boot/index.html new file mode 100644 index 0000000..88aeeea --- /dev/null +++ b/polyhal/components/boot/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/boot/index.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/boot/riscv64/fn.boot_page_table.html b/polyhal/components/boot/riscv64/fn.boot_page_table.html new file mode 100644 index 0000000..a0498c2 --- /dev/null +++ b/polyhal/components/boot/riscv64/fn.boot_page_table.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../polyhal/boot/fn.boot_page_table.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/common/fn.get_cpu_num.html b/polyhal/components/common/fn.get_cpu_num.html new file mode 100644 index 0000000..d26aab5 --- /dev/null +++ b/polyhal/components/common/fn.get_cpu_num.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/common/fn.get_cpu_num.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/common/fn.get_fdt.html b/polyhal/components/common/fn.get_fdt.html new file mode 100644 index 0000000..da30201 --- /dev/null +++ b/polyhal/components/common/fn.get_fdt.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/common/fn.get_fdt.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/common/fn.get_mem_areas.html b/polyhal/components/common/fn.get_mem_areas.html new file mode 100644 index 0000000..175778c --- /dev/null +++ b/polyhal/components/common/fn.get_mem_areas.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/common/fn.get_mem_areas.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/common/fn.init.html b/polyhal/components/common/fn.init.html new file mode 100644 index 0000000..fa6bd2e --- /dev/null +++ b/polyhal/components/common/fn.init.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/common/fn.init.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/common/index.html b/polyhal/components/common/index.html new file mode 100644 index 0000000..b4d96c1 --- /dev/null +++ b/polyhal/components/common/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/common/index.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/common/trait.PageAlloc.html b/polyhal/components/common/trait.PageAlloc.html new file mode 100644 index 0000000..23f790a --- /dev/null +++ b/polyhal/components/common/trait.PageAlloc.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/common/trait.PageAlloc.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/consts/constant.VIRT_ADDR_START.html b/polyhal/components/consts/constant.VIRT_ADDR_START.html new file mode 100644 index 0000000..ee3a792 --- /dev/null +++ b/polyhal/components/consts/constant.VIRT_ADDR_START.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/consts/constant.VIRT_ADDR_START.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/consts/index.html b/polyhal/components/consts/index.html new file mode 100644 index 0000000..0e0dbd1 --- /dev/null +++ b/polyhal/components/consts/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/consts/index.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/consts/riscv64/constant.MULTI_CORE_AREA.html b/polyhal/components/consts/riscv64/constant.MULTI_CORE_AREA.html new file mode 100644 index 0000000..78612cd --- /dev/null +++ b/polyhal/components/consts/riscv64/constant.MULTI_CORE_AREA.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../polyhal/consts/constant.MULTI_CORE_AREA.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/consts/riscv64/constant.MULTI_CORE_AREA_SIZE.html b/polyhal/components/consts/riscv64/constant.MULTI_CORE_AREA_SIZE.html new file mode 100644 index 0000000..87b758a --- /dev/null +++ b/polyhal/components/consts/riscv64/constant.MULTI_CORE_AREA_SIZE.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../polyhal/consts/constant.MULTI_CORE_AREA_SIZE.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/debug_console/index.html b/polyhal/components/debug_console/index.html new file mode 100644 index 0000000..7465dd8 --- /dev/null +++ b/polyhal/components/debug_console/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/debug_console/index.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/debug_console/struct.DebugConsole.html b/polyhal/components/debug_console/struct.DebugConsole.html new file mode 100644 index 0000000..4070d2e --- /dev/null +++ b/polyhal/components/debug_console/struct.DebugConsole.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/debug_console/struct.DebugConsole.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/instruction/index.html b/polyhal/components/instruction/index.html new file mode 100644 index 0000000..b2c3eff --- /dev/null +++ b/polyhal/components/instruction/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/instruction/index.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/instruction/struct.Instruction.html b/polyhal/components/instruction/struct.Instruction.html new file mode 100644 index 0000000..e1b83c6 --- /dev/null +++ b/polyhal/components/instruction/struct.Instruction.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/instruction/struct.Instruction.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/irq/index.html b/polyhal/components/irq/index.html new file mode 100644 index 0000000..0f85f86 --- /dev/null +++ b/polyhal/components/irq/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/irq/index.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/irq/struct.IRQ.html b/polyhal/components/irq/struct.IRQ.html new file mode 100644 index 0000000..3fbada4 --- /dev/null +++ b/polyhal/components/irq/struct.IRQ.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/irq/struct.IRQ.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/irq/struct.IRQVector.html b/polyhal/components/irq/struct.IRQVector.html new file mode 100644 index 0000000..44f30dd --- /dev/null +++ b/polyhal/components/irq/struct.IRQVector.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/irq/struct.IRQVector.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/kcontext/enum.KContextArgs.html b/polyhal/components/kcontext/enum.KContextArgs.html new file mode 100644 index 0000000..c63b7d1 --- /dev/null +++ b/polyhal/components/kcontext/enum.KContextArgs.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/kcontext/enum.KContextArgs.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/kcontext/index.html b/polyhal/components/kcontext/index.html new file mode 100644 index 0000000..220e644 --- /dev/null +++ b/polyhal/components/kcontext/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/kcontext/index.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/kcontext/riscv64/fn.context_switch.html b/polyhal/components/kcontext/riscv64/fn.context_switch.html new file mode 100644 index 0000000..3d8c461 --- /dev/null +++ b/polyhal/components/kcontext/riscv64/fn.context_switch.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../polyhal/kcontext/fn.context_switch.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/kcontext/riscv64/fn.context_switch_pt.html b/polyhal/components/kcontext/riscv64/fn.context_switch_pt.html new file mode 100644 index 0000000..078291b --- /dev/null +++ b/polyhal/components/kcontext/riscv64/fn.context_switch_pt.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../polyhal/kcontext/fn.context_switch_pt.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/kcontext/riscv64/fn.read_current_tp.html b/polyhal/components/kcontext/riscv64/fn.read_current_tp.html new file mode 100644 index 0000000..7d96630 --- /dev/null +++ b/polyhal/components/kcontext/riscv64/fn.read_current_tp.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../polyhal/kcontext/fn.read_current_tp.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/kcontext/riscv64/struct.KContext.html b/polyhal/components/kcontext/riscv64/struct.KContext.html new file mode 100644 index 0000000..a2959d2 --- /dev/null +++ b/polyhal/components/kcontext/riscv64/struct.KContext.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../polyhal/kcontext/struct.KContext.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/macros/index.html b/polyhal/components/macros/index.html new file mode 100644 index 0000000..1752b0a --- /dev/null +++ b/polyhal/components/macros/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/macros/index.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/mem/index.html b/polyhal/components/mem/index.html new file mode 100644 index 0000000..6331a5a --- /dev/null +++ b/polyhal/components/mem/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/mem/index.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/mem/struct.Barrier.html b/polyhal/components/mem/struct.Barrier.html new file mode 100644 index 0000000..c089413 --- /dev/null +++ b/polyhal/components/mem/struct.Barrier.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/mem/struct.Barrier.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/multicore/index.html b/polyhal/components/multicore/index.html new file mode 100644 index 0000000..b737bea --- /dev/null +++ b/polyhal/components/multicore/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/multicore/index.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/multicore/riscv64/fn.boot_core.html b/polyhal/components/multicore/riscv64/fn.boot_core.html new file mode 100644 index 0000000..36f9d34 --- /dev/null +++ b/polyhal/components/multicore/riscv64/fn.boot_core.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../polyhal/multicore/fn.boot_core.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/multicore/struct.CpuCore.html b/polyhal/components/multicore/struct.CpuCore.html new file mode 100644 index 0000000..030cbca --- /dev/null +++ b/polyhal/components/multicore/struct.CpuCore.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/multicore/struct.CpuCore.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/multicore/struct.MultiCore.html b/polyhal/components/multicore/struct.MultiCore.html new file mode 100644 index 0000000..d45f3ae --- /dev/null +++ b/polyhal/components/multicore/struct.MultiCore.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/multicore/struct.MultiCore.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/pagetable/constant.PAGE_SIZE.html b/polyhal/components/pagetable/constant.PAGE_SIZE.html new file mode 100644 index 0000000..d7e16eb --- /dev/null +++ b/polyhal/components/pagetable/constant.PAGE_SIZE.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/pagetable/constant.PAGE_SIZE.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/pagetable/constant.USER_VADDR_END.html b/polyhal/components/pagetable/constant.USER_VADDR_END.html new file mode 100644 index 0000000..bf3294a --- /dev/null +++ b/polyhal/components/pagetable/constant.USER_VADDR_END.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/pagetable/constant.USER_VADDR_END.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/pagetable/enum.MappingSize.html b/polyhal/components/pagetable/enum.MappingSize.html new file mode 100644 index 0000000..fd8abf5 --- /dev/null +++ b/polyhal/components/pagetable/enum.MappingSize.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/pagetable/enum.MappingSize.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/pagetable/index.html b/polyhal/components/pagetable/index.html new file mode 100644 index 0000000..0126bf8 --- /dev/null +++ b/polyhal/components/pagetable/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/pagetable/index.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/pagetable/riscv64/struct.PTEFlags.html b/polyhal/components/pagetable/riscv64/struct.PTEFlags.html new file mode 100644 index 0000000..d04c738 --- /dev/null +++ b/polyhal/components/pagetable/riscv64/struct.PTEFlags.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../polyhal/pagetable/struct.PTEFlags.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/pagetable/struct.MappingFlags.html b/polyhal/components/pagetable/struct.MappingFlags.html new file mode 100644 index 0000000..ec515ba --- /dev/null +++ b/polyhal/components/pagetable/struct.MappingFlags.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/pagetable/struct.MappingFlags.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/pagetable/struct.PageTable.html b/polyhal/components/pagetable/struct.PageTable.html new file mode 100644 index 0000000..410dd4e --- /dev/null +++ b/polyhal/components/pagetable/struct.PageTable.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/pagetable/struct.PageTable.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/pagetable/struct.PageTableWrapper.html b/polyhal/components/pagetable/struct.PageTableWrapper.html new file mode 100644 index 0000000..5a7ca9b --- /dev/null +++ b/polyhal/components/pagetable/struct.PageTableWrapper.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/pagetable/struct.PageTableWrapper.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/pagetable/struct.TLB.html b/polyhal/components/pagetable/struct.TLB.html new file mode 100644 index 0000000..0d13de1 --- /dev/null +++ b/polyhal/components/pagetable/struct.TLB.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/pagetable/struct.TLB.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/percpu/attr.def_percpu.html b/polyhal/components/percpu/attr.def_percpu.html new file mode 100644 index 0000000..c345535 --- /dev/null +++ b/polyhal/components/percpu/attr.def_percpu.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/percpu/attr.def_percpu.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/percpu/fn.get_local_thread_pointer.html b/polyhal/components/percpu/fn.get_local_thread_pointer.html new file mode 100644 index 0000000..fcb418d --- /dev/null +++ b/polyhal/components/percpu/fn.get_local_thread_pointer.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/percpu/fn.get_local_thread_pointer.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/percpu/fn.percpu_area_init.html b/polyhal/components/percpu/fn.percpu_area_init.html new file mode 100644 index 0000000..cd625f5 --- /dev/null +++ b/polyhal/components/percpu/fn.percpu_area_init.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/percpu/fn.percpu_area_init.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/percpu/fn.set_local_thread_pointer.html b/polyhal/components/percpu/fn.set_local_thread_pointer.html new file mode 100644 index 0000000..400578b --- /dev/null +++ b/polyhal/components/percpu/fn.set_local_thread_pointer.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/percpu/fn.set_local_thread_pointer.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/percpu/index.html b/polyhal/components/percpu/index.html new file mode 100644 index 0000000..400309f --- /dev/null +++ b/polyhal/components/percpu/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/percpu/index.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/timer/index.html b/polyhal/components/timer/index.html new file mode 100644 index 0000000..a56beea --- /dev/null +++ b/polyhal/components/timer/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/timer/index.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/timer/riscv64/fn.init.html b/polyhal/components/timer/riscv64/fn.init.html new file mode 100644 index 0000000..34c8bd8 --- /dev/null +++ b/polyhal/components/timer/riscv64/fn.init.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../polyhal/timer/fn.init.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/timer/riscv64/fn.set_next_timeout.html b/polyhal/components/timer/riscv64/fn.set_next_timeout.html new file mode 100644 index 0000000..b5bc398 --- /dev/null +++ b/polyhal/components/timer/riscv64/fn.set_next_timeout.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../polyhal/timer/fn.set_next_timeout.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/trap/enum.EscapeReason.html b/polyhal/components/trap/enum.EscapeReason.html new file mode 100644 index 0000000..7485c37 --- /dev/null +++ b/polyhal/components/trap/enum.EscapeReason.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/trap/enum.EscapeReason.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/trap/enum.TrapType.html b/polyhal/components/trap/enum.TrapType.html new file mode 100644 index 0000000..09ac4b6 --- /dev/null +++ b/polyhal/components/trap/enum.TrapType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/trap/enum.TrapType.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/trap/index.html b/polyhal/components/trap/index.html new file mode 100644 index 0000000..6ccfe6a --- /dev/null +++ b/polyhal/components/trap/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/trap/index.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/trap/riscv64/fn.kernelvec.html b/polyhal/components/trap/riscv64/fn.kernelvec.html new file mode 100644 index 0000000..83d659e --- /dev/null +++ b/polyhal/components/trap/riscv64/fn.kernelvec.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../polyhal/trap/fn.kernelvec.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/trap/riscv64/fn.run_user_task.html b/polyhal/components/trap/riscv64/fn.run_user_task.html new file mode 100644 index 0000000..9aca85d --- /dev/null +++ b/polyhal/components/trap/riscv64/fn.run_user_task.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../polyhal/trap/fn.run_user_task.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/trap/riscv64/fn.run_user_task_forever.html b/polyhal/components/trap/riscv64/fn.run_user_task_forever.html new file mode 100644 index 0000000..3b3e9b9 --- /dev/null +++ b/polyhal/components/trap/riscv64/fn.run_user_task_forever.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../polyhal/trap/fn.run_user_task_forever.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/trap/riscv64/fn.uservec.html b/polyhal/components/trap/riscv64/fn.uservec.html new file mode 100644 index 0000000..2e33c33 --- /dev/null +++ b/polyhal/components/trap/riscv64/fn.uservec.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../polyhal/trap/fn.uservec.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/trapframe/constant.TRAPFRAME_SIZE.html b/polyhal/components/trapframe/constant.TRAPFRAME_SIZE.html new file mode 100644 index 0000000..a2cc886 --- /dev/null +++ b/polyhal/components/trapframe/constant.TRAPFRAME_SIZE.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/trapframe/constant.TRAPFRAME_SIZE.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/trapframe/enum.TrapFrameArgs.html b/polyhal/components/trapframe/enum.TrapFrameArgs.html new file mode 100644 index 0000000..c6bbd8e --- /dev/null +++ b/polyhal/components/trapframe/enum.TrapFrameArgs.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/trapframe/enum.TrapFrameArgs.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/trapframe/index.html b/polyhal/components/trapframe/index.html new file mode 100644 index 0000000..0f93f89 --- /dev/null +++ b/polyhal/components/trapframe/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/trapframe/index.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/trapframe/riscv64/struct.KernelToken.html b/polyhal/components/trapframe/riscv64/struct.KernelToken.html new file mode 100644 index 0000000..c262709 --- /dev/null +++ b/polyhal/components/trapframe/riscv64/struct.KernelToken.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../polyhal/trapframe/struct.KernelToken.html...

+ + + \ No newline at end of file diff --git a/polyhal/components/trapframe/riscv64/struct.TrapFrame.html b/polyhal/components/trapframe/riscv64/struct.TrapFrame.html new file mode 100644 index 0000000..fd64718 --- /dev/null +++ b/polyhal/components/trapframe/riscv64/struct.TrapFrame.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../polyhal/trapframe/struct.TrapFrame.html...

+ + + \ No newline at end of file diff --git a/polyhal/consts/constant.MULTI_CORE_AREA.html b/polyhal/consts/constant.MULTI_CORE_AREA.html new file mode 100644 index 0000000..3d7abe9 --- /dev/null +++ b/polyhal/consts/constant.MULTI_CORE_AREA.html @@ -0,0 +1,7 @@ +MULTI_CORE_AREA in polyhal::consts - Rust
pub const MULTI_CORE_AREA: usize = 0xFFFF_FFC2_0000_0000;
Expand description

Every core has a unique area of memory. +Just using pagetable to map multi core area. +Area size: 0x100_0000 (16MBytes)

+

First Area is 0xFFFF_FFC2_0000_0000 +Next Area is 0xFFFF_FFC2_0100_0000 +Others Same as This, so it will support 16 * 16 = 256 cores (Only auxiliary Harts).

+
\ No newline at end of file diff --git a/polyhal/consts/constant.MULTI_CORE_AREA_SIZE.html b/polyhal/consts/constant.MULTI_CORE_AREA_SIZE.html new file mode 100644 index 0000000..329a8ae --- /dev/null +++ b/polyhal/consts/constant.MULTI_CORE_AREA_SIZE.html @@ -0,0 +1 @@ +MULTI_CORE_AREA_SIZE in polyhal::consts - Rust
pub const MULTI_CORE_AREA_SIZE: usize = 0x100_0000;
\ No newline at end of file diff --git a/polyhal/consts/constant.VIRT_ADDR_START.html b/polyhal/consts/constant.VIRT_ADDR_START.html new file mode 100644 index 0000000..c507e73 --- /dev/null +++ b/polyhal/consts/constant.VIRT_ADDR_START.html @@ -0,0 +1,2 @@ +VIRT_ADDR_START in polyhal::consts - Rust
pub const VIRT_ADDR_START: usize = GenericConfig::VIRT_ADDR; // 18_446_743_798_831_644_672usize
Expand description

Virtual Address Offset.

+
\ No newline at end of file diff --git a/polyhal/consts/index.html b/polyhal/consts/index.html new file mode 100644 index 0000000..178eb19 --- /dev/null +++ b/polyhal/consts/index.html @@ -0,0 +1,4 @@ +polyhal::consts - Rust

Module polyhal::consts

source ·
Expand description

Consts components

+

Constants

\ No newline at end of file diff --git a/polyhal/consts/sidebar-items.js b/polyhal/consts/sidebar-items.js new file mode 100644 index 0000000..27d8ce5 --- /dev/null +++ b/polyhal/consts/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["MULTI_CORE_AREA","MULTI_CORE_AREA_SIZE","VIRT_ADDR_START"]}; \ No newline at end of file diff --git a/polyhal/debug_console/index.html b/polyhal/debug_console/index.html new file mode 100644 index 0000000..561f1b7 --- /dev/null +++ b/polyhal/debug_console/index.html @@ -0,0 +1,8 @@ +polyhal::debug_console - Rust

Module polyhal::debug_console

source ·
Expand description

This is a console for debugging, +If you want to use this logging +You need to use like this:

+
Put a char to output device(always uart)
+
DebugConsole::putchar(b'3');
+

Get a char from input device(always uart)

+
DebugConsole::getchar();
+

Structs

\ No newline at end of file diff --git a/polyhal/debug_console/sidebar-items.js b/polyhal/debug_console/sidebar-items.js new file mode 100644 index 0000000..8ca1933 --- /dev/null +++ b/polyhal/debug_console/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["DebugConsole"]}; \ No newline at end of file diff --git a/polyhal/debug_console/struct.DebugConsole.html b/polyhal/debug_console/struct.DebugConsole.html new file mode 100644 index 0000000..3383e41 --- /dev/null +++ b/polyhal/debug_console/struct.DebugConsole.html @@ -0,0 +1,14 @@ +DebugConsole in polyhal::debug_console - Rust
pub struct DebugConsole;

Implementations§

source§

impl DebugConsole

Debug console function.

+
source

pub fn putchar(ch: u8)

source

pub fn getchar() -> Option<u8>

Trait Implementations§

source§

impl Log for DebugConsole

source§

fn enabled(&self, _metadata: &Metadata<'_>) -> bool

Determines if a log message with the specified metadata would be +logged. Read more
source§

fn log(&self, record: &Record<'_>)

Logs the Record. Read more
source§

fn flush(&self)

Flushes any buffered records.
source§

impl Write for DebugConsole

source§

fn write_str(&mut self, s: &str) -> Result

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

fn write_char(&mut self, c: char) -> Result<(), Error>

Writes a char into this writer, returning whether the write succeeded. Read more
1.0.0 · source§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

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

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/enum.MappingSize.html b/polyhal/enum.MappingSize.html new file mode 100644 index 0000000..686e4dc --- /dev/null +++ b/polyhal/enum.MappingSize.html @@ -0,0 +1,16 @@ +MappingSize in polyhal - Rust

Enum polyhal::MappingSize

source ·
pub enum MappingSize {
+    Page4KB,
+}
Expand description

This structure indicates size of the page that will be mapped.

+

TODO: Support More Page Size, 16KB or 32KB +Just support 4KB right now.

+

Variants§

§

Page4KB

Trait Implementations§

source§

impl Debug for MappingSize

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/index.html b/polyhal/index.html new file mode 100644 index 0000000..749ac02 --- /dev/null +++ b/polyhal/index.html @@ -0,0 +1,100 @@ +polyhal - Rust

Crate polyhal

source ·
Expand description

This is a crate to help you supporting multiple platforms.

+

If you want to use this crate, you should implement the following trait in your code.

+ +
/// impl
+pub struct PageAllocImpl;
+
+impl PageAlloc for PageAllocImpl {
+    fn alloc(&self) -> PhysPage {
+        frame_alloc()
+    }
+
+    fn dealloc(&self, ppn: PhysPage) {
+        frame::frame_dealloc(ppn)
+    }
+}
+
+/// kernel interrupt
+#[polyhal::arch_interrupt]
+fn kernel_interrupt(ctx: &mut TrapFrame, trap_type: TrapType) {
+    // println!("trap_type @ {:x?} {:#x?}", trap_type, ctx);
+    match trap_type {
+        Breakpoint => return,
+        UserEnvCall => {
+            // jump to next instruction anyway
+            ctx.syscall_ok();
+            log::info!("Handle a syscall");
+        }
+        StorePageFault(_paddr) | LoadPageFault(_paddr) | InstructionPageFault(_paddr) => {
+            log::info!("page fault");
+        }
+        IllegalInstruction(_) => {
+            log::info!("illegal instruction");
+        }
+        Time => {
+            log::info!("Timer");
+        }
+        _ => {
+            log::warn!("unsuspended trap type: {:?}", trap_type);
+        }
+    }
+}
+
+#[polyhal::arch_entry]
+/// kernel main function, entry point.
+fn main(hartid: usize) {
+    if hartid != 0 {
+        return;
+    }
+
+    println!("[kernel] Hello, world!");
+    allocator::init_allocator();
+    logging::init(Some("trace"));
+    println!("init logging");
+
+    // Init page alloc for polyhal
+    polyhal::init(&PageAllocImpl);
+
+    get_mem_areas().into_iter().for_each(|(start, size)| {
+        println!("init memory region {:#x} - {:#x}", start, start + size);
+        frame::add_frame_range(start, start + size);
+    });
+    panic!("end of rust_main!");
+}
+
+

The main(hardid: usize) is the entry point.

+

You can find details in the example.

+

In this crate you can find some interfaces to use. +These interfaces are classified into some structures.

+

PhysPage: PhysicalPage And its associated functions.

+

PhysAddr: PhysicalAddr And its associated functions.

+

VirtPage: VirtualPage And its associated functions.

+

VirtAddr: VirtualAddr And its associated functions.

+

IRQ: Interrupt ReQuest management, includes enable and disable.

+

Barrier: Memory barrier operations.

+

MultiCore: MultiCore operations. Now only multicore::MultiCore::boot_all is available.

+

PageTable: PageTable and its associated functions.

+

MappingFlags: MappingFlags, This is an abstraction of pagetable flags.

+

TLB: TLB operations.

+

PageTableWrapper: PageTableWrapper. It will dealloc all pagetable leaf when it was dropping.

+

Time: Time and its associated functions.

+

Instruction: Some platform instruction.

+

There also provides a debugging console(recommanded only for debugging).

+

DebugConsole: A console for debugging.

+

This crate provides a [TrapFrame], you can operate it through index with [TrapFrameArgs].

+

If you are using kernel task. You should to enable feature kcontext. +Then you can use kernel task context structure [KContext], and manipulate it with [KContextArgs].

+

You can switch kcontext through [context_switch_pt] or [context_switch]

+

There are also some consts.

+

[VIRT_ADDR_START]: This is a higher half kernel offset address. +[USER_VADDR_END]: End of the user address range. +[PAGE_SIZE]: The size of the page.

+

You can get some device information using the functions below. +[get_mem_areas]: Get the avaliable memorys. +[get_fdt]: Get the Fdt structure(fdt is a rust dtb operation crate). +[get_cpu_num]: Get the number of cpus.

+

TIPS: You should have finished [init] before using [get_mem_areas] and [get_fdt].

+

Re-exports

Modules

Macros

Structs

Enums

  • This structure indicates size of the page that will be mapped.

Attribute Macros

\ No newline at end of file diff --git a/polyhal/instruction/index.html b/polyhal/instruction/index.html new file mode 100644 index 0000000..37b5673 --- /dev/null +++ b/polyhal/instruction/index.html @@ -0,0 +1,4 @@ +polyhal::instruction - Rust

Module polyhal::instruction

source ·
Expand description

Instruction Module.

+

This module contains the instruction of the different architectures.

+

Structs

  • Platform Instruction +[Instruction::ebreak] Intruction Breakpoint
\ No newline at end of file diff --git a/polyhal/instruction/sidebar-items.js b/polyhal/instruction/sidebar-items.js new file mode 100644 index 0000000..11e2ee0 --- /dev/null +++ b/polyhal/instruction/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Instruction"]}; \ No newline at end of file diff --git a/polyhal/instruction/struct.Instruction.html b/polyhal/instruction/struct.Instruction.html new file mode 100644 index 0000000..dc3c050 --- /dev/null +++ b/polyhal/instruction/struct.Instruction.html @@ -0,0 +1,14 @@ +Instruction in polyhal::instruction - Rust
pub struct Instruction;
Expand description

Platform Instruction +[Instruction::ebreak] Intruction Breakpoint

+

Implementations§

source§

impl Instruction

source

pub fn shutdown() -> !

Call SBI_SHUTDOWN to close the machine. Exit qemu if you are using qemu.

+
source§

impl Instruction

source

pub fn hlt()

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/irq/index.html b/polyhal/irq/index.html new file mode 100644 index 0000000..ad06c1b --- /dev/null +++ b/polyhal/irq/index.html @@ -0,0 +1,25 @@ +polyhal::irq - Rust

Module polyhal::irq

source ·
Expand description

IRQ(Interrupt requests queue) module.

+

How to use this interface.

+ +
// Init irq
+IRQ::init();
+[IRQ::irq_enable]
+// Enable irq 3
+IRQ::irq_enable(3);
+[IRQ::irq_disable]
+// Disable irq 3
+IRQ::irq_disable(3);
+[IRQ::irq_enabled]
+// Check if irq is enabled
+// Return true if the irq is enabled.
+IRQ::irq_enabled(3);
+[IRQ::int_enable]
+// Enable interrupt
+IRQ::int_enable();
+[IRQ::int_disable]
+// Disable interrupt
+IRQ::int_disable();
+[IRQ::int_enabled]
+// Check if interrupt is enabled
+let enabled = IRQ::int_enabled();
+

Structs

\ No newline at end of file diff --git a/polyhal/irq/sidebar-items.js b/polyhal/irq/sidebar-items.js new file mode 100644 index 0000000..d9006ce --- /dev/null +++ b/polyhal/irq/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["IRQ","IRQVector"]}; \ No newline at end of file diff --git a/polyhal/irq/struct.IRQ.html b/polyhal/irq/struct.IRQ.html new file mode 100644 index 0000000..f920f57 --- /dev/null +++ b/polyhal/irq/struct.IRQ.html @@ -0,0 +1,17 @@ +IRQ in polyhal::irq - Rust

Struct polyhal::irq::IRQ

source ·
pub struct IRQ;

Implementations§

source§

impl IRQ

Implement IRQ operations for the IRQ interface.

+
source

pub fn irq_enable(_irq_num: usize)

Enable irq for the given IRQ number.

+
source

pub fn irq_disable(_irq_num: usize)

Disable irq for the given IRQ number.

+
source

pub fn int_enable()

Enable interrupts.

+
source

pub fn int_disable()

Disable interrupts.

+
source

pub fn int_enabled() -> bool

Check if the interrupts was enabled.

+

Auto Trait Implementations§

§

impl RefUnwindSafe for IRQ

§

impl Send for IRQ

§

impl Sync for IRQ

§

impl Unpin for IRQ

§

impl UnwindSafe for IRQ

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/irq/struct.IRQVector.html b/polyhal/irq/struct.IRQVector.html new file mode 100644 index 0000000..c6b3fb7 --- /dev/null +++ b/polyhal/irq/struct.IRQVector.html @@ -0,0 +1,15 @@ +IRQVector in polyhal::irq - Rust

Struct polyhal::irq::IRQVector

source ·
pub struct IRQVector(/* private fields */);

Implementations§

source§

impl IRQVector

Implmente the irq vector methods

+
source

pub fn irq_num(&self) -> usize

Get the irq number in this vector

+
source

pub fn ack(&self)

Acknowledge the irq

+

Trait Implementations§

source§

impl Clone for IRQVector

source§

fn clone(&self) -> IRQVector

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for IRQVector

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for IRQVector

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/kcontext/enum.KContextArgs.html b/polyhal/kcontext/enum.KContextArgs.html new file mode 100644 index 0000000..3d8ce1d --- /dev/null +++ b/polyhal/kcontext/enum.KContextArgs.html @@ -0,0 +1,41 @@ +KContextArgs in polyhal::kcontext - Rust
pub enum KContextArgs {
+    KSP,
+    KTP,
+    KPC,
+}
Expand description

Kernel Context Arg Type.

+

Using this by Index and IndexMut trait bound on KContext.

+

Variants§

§

KSP

Kernel Stack Pointer

+
§

KTP

Kernel Thread Pointer

+
§

KPC

Kernel Program Counter

+

Trait Implementations§

source§

impl Debug for KContextArgs

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Index<KContextArgs> for KContext

Indexing operations for KContext

+

Using it just like the Vector.

+

#[derive(Debug)] +pub enum KContextArgs { +/// Kernel Stack Pointer +KSP, +/// Kernel Thread Pointer +KTP, +/// Kernel Program Counter +KPC +}

+

etc. Get reg of the kernel stack:

+

let ksp = KContextKContextArgs::KSP +let kpc = KContextKContextArgs::KPC +let ktp = KContextKContextArgs::KTP

+
§

type Output = usize

The returned type after indexing.
source§

fn index(&self, index: KContextArgs) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl IndexMut<KContextArgs> for KContext

Indexing Mutable operations for KContext

+

Using it just like the Vector.

+

etc. Change the value of the kernel Context using IndexMut

+
KContext[KContextArgs::KSP] = ksp;
+KContext[KContextArgs::KPC] = kpc;
+KContext[KContextArgs::KTP] = ktp;
+
source§

fn index_mut(&mut self, index: KContextArgs) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/kcontext/fn.context_switch.html b/polyhal/kcontext/fn.context_switch.html new file mode 100644 index 0000000..283263f --- /dev/null +++ b/polyhal/kcontext/fn.context_switch.html @@ -0,0 +1,6 @@ +context_switch in polyhal::kcontext - Rust
pub unsafe extern "C" fn context_switch(
+    from: *mut KContext,
+    to: *const KContext
+)
Expand description

Context Switch

+

Save the context of current task and switch to new task.

+
\ No newline at end of file diff --git a/polyhal/kcontext/fn.context_switch_pt.html b/polyhal/kcontext/fn.context_switch_pt.html new file mode 100644 index 0000000..c04ac83 --- /dev/null +++ b/polyhal/kcontext/fn.context_switch_pt.html @@ -0,0 +1,7 @@ +context_switch_pt in polyhal::kcontext - Rust
pub unsafe extern "C" fn context_switch_pt(
+    from: *mut KContext,
+    to: *const KContext,
+    pt_token: PageTable
+)
Expand description

Context Switch With Page Table

+

Save the context of current task and switch to new task.

+
\ No newline at end of file diff --git a/polyhal/kcontext/fn.read_current_tp.html b/polyhal/kcontext/fn.read_current_tp.html new file mode 100644 index 0000000..aa709be --- /dev/null +++ b/polyhal/kcontext/fn.read_current_tp.html @@ -0,0 +1 @@ +read_current_tp in polyhal::kcontext - Rust
pub extern "C" fn read_current_tp() -> usize
\ No newline at end of file diff --git a/polyhal/kcontext/index.html b/polyhal/kcontext/index.html new file mode 100644 index 0000000..785ce7c --- /dev/null +++ b/polyhal/kcontext/index.html @@ -0,0 +1,2 @@ +polyhal::kcontext - Rust

Module polyhal::kcontext

source ·
Expand description

Kernel Context module.

+

Structs

Enums

Functions

\ No newline at end of file diff --git a/polyhal/kcontext/sidebar-items.js b/polyhal/kcontext/sidebar-items.js new file mode 100644 index 0000000..f12b2ee --- /dev/null +++ b/polyhal/kcontext/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["KContextArgs"],"fn":["context_switch","context_switch_pt","read_current_tp"],"struct":["KContext"]}; \ No newline at end of file diff --git a/polyhal/kcontext/struct.KContext.html b/polyhal/kcontext/struct.KContext.html new file mode 100644 index 0000000..7999a24 --- /dev/null +++ b/polyhal/kcontext/struct.KContext.html @@ -0,0 +1,35 @@ +KContext in polyhal::kcontext - Rust

Struct polyhal::kcontext::KContext

source ·
#[repr(C)]
pub struct KContext { /* private fields */ }
Expand description

Kernel Context

+

Kernel Context is used to switch context between kernel task.

+

Implementations§

source§

impl KContext

source

pub fn blank() -> Self

Create a new blank Kernel Context.

+

Trait Implementations§

source§

impl Debug for KContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Index<KContextArgs> for KContext

Indexing operations for KContext

+

Using it just like the Vector.

+

#[derive(Debug)] +pub enum KContextArgs { +/// Kernel Stack Pointer +KSP, +/// Kernel Thread Pointer +KTP, +/// Kernel Program Counter +KPC +}

+

etc. Get reg of the kernel stack:

+

let ksp = KContextKContextArgs::KSP +let kpc = KContextKContextArgs::KPC +let ktp = KContextKContextArgs::KTP

+
§

type Output = usize

The returned type after indexing.
source§

fn index(&self, index: KContextArgs) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl IndexMut<KContextArgs> for KContext

Indexing Mutable operations for KContext

+

Using it just like the Vector.

+

etc. Change the value of the kernel Context using IndexMut

+
KContext[KContextArgs::KSP] = ksp;
+KContext[KContextArgs::KPC] = kpc;
+KContext[KContextArgs::KTP] = ktp;
+
source§

fn index_mut(&mut self, index: KContextArgs) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/macro.pub_use_arch!.html b/polyhal/macro.pub_use_arch!.html new file mode 100644 index 0000000..48ab1b6 --- /dev/null +++ b/polyhal/macro.pub_use_arch!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.pub_use_arch.html...

+ + + \ No newline at end of file diff --git a/polyhal/macro.pub_use_arch.html b/polyhal/macro.pub_use_arch.html new file mode 100644 index 0000000..5e8ae28 --- /dev/null +++ b/polyhal/macro.pub_use_arch.html @@ -0,0 +1,3 @@ +pub_use_arch in polyhal - Rust

Macro polyhal::pub_use_arch

source ·
macro_rules! pub_use_arch {
+    ($($name:ident),*) => { ... };
+}
\ No newline at end of file diff --git a/polyhal/macros/index.html b/polyhal/macros/index.html new file mode 100644 index 0000000..60dc327 --- /dev/null +++ b/polyhal/macros/index.html @@ -0,0 +1 @@ +polyhal::macros - Rust

Module polyhal::macros

source ·

Macros

\ No newline at end of file diff --git a/polyhal/macros/macro.pub_use_arch!.html b/polyhal/macros/macro.pub_use_arch!.html new file mode 100644 index 0000000..48ab1b6 --- /dev/null +++ b/polyhal/macros/macro.pub_use_arch!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.pub_use_arch.html...

+ + + \ No newline at end of file diff --git a/polyhal/macros/macro.pub_use_arch.html b/polyhal/macros/macro.pub_use_arch.html new file mode 100644 index 0000000..c659e40 --- /dev/null +++ b/polyhal/macros/macro.pub_use_arch.html @@ -0,0 +1,3 @@ +pub_use_arch in polyhal::macros - Rust
macro_rules! pub_use_arch {
+    ($($name:ident),*) => { ... };
+}
\ No newline at end of file diff --git a/polyhal/macros/sidebar-items.js b/polyhal/macros/sidebar-items.js new file mode 100644 index 0000000..9dfccbe --- /dev/null +++ b/polyhal/macros/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"macro":["pub_use_arch"]}; \ No newline at end of file diff --git a/polyhal/mem/index.html b/polyhal/mem/index.html new file mode 100644 index 0000000..8b30c29 --- /dev/null +++ b/polyhal/mem/index.html @@ -0,0 +1 @@ +polyhal::mem - Rust

Module polyhal::mem

source ·

Structs

\ No newline at end of file diff --git a/polyhal/mem/sidebar-items.js b/polyhal/mem/sidebar-items.js new file mode 100644 index 0000000..39051f8 --- /dev/null +++ b/polyhal/mem/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Barrier"]}; \ No newline at end of file diff --git a/polyhal/mem/struct.Barrier.html b/polyhal/mem/struct.Barrier.html new file mode 100644 index 0000000..63ca1d4 --- /dev/null +++ b/polyhal/mem/struct.Barrier.html @@ -0,0 +1,15 @@ +Barrier in polyhal::mem - Rust

Struct polyhal::mem::Barrier

source ·
pub struct Barrier;
Expand description

This is a barrier function.

+

This struct has two functions. +Barrier::complete_sync: ensures the correct sequencing of instructions +Barrier::ordering_sync: ensures the visibility and consistency of memory operations

+

Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/multicore/fn.boot_core.html b/polyhal/multicore/fn.boot_core.html new file mode 100644 index 0000000..2ac8109 --- /dev/null +++ b/polyhal/multicore/fn.boot_core.html @@ -0,0 +1 @@ +boot_core in polyhal::multicore - Rust

Function polyhal::multicore::boot_core

source ·
pub fn boot_core(cpu: usize, sp_top: usize)
\ No newline at end of file diff --git a/polyhal/multicore/index.html b/polyhal/multicore/index.html new file mode 100644 index 0000000..8250ee0 --- /dev/null +++ b/polyhal/multicore/index.html @@ -0,0 +1,10 @@ +polyhal::multicore - Rust

Module polyhal::multicore

source ·
Expand description

Multi-core Module.

+

This is a leader for the multicore operation

+

You can use this function to use the multicore operation

+

Boot other calls after the multicore +If you use this function call, you should call it after arch::init(..); +This function will allocate the stack and map it for itself.

+ +
Multicore::boot_all();
+

Here will have more functionality about multicore in the future.

+

Structs

Functions

\ No newline at end of file diff --git a/polyhal/multicore/sidebar-items.js b/polyhal/multicore/sidebar-items.js new file mode 100644 index 0000000..b448093 --- /dev/null +++ b/polyhal/multicore/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["boot_core"],"struct":["CpuCore","MultiCore"]}; \ No newline at end of file diff --git a/polyhal/multicore/struct.CpuCore.html b/polyhal/multicore/struct.CpuCore.html new file mode 100644 index 0000000..c9184bf --- /dev/null +++ b/polyhal/multicore/struct.CpuCore.html @@ -0,0 +1,11 @@ +CpuCore in polyhal::multicore - Rust

Struct polyhal::multicore::CpuCore

source ·
pub struct CpuCore;

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/multicore/struct.MultiCore.html b/polyhal/multicore/struct.MultiCore.html new file mode 100644 index 0000000..6583bc1 --- /dev/null +++ b/polyhal/multicore/struct.MultiCore.html @@ -0,0 +1,13 @@ +MultiCore in polyhal::multicore - Rust
pub struct MultiCore;

Implementations§

source§

impl MultiCore

Implement the function for multicore

+
source

pub fn boot_all()

Boot all application cores.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/pagetable/constant.PAGE_SIZE.html b/polyhal/pagetable/constant.PAGE_SIZE.html new file mode 100644 index 0000000..11236b8 --- /dev/null +++ b/polyhal/pagetable/constant.PAGE_SIZE.html @@ -0,0 +1,2 @@ +PAGE_SIZE in polyhal::pagetable - Rust

Constant polyhal::pagetable::PAGE_SIZE

source ·
pub const PAGE_SIZE: usize = PageTable::PAGE_SIZE; // 4_096usize
Expand description

The size of the page table.

+
\ No newline at end of file diff --git a/polyhal/pagetable/constant.USER_VADDR_END.html b/polyhal/pagetable/constant.USER_VADDR_END.html new file mode 100644 index 0000000..e69300d --- /dev/null +++ b/polyhal/pagetable/constant.USER_VADDR_END.html @@ -0,0 +1,2 @@ +USER_VADDR_END in polyhal::pagetable - Rust
pub const USER_VADDR_END: usize = PageTable::USER_VADDR_END; // 549_755_813_887usize
Expand description

The max address of the user virtual address.

+
\ No newline at end of file diff --git a/polyhal/pagetable/enum.MappingSize.html b/polyhal/pagetable/enum.MappingSize.html new file mode 100644 index 0000000..d53fd8d --- /dev/null +++ b/polyhal/pagetable/enum.MappingSize.html @@ -0,0 +1,16 @@ +MappingSize in polyhal::pagetable - Rust
pub enum MappingSize {
+    Page4KB,
+}
Expand description

This structure indicates size of the page that will be mapped.

+

TODO: Support More Page Size, 16KB or 32KB +Just support 4KB right now.

+

Variants§

§

Page4KB

Trait Implementations§

source§

impl Debug for MappingSize

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/pagetable/index.html b/polyhal/pagetable/index.html new file mode 100644 index 0000000..05f5647 --- /dev/null +++ b/polyhal/pagetable/index.html @@ -0,0 +1,3 @@ +polyhal::pagetable - Rust

Module polyhal::pagetable

source ·

Structs

Enums

  • This structure indicates size of the page that will be mapped.

Constants

\ No newline at end of file diff --git a/polyhal/pagetable/sidebar-items.js b/polyhal/pagetable/sidebar-items.js new file mode 100644 index 0000000..13fd71f --- /dev/null +++ b/polyhal/pagetable/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["PAGE_SIZE","USER_VADDR_END"],"enum":["MappingSize"],"struct":["MappingFlags","PTEFlags","PageTable","PageTableWrapper","TLB"]}; \ No newline at end of file diff --git a/polyhal/pagetable/struct.MappingFlags.html b/polyhal/pagetable/struct.MappingFlags.html new file mode 100644 index 0000000..d7ed552 --- /dev/null +++ b/polyhal/pagetable/struct.MappingFlags.html @@ -0,0 +1,91 @@ +MappingFlags in polyhal::pagetable - Rust
pub struct MappingFlags(/* private fields */);
Expand description

Mapping flags for page table.

+

Implementations§

source§

impl MappingFlags

source

pub const P: Self = _

Persent

+
source

pub const U: Self = _

User Accessable Flag

+
source

pub const R: Self = _

Readable Flag

+
source

pub const W: Self = _

Writeable Flag

+
source

pub const X: Self = _

Executeable Flag

+
source

pub const A: Self = _

Accessed Flag

+
source

pub const D: Self = _

Dirty Flag, indicating that the page was written

+
source

pub const G: Self = _

Global Flag

+
source

pub const Device: Self = _

Device Flag, indicating that the page was used for device memory

+
source

pub const Cache: Self = _

Cache Flag, indicating that the page will be cached

+
source

pub const RWX: Self = _

Read | Write | Executeable Flags

+
source

pub const URW: Self = _

User | Read | Write Flags

+
source

pub const URX: Self = _

User | Read | Executeable Flags

+
source

pub const URWX: Self = _

User | Read | Write | Executeable Flags

+
source§

impl MappingFlags

source

pub const fn empty() -> Self

Get a flags value with all bits unset.

+
source

pub const fn all() -> Self

Get a flags value with all known bits set.

+
source

pub const fn bits(&self) -> u64

Get the underlying bits value.

+

The returned value is exactly the bits set in this flags value.

+
source

pub const fn from_bits(bits: u64) -> Option<Self>

Convert from a bits value.

+

This method will return None if any unknown bits are set.

+
source

pub const fn from_bits_truncate(bits: u64) -> Self

Convert from a bits value, unsetting any unknown bits.

+
source

pub const fn from_bits_retain(bits: u64) -> Self

Convert from a bits value exactly.

+
source

pub fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set.

+

This method will return None if name is empty or doesn’t +correspond to any named flag.

+
source

pub const fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.

+
source

pub const fn is_all(&self) -> bool

Whether all known bits in this flags value are set.

+
source

pub const fn intersects(&self, other: Self) -> bool

Whether any set bits in a source flags value are also set in a target flags value.

+
source

pub const fn contains(&self, other: Self) -> bool

Whether all set bits in a source flags value are also set in a target flags value.

+
source

pub fn insert(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source

pub fn remove(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +remove won’t truncate other, but the ! operator will.

+
source

pub fn toggle(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub fn set(&mut self, other: Self, value: bool)

Call insert when value is true or remove when value is false.

+
source

pub const fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
source

pub const fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.

+
source

pub const fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source

pub const fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub const fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
source§

impl MappingFlags

source

pub const fn iter(&self) -> Iter<MappingFlags>

Yield a set of contained flags values.

+

Each yielded flags value will correspond to a defined named flag. Any unknown bits +will be yielded together as a final flags value.

+
source

pub const fn iter_names(&self) -> IterNames<MappingFlags>

Yield a set of contained named flags values.

+

This method is like iter, except only yields bits in contained named flags. +Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

+

Trait Implementations§

source§

impl Binary for MappingFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl BitAnd for MappingFlags

source§

fn bitand(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
§

type Output = MappingFlags

The resulting type after applying the & operator.
source§

impl BitAndAssign for MappingFlags

source§

fn bitand_assign(&mut self, other: Self)

The bitwise and (&) of the bits in two flags values.

+
source§

impl BitOr for MappingFlags

source§

fn bitor(self, other: MappingFlags) -> Self

The bitwise or (|) of the bits in two flags values.

+
§

type Output = MappingFlags

The resulting type after applying the | operator.
source§

impl BitOrAssign for MappingFlags

source§

fn bitor_assign(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source§

impl BitXor for MappingFlags

source§

fn bitxor(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
§

type Output = MappingFlags

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for MappingFlags

source§

fn bitxor_assign(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source§

impl Clone for MappingFlags

source§

fn clone(&self) -> MappingFlags

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MappingFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Extend<MappingFlags> for MappingFlags

source§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

The bitwise or (|) of the bits in each flags value.

+
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl Flags for MappingFlags

source§

const FLAGS: &'static [Flag<MappingFlags>] = _

The set of defined flags.
§

type Bits = u64

The underlying bits type.
source§

fn bits(&self) -> u64

Get the underlying bits value. Read more
source§

fn from_bits_retain(bits: u64) -> MappingFlags

Convert from a bits value exactly.
§

fn empty() -> Self

Get a flags value with all bits unset.
§

fn all() -> Self

Get a flags value with all known bits set.
§

fn from_bits(bits: Self::Bits) -> Option<Self>

Convert from a bits value. Read more
§

fn from_bits_truncate(bits: Self::Bits) -> Self

Convert from a bits value, unsetting any unknown bits.
§

fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set. Read more
§

fn iter(&self) -> Iter<Self>

Yield a set of contained flags values. Read more
§

fn iter_names(&self) -> IterNames<Self>

Yield a set of contained named flags values. Read more
§

fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.
§

fn is_all(&self) -> bool

Whether all known bits in this flags value are set.
§

fn intersects(&self, other: Self) -> boolwhere + Self: Sized,

Whether any set bits in a source flags value are also set in a target flags value.
§

fn contains(&self, other: Self) -> boolwhere + Self: Sized,

Whether all set bits in a source flags value are also set in a target flags value.
§

fn insert(&mut self, other: Self)where + Self: Sized,

The bitwise or (|) of the bits in two flags values.
§

fn remove(&mut self, other: Self)where + Self: Sized,

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn toggle(&mut self, other: Self)where + Self: Sized,

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn set(&mut self, other: Self, value: bool)where + Self: Sized,

Call [Flags::insert] when value is true or [Flags::remove] when value is false.
§

fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.
§

fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.
§

fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.
source§

impl From<MappingFlags> for PTEFlags

source§

fn from(flags: MappingFlags) -> Self

Converts to this type from the input type.
source§

impl From<PTEFlags> for MappingFlags

source§

fn from(value: PTEFlags) -> Self

Converts to this type from the input type.
source§

impl FromIterator<MappingFlags> for MappingFlags

source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

The bitwise or (|) of the bits in each flags value.

+
source§

impl Hash for MappingFlags

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

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

impl IntoIterator for MappingFlags

§

type Item = MappingFlags

The type of the elements being iterated over.
§

type IntoIter = Iter<MappingFlags>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl LowerHex for MappingFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Not for MappingFlags

source§

fn not(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
§

type Output = MappingFlags

The resulting type after applying the ! operator.
source§

impl Octal for MappingFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Ord for MappingFlags

source§

fn cmp(&self, other: &MappingFlags) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for MappingFlags

source§

fn eq(&self, other: &MappingFlags) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for MappingFlags

source§

fn partial_cmp(&self, other: &MappingFlags) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl PublicFlags for MappingFlags

§

type Primitive = u64

The type of the underlying storage.
§

type Internal = InternalBitFlags

The type of the internal field on the generated flags type.
source§

impl Sub for MappingFlags

source§

fn sub(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
§

type Output = MappingFlags

The resulting type after applying the - operator.
source§

impl SubAssign for MappingFlags

source§

fn sub_assign(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source§

impl UpperHex for MappingFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Copy for MappingFlags

source§

impl Eq for MappingFlags

source§

impl StructuralEq for MappingFlags

source§

impl StructuralPartialEq for MappingFlags

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/pagetable/struct.PTEFlags.html b/polyhal/pagetable/struct.PTEFlags.html new file mode 100644 index 0000000..2481dc7 --- /dev/null +++ b/polyhal/pagetable/struct.PTEFlags.html @@ -0,0 +1,76 @@ +PTEFlags in polyhal::pagetable - Rust

Struct polyhal::pagetable::PTEFlags

source ·
pub struct PTEFlags(/* private fields */);

Implementations§

source§

impl PTEFlags

source

pub const V: Self = _

source

pub const R: Self = _

source

pub const W: Self = _

source

pub const X: Self = _

source

pub const U: Self = _

source

pub const G: Self = _

source

pub const A: Self = _

source

pub const D: Self = _

source

pub const VRWX: Self = _

source

pub const ADUVRX: Self = _

source

pub const ADVRWX: Self = _

source

pub const ADGVRWX: Self = _

source§

impl PTEFlags

source

pub const fn empty() -> Self

Get a flags value with all bits unset.

+
source

pub const fn all() -> Self

Get a flags value with all known bits set.

+
source

pub const fn bits(&self) -> u64

Get the underlying bits value.

+

The returned value is exactly the bits set in this flags value.

+
source

pub const fn from_bits(bits: u64) -> Option<Self>

Convert from a bits value.

+

This method will return None if any unknown bits are set.

+
source

pub const fn from_bits_truncate(bits: u64) -> Self

Convert from a bits value, unsetting any unknown bits.

+
source

pub const fn from_bits_retain(bits: u64) -> Self

Convert from a bits value exactly.

+
source

pub fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set.

+

This method will return None if name is empty or doesn’t +correspond to any named flag.

+
source

pub const fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.

+
source

pub const fn is_all(&self) -> bool

Whether all known bits in this flags value are set.

+
source

pub const fn intersects(&self, other: Self) -> bool

Whether any set bits in a source flags value are also set in a target flags value.

+
source

pub const fn contains(&self, other: Self) -> bool

Whether all set bits in a source flags value are also set in a target flags value.

+
source

pub fn insert(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source

pub fn remove(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +remove won’t truncate other, but the ! operator will.

+
source

pub fn toggle(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub fn set(&mut self, other: Self, value: bool)

Call insert when value is true or remove when value is false.

+
source

pub const fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
source

pub const fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.

+
source

pub const fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source

pub const fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub const fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
source§

impl PTEFlags

source

pub const fn iter(&self) -> Iter<PTEFlags>

Yield a set of contained flags values.

+

Each yielded flags value will correspond to a defined named flag. Any unknown bits +will be yielded together as a final flags value.

+
source

pub const fn iter_names(&self) -> IterNames<PTEFlags>

Yield a set of contained named flags values.

+

This method is like iter, except only yields bits in contained named flags. +Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

+

Trait Implementations§

source§

impl Binary for PTEFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl BitAnd for PTEFlags

source§

fn bitand(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
§

type Output = PTEFlags

The resulting type after applying the & operator.
source§

impl BitAndAssign for PTEFlags

source§

fn bitand_assign(&mut self, other: Self)

The bitwise and (&) of the bits in two flags values.

+
source§

impl BitOr for PTEFlags

source§

fn bitor(self, other: PTEFlags) -> Self

The bitwise or (|) of the bits in two flags values.

+
§

type Output = PTEFlags

The resulting type after applying the | operator.
source§

impl BitOrAssign for PTEFlags

source§

fn bitor_assign(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source§

impl BitXor for PTEFlags

source§

fn bitxor(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
§

type Output = PTEFlags

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for PTEFlags

source§

fn bitxor_assign(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source§

impl Clone for PTEFlags

source§

fn clone(&self) -> PTEFlags

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PTEFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Extend<PTEFlags> for PTEFlags

source§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

The bitwise or (|) of the bits in each flags value.

+
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl Flags for PTEFlags

source§

const FLAGS: &'static [Flag<PTEFlags>] = _

The set of defined flags.
§

type Bits = u64

The underlying bits type.
source§

fn bits(&self) -> u64

Get the underlying bits value. Read more
source§

fn from_bits_retain(bits: u64) -> PTEFlags

Convert from a bits value exactly.
§

fn empty() -> Self

Get a flags value with all bits unset.
§

fn all() -> Self

Get a flags value with all known bits set.
§

fn from_bits(bits: Self::Bits) -> Option<Self>

Convert from a bits value. Read more
§

fn from_bits_truncate(bits: Self::Bits) -> Self

Convert from a bits value, unsetting any unknown bits.
§

fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set. Read more
§

fn iter(&self) -> Iter<Self>

Yield a set of contained flags values. Read more
§

fn iter_names(&self) -> IterNames<Self>

Yield a set of contained named flags values. Read more
§

fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.
§

fn is_all(&self) -> bool

Whether all known bits in this flags value are set.
§

fn intersects(&self, other: Self) -> boolwhere + Self: Sized,

Whether any set bits in a source flags value are also set in a target flags value.
§

fn contains(&self, other: Self) -> boolwhere + Self: Sized,

Whether all set bits in a source flags value are also set in a target flags value.
§

fn insert(&mut self, other: Self)where + Self: Sized,

The bitwise or (|) of the bits in two flags values.
§

fn remove(&mut self, other: Self)where + Self: Sized,

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn toggle(&mut self, other: Self)where + Self: Sized,

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn set(&mut self, other: Self, value: bool)where + Self: Sized,

Call [Flags::insert] when value is true or [Flags::remove] when value is false.
§

fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.
§

fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.
§

fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.
source§

impl From<MappingFlags> for PTEFlags

source§

fn from(flags: MappingFlags) -> Self

Converts to this type from the input type.
source§

impl From<PTEFlags> for MappingFlags

source§

fn from(value: PTEFlags) -> Self

Converts to this type from the input type.
source§

impl FromIterator<PTEFlags> for PTEFlags

source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

The bitwise or (|) of the bits in each flags value.

+
source§

impl Hash for PTEFlags

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

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

impl IntoIterator for PTEFlags

§

type Item = PTEFlags

The type of the elements being iterated over.
§

type IntoIter = Iter<PTEFlags>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl LowerHex for PTEFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Not for PTEFlags

source§

fn not(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
§

type Output = PTEFlags

The resulting type after applying the ! operator.
source§

impl Octal for PTEFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Ord for PTEFlags

source§

fn cmp(&self, other: &PTEFlags) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for PTEFlags

source§

fn eq(&self, other: &PTEFlags) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PTEFlags

source§

fn partial_cmp(&self, other: &PTEFlags) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl PublicFlags for PTEFlags

§

type Primitive = u64

The type of the underlying storage.
§

type Internal = InternalBitFlags

The type of the internal field on the generated flags type.
source§

impl Sub for PTEFlags

source§

fn sub(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
§

type Output = PTEFlags

The resulting type after applying the - operator.
source§

impl SubAssign for PTEFlags

source§

fn sub_assign(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source§

impl UpperHex for PTEFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Copy for PTEFlags

source§

impl Eq for PTEFlags

source§

impl StructuralEq for PTEFlags

source§

impl StructuralPartialEq for PTEFlags

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/pagetable/struct.PageTable.html b/polyhal/pagetable/struct.PageTable.html new file mode 100644 index 0000000..e11a599 --- /dev/null +++ b/polyhal/pagetable/struct.PageTable.html @@ -0,0 +1,57 @@ +PageTable in polyhal::pagetable - Rust
#[repr(C)]
pub struct PageTable(/* private fields */);
Expand description

Page Table

+

This is just the page table defination. +The implementation of the page table in the specific architecture mod. +Such as: +x86_64/page_table.rs +riscv64/page_table/sv39.rs +aarch64/page_table.rs +loongarch64/page_table.rs

+

Implementations§

source§

impl PageTable

source

pub fn current() -> Self

source

pub fn kernel_pte_entry(&self) -> PhysAddr

source

pub fn restore(&self)

source

pub fn change(&self)

source§

impl PageTable

source

pub fn map_page( + &self, + vpn: VirtPage, + ppn: PhysPage, + flags: MappingFlags, + _size: MappingSize +)

Mapping a page to specific virtual page (user space address).

+

Ensure that PageTable is which you want to map. +vpn: Virtual page will be mapped. +ppn: Physical page. +flags: Mapping flags, include Read, Write, Execute and so on. +size: MappingSize. Just support 4KB page currently.

+
source

pub fn map_kernel( + &self, + vpn: VirtPage, + ppn: PhysPage, + flags: MappingFlags, + _size: MappingSize +)

Mapping a page to specific address(kernel space address).

+

TODO: This method is not implemented. +TIPS: If we mapped to kernel, the page will be shared between different pagetable.

+

Ensure that PageTable is which you want to map. +vpn: Virtual page will be mapped. +ppn: Physical page. +flags: Mapping flags, include Read, Write, Execute and so on. +size: MappingSize. Just support 4KB page currently.

+

How to implement shared.

+
source

pub fn unmap_page(&self, vpn: VirtPage)

Unmap a page from specific virtual page (user space address).

+

Ensure the virtual page is exists. +vpn: Virtual address.

+
source

pub fn translate(&self, vaddr: VirtAddr) -> Option<(PhysAddr, MappingFlags)>

Translate a virtual adress to a physical address and mapping flags.

+

Return None if the vaddr isn’t mapped. +vpn: The virtual address will be translated.

+
source

pub fn release(&self)

Release the page table entry.

+

The page table entry in the user space address will be released. +Page Table Wikipedia. +You don’t need to care about this if you just want to use.

+

Trait Implementations§

source§

impl Clone for PageTable

source§

fn clone(&self) -> PageTable

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PageTable

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for PageTable

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/pagetable/struct.PageTableWrapper.html b/polyhal/pagetable/struct.PageTableWrapper.html new file mode 100644 index 0000000..6c2b5a6 --- /dev/null +++ b/polyhal/pagetable/struct.PageTableWrapper.html @@ -0,0 +1,59 @@ +PageTableWrapper in polyhal::pagetable - Rust
pub struct PageTableWrapper(pub PageTable);
Expand description

Page Table Wrapper

+

You can use this wrapper to packing PageTable. +If you release the PageTableWrapper, +the PageTable will release its page table entry.

+

Tuple Fields§

§0: PageTable

Implementations§

source§

impl PageTableWrapper

Allocate a new PageTableWrapper with new page table root

+

This operation will restore the page table.

+
source

pub fn alloc() -> Self

Alloc a new PageTableWrapper with new page table root +This operation will copy kernel page table space from booting page table.

+

Methods from Deref<Target = PageTable>§

source

pub fn kernel_pte_entry(&self) -> PhysAddr

source

pub fn restore(&self)

source

pub fn change(&self)

source

pub fn map_page( + &self, + vpn: VirtPage, + ppn: PhysPage, + flags: MappingFlags, + _size: MappingSize +)

Mapping a page to specific virtual page (user space address).

+

Ensure that PageTable is which you want to map. +vpn: Virtual page will be mapped. +ppn: Physical page. +flags: Mapping flags, include Read, Write, Execute and so on. +size: MappingSize. Just support 4KB page currently.

+
source

pub fn map_kernel( + &self, + vpn: VirtPage, + ppn: PhysPage, + flags: MappingFlags, + _size: MappingSize +)

Mapping a page to specific address(kernel space address).

+

TODO: This method is not implemented. +TIPS: If we mapped to kernel, the page will be shared between different pagetable.

+

Ensure that PageTable is which you want to map. +vpn: Virtual page will be mapped. +ppn: Physical page. +flags: Mapping flags, include Read, Write, Execute and so on. +size: MappingSize. Just support 4KB page currently.

+

How to implement shared.

+
source

pub fn unmap_page(&self, vpn: VirtPage)

Unmap a page from specific virtual page (user space address).

+

Ensure the virtual page is exists. +vpn: Virtual address.

+
source

pub fn translate(&self, vaddr: VirtAddr) -> Option<(PhysAddr, MappingFlags)>

Translate a virtual adress to a physical address and mapping flags.

+

Return None if the vaddr isn’t mapped. +vpn: The virtual address will be translated.

+
source

pub fn release(&self)

Release the page table entry.

+

The page table entry in the user space address will be released. +Page Table Wikipedia. +You don’t need to care about this if you just want to use.

+

Trait Implementations§

source§

impl Debug for PageTableWrapper

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for PageTableWrapper

§

type Target = PageTable

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Drop for PageTableWrapper

Page Table Release.

+

You must implement this trait to release page table. +Include the page table entry and root page.

+
source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/pagetable/struct.TLB.html b/polyhal/pagetable/struct.TLB.html new file mode 100644 index 0000000..1b9a11e --- /dev/null +++ b/polyhal/pagetable/struct.TLB.html @@ -0,0 +1,27 @@ +TLB in polyhal::pagetable - Rust

Struct polyhal::pagetable::TLB

source ·
pub struct TLB;
Expand description

TLB Operation set. +Such as flush_vaddr, flush_all. +Just use it in the fn.

+

there are some methods in the TLB implementation

+

Flush the tlb entry through the specific virtual address

+
TLB::flush_vaddr(arg0);  arg0 should be VirtAddr
+

Flush all tlb entries

+
TLB::flush_all();
+

Implementations§

source§

impl TLB

TLB operations

+
source

pub fn flush_vaddr(vaddr: VirtAddr)

flush the TLB entry by VirtualAddress +just use it directly

+

TLB::flush_vaddr(arg0); // arg0 is the virtual address(VirtAddr)

+
source

pub fn flush_all()

flush all tlb entry

+

how to use ? +just +TLB::flush_all();

+

Auto Trait Implementations§

§

impl RefUnwindSafe for TLB

§

impl Send for TLB

§

impl Sync for TLB

§

impl Unpin for TLB

§

impl UnwindSafe for TLB

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/percpu/attr.def_percpu.html b/polyhal/percpu/attr.def_percpu.html new file mode 100644 index 0000000..9236e49 --- /dev/null +++ b/polyhal/percpu/attr.def_percpu.html @@ -0,0 +1,4 @@ +def_percpu in polyhal::percpu - Rust

Attribute Macro polyhal::percpu::def_percpu

#[def_percpu]
Expand description

Defines a per-CPU data structure.

+

It should be used on a static variable.

+

See the crate-level documentation for more details.

+
\ No newline at end of file diff --git a/polyhal/percpu/fn.get_local_thread_pointer.html b/polyhal/percpu/fn.get_local_thread_pointer.html new file mode 100644 index 0000000..f8b1c7e --- /dev/null +++ b/polyhal/percpu/fn.get_local_thread_pointer.html @@ -0,0 +1,2 @@ +get_local_thread_pointer in polyhal::percpu - Rust
pub fn get_local_thread_pointer() -> usize
Expand description

Read the architecture-specific thread pointer register on the current CPU.

+
\ No newline at end of file diff --git a/polyhal/percpu/fn.percpu_area_init.html b/polyhal/percpu/fn.percpu_area_init.html new file mode 100644 index 0000000..9ec1204 --- /dev/null +++ b/polyhal/percpu/fn.percpu_area_init.html @@ -0,0 +1,3 @@ +percpu_area_init in polyhal::percpu - Rust
pub fn percpu_area_init(cpu_id: usize) -> usize
Expand description

Returns the base address of the per-CPU data area on the given CPU.

+

if cpu_id is 0, it returns the base address of all per-CPU data areas.

+
\ No newline at end of file diff --git a/polyhal/percpu/fn.set_local_thread_pointer.html b/polyhal/percpu/fn.set_local_thread_pointer.html new file mode 100644 index 0000000..844fd30 --- /dev/null +++ b/polyhal/percpu/fn.set_local_thread_pointer.html @@ -0,0 +1,4 @@ +set_local_thread_pointer in polyhal::percpu - Rust
pub fn set_local_thread_pointer(cpu_id: usize)
Expand description

Set the architecture-specific thread pointer register to the per-CPU data +area base on the current CPU.

+

cpu_id indicates which per-CPU data area to use.

+
\ No newline at end of file diff --git a/polyhal/percpu/index.html b/polyhal/percpu/index.html new file mode 100644 index 0000000..c808fae --- /dev/null +++ b/polyhal/percpu/index.html @@ -0,0 +1,3 @@ +polyhal::percpu - Rust

Module polyhal::percpu

source ·
Expand description

Per-cpu module.

+

Functions

Attribute Macros

\ No newline at end of file diff --git a/polyhal/percpu/sidebar-items.js b/polyhal/percpu/sidebar-items.js new file mode 100644 index 0000000..69ff160 --- /dev/null +++ b/polyhal/percpu/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"attr":["def_percpu"],"fn":["get_local_thread_pointer","percpu_area_init","set_local_thread_pointer"]}; \ No newline at end of file diff --git a/polyhal/sidebar-items.js b/polyhal/sidebar-items.js new file mode 100644 index 0000000..b0861c3 --- /dev/null +++ b/polyhal/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"attr":["arch_entry","arch_interrupt"],"enum":["MappingSize"],"macro":["pub_use_arch"],"mod":["addr","boot","common","consts","debug_console","instruction","irq","kcontext","macros","mem","multicore","pagetable","percpu","time","timer","trap","trapframe","utils"],"struct":["MappingFlags","PageTable","PageTableWrapper"]}; \ No newline at end of file diff --git a/polyhal/struct.MappingFlags.html b/polyhal/struct.MappingFlags.html new file mode 100644 index 0000000..3c340d2 --- /dev/null +++ b/polyhal/struct.MappingFlags.html @@ -0,0 +1,91 @@ +MappingFlags in polyhal - Rust

Struct polyhal::MappingFlags

source ·
pub struct MappingFlags(/* private fields */);
Expand description

Mapping flags for page table.

+

Implementations§

source§

impl MappingFlags

source

pub const P: Self = _

Persent

+
source

pub const U: Self = _

User Accessable Flag

+
source

pub const R: Self = _

Readable Flag

+
source

pub const W: Self = _

Writeable Flag

+
source

pub const X: Self = _

Executeable Flag

+
source

pub const A: Self = _

Accessed Flag

+
source

pub const D: Self = _

Dirty Flag, indicating that the page was written

+
source

pub const G: Self = _

Global Flag

+
source

pub const Device: Self = _

Device Flag, indicating that the page was used for device memory

+
source

pub const Cache: Self = _

Cache Flag, indicating that the page will be cached

+
source

pub const RWX: Self = _

Read | Write | Executeable Flags

+
source

pub const URW: Self = _

User | Read | Write Flags

+
source

pub const URX: Self = _

User | Read | Executeable Flags

+
source

pub const URWX: Self = _

User | Read | Write | Executeable Flags

+
source§

impl MappingFlags

source

pub const fn empty() -> Self

Get a flags value with all bits unset.

+
source

pub const fn all() -> Self

Get a flags value with all known bits set.

+
source

pub const fn bits(&self) -> u64

Get the underlying bits value.

+

The returned value is exactly the bits set in this flags value.

+
source

pub const fn from_bits(bits: u64) -> Option<Self>

Convert from a bits value.

+

This method will return None if any unknown bits are set.

+
source

pub const fn from_bits_truncate(bits: u64) -> Self

Convert from a bits value, unsetting any unknown bits.

+
source

pub const fn from_bits_retain(bits: u64) -> Self

Convert from a bits value exactly.

+
source

pub fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set.

+

This method will return None if name is empty or doesn’t +correspond to any named flag.

+
source

pub const fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.

+
source

pub const fn is_all(&self) -> bool

Whether all known bits in this flags value are set.

+
source

pub const fn intersects(&self, other: Self) -> bool

Whether any set bits in a source flags value are also set in a target flags value.

+
source

pub const fn contains(&self, other: Self) -> bool

Whether all set bits in a source flags value are also set in a target flags value.

+
source

pub fn insert(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source

pub fn remove(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +remove won’t truncate other, but the ! operator will.

+
source

pub fn toggle(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub fn set(&mut self, other: Self, value: bool)

Call insert when value is true or remove when value is false.

+
source

pub const fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
source

pub const fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.

+
source

pub const fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source

pub const fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub const fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
source§

impl MappingFlags

source

pub const fn iter(&self) -> Iter<MappingFlags>

Yield a set of contained flags values.

+

Each yielded flags value will correspond to a defined named flag. Any unknown bits +will be yielded together as a final flags value.

+
source

pub const fn iter_names(&self) -> IterNames<MappingFlags>

Yield a set of contained named flags values.

+

This method is like iter, except only yields bits in contained named flags. +Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

+

Trait Implementations§

source§

impl Binary for MappingFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl BitAnd for MappingFlags

source§

fn bitand(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
§

type Output = MappingFlags

The resulting type after applying the & operator.
source§

impl BitAndAssign for MappingFlags

source§

fn bitand_assign(&mut self, other: Self)

The bitwise and (&) of the bits in two flags values.

+
source§

impl BitOr for MappingFlags

source§

fn bitor(self, other: MappingFlags) -> Self

The bitwise or (|) of the bits in two flags values.

+
§

type Output = MappingFlags

The resulting type after applying the | operator.
source§

impl BitOrAssign for MappingFlags

source§

fn bitor_assign(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source§

impl BitXor for MappingFlags

source§

fn bitxor(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
§

type Output = MappingFlags

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for MappingFlags

source§

fn bitxor_assign(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source§

impl Clone for MappingFlags

source§

fn clone(&self) -> MappingFlags

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MappingFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Extend<MappingFlags> for MappingFlags

source§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

The bitwise or (|) of the bits in each flags value.

+
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl Flags for MappingFlags

source§

const FLAGS: &'static [Flag<MappingFlags>] = _

The set of defined flags.
§

type Bits = u64

The underlying bits type.
source§

fn bits(&self) -> u64

Get the underlying bits value. Read more
source§

fn from_bits_retain(bits: u64) -> MappingFlags

Convert from a bits value exactly.
§

fn empty() -> Self

Get a flags value with all bits unset.
§

fn all() -> Self

Get a flags value with all known bits set.
§

fn from_bits(bits: Self::Bits) -> Option<Self>

Convert from a bits value. Read more
§

fn from_bits_truncate(bits: Self::Bits) -> Self

Convert from a bits value, unsetting any unknown bits.
§

fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set. Read more
§

fn iter(&self) -> Iter<Self>

Yield a set of contained flags values. Read more
§

fn iter_names(&self) -> IterNames<Self>

Yield a set of contained named flags values. Read more
§

fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.
§

fn is_all(&self) -> bool

Whether all known bits in this flags value are set.
§

fn intersects(&self, other: Self) -> boolwhere + Self: Sized,

Whether any set bits in a source flags value are also set in a target flags value.
§

fn contains(&self, other: Self) -> boolwhere + Self: Sized,

Whether all set bits in a source flags value are also set in a target flags value.
§

fn insert(&mut self, other: Self)where + Self: Sized,

The bitwise or (|) of the bits in two flags values.
§

fn remove(&mut self, other: Self)where + Self: Sized,

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn toggle(&mut self, other: Self)where + Self: Sized,

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn set(&mut self, other: Self, value: bool)where + Self: Sized,

Call [Flags::insert] when value is true or [Flags::remove] when value is false.
§

fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.
§

fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.
§

fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.
source§

impl From<MappingFlags> for PTEFlags

source§

fn from(flags: MappingFlags) -> Self

Converts to this type from the input type.
source§

impl From<PTEFlags> for MappingFlags

source§

fn from(value: PTEFlags) -> Self

Converts to this type from the input type.
source§

impl FromIterator<MappingFlags> for MappingFlags

source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

The bitwise or (|) of the bits in each flags value.

+
source§

impl Hash for MappingFlags

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where + H: Hasher, + Self: Sized,

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

impl IntoIterator for MappingFlags

§

type Item = MappingFlags

The type of the elements being iterated over.
§

type IntoIter = Iter<MappingFlags>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl LowerHex for MappingFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Not for MappingFlags

source§

fn not(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
§

type Output = MappingFlags

The resulting type after applying the ! operator.
source§

impl Octal for MappingFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Ord for MappingFlags

source§

fn cmp(&self, other: &MappingFlags) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for MappingFlags

source§

fn eq(&self, other: &MappingFlags) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for MappingFlags

source§

fn partial_cmp(&self, other: &MappingFlags) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl PublicFlags for MappingFlags

§

type Primitive = u64

The type of the underlying storage.
§

type Internal = InternalBitFlags

The type of the internal field on the generated flags type.
source§

impl Sub for MappingFlags

source§

fn sub(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
§

type Output = MappingFlags

The resulting type after applying the - operator.
source§

impl SubAssign for MappingFlags

source§

fn sub_assign(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source§

impl UpperHex for MappingFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Copy for MappingFlags

source§

impl Eq for MappingFlags

source§

impl StructuralEq for MappingFlags

source§

impl StructuralPartialEq for MappingFlags

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/struct.PageTable.html b/polyhal/struct.PageTable.html new file mode 100644 index 0000000..d403b91 --- /dev/null +++ b/polyhal/struct.PageTable.html @@ -0,0 +1,57 @@ +PageTable in polyhal - Rust

Struct polyhal::PageTable

source ·
#[repr(C)]
pub struct PageTable(/* private fields */);
Expand description

Page Table

+

This is just the page table defination. +The implementation of the page table in the specific architecture mod. +Such as: +x86_64/page_table.rs +riscv64/page_table/sv39.rs +aarch64/page_table.rs +loongarch64/page_table.rs

+

Implementations§

source§

impl PageTable

source

pub fn current() -> Self

source

pub fn kernel_pte_entry(&self) -> PhysAddr

source

pub fn restore(&self)

source

pub fn change(&self)

source§

impl PageTable

source

pub fn map_page( + &self, + vpn: VirtPage, + ppn: PhysPage, + flags: MappingFlags, + _size: MappingSize +)

Mapping a page to specific virtual page (user space address).

+

Ensure that PageTable is which you want to map. +vpn: Virtual page will be mapped. +ppn: Physical page. +flags: Mapping flags, include Read, Write, Execute and so on. +size: MappingSize. Just support 4KB page currently.

+
source

pub fn map_kernel( + &self, + vpn: VirtPage, + ppn: PhysPage, + flags: MappingFlags, + _size: MappingSize +)

Mapping a page to specific address(kernel space address).

+

TODO: This method is not implemented. +TIPS: If we mapped to kernel, the page will be shared between different pagetable.

+

Ensure that PageTable is which you want to map. +vpn: Virtual page will be mapped. +ppn: Physical page. +flags: Mapping flags, include Read, Write, Execute and so on. +size: MappingSize. Just support 4KB page currently.

+

How to implement shared.

+
source

pub fn unmap_page(&self, vpn: VirtPage)

Unmap a page from specific virtual page (user space address).

+

Ensure the virtual page is exists. +vpn: Virtual address.

+
source

pub fn translate(&self, vaddr: VirtAddr) -> Option<(PhysAddr, MappingFlags)>

Translate a virtual adress to a physical address and mapping flags.

+

Return None if the vaddr isn’t mapped. +vpn: The virtual address will be translated.

+
source

pub fn release(&self)

Release the page table entry.

+

The page table entry in the user space address will be released. +Page Table Wikipedia. +You don’t need to care about this if you just want to use.

+

Trait Implementations§

source§

impl Clone for PageTable

source§

fn clone(&self) -> PageTable

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PageTable

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for PageTable

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/struct.PageTableWrapper.html b/polyhal/struct.PageTableWrapper.html new file mode 100644 index 0000000..a31b365 --- /dev/null +++ b/polyhal/struct.PageTableWrapper.html @@ -0,0 +1,59 @@ +PageTableWrapper in polyhal - Rust
pub struct PageTableWrapper(pub PageTable);
Expand description

Page Table Wrapper

+

You can use this wrapper to packing PageTable. +If you release the PageTableWrapper, +the PageTable will release its page table entry.

+

Tuple Fields§

§0: PageTable

Implementations§

source§

impl PageTableWrapper

Allocate a new PageTableWrapper with new page table root

+

This operation will restore the page table.

+
source

pub fn alloc() -> Self

Alloc a new PageTableWrapper with new page table root +This operation will copy kernel page table space from booting page table.

+

Methods from Deref<Target = PageTable>§

source

pub fn kernel_pte_entry(&self) -> PhysAddr

source

pub fn restore(&self)

source

pub fn change(&self)

source

pub fn map_page( + &self, + vpn: VirtPage, + ppn: PhysPage, + flags: MappingFlags, + _size: MappingSize +)

Mapping a page to specific virtual page (user space address).

+

Ensure that PageTable is which you want to map. +vpn: Virtual page will be mapped. +ppn: Physical page. +flags: Mapping flags, include Read, Write, Execute and so on. +size: MappingSize. Just support 4KB page currently.

+
source

pub fn map_kernel( + &self, + vpn: VirtPage, + ppn: PhysPage, + flags: MappingFlags, + _size: MappingSize +)

Mapping a page to specific address(kernel space address).

+

TODO: This method is not implemented. +TIPS: If we mapped to kernel, the page will be shared between different pagetable.

+

Ensure that PageTable is which you want to map. +vpn: Virtual page will be mapped. +ppn: Physical page. +flags: Mapping flags, include Read, Write, Execute and so on. +size: MappingSize. Just support 4KB page currently.

+

How to implement shared.

+
source

pub fn unmap_page(&self, vpn: VirtPage)

Unmap a page from specific virtual page (user space address).

+

Ensure the virtual page is exists. +vpn: Virtual address.

+
source

pub fn translate(&self, vaddr: VirtAddr) -> Option<(PhysAddr, MappingFlags)>

Translate a virtual adress to a physical address and mapping flags.

+

Return None if the vaddr isn’t mapped. +vpn: The virtual address will be translated.

+
source

pub fn release(&self)

Release the page table entry.

+

The page table entry in the user space address will be released. +Page Table Wikipedia. +You don’t need to care about this if you just want to use.

+

Trait Implementations§

source§

impl Debug for PageTableWrapper

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for PageTableWrapper

§

type Target = PageTable

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Drop for PageTableWrapper

Page Table Release.

+

You must implement this trait to release page table. +Include the page table entry and root page.

+
source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/time/index.html b/polyhal/time/index.html new file mode 100644 index 0000000..de1c6bb --- /dev/null +++ b/polyhal/time/index.html @@ -0,0 +1 @@ +polyhal::time - Rust

Module polyhal::time

source ·

Structs

  • Time struct and its interface
\ No newline at end of file diff --git a/polyhal/time/sidebar-items.js b/polyhal/time/sidebar-items.js new file mode 100644 index 0000000..523bc91 --- /dev/null +++ b/polyhal/time/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Time"]}; \ No newline at end of file diff --git a/polyhal/time/struct.Time.html b/polyhal/time/struct.Time.html new file mode 100644 index 0000000..ea90269 --- /dev/null +++ b/polyhal/time/struct.Time.html @@ -0,0 +1,29 @@ +Time in polyhal::time - Rust

Struct polyhal::time::Time

source ·
pub struct Time(/* private fields */);
Expand description

Time struct and its interface

+

You can use this to get time from ticks

+

get current time

+
Time::now();
+

get current cpu’s frequency

+
Time::get_freq();
+

get how many nanoseconds have passed.

+
Time::now().to_nsec();
+

get how many microseconds have passed.

+
Time::now().to_usec();
+

get how many millisecond have passed.

+
Time::now().to_msec();
+

get how may ticks have passed

+
Time::now().raw();
+

convert ticks to time

+
Time::from_raw(Time::now().raw());
+

Implementations§

source§

impl Time

source

pub fn get_freq() -> usize

source

pub fn now() -> Self

source§

impl Time

source

pub fn to_msec(&self) -> usize

source

pub fn to_usec(&self) -> usize

source

pub fn to_nsec(&self) -> usize

Converts hardware ticks to nanoseconds.

+
source

pub fn raw(&self) -> usize

source

pub fn from_raw(raw: usize) -> Self

Trait Implementations§

source§

impl Clone for Time

source§

fn clone(&self) -> Time

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Time

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for Time

Auto Trait Implementations§

§

impl RefUnwindSafe for Time

§

impl Send for Time

§

impl Sync for Time

§

impl Unpin for Time

§

impl UnwindSafe for Time

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/timer/fn.init.html b/polyhal/timer/fn.init.html new file mode 100644 index 0000000..92a8d94 --- /dev/null +++ b/polyhal/timer/fn.init.html @@ -0,0 +1 @@ +init in polyhal::timer - Rust

Function polyhal::timer::init

source ·
pub fn init()
\ No newline at end of file diff --git a/polyhal/timer/fn.set_next_timeout.html b/polyhal/timer/fn.set_next_timeout.html new file mode 100644 index 0000000..b43f017 --- /dev/null +++ b/polyhal/timer/fn.set_next_timeout.html @@ -0,0 +1 @@ +set_next_timeout in polyhal::timer - Rust
pub fn set_next_timeout()
\ No newline at end of file diff --git a/polyhal/timer/index.html b/polyhal/timer/index.html new file mode 100644 index 0000000..980ca29 --- /dev/null +++ b/polyhal/timer/index.html @@ -0,0 +1,2 @@ +polyhal::timer - Rust

Module polyhal::timer

source ·
Expand description

Timer module.

+

Functions

\ No newline at end of file diff --git a/polyhal/timer/sidebar-items.js b/polyhal/timer/sidebar-items.js new file mode 100644 index 0000000..4ce0a73 --- /dev/null +++ b/polyhal/timer/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["init","set_next_timeout"]}; \ No newline at end of file diff --git a/polyhal/trap/enum.EscapeReason.html b/polyhal/trap/enum.EscapeReason.html new file mode 100644 index 0000000..3345c89 --- /dev/null +++ b/polyhal/trap/enum.EscapeReason.html @@ -0,0 +1,19 @@ +EscapeReason in polyhal::trap - Rust
pub enum EscapeReason {
+    NoReason,
+    IRQ,
+    Timer,
+    SysCall,
+}

Variants§

§

NoReason

§

IRQ

§

Timer

§

SysCall

Trait Implementations§

source§

impl Clone for EscapeReason

source§

fn clone(&self) -> EscapeReason

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EscapeReason

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Into<EscapeReason> for TrapType

source§

fn into(self) -> EscapeReason

Converts this type into the (usually inferred) input type.
source§

impl PartialEq for EscapeReason

source§

fn eq(&self, other: &EscapeReason) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for EscapeReason

source§

impl Eq for EscapeReason

source§

impl StructuralEq for EscapeReason

source§

impl StructuralPartialEq for EscapeReason

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/trap/enum.TrapType.html b/polyhal/trap/enum.TrapType.html new file mode 100644 index 0000000..b19cd3a --- /dev/null +++ b/polyhal/trap/enum.TrapType.html @@ -0,0 +1,23 @@ +TrapType in polyhal::trap - Rust

Enum polyhal::trap::TrapType

source ·
pub enum TrapType {
+    Breakpoint,
+    SysCall,
+    Timer,
+    Unknown,
+    SupervisorExternal,
+    StorePageFault(usize),
+    LoadPageFault(usize),
+    InstructionPageFault(usize),
+    IllegalInstruction(usize),
+    Irq(IRQVector),
+}

Variants§

§

Breakpoint

§

SysCall

§

Timer

§

Unknown

§

SupervisorExternal

§

StorePageFault(usize)

§

LoadPageFault(usize)

§

InstructionPageFault(usize)

§

IllegalInstruction(usize)

§

Irq(IRQVector)

Trait Implementations§

source§

impl Clone for TrapType

source§

fn clone(&self) -> TrapType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TrapType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Into<EscapeReason> for TrapType

source§

fn into(self) -> EscapeReason

Converts this type into the (usually inferred) input type.
source§

impl Copy for TrapType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/trap/fn.kernelvec.html b/polyhal/trap/fn.kernelvec.html new file mode 100644 index 0000000..f7e4f78 --- /dev/null +++ b/polyhal/trap/fn.kernelvec.html @@ -0,0 +1 @@ +kernelvec in polyhal::trap - Rust

Function polyhal::trap::kernelvec

source ·
pub unsafe extern "C" fn kernelvec()
\ No newline at end of file diff --git a/polyhal/trap/fn.run_user_task.html b/polyhal/trap/fn.run_user_task.html new file mode 100644 index 0000000..99f9e6f --- /dev/null +++ b/polyhal/trap/fn.run_user_task.html @@ -0,0 +1,2 @@ +run_user_task in polyhal::trap - Rust

Function polyhal::trap::run_user_task

source ·
pub fn run_user_task(context: &mut TrapFrame) -> EscapeReason
Expand description

Return EscapeReson related to interrupt type.

+
\ No newline at end of file diff --git a/polyhal/trap/fn.run_user_task_forever.html b/polyhal/trap/fn.run_user_task_forever.html new file mode 100644 index 0000000..3f290e3 --- /dev/null +++ b/polyhal/trap/fn.run_user_task_forever.html @@ -0,0 +1,2 @@ +run_user_task_forever in polyhal::trap - Rust
pub fn run_user_task_forever(context: &mut TrapFrame) -> !
Expand description

Run user task until interrupt is received.

+
\ No newline at end of file diff --git a/polyhal/trap/fn.uservec.html b/polyhal/trap/fn.uservec.html new file mode 100644 index 0000000..cbe68af --- /dev/null +++ b/polyhal/trap/fn.uservec.html @@ -0,0 +1,2 @@ +uservec in polyhal::trap - Rust

Function polyhal::trap::uservec

source ·
#[no_mangle]
+pub unsafe extern "C" fn uservec()
\ No newline at end of file diff --git a/polyhal/trap/index.html b/polyhal/trap/index.html new file mode 100644 index 0000000..7a312b4 --- /dev/null +++ b/polyhal/trap/index.html @@ -0,0 +1,2 @@ +polyhal::trap - Rust

Module polyhal::trap

source ·
Expand description

Define and initialize the trap handler.

+

Enums

Functions

\ No newline at end of file diff --git a/polyhal/trap/sidebar-items.js b/polyhal/trap/sidebar-items.js new file mode 100644 index 0000000..e179ec1 --- /dev/null +++ b/polyhal/trap/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["EscapeReason","TrapType"],"fn":["kernelvec","run_user_task","run_user_task_forever","uservec"]}; \ No newline at end of file diff --git a/polyhal/trapframe/constant.TRAPFRAME_SIZE.html b/polyhal/trapframe/constant.TRAPFRAME_SIZE.html new file mode 100644 index 0000000..f070cfc --- /dev/null +++ b/polyhal/trapframe/constant.TRAPFRAME_SIZE.html @@ -0,0 +1,2 @@ +TRAPFRAME_SIZE in polyhal::trapframe - Rust
pub const TRAPFRAME_SIZE: usize = _; // 288usize
Expand description

The size of the TrapFrame

+
\ No newline at end of file diff --git a/polyhal/trapframe/enum.TrapFrameArgs.html b/polyhal/trapframe/enum.TrapFrameArgs.html new file mode 100644 index 0000000..12331cd --- /dev/null +++ b/polyhal/trapframe/enum.TrapFrameArgs.html @@ -0,0 +1,23 @@ +TrapFrameArgs in polyhal::trapframe - Rust
pub enum TrapFrameArgs {
+    SEPC,
+    RA,
+    SP,
+    RET,
+    ARG0,
+    ARG1,
+    ARG2,
+    TLS,
+    SYSCALL,
+}
Expand description

Trap Frame Arg Type

+

Using this by Index and IndexMut trait bound on TrapFrame

+

Variants§

§

SEPC

§

RA

§

SP

§

RET

§

ARG0

§

ARG1

§

ARG2

§

TLS

§

SYSCALL

Trait Implementations§

source§

impl Debug for TrapFrameArgs

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Index<TrapFrameArgs> for TrapFrame

§

type Output = usize

The returned type after indexing.
source§

fn index(&self, index: TrapFrameArgs) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl IndexMut<TrapFrameArgs> for TrapFrame

source§

fn index_mut(&mut self, index: TrapFrameArgs) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/trapframe/index.html b/polyhal/trapframe/index.html new file mode 100644 index 0000000..86680fe --- /dev/null +++ b/polyhal/trapframe/index.html @@ -0,0 +1,2 @@ +polyhal::trapframe - Rust

Module polyhal::trapframe

source ·
Expand description

Trapframe module.

+

Structs

Enums

Constants

\ No newline at end of file diff --git a/polyhal/trapframe/sidebar-items.js b/polyhal/trapframe/sidebar-items.js new file mode 100644 index 0000000..9337cc9 --- /dev/null +++ b/polyhal/trapframe/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["TRAPFRAME_SIZE"],"enum":["TrapFrameArgs"],"struct":["KernelToken","TrapFrame"]}; \ No newline at end of file diff --git a/polyhal/trapframe/struct.KernelToken.html b/polyhal/trapframe/struct.KernelToken.html new file mode 100644 index 0000000..f6d62c2 --- /dev/null +++ b/polyhal/trapframe/struct.KernelToken.html @@ -0,0 +1,20 @@ +KernelToken in polyhal::trapframe - Rust
#[repr(C)]
pub struct KernelToken { + pub sp: usize, + pub gp: usize, + pub tp: usize, + pub a0: usize, + pub ra: usize, + /* private fields */ +}
Expand description

Kernel Token

+

Store the kernel runtime info before

+

Fields§

§sp: usize§gp: usize§tp: usize§a0: usize§ra: usize

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/trapframe/struct.TrapFrame.html b/polyhal/trapframe/struct.TrapFrame.html new file mode 100644 index 0000000..369f647 --- /dev/null +++ b/polyhal/trapframe/struct.TrapFrame.html @@ -0,0 +1,18 @@ +TrapFrame in polyhal::trapframe - Rust
#[repr(C)]
pub struct TrapFrame { + pub x: [usize; 32], + pub sstatus: Sstatus, + pub sepc: usize, + pub fsx: [usize; 2], +}

Fields§

§x: [usize; 32]§sstatus: Sstatus§sepc: usize§fsx: [usize; 2]

Implementations§

source§

impl TrapFrame

source

pub fn new() -> Self

source

pub fn args(&self) -> [usize; 6]

source

pub fn from_user(&self) -> bool

Check if the trapframe was from user.

+
source

pub fn syscall_ok(&mut self)

Trait Implementations§

source§

impl Clone for TrapFrame

source§

fn clone(&self) -> TrapFrame

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TrapFrame

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Index<TrapFrameArgs> for TrapFrame

§

type Output = usize

The returned type after indexing.
source§

fn index(&self, index: TrapFrameArgs) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl IndexMut<TrapFrameArgs> for TrapFrame

source§

fn index_mut(&mut self, index: TrapFrameArgs) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/utils/index.html b/polyhal/utils/index.html new file mode 100644 index 0000000..5ed4006 --- /dev/null +++ b/polyhal/utils/index.html @@ -0,0 +1 @@ +polyhal::utils - Rust

Module polyhal::utils

source ·

Macros

  • bit macro will generate the number through a shift value.

Structs

\ No newline at end of file diff --git a/polyhal/utils/lazy_init/struct.LazyInit.html b/polyhal/utils/lazy_init/struct.LazyInit.html new file mode 100644 index 0000000..bfeb39c --- /dev/null +++ b/polyhal/utils/lazy_init/struct.LazyInit.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/utils/struct.LazyInit.html...

+ + + \ No newline at end of file diff --git a/polyhal/utils/macro.bit!.html b/polyhal/utils/macro.bit!.html new file mode 100644 index 0000000..4b73408 --- /dev/null +++ b/polyhal/utils/macro.bit!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.bit.html...

+ + + \ No newline at end of file diff --git a/polyhal/utils/macro.bit.html b/polyhal/utils/macro.bit.html new file mode 100644 index 0000000..4c7f59f --- /dev/null +++ b/polyhal/utils/macro.bit.html @@ -0,0 +1,7 @@ +bit in polyhal::utils - Rust

Macro polyhal::utils::bit

source ·
pub macro bit($x: expr) {
+    ...
+}
Expand description

bit macro will generate the number through a shift value.

+

Here is an example. +You can use bit!(0) instead of 1 << 0. +bit!(39) instead of 1 << 39.

+
\ No newline at end of file diff --git a/polyhal/utils/macros/macro.bit!.html b/polyhal/utils/macros/macro.bit!.html new file mode 100644 index 0000000..4b73408 --- /dev/null +++ b/polyhal/utils/macros/macro.bit!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.bit.html...

+ + + \ No newline at end of file diff --git a/polyhal/utils/macros/macro.bit.html b/polyhal/utils/macros/macro.bit.html new file mode 100644 index 0000000..e989e93 --- /dev/null +++ b/polyhal/utils/macros/macro.bit.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/utils/macro.bit.html...

+ + + \ No newline at end of file diff --git a/polyhal/utils/mutex_no_irq/struct.MutexNoIrq.html b/polyhal/utils/mutex_no_irq/struct.MutexNoIrq.html new file mode 100644 index 0000000..21a3da1 --- /dev/null +++ b/polyhal/utils/mutex_no_irq/struct.MutexNoIrq.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/utils/struct.MutexNoIrq.html...

+ + + \ No newline at end of file diff --git a/polyhal/utils/mutex_no_irq/struct.MutexNoIrqGuard.html b/polyhal/utils/mutex_no_irq/struct.MutexNoIrqGuard.html new file mode 100644 index 0000000..8b33690 --- /dev/null +++ b/polyhal/utils/mutex_no_irq/struct.MutexNoIrqGuard.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../polyhal/utils/struct.MutexNoIrqGuard.html...

+ + + \ No newline at end of file diff --git a/polyhal/utils/sidebar-items.js b/polyhal/utils/sidebar-items.js new file mode 100644 index 0000000..e046221 --- /dev/null +++ b/polyhal/utils/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"macro":["bit"],"struct":["LazyInit","MutexNoIrq","MutexNoIrqGuard"]}; \ No newline at end of file diff --git a/polyhal/utils/struct.LazyInit.html b/polyhal/utils/struct.LazyInit.html new file mode 100644 index 0000000..a6b9ee0 --- /dev/null +++ b/polyhal/utils/struct.LazyInit.html @@ -0,0 +1,17 @@ +LazyInit in polyhal::utils - Rust

Struct polyhal::utils::LazyInit

source ·
pub struct LazyInit<T> { /* private fields */ }

Implementations§

source§

impl<T> LazyInit<T>

source

pub const fn new() -> Self

source

pub fn init_by(&self, data: T)

source

pub fn is_init(&self) -> bool

source

pub fn try_get(&self) -> Option<&T>

source

pub unsafe fn get_unchecked(&self) -> &T

Safety
+

Must be called after initialization.

+
source

pub unsafe fn get_mut_unchecked(&mut self) -> &mut T

Safety
+

Must be called after initialization.

+

Trait Implementations§

source§

impl<T: Debug> Debug for LazyInit<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> Deref for LazyInit<T>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
source§

impl<T> DerefMut for LazyInit<T>

source§

fn deref_mut(&mut self) -> &mut T

Mutably dereferences the value.
source§

impl<T> Drop for LazyInit<T>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<T: Send> Send for LazyInit<T>

source§

impl<T: Send + Sync> Sync for LazyInit<T>

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for LazyInit<T>

§

impl<T> Unpin for LazyInit<T>where + T: Unpin,

§

impl<T> UnwindSafe for LazyInit<T>where + T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/utils/struct.MutexNoIrq.html b/polyhal/utils/struct.MutexNoIrq.html new file mode 100644 index 0000000..a5c09ad --- /dev/null +++ b/polyhal/utils/struct.MutexNoIrq.html @@ -0,0 +1,15 @@ +MutexNoIrq in polyhal::utils - Rust

Struct polyhal::utils::MutexNoIrq

source ·
pub struct MutexNoIrq<T: ?Sized> { /* private fields */ }

Implementations§

source§

impl<T> MutexNoIrq<T>

source

pub const fn new(data: T) -> MutexNoIrq<T>

source

pub fn into_inner(self) -> T

source§

impl<T: ?Sized> MutexNoIrq<T>

source

pub fn lock(&self) -> MutexNoIrqGuard<'_, T>

source

pub fn is_locked(&self) -> bool

source

pub unsafe fn force_unlock(&self)

source

pub fn try_lock(&self) -> Option<MutexNoIrqGuard<'_, T>>

Trait Implementations§

source§

impl<T: ?Sized + Send> Send for MutexNoIrq<T>

Implement Send for MutexNoIrq

+
source§

impl<T: ?Sized + Send> Sync for MutexNoIrq<T>

Implement Sync for MutexNoIrq

+

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for MutexNoIrq<T>

§

impl<T: ?Sized> Unpin for MutexNoIrq<T>where + T: Unpin,

§

impl<T: ?Sized> UnwindSafe for MutexNoIrq<T>where + T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/polyhal/utils/struct.MutexNoIrqGuard.html b/polyhal/utils/struct.MutexNoIrqGuard.html new file mode 100644 index 0000000..aae89ad --- /dev/null +++ b/polyhal/utils/struct.MutexNoIrqGuard.html @@ -0,0 +1,16 @@ +MutexNoIrqGuard in polyhal::utils - Rust
pub struct MutexNoIrqGuard<'a, T: ?Sized + 'a> { /* private fields */ }
Expand description

The Mutex Guard.

+

Trait Implementations§

source§

impl<'a, T: ?Sized> Deref for MutexNoIrqGuard<'a, T>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
source§

impl<'a, T: ?Sized> DerefMut for MutexNoIrqGuard<'a, T>

source§

fn deref_mut(&mut self) -> &mut T

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'a, T: ?Sized> RefUnwindSafe for MutexNoIrqGuard<'a, T>where + T: RefUnwindSafe,

§

impl<'a, T: ?Sized> Send for MutexNoIrqGuard<'a, T>where + T: Send,

§

impl<'a, T: ?Sized> Sync for MutexNoIrqGuard<'a, T>where + T: Sync,

§

impl<'a, T: ?Sized> Unpin for MutexNoIrqGuard<'a, T>

§

impl<'a, T: ?Sized> UnwindSafe for MutexNoIrqGuard<'a, T>where + T: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for Twhere + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

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

+
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/search-index.js b/search-index.js new file mode 100644 index 0000000..0ddd232 --- /dev/null +++ b/search-index.js @@ -0,0 +1,5 @@ +var searchIndex = JSON.parse('{\ +"polyhal":{"doc":"This is a crate to help you supporting multiple platforms.","t":"FGPFFEEEEECXXCCCCCCCCCCCCQCCCCCFFFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNSHKMMHHHHSSSFNNNNNNNNNNNNNFNNNNNNNNNFFNNNNNNNNNNNNNNNNNNNNNNNNNFGPPPNNNNNHHNNNNNNNNHNNNNNNQFNNNNNNNNNFFNHHNNNNNNNNNNNNNNTTTTTTTTTTTFGTSFPFFTTTFTTTTTSTTTTTTNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNXHHHFNNNNNNNNNNNNNNNNNNHHPGPPPPPPPPPPPPGPNNNNNNNNNNNNNNNNHHHNNNNNNNNHPPPFPPPPPPSFGONNNNNNNNNNNNNNNOONNNNNNOOOONNONNNNNNNNNOFFFQNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN","n":["MappingFlags","MappingSize","Page4KB","PageTable","PageTableWrapper","PhysAddr","PhysPage","Time","VirtAddr","VirtPage","addr","arch_entry","arch_interrupt","boot","common","consts","debug_console","instruction","irq","kcontext","macros","mem","multicore","pagetable","percpu","pub_use_arch","time","timer","trap","trapframe","utils","PhysAddr","PhysPage","VirtAddr","VirtPage","add","add","add","addr","addr","as_num","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","ceil","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","cmp","cmp","cmp","cmp","copy_value_from_another","drop_clear","eq","eq","eq","eq","floor","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from_addr","from_addr","get_buffer","get_cstr","get_cstr","get_mut_ptr","get_mut_ptr","get_mut_ref","get_ptr","get_ptr","get_ref","into","into","into","into","new","new","new","new","partial_cmp","partial_cmp","partial_cmp","partial_cmp","pn_index","pn_offest","slice_mut_with_len","slice_mut_with_len","slice_until","slice_with_len","slice_with_len","to_addr","to_addr","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","write_volatile","STACK_SIZE","boot_page_table","PageAlloc","alloc","dealloc","get_cpu_num","get_fdt","get_mem_areas","init","MULTI_CORE_AREA","MULTI_CORE_AREA_SIZE","VIRT_ADDR_START","DebugConsole","borrow","borrow_mut","enabled","flush","from","getchar","into","log","putchar","try_from","try_into","type_id","write_str","Instruction","borrow","borrow_mut","from","hlt","into","shutdown","try_from","try_into","type_id","IRQ","IRQVector","ack","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","fmt","from","from","int_disable","int_enable","int_enabled","into","into","irq_disable","irq_enable","irq_num","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","KContext","KContextArgs","KPC","KSP","KTP","blank","borrow","borrow","borrow_mut","borrow_mut","context_switch","context_switch_pt","fmt","fmt","from","from","index","index_mut","into","into","read_current_tp","try_from","try_from","try_into","try_into","type_id","type_id","pub_use_arch","Barrier","borrow","borrow_mut","complete_sync","from","into","ordering_sync","try_from","try_into","type_id","CpuCore","MultiCore","boot_all","boot_core","boot_core","borrow","borrow","borrow_mut","borrow_mut","from","from","into","into","try_from","try_from","try_into","try_into","type_id","type_id","A","A","ADGVRWX","ADUVRX","ADVRWX","Cache","D","D","Device","G","G","MappingFlags","MappingSize","P","PAGE_SIZE","PTEFlags","Page4KB","PageTable","PageTableWrapper","R","R","RWX","TLB","U","U","URW","URWX","URX","USER_VADDR_END","V","VRWX","W","W","X","X","all","all","all","alloc","bitand","bitand","bitand_assign","bitand_assign","bitor","bitor","bitor_assign","bitor_assign","bits","bits","bits","bits","bits","bitxor","bitxor","bitxor_assign","bitxor_assign","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","change","clone","clone","clone","clone_into","clone_into","clone_into","cmp","cmp","complement","complement","complement","contains","contains","contains","current","deref","difference","difference","difference","drop","empty","empty","empty","eq","eq","extend","extend","flush_all","flush_vaddr","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_retain","from_bits_retain","from_bits_retain","from_bits_retain","from_bits_retain","from_bits_truncate","from_bits_truncate","from_bits_truncate","from_iter","from_iter","from_name","from_name","from_name","hash","hash","insert","insert","insert","intersection","intersection","intersection","intersects","intersects","intersects","into","into","into","into","into","into","into_iter","into_iter","is_all","is_all","is_all","is_empty","is_empty","is_empty","iter","iter","iter","iter_names","iter_names","iter_names","kernel_pte_entry","map_kernel","map_page","not","not","partial_cmp","partial_cmp","release","remove","remove","remove","restore","set","set","set","sub","sub","sub_assign","sub_assign","symmetric_difference","symmetric_difference","symmetric_difference","to_owned","to_owned","to_owned","toggle","toggle","toggle","translate","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","union","union","union","unmap_page","def_percpu","get_local_thread_pointer","percpu_area_init","set_local_thread_pointer","Time","borrow","borrow_mut","clone","clone_into","fmt","from","from_raw","get_freq","into","now","raw","to_msec","to_nsec","to_owned","to_usec","try_from","try_into","type_id","init","set_next_timeout","Breakpoint","EscapeReason","IRQ","IllegalInstruction","InstructionPageFault","Irq","LoadPageFault","NoReason","StorePageFault","SupervisorExternal","SysCall","SysCall","Timer","Timer","TrapType","Unknown","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","eq","fmt","fmt","from","from","into","into","into","kernelvec","run_user_task","run_user_task_forever","to_owned","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","uservec","ARG0","ARG1","ARG2","KernelToken","RA","RET","SEPC","SP","SYSCALL","TLS","TRAPFRAME_SIZE","TrapFrame","TrapFrameArgs","a0","args","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone_into","fmt","fmt","from","from","from","from_user","fsx","gp","index","index_mut","into","into","into","new","ra","sepc","sp","sstatus","syscall_ok","to_owned","tp","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","x","LazyInit","MutexNoIrq","MutexNoIrqGuard","bit","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","deref","deref","deref_mut","deref_mut","drop","fmt","force_unlock","from","from","from","get_mut_unchecked","get_unchecked","init_by","into","into","into","into_inner","is_init","is_locked","lock","new","new","try_from","try_from","try_from","try_get","try_into","try_into","try_into","try_lock","type_id","type_id","type_id"],"q":[[0,"polyhal"],[31,"polyhal::addr"],[141,"polyhal::boot"],[143,"polyhal::common"],[150,"polyhal::consts"],[153,"polyhal::debug_console"],[167,"polyhal::instruction"],[177,"polyhal::irq"],[204,"polyhal::kcontext"],[231,"polyhal::macros"],[232,"polyhal::mem"],[242,"polyhal::multicore"],[261,"polyhal::pagetable"],[478,"polyhal::percpu"],[482,"polyhal::time"],[501,"polyhal::timer"],[503,"polyhal::trap"],[547,"polyhal::trapframe"],[601,"polyhal::utils"],[644,"core::cmp"],[645,"core::fmt"],[646,"core::fmt"],[647,"core::option"],[648,"alloc::string"],[649,"core::result"],[650,"core::any"],[651,"fdt"],[652,"alloc::vec"],[653,"log"],[654,"log"],[655,"core::hash"],[656,"bitflags::iter"],[657,"bitflags::iter"],[658,"core::fmt"]],"d":["Mapping flags for page table.","This structure indicates size of the page that will be …","","Page Table","Page Table Wrapper","","","","","","","","","Boot Components.","","Consts components","This is a console for debugging, If you want to use this …","Instruction Module.","IRQ(Interrupt requests queue) module.","Kernel Context module.","","","Multi-core Module.","","Per-cpu module.","","","Timer module.","Define and initialize the trap handler.","Trapframe module.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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).","","","","","","","","","Get n level page table index of the given virtual address","Get n level page table offset of the given virtual address","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Boot Stack Size. TODO: reduce the boot stack size. Map …","Get Boot Page Table.","Page Allocation trait for privoids that page allocation","Allocate a physical page","Release a physical page","Get the number of cpus","Get the fdt","Get the memory area, this function should be called after …","Init arch with page allocator, like log crate Please …","Every core has a unique area of memory. Just using …","","Virtual Address Offset.","","","","","","Returns the argument unchanged.","","Calls U::from(self).","","","","","","","Platform Instruction [Instruction::ebreak] Intruction …","","","Returns the argument unchanged.","","Calls U::from(self).","Call SBI_SHUTDOWN to close the machine. Exit qemu if you …","","","","","","Acknowledge the irq","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Disable interrupts.","Enable interrupts.","Check if the interrupts was enabled.","Calls U::from(self).","Calls U::from(self).","Disable irq for the given IRQ number.","Enable irq for the given IRQ number.","Get the irq number in this vector","","","","","","","","Kernel Context","Kernel Context Arg Type.","Kernel Program Counter","Kernel Stack Pointer","Kernel Thread Pointer","Create a new blank Kernel Context.","","","","","Context Switch","Context Switch With Page Table","","","Returns the argument unchanged.","Returns the argument unchanged.","","","Calls U::from(self).","Calls U::from(self).","","","","","","","","","This is a barrier function.","","","","Returns the argument unchanged.","Calls U::from(self).","","","","","","","Boot all application cores.","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","","","","","","","Accessed Flag","","","","","Cache Flag, indicating that the page will be cached","Dirty Flag, indicating that the page was written","","Device Flag, indicating that the page was used for device …","Global Flag","","Mapping flags for page table.","This structure indicates size of the page that will be …","Persent","The size of the page table.","","","Page Table","Page Table Wrapper","Readable Flag","","Read | Write | Executeable Flags","TLB Operation set. Such as flush_vaddr, flush_all. Just …","User Accessable Flag","","User | Read | Write Flags","User | Read | Write | Executeable Flags","User | Read | Executeable Flags","The max address of the user virtual address.","","","Writeable Flag","","Executeable Flag","","Get a flags value with all known bits set.","Get a flags value with all known bits set.","Get a flags value with all known bits set.","Alloc a new PageTableWrapper with new page table root This …","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","Get the underlying bits value.","Get the underlying bits value.","","","Get the underlying bits value.","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","","","","","","","","","","","","","","","","","","","","","","The bitwise negation (!) of the bits in a flags value, …","The bitwise negation (!) of the bits in a flags value, …","The bitwise negation (!) of the bits in a flags value, …","Whether all set bits in a source flags value are also set …","Whether all set bits in a source flags value are also set …","Whether all set bits in a source flags value are also set …","","","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","","Get a flags value with all bits unset.","Get a flags value with all bits unset.","Get a flags value with all bits unset.","","","The bitwise or (|) of the bits in each flags value.","The bitwise or (|) of the bits in each flags value.","flush all tlb entry","flush the TLB entry by VirtualAddress just use it directly","","","","","","","","","","","","","","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 a bits value.","Convert from a bits value.","Convert from a bits value.","Convert from a bits value exactly.","","Convert from a bits value exactly.","Convert from a bits value exactly.","","Convert from a bits value, unsetting any unknown bits.","Convert from a bits value, unsetting any unknown bits.","Convert from a bits value, unsetting any unknown bits.","The bitwise or (|) of the bits in each flags value.","The bitwise or (|) of the bits in each flags value.","Get a flags value with the bits of a flag with the given …","Get a flags value with the bits of a flag with the given …","Get a flags value with the bits of a flag with the given …","","","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","The bitwise and (&) of the bits in two flags values.","Whether any set bits in a source flags value are also set …","Whether any set bits in a source flags value are also set …","Whether any set bits in a source flags value are also set …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","Whether all known bits in this flags value are set.","Whether all known bits in this flags value are set.","Whether all known bits in this flags value are set.","Whether all bits in this flags value are unset.","Whether all bits in this flags value are unset.","Whether all bits in this flags value are unset.","Yield a set of contained flags values.","Yield a set of contained flags values.","Yield a set of contained flags values.","Yield a set of contained named flags values.","Yield a set of contained named flags values.","Yield a set of contained named flags values.","","Mapping a page to specific address(kernel space address).","Mapping a page to specific virtual page (user space …","The bitwise negation (!) of the bits in a flags value, …","The bitwise negation (!) of the bits in a flags value, …","","","Release the page table entry.","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","","Call insert when value is true or remove when value is …","Call insert when value is true or remove when value is …","Call insert when value is true or remove when value is …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The intersection of a source flags value with the …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","","","","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","The bitwise exclusive-or (^) of the bits in two flags …","Translate a virtual adress to a physical address and …","","","","","","","","","","","","","","","","","","","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","The bitwise or (|) of the bits in two flags values.","Unmap a page from specific virtual page (user space …","Defines a per-CPU data structure.","Read the architecture-specific thread pointer register on …","Returns the base address of the per-CPU data area on the …","Set the architecture-specific thread pointer register to …","Time struct and its interface","","","","","","Returns the argument unchanged.","","","Calls U::from(self).","","","","Converts hardware ticks to nanoseconds.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","","Calls U::from(self).","","Return EscapeReson related to interrupt type.","Run user task until interrupt is received.","","","","","","","","","","","","","Kernel Token","","","","","","","The size of the TrapFrame","","Trap Frame Arg Type","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Check if the trapframe was from user.","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","The Mutex Guard.","bit macro will generate the number through a shift value.","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Safety","Safety","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","",""],"i":[0,0,36,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,1,1,3,4,5,1,4,5,1,3,4,5,1,3,5,4,5,1,3,4,5,1,3,4,5,1,3,1,1,4,5,1,3,5,4,4,5,5,1,1,3,3,4,4,5,5,5,1,1,1,3,3,3,1,3,1,4,5,4,5,5,4,5,5,4,5,1,3,4,5,1,3,4,5,1,3,3,5,4,5,5,4,5,1,3,4,5,1,3,4,5,1,3,4,5,1,3,4,5,1,3,4,5,1,3,4,0,0,0,19,19,0,0,0,0,0,0,0,0,22,22,22,22,22,22,22,22,22,22,22,22,22,0,51,51,51,51,51,51,51,51,51,0,0,27,52,27,52,27,27,27,27,52,27,52,52,52,52,27,52,52,27,27,52,27,52,27,52,27,0,0,29,29,29,28,28,29,28,29,0,0,28,29,28,29,28,28,28,29,0,28,29,28,29,28,29,0,0,53,53,53,53,53,53,53,53,53,0,0,54,0,0,54,55,54,55,54,55,54,55,54,55,54,55,54,55,30,31,31,31,31,30,30,31,30,30,31,0,0,30,0,0,36,0,0,30,31,30,0,30,31,30,30,30,0,31,31,30,31,30,31,30,30,31,32,30,31,30,31,30,31,30,31,30,30,30,31,31,30,31,30,31,56,18,30,36,32,31,56,18,30,36,32,31,18,18,30,31,18,30,31,30,31,30,30,31,30,30,31,18,32,30,30,31,32,30,30,31,30,31,30,31,56,56,18,30,30,30,30,30,36,32,31,31,31,31,31,56,18,30,30,36,32,31,31,30,30,31,30,30,30,31,31,30,30,31,30,31,30,30,31,30,31,30,30,31,30,30,31,30,30,31,56,18,30,36,32,31,30,31,30,30,31,30,30,31,30,30,31,30,30,31,18,18,18,30,31,30,31,18,30,30,31,18,30,30,31,30,31,30,31,30,30,31,18,30,31,30,30,31,18,56,18,30,36,32,31,56,18,30,36,32,31,56,18,30,36,32,31,30,30,31,18,0,0,0,0,0,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,0,0,41,0,42,41,41,41,41,42,41,41,41,42,41,42,0,41,41,42,41,42,41,42,41,42,42,41,42,41,42,41,41,42,0,0,0,41,42,41,42,41,42,41,42,0,45,45,45,0,45,45,45,45,45,45,0,0,0,57,43,57,43,45,57,43,45,43,43,43,45,57,43,45,43,43,57,43,43,57,43,45,43,57,43,57,43,43,43,57,57,43,45,57,43,45,57,43,45,43,0,0,0,0,46,50,47,46,50,47,46,47,46,47,46,46,50,46,50,47,46,46,46,46,50,47,50,46,50,50,46,50,46,50,47,46,46,50,47,50,46,50,47],"f":[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,[[1,2],-1,[]],[[1,1],-1,[]],[[3,2],-1,[]],[4,2],[5,2],[1,2],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[5,5],[4,4],[5,5],[1,1],[3,3],[[-1,-2],6,[],[]],[[-1,-2],6,[],[]],[[-1,-2],6,[],[]],[[-1,-2],6,[],[]],[[4,4],7],[[5,5],7],[[1,1],7],[[3,3],7],[[1,1],6],[1,6],[[4,4],8],[[5,5],8],[[1,1],8],[[3,3],8],[5,5],[[4,9],10],[[4,9],10],[[5,9],10],[[5,9],10],[[1,9],10],[[1,9],10],[[3,9],10],[[3,9],10],[-1,-1,[]],[1,4],[2,5],[3,5],[-1,-1,[]],[2,1],[-1,-1,[]],[4,1],[2,3],[5,3],[-1,-1,[]],[2,1],[2,3],[1,[[12,[11]]]],[4,13],[5,13],[4],[5],[5,-1,[]],[4],[5],[5,-1,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[2,4],[2,5],[2,1],[2,3],[[4,4],[[14,[7]]]],[[5,5],[[14,[7]]]],[[1,1],[[14,[7]]]],[[3,3],[[14,[7]]]],[[3,2],2],[[5,2],2],[[4,2],[[12,[-1]]],[]],[[5,2],[[12,[-1]]],[]],[5,[[12,[-1]]],[]],[[4,2],[[12,[-1]]],[]],[[5,2],[[12,[-1]]],[]],[1,2],[3,2],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,15,[]],[-1,15,[]],[-1,15,[]],[-1,15,[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,17,[]],[-1,17,[]],[-1,17,[]],[-1,17,[]],[[4,-1],6,[]],0,[[],18],0,[19,1],[[19,1],6],[[],2],[[],[[14,[20]]]],[[],[[21,[[6,[2,2]]]]]],[19,6],0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[[22,23],8],[22,6],[-1,-1,[]],[[],[[14,[11]]]],[-1,-2,[],[]],[[22,24],6],[11,6],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,17,[]],[[22,25],10],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-1,[]],[[],6],[-1,-2,[],[]],[[],26],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,17,[]],0,0,[27,6],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[27,27],[[-1,-2],6,[],[]],[[27,9],10],[-1,-1,[]],[-1,-1,[]],[[],6],[[],6],[[],8],[-1,-2,[],[]],[-1,-2,[],[]],[2,6],[2,6],[27,2],[-1,-2,[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,17,[]],[-1,17,[]],0,0,0,0,0,[[],28],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[28,28],6],[[28,28,18],6],[[28,9],10],[[29,9],10],[-1,-1,[]],[-1,-1,[]],[[28,29],-1,[]],[[28,29],-1,[]],[-1,-2,[],[]],[-1,-2,[],[]],[[],2],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,17,[]],[-1,17,[]],0,0,[-1,-2,[],[]],[-1,-2,[],[]],[[],6],[-1,-1,[]],[-1,-2,[],[]],[[],6],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,17,[]],0,0,[[],6],[[2,2],6],[[2,2],6],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-1,[]],[-1,-1,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,17,[]],[-1,17,[]],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,[[],30],[[],30],[[],31],[[],32],[[30,30],30],[[31,31],31],[[30,30],6],[[31,31],6],[[30,30],30],[[31,31],31],[[30,30],6],[[31,31],6],[30,33],[30,33],[30,33],[31,33],[31,33],[[30,30],30],[[31,31],31],[[30,30],6],[[31,31],6],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[18,6],[18,18],[30,30],[31,31],[[-1,-2],6,[],[]],[[-1,-2],6,[],[]],[[-1,-2],6,[],[]],[[30,30],7],[[31,31],7],[30,30],[30,30],[31,31],[[30,30],8],[[30,30],8],[[31,31],8],[[],18],[32,-1,[]],[[30,30],30],[[30,30],30],[[31,31],31],[32,6],[[],30],[[],30],[[],31],[[30,30],8],[[31,31],8],[[30,-1],6,[[35,[],[[34,[30]]]]]],[[31,-1],6,[[35,[],[[34,[31]]]]]],[[],6],[5,6],[[18,9],10],[[30,9],10],[[30,9],10],[[30,9],10],[[30,9],10],[[30,9],10],[[36,9],10],[[32,9],10],[[31,9],10],[[31,9],10],[[31,9],10],[[31,9],10],[[31,9],10],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[31,30],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[30,31],[33,[[14,[30]]]],[33,[[14,[30]]]],[33,[[14,[31]]]],[33,30],[33,30],[33,30],[33,31],[33,31],[33,30],[33,30],[33,31],[-1,30,[[35,[],[[34,[30]]]]]],[-1,31,[[35,[],[[34,[31]]]]]],[25,[[14,[30]]]],[25,[[14,[30]]]],[25,[[14,[31]]]],[[30,-1],6,37],[[31,-1],6,37],[[30,30],6],[[30,30],6],[[31,31],6],[[30,30],30],[[30,30],30],[[31,31],31],[[30,30],8],[[30,30],8],[[31,31],8],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[30,-1,[]],[31,-1,[]],[30,8],[30,8],[31,8],[30,8],[30,8],[31,8],[30,[[38,[30]]]],[30,[[38,[30]]]],[31,[[38,[31]]]],[30,[[39,[30]]]],[30,[[39,[30]]]],[31,[[39,[31]]]],[18,4],[[18,3,1,30,36],6],[[18,3,1,30,36],6],[30,30],[31,31],[[30,30],[[14,[7]]]],[[31,31],[[14,[7]]]],[18,6],[[30,30],6],[[30,30],6],[[31,31],6],[18,6],[[30,30,8],6],[[30,30,8],6],[[31,31,8],6],[[30,30],30],[[31,31],31],[[30,30],6],[[31,31],6],[[30,30],30],[[30,30],30],[[31,31],31],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[30,30],6],[[30,30],6],[[31,31],6],[[18,5],[[14,[[6,[4,30]]]]]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,17,[]],[-1,17,[]],[-1,17,[]],[-1,17,[]],[-1,17,[]],[-1,17,[]],[[30,30],30],[[30,30],30],[[31,31],31],[[18,3],6],0,[[],2],[2,2],[2,6],0,[-1,-2,[],[]],[-1,-2,[],[]],[40,40],[[-1,-2],6,[],[]],[[40,9],10],[-1,-1,[]],[2,40],[[],2],[-1,-2,[],[]],[[],40],[40,2],[40,2],[40,2],[-1,-2,[],[]],[40,2],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,17,[]],[[],6],[[],6],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[41,41],[42,42],[[-1,-2],6,[],[]],[[-1,-2],6,[],[]],[[42,42],8],[[41,9],10],[[42,9],10],[-1,-1,[]],[-1,-1,[]],[-1,-2,[],[]],[41,42],[-1,-2,[],[]],[[],6],[43,42],[43,26],[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,17,[]],[-1,17,[]],[[],6],0,0,0,0,0,0,0,0,0,0,0,0,0,0,[43,[[44,[2]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[43,43],[[-1,-2],6,[],[]],[[43,9],10],[[45,9],10],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[43,8],0,0,[[43,45],-1,[]],[[43,45],-1,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[],43],0,0,0,0,[43,6],[-1,-2,[],[]],0,[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,17,[]],[-1,17,[]],[-1,17,[]],0,0,0,0,0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[46,[-1]]],-1,[]],[[[47,[-1]]],-1,48],[[[46,[-1]]],-1,[]],[[[47,[-1]]],-1,48],[[[46,[-1]]],6,[]],[[[46,[-1]],9],10,49],[[[50,[-1]]],6,48],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[[46,[-1]]],-1,[]],[[[46,[-1]]],-1,[]],[[[46,[-1]],-1],6,[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[50,[-1]]],-1,[]],[[[46,[-1]]],8,[]],[[[50,[-1]]],8,48],[[[50,[-1]]],[[47,[-1]]],48],[[],[[46,[-1]]],[]],[-1,[[50,[-1]]],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[[[46,[-1]]],[[14,[-1]]],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[-1,[[16,[-2]]],[],[]],[[[50,[-1]]],[[14,[[47,[-1]]]]],48],[-1,17,[]],[-1,17,[]],[-1,17,[]]],"c":[],"p":[[5,"PhysPage",31],[1,"usize"],[5,"VirtPage",31],[5,"PhysAddr",31],[5,"VirtAddr",31],[1,"tuple"],[6,"Ordering",644],[1,"bool"],[5,"Formatter",645],[8,"Result",645],[1,"u8"],[1,"slice"],[5,"CStr",646],[6,"Option",647],[5,"String",648],[6,"Result",649],[5,"TypeId",650],[5,"PageTable",261],[10,"PageAlloc",143],[5,"Fdt",651],[5,"Vec",652],[5,"DebugConsole",153],[5,"Metadata",653],[5,"Record",653],[1,"str"],[1,"never"],[5,"IRQVector",177],[5,"KContext",204],[6,"KContextArgs",204],[5,"MappingFlags",261],[5,"PTEFlags",261],[5,"PageTableWrapper",261],[1,"u64"],[17,"Item"],[10,"IntoIterator",654],[6,"MappingSize",261],[10,"Hasher",655],[5,"Iter",656],[5,"IterNames",656],[5,"Time",482],[6,"TrapType",503],[6,"EscapeReason",503],[5,"TrapFrame",547],[1,"array"],[6,"TrapFrameArgs",547],[5,"LazyInit",601],[5,"MutexNoIrqGuard",601],[10,"Sized",657],[10,"Debug",645],[5,"MutexNoIrq",601],[5,"Instruction",167],[5,"IRQ",177],[5,"Barrier",232],[5,"MultiCore",242],[5,"CpuCore",242],[5,"TLB",261],[5,"KernelToken",547]],"b":[[35,"impl-Add%3Cusize%3E-for-PhysPage"],[36,"impl-Add-for-PhysPage"],[69,"impl-Display-for-PhysAddr"],[70,"impl-Debug-for-PhysAddr"],[71,"impl-Debug-for-VirtAddr"],[72,"impl-Display-for-VirtAddr"],[73,"impl-Display-for-PhysPage"],[74,"impl-Debug-for-PhysPage"],[75,"impl-Display-for-VirtPage"],[76,"impl-Debug-for-VirtPage"],[79,"impl-From%3Cusize%3E-for-VirtAddr"],[80,"impl-From%3CVirtPage%3E-for-VirtAddr"],[82,"impl-From%3Cusize%3E-for-PhysPage"],[84,"impl-From%3CPhysAddr%3E-for-PhysPage"],[85,"impl-From%3Cusize%3E-for-VirtPage"],[86,"impl-From%3CVirtAddr%3E-for-VirtPage"],[296,"impl-MappingFlags"],[297,"impl-MappingFlags"],[308,"impl-MappingFlags"],[309,"impl-MappingFlags"],[310,"impl-Flags-for-MappingFlags"],[311,"impl-Flags-for-PTEFlags"],[312,"impl-PTEFlags"],[338,"impl-MappingFlags"],[339,"impl-MappingFlags"],[341,"impl-MappingFlags"],[342,"impl-MappingFlags"],[346,"impl-MappingFlags"],[347,"impl-MappingFlags"],[350,"impl-MappingFlags"],[351,"impl-MappingFlags"],[360,"impl-Binary-for-MappingFlags"],[361,"impl-UpperHex-for-MappingFlags"],[362,"impl-Debug-for-MappingFlags"],[363,"impl-LowerHex-for-MappingFlags"],[364,"impl-Octal-for-MappingFlags"],[367,"impl-UpperHex-for-PTEFlags"],[368,"impl-Binary-for-PTEFlags"],[369,"impl-Octal-for-PTEFlags"],[370,"impl-LowerHex-for-PTEFlags"],[371,"impl-Debug-for-PTEFlags"],[380,"impl-MappingFlags"],[381,"impl-MappingFlags"],[383,"impl-MappingFlags"],[384,"impl-Flags-for-MappingFlags"],[385,"impl-MappingFlags"],[386,"impl-PTEFlags"],[387,"impl-Flags-for-PTEFlags"],[388,"impl-MappingFlags"],[389,"impl-MappingFlags"],[393,"impl-MappingFlags"],[394,"impl-MappingFlags"],[398,"impl-MappingFlags"],[399,"impl-MappingFlags"],[401,"impl-MappingFlags"],[402,"impl-MappingFlags"],[404,"impl-MappingFlags"],[405,"impl-MappingFlags"],[415,"impl-MappingFlags"],[416,"impl-MappingFlags"],[418,"impl-MappingFlags"],[419,"impl-MappingFlags"],[421,"impl-MappingFlags"],[422,"impl-MappingFlags"],[424,"impl-MappingFlags"],[425,"impl-MappingFlags"],[435,"impl-MappingFlags"],[436,"impl-MappingFlags"],[439,"impl-MappingFlags"],[440,"impl-MappingFlags"],[446,"impl-MappingFlags"],[447,"impl-MappingFlags"],[452,"impl-MappingFlags"],[453,"impl-MappingFlags"],[474,"impl-MappingFlags"],[475,"impl-MappingFlags"]]}\ +}'); +if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)}; +if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex}; diff --git a/settings.html b/settings.html new file mode 100644 index 0000000..b9f4de7 --- /dev/null +++ b/settings.html @@ -0,0 +1 @@ +Settings

Rustdoc settings

Back
\ No newline at end of file diff --git a/src-files.js b/src-files.js new file mode 100644 index 0000000..ddb9e0d --- /dev/null +++ b/src-files.js @@ -0,0 +1,4 @@ +var srcIndex = JSON.parse('{\ +"polyhal":["",[["components",[["arch",[],["mod.rs","riscv64.rs"]],["boot",[],["mod.rs","riscv64.rs"]],["consts",[],["mod.rs","riscv64.rs"]],["debug_console",[],["mod.rs","riscv64.rs"]],["instruction",[["riscv64",[],["shutdown.rs"]]],["mod.rs","riscv64.rs"]],["irq",[],["mod.rs","riscv64.rs"]],["kcontext",[],["mod.rs","riscv64.rs"]],["mem",[],["mod.rs","riscv64.rs"]],["multicore",[],["mod.rs","riscv64.rs"]],["pagetable",[],["mod.rs","riscv64.rs"]],["percpu",[],["mod.rs","riscv64.rs"]],["timer",[],["mod.rs","riscv64.rs"]],["trap",[],["mod.rs","riscv64.rs"]],["trapframe",[],["mod.rs","riscv64.rs"]]],["common.rs","macros.rs","mod.rs"]],["drivers",[["interrupt",[],["mod.rs"]],["uart",[],["mod.rs"]]],["mod.rs"]],["utils",[],["lazy_init.rs","macros.rs","mod.rs","mutex_no_irq.rs"]]],["addr.rs","lib.rs","time.rs"]]\ +}'); +createSrcSidebar(); diff --git a/src/polyhal/addr.rs.html b/src/polyhal/addr.rs.html new file mode 100644 index 0000000..6b28da8 --- /dev/null +++ b/src/polyhal/addr.rs.html @@ -0,0 +1,695 @@ +addr.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
+
use core::{
+    ffi::CStr,
+    fmt::{Debug, Display},
+    mem::size_of,
+    ops::Add,
+};
+
+use crate::{components::consts::VIRT_ADDR_START, PageTable};
+
+#[repr(C)]
+#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq)]
+pub struct PhysAddr(pub(crate) usize);
+impl From<PhysPage> for PhysAddr {
+    fn from(value: PhysPage) -> Self {
+        Self(value.0 << 12)
+    }
+}
+
+impl PhysAddr {
+    #[inline]
+    pub fn addr(&self) -> usize {
+        self.0
+    }
+
+    #[inline]
+    pub fn get_ptr<T>(&self) -> *const T {
+        (self.0 | VIRT_ADDR_START) as *const T
+    }
+
+    #[inline]
+    pub const fn get_mut_ptr<T>(&self) -> *mut T {
+        (self.0 | VIRT_ADDR_START) as *mut T
+    }
+
+    #[inline]
+    pub fn write_volatile<T>(&self, v: T) {
+        unsafe { self.get_mut_ptr::<T>().write_volatile(v) }
+    }
+
+    #[inline]
+    pub fn slice_with_len<T>(&self, len: usize) -> &'static [T] {
+        unsafe { core::slice::from_raw_parts(self.get_ptr(), len) }
+    }
+
+    #[inline]
+    pub fn slice_mut_with_len<T>(&self, len: usize) -> &'static mut [T] {
+        unsafe { core::slice::from_raw_parts_mut(self.get_mut_ptr(), len) }
+    }
+
+    #[inline]
+    pub fn get_cstr(&self) -> &CStr {
+        unsafe { CStr::from_ptr(self.get_ptr::<i8>()) }
+    }
+}
+
+#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq)]
+pub struct VirtAddr(pub(crate) usize);
+
+impl From<usize> for VirtAddr {
+    fn from(value: usize) -> Self {
+        Self(value)
+    }
+}
+
+impl From<VirtAddr> for usize {
+    fn from(value: VirtAddr) -> Self {
+        value.0
+    }
+}
+
+impl VirtAddr {
+    #[inline]
+    pub fn addr(&self) -> usize {
+        self.0
+    }
+
+    #[inline]
+    pub fn get_ptr<T>(&self) -> *const T {
+        self.0 as *const T
+    }
+
+    #[inline]
+    pub fn get_mut_ptr<T>(&self) -> *mut T {
+        self.0 as *mut T
+    }
+
+    #[inline]
+    pub fn get_ref<T>(&self) -> &'static T {
+        unsafe { &*(self.0 as *const T) }
+    }
+
+    #[inline]
+    pub fn get_mut_ref<T>(&self) -> &'static mut T {
+        unsafe { &mut *(self.0 as *mut T) }
+    }
+
+    #[inline]
+    pub fn slice_with_len<T>(&self, len: usize) -> &'static [T] {
+        unsafe { core::slice::from_raw_parts(self.get_ptr(), len) }
+    }
+
+    #[inline]
+    pub fn slice_mut_with_len<T>(&self, len: usize) -> &'static mut [T] {
+        unsafe { core::slice::from_raw_parts_mut(self.get_mut_ptr(), len) }
+    }
+
+    #[inline]
+    pub fn slice_until<T>(&self, is_valid: fn(T) -> bool) -> &'static mut [T] {
+        let ptr = self.addr() as *mut T;
+        unsafe {
+            let mut len = 0;
+            if !ptr.is_null() {
+                loop {
+                    if !is_valid(ptr.add(len).read()) {
+                        break;
+                    }
+                    len += 1;
+                }
+            }
+            core::slice::from_raw_parts_mut(ptr, len)
+        }
+    }
+
+    #[inline]
+    pub fn get_cstr(&self) -> &CStr {
+        unsafe { CStr::from_ptr(self.get_ptr::<i8>()) }
+    }
+
+    #[inline]
+    pub fn floor(&self) -> Self {
+        Self(self.0 / PageTable::PAGE_SIZE * PageTable::PAGE_SIZE)
+    }
+
+    #[inline]
+    pub fn ceil(&self) -> Self {
+        Self((self.0 + PageTable::PAGE_SIZE - 1) / PageTable::PAGE_SIZE * PageTable::PAGE_SIZE)
+    }
+}
+
+#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq)]
+pub struct PhysPage(pub(crate) usize);
+
+impl From<usize> for PhysPage {
+    fn from(value: usize) -> Self {
+        Self(value)
+    }
+}
+
+impl From<PhysAddr> for PhysPage {
+    fn from(value: PhysAddr) -> Self {
+        Self(value.0 >> 12)
+    }
+}
+
+impl From<PhysPage> for usize {
+    fn from(value: PhysPage) -> Self {
+        value.0
+    }
+}
+
+impl Add<PhysPage> for PhysPage {
+    type Output = PhysPage;
+
+    fn add(self, rhs: PhysPage) -> Self::Output {
+        PhysPage(self.0 + rhs.0)
+    }
+}
+
+impl Add<usize> for PhysPage {
+    type Output = PhysPage;
+
+    fn add(self, rhs: usize) -> Self::Output {
+        PhysPage(self.0 + rhs)
+    }
+}
+
+#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq)]
+pub struct VirtPage(pub(crate) usize);
+impl From<VirtAddr> for VirtPage {
+    fn from(value: VirtAddr) -> Self {
+        Self(value.0 >> 12)
+    }
+}
+impl From<usize> for VirtPage {
+    fn from(value: usize) -> Self {
+        Self(value)
+    }
+}
+
+impl PhysPage {
+    #[inline]
+    pub const fn new(ppn: usize) -> Self {
+        Self(ppn)
+    }
+
+    #[inline]
+    pub const fn from_addr(addr: usize) -> Self {
+        Self(addr >> 12)
+    }
+
+    #[inline]
+    pub const fn to_addr(&self) -> usize {
+        self.0 << 12
+    }
+
+    #[inline]
+    pub const fn get_buffer(&self) -> &'static mut [u8] {
+        unsafe {
+            core::slice::from_raw_parts_mut(
+                (self.0 << 12 | VIRT_ADDR_START) as *mut u8,
+                PageTable::PAGE_SIZE,
+            )
+        }
+    }
+
+    #[inline]
+    pub fn copy_value_from_another(&self, ppn: PhysPage) {
+        self.get_buffer().copy_from_slice(ppn.get_buffer());
+        #[cfg(c906)]
+        unsafe {
+            asm!(".long 0x0010000b"); // dcache.all
+            asm!(".long 0x01b0000b"); // sync.is
+        }
+        #[cfg(board = "2k1000")]
+        unsafe {
+            core::arch::asm!("dbar 0;ibar 0;")
+        }
+    }
+
+    #[inline]
+    pub fn drop_clear(&self) {
+        // self.get_buffer().fill(0);
+        unsafe {
+            core::slice::from_raw_parts_mut(
+                (self.0 << 12 | VIRT_ADDR_START) as *mut usize,
+                PageTable::PAGE_SIZE / size_of::<usize>(),
+            )
+            .fill(0);
+        }
+        #[cfg(board = "2k1000")]
+        unsafe {
+            core::arch::asm!("dbar 0;ibar 0;")
+        }
+        #[cfg(c906)]
+        unsafe {
+            asm!(".long 0x0010000b"); // dcache.all
+            asm!(".long 0x01b0000b"); // sync.is
+        }
+    }
+
+    #[inline]
+    pub fn as_num(&self) -> usize {
+        self.0
+    }
+}
+
+impl Add<usize> for VirtPage {
+    type Output = VirtPage;
+
+    fn add(self, rhs: usize) -> Self::Output {
+        VirtPage(self.0 + rhs)
+    }
+}
+
+impl From<VirtPage> for VirtAddr {
+    fn from(value: VirtPage) -> Self {
+        Self(value.to_addr())
+    }
+}
+
+impl PhysAddr {
+    #[inline]
+    pub const fn new(addr: usize) -> Self {
+        Self(addr)
+    }
+}
+
+impl VirtPage {
+    #[inline]
+    pub const fn new(vpn: usize) -> Self {
+        Self(vpn)
+    }
+
+    #[inline]
+    pub const fn from_addr(addr: usize) -> Self {
+        Self(addr >> 12)
+    }
+    #[inline]
+    pub const fn to_addr(&self) -> usize {
+        self.0 << 12
+    }
+}
+
+impl VirtAddr {
+    #[inline]
+    pub const fn new(addr: usize) -> Self {
+        Self(addr)
+    }
+}
+
+impl Display for PhysPage {
+    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+        f.write_fmt(format_args!("{:#x}", self.0))
+    }
+}
+
+impl Display for PhysAddr {
+    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+        f.write_fmt(format_args!("{:#x}", self.0))
+    }
+}
+
+impl Display for VirtPage {
+    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+        f.write_fmt(format_args!("{:#x}", self.0))
+    }
+}
+
+impl Display for VirtAddr {
+    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+        f.write_fmt(format_args!("{:#x}", self.0))
+    }
+}
+
+impl Debug for PhysPage {
+    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+        f.write_fmt(format_args!("{:#x}", self.0))
+    }
+}
+
+impl Debug for PhysAddr {
+    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+        f.write_fmt(format_args!("{:#x}", self.0))
+    }
+}
+
+impl Debug for VirtPage {
+    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+        f.write_fmt(format_args!("{:#x}", self.0))
+    }
+}
+
+impl Debug for VirtAddr {
+    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+        f.write_fmt(format_args!("{:#x}", self.0))
+    }
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/arch/mod.rs.html b/src/polyhal/components/arch/mod.rs.html new file mode 100644 index 0000000..9f71682 --- /dev/null +++ b/src/polyhal/components/arch/mod.rs.html @@ -0,0 +1,3 @@ +mod.rs - source
1
+
super::define_arch_mods!();
+
\ No newline at end of file diff --git a/src/polyhal/components/arch/riscv64.rs.html b/src/polyhal/components/arch/riscv64.rs.html new file mode 100644 index 0000000..10c0508 --- /dev/null +++ b/src/polyhal/components/arch/riscv64.rs.html @@ -0,0 +1,103 @@ +riscv64.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
+
use core::slice;
+
+use alloc::vec::Vec;
+use fdt::Fdt;
+
+use crate::components::{common::{CPU_ID, DTB_BIN, DTB_PTR, MEM_AREA}, consts::VIRT_ADDR_START};
+
+
+#[inline]
+pub fn wfi() {
+    unsafe {
+        riscv::register::sstatus::clear_sie();
+        riscv::asm::wfi();
+        riscv::register::sstatus::set_sie();
+    }
+}
+
+pub fn hart_id() -> usize {
+    CPU_ID.read_current()
+}
+
+pub fn arch_init() {
+    let mut buffer = Vec::new();
+    if let Ok(fdt) = unsafe { Fdt::from_ptr(*DTB_PTR as *const u8) } {
+        unsafe {
+            buffer.extend_from_slice(slice::from_raw_parts(
+                *DTB_PTR as *const u8,
+                fdt.total_size(),
+            ));
+        }
+    }
+    DTB_BIN.init_by(buffer);
+    let mut mem_area = Vec::new();
+    if let Ok(fdt) = Fdt::new(&DTB_BIN) {
+        log::info!("There has {} CPU(s)", fdt.cpus().count());
+        fdt.memory().regions().for_each(|x| {
+            log::info!(
+                "memory region {:#X} - {:#X}",
+                x.starting_address as usize,
+                x.starting_address as usize + x.size.unwrap()
+            );
+            mem_area.push((
+                x.starting_address as usize | VIRT_ADDR_START,
+                x.size.unwrap_or(0),
+            ));
+        });
+    } else {
+        mem_area.push((0x8000_0000 | VIRT_ADDR_START, 0x1000_0000));
+    }
+    MEM_AREA.init_by(mem_area);
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/boot/mod.rs.html b/src/polyhal/components/boot/mod.rs.html new file mode 100644 index 0000000..a32da4c --- /dev/null +++ b/src/polyhal/components/boot/mod.rs.html @@ -0,0 +1,47 @@ +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
+
//! Boot Components.
+//!
+//!
+
+// Define multi-architecture modules and pub use them.
+super::define_arch_mods!();
+
+/// Boot Stack Size.
+/// TODO: reduce the boot stack size. Map stack in boot step.
+pub const STACK_SIZE: usize = 0x8_0000;
+
+/// Boot Stack. Boot Stack Size is [STACK_SIZE]
+#[link_section = ".bss.stack"]
+pub(crate) static mut BOOT_STACK: [u8; STACK_SIZE] = [0; STACK_SIZE];
+
+#[cfg(any(target_arch = "riscv64", target_arch = "aarch64"))]
+#[repr(align(4096))]
+pub(crate) struct PageAlignment([crate::pagetable::PTE; crate::PageTable::PTE_NUM_IN_PAGE]);
+
+// Declare the _main_for_arch exists.
+extern "Rust" {
+    pub(crate) fn _main_for_arch(hartid: usize);
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/boot/riscv64.rs.html b/src/polyhal/components/boot/riscv64.rs.html new file mode 100644 index 0000000..8e7b830 --- /dev/null +++ b/src/polyhal/components/boot/riscv64.rs.html @@ -0,0 +1,401 @@ +riscv64.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
+
use fdt::Fdt;
+use riscv::register::{sie, sstatus};
+
+use crate::components::common::{CPU_ID, CPU_NUM, DTB_PTR};
+use crate::components::consts::VIRT_ADDR_START;
+use crate::components::debug_console::{display_info, println};
+use crate::components::instruction::Instruction;
+use crate::components::pagetable::{PTEFlags, PTE};
+use crate::PageTable;
+
+use super::PageAlignment;
+
+/// TODO: Map the whole memory in the available memory region.
+pub(crate) static mut PAGE_TABLE: PageAlignment = {
+    let mut arr: [PTE; PageTable::PTE_NUM_IN_PAGE] = [PTE(0); PageTable::PTE_NUM_IN_PAGE];
+    // Init Page Table
+    // 0x00000000_00000000 -> 0x00000000_00000000 (256G)
+    // 0xffffffc0_00000000 -> 0x00000000_00000000 (256G)
+    // Const Loop, Can't use for i in 0..
+    let mut i = 0;
+    while i < 0x100 {
+        // Base Address
+        arr[i] = PTE::from_addr(i * 0x4000_0000, PTEFlags::ADVRWX);
+        // Higher Half Kernel
+        arr[i + 0x100] = PTE::from_addr(i * 0x4000_0000, PTEFlags::ADGVRWX);
+        i += 1;
+    }
+    PageAlignment(arr)
+};
+
+/// Assembly Entry Function
+///
+/// Initialize Stack, Page Table and call rust entry.
+#[naked]
+#[no_mangle]
+#[link_section = ".text.entry"]
+unsafe extern "C" fn _start() -> ! {
+    core::arch::asm!(
+        // Chcek boot core
+        "
+            beqz    a0, 2f
+        ",
+        // 1. Set Stack Pointer.
+        // sp = bootstack + (hartid + 1) * 0x10000
+        "2:
+            la      sp, {boot_stack}
+            li      t0, {stack_size}
+            add     sp, sp, t0              // set boot stack
+
+            li      s0, {virt_addr_start}   // add virtual address
+            or      sp, sp, s0
+        ",
+        // 2. Open Paging Mode
+        // satp = (8 << 60) | PPN(page_table)
+        "
+            la      t0, {page_table}
+            srli    t0, t0, 12
+            li      t1, 8 << 60
+            or      t0, t0, t1
+            csrw    satp, t0
+            sfence.vma
+        ",
+        // 3. Call rust_main function.
+        "
+            la      a2, {entry}
+            or      a2, a2, s0
+            jalr    a2                      // call rust_main
+        ",
+        stack_size = const crate::components::boot::STACK_SIZE,
+        boot_stack = sym crate::components::boot::BOOT_STACK,
+        page_table = sym PAGE_TABLE,
+        entry = sym rust_main,
+        virt_addr_start = const VIRT_ADDR_START,
+        options(noreturn),
+    )
+}
+
+/// Assembly Entry Function
+///
+/// Initialize Page Information. Call rust_secondary_main entry function.
+#[naked]
+#[no_mangle]
+pub(crate) unsafe extern "C" fn secondary_start() -> ! {
+    core::arch::asm!(
+        // 1. Set Stack Pointer.
+        // sp = a1(given Stack Pointer.)
+        "
+            mv      s6, a0
+            mv      sp, a1
+
+            li      s0, {virt_addr_start}   // add virtual address
+            or      sp, sp, s0
+        ",
+        // 2. Call Paging Mode
+        // satp = (8 << 60) | PPN(page_table)
+        "
+            la      t0, {page_table}
+            srli    t0, t0, 12
+            li      t1, 8 << 60
+            or      t0, t0, t1
+            csrw    satp, t0
+            sfence.vma
+        ", 
+        // 3. Call secondary_entry
+        "
+            la      a2, {entry}
+            or      a2, a2, s0
+            mv      a0, s6
+            jalr    a2                      // call rust_main
+        ",
+        page_table = sym PAGE_TABLE,
+        entry = sym rust_secondary_main,
+        virt_addr_start = const VIRT_ADDR_START,
+        options(noreturn)
+    );
+}
+
+pub(crate) fn rust_main(hartid: usize, device_tree: usize) {
+    crate::clear_bss();
+    #[cfg(feature = "logger")]
+    crate::components::debug_console::DebugConsole::log_init();
+    // Init allocator
+    crate::components::percpu::set_local_thread_pointer(hartid);
+    CPU_ID.write_current(hartid);
+    #[cfg(feature = "trap")]
+    crate::components::trap::init();
+
+    // Initialize CPU Configuration.
+    init_cpu();
+
+    let fdt = unsafe { Fdt::from_ptr(device_tree as *const u8) };
+    CPU_NUM.init_by(fdt.map(|fdt| fdt.cpus().count()).unwrap_or(1));
+
+    DTB_PTR.init_by(device_tree);
+
+    display_info!();
+    println!(include_str!("../../banner.txt"));
+    display_info!("Platform Name", "riscv64");
+    if let Ok(fdt) = fdt {
+        display_info!("Platform HART Count", "{}", fdt.cpus().count());
+        fdt.memory().regions().for_each(|x| {
+            display_info!(
+                "Platform Memory Region",
+                "{:#p} - {:#018x}",
+                x.starting_address,
+                x.starting_address as usize + x.size.unwrap()
+            );
+        });
+        // TODO: Map available memory regions in the current region.
+    }
+    display_info!("Platform Virt Mem Offset", "{:#x}", VIRT_ADDR_START);
+    display_info!();
+    display_info!("Boot HART ID", "{}", hartid);
+    display_info!();
+
+    unsafe { crate::components::boot::_main_for_arch(hartid) };
+    Instruction::shutdown();
+}
+
+/// Secondary Main function Entry.
+/// 
+/// Supports MultiCore, Boot in this function.
+pub(crate) extern "C" fn rust_secondary_main(hartid: usize) {
+    crate::components::percpu::set_local_thread_pointer(hartid);
+    CPU_ID.write_current(hartid);
+
+    // Initialize the trap.
+    #[cfg(feature = "trap")]
+    crate::components::trap::init();
+
+    // TODO: Get the hart_id and device_tree for the specified device.
+    // let (hartid, _device_tree) = boards::init_device(hartid, 0);
+
+    // Initialize CPU Configuration.
+    init_cpu();
+
+    log::info!("secondary hart {} started", hartid);
+    unsafe { crate::components::boot::_main_for_arch(hartid) };
+    Instruction::shutdown();
+}
+
+#[inline]
+fn init_cpu() {
+    unsafe {
+        // Enable SUM for access user memory directly.
+        // TODO: Call set_sum() for riscv version up than 1.0, Close when below 1.0
+        sstatus::set_sum();
+        // Open float point support.
+        sstatus::set_fs(sstatus::FS::Dirty);
+        sie::set_sext();
+        sie::set_ssoft();
+    }
+}
+
+/// Get Boot Page Table.
+pub fn boot_page_table() -> PageTable {
+    PageTable(crate::addr::PhysAddr(unsafe {
+        PAGE_TABLE.0.as_ptr() as usize & !VIRT_ADDR_START
+    }))
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/common.rs.html b/src/polyhal/components/common.rs.html new file mode 100644 index 0000000..57d09e2 --- /dev/null +++ b/src/polyhal/components/common.rs.html @@ -0,0 +1,135 @@ +common.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::vec::Vec;
+use fdt::Fdt;
+
+use crate::components::arch::arch_init;
+use crate::{utils::LazyInit, PhysPage};
+
+#[polyhal_macro::def_percpu]
+pub(crate) static CPU_ID: usize = 0;
+
+// TODO: Hide DTB_PTR For arch not yet supported.
+#[allow(dead_code)]
+pub(crate) static DTB_PTR: LazyInit<usize> = LazyInit::new();
+
+/// Page Allocation trait for privoids that page allocation
+pub trait PageAlloc: Sync {
+    /// Allocate a physical page
+    fn alloc(&self) -> PhysPage;
+    /// Release a physical page
+    fn dealloc(&self, ppn: PhysPage);
+}
+
+static PAGE_ALLOC: LazyInit<&dyn PageAlloc> = LazyInit::new();
+
+/// Init arch with page allocator, like log crate
+/// Please initialize the allocator before calling this function.
+pub fn init(page_alloc: &'static dyn PageAlloc) {
+    PAGE_ALLOC.init_by(page_alloc);
+
+    // Init current architecture
+    arch_init();
+}
+
+/// Store the number of cpu, this will fill up by startup function.
+pub(crate) static CPU_NUM: LazyInit<usize> = LazyInit::new();
+
+/// Store the memory area, this will fill up by the arch_init() function in each architecture.
+pub(crate) static MEM_AREA: LazyInit<Vec<(usize, usize)>> = LazyInit::new();
+
+/// Store the DTB_area, this will fill up by the arch_init() function in each architecture
+pub(crate) static DTB_BIN: LazyInit<Vec<u8>> = LazyInit::new();
+
+/// Get the memory area, this function should be called after initialization
+pub fn get_mem_areas() -> Vec<(usize, usize)> {
+    MEM_AREA.clone()
+}
+
+/// Get the fdt
+pub fn get_fdt() -> Option<Fdt<'static>> {
+    Fdt::new(&DTB_BIN).ok()
+}
+
+/// Get the number of cpus
+pub fn get_cpu_num() -> usize {
+    *CPU_NUM
+}
+
+/// alloc a persistent memory page
+#[inline]
+pub(crate) fn frame_alloc() -> PhysPage {
+    PAGE_ALLOC.alloc()
+}
+
+/// release a frame
+#[inline]
+pub(crate) fn frame_dealloc(ppn: PhysPage) {
+    PAGE_ALLOC.dealloc(ppn)
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/consts/mod.rs.html b/src/polyhal/components/consts/mod.rs.html new file mode 100644 index 0000000..6122672 --- /dev/null +++ b/src/polyhal/components/consts/mod.rs.html @@ -0,0 +1,33 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+
//! Consts components
+//!
+//!
+
+super::define_arch_mods!();
+
+/// Virtual Address Offset.
+pub const VIRT_ADDR_START: usize = GenericConfig::VIRT_ADDR;
+
+/// Generic Configuration Implementation.
+struct GenericConfig;
+
+/// Configuration Trait, Bound for configs
+trait ConfigTrait {
+    const VIRT_ADDR: usize;
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/consts/riscv64.rs.html b/src/polyhal/components/consts/riscv64.rs.html new file mode 100644 index 0000000..4765f60 --- /dev/null +++ b/src/polyhal/components/consts/riscv64.rs.html @@ -0,0 +1,27 @@ +riscv64.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+
/// Every core has a unique area of memory.
+/// Just using pagetable to map multi core area.
+/// Area size: 0x100_0000 (16MBytes)
+///
+/// First Area is 0xFFFF_FFC2_0000_0000
+/// Next Area is 0xFFFF_FFC2_0100_0000
+/// Others Same as This, so it will support 16 * 16 = 256 cores (Only auxiliary Harts).
+pub const MULTI_CORE_AREA: usize = 0xFFFF_FFC2_0000_0000;
+pub const MULTI_CORE_AREA_SIZE: usize = 0x100_0000;
+
+impl super::ConfigTrait for super::GenericConfig {
+    const VIRT_ADDR: usize = 0xffff_ffc0_0000_0000;
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/debug_console/mod.rs.html b/src/polyhal/components/debug_console/mod.rs.html new file mode 100644 index 0000000..09f1446 --- /dev/null +++ b/src/polyhal/components/debug_console/mod.rs.html @@ -0,0 +1,255 @@ +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
+
//! This is a console for debugging,
+//! If you want to use this logging
+//! You need to use like this:
+//!
+//! #### Put a char to output device(always uart)
+//! ```rust
+//! DebugConsole::putchar(b'3');
+//! ```
+//!
+//! ### Get a char from input device(always uart)
+//! ```rust
+//! DebugConsole::getchar();
+//! ```
+
+super::define_arch_mods!();
+
+use core::fmt::Write;
+
+/// Print macro to print polyhal information with newline
+pub(crate) macro println {
+    () => {
+        $crate::components::debug_console::_print(format_args!("\n"))
+    },
+    ($fmt: expr $(, $($arg: tt)+)?) => {
+        $crate::components::debug_console::_print(format_args!("{}\n", format_args!($fmt $(, $($arg)+)?)))
+    },
+}
+
+/// Display Platform Information with specified format
+/// display_info!("item name", "{}", "format");
+/// The output format like below:
+/// item name             : format
+pub(crate) macro display_info{
+    () => {
+        $crate::components::debug_console::_print(format_args!("\n"))
+    },
+    ($item:expr,$fmt: expr $(, $($arg: tt)+)?) => {
+        $crate::components::debug_console::_print(format_args!("{:<26}: {}\n", $item, format_args!($fmt $(, $($arg)+)?)))
+    }
+}
+
+/// Print the given arguments
+#[inline]
+pub(crate) fn _print(args: core::fmt::Arguments) {
+    DebugConsole.write_fmt(args).expect("can't print arguments");
+}
+
+pub struct DebugConsole;
+
+// Write string through DebugConsole
+impl Write for DebugConsole {
+    fn write_str(&mut self, s: &str) -> core::fmt::Result {
+        s.as_bytes().iter().for_each(|x| Self::putchar(*x));
+        Ok(())
+    }
+}
+
+#[cfg(feature = "logger")]
+impl log::Log for DebugConsole {
+    fn enabled(&self, _metadata: &log::Metadata) -> bool {
+        true
+    }
+
+    fn log(&self, record: &log::Record) {
+        use log::Level;
+
+        let file = record.module_path();
+        let line = record.line();
+        #[cfg(all(target_arch = "x86_64", feature = "graphic"))]
+        {
+            let color_code = match record.level() {
+                Level::Error => 0xff0000u32, // Red
+                Level::Warn => 0xFFFF00,     // BrightYellow
+                Level::Info => 0x33ccff,     // Blue
+                Level::Debug => 0x00ff00,    // Green
+                Level::Trace => 0xaaaaaa,    // BrightBlack
+            };
+            DebugConsole::set_color(color_code);
+            println!(
+                "[{}] <{}:{}> {}",
+                record.level(),
+                file.unwrap(),
+                line.unwrap(),
+                record.args()
+            );
+            DebugConsole::set_color(0xffffff);
+        }
+        #[cfg(not(all(target_arch = "x86_64", feature = "graphic")))]
+        {
+            let color_code = match record.level() {
+                Level::Error => 31u8, // Red
+                Level::Warn => 93,    // BrightYellow
+                Level::Info => 34,    // Blue
+                Level::Debug => 32,   // Green
+                Level::Trace => 90,   // BrightBlack
+            };
+            println!(
+                "\u{1B}[{}m\
+                    [{}] <{}:{}> {}\
+                    \u{1B}[0m",
+                color_code,
+                record.level(),
+                file.unwrap(),
+                line.unwrap(),
+                record.args()
+            );
+        }
+    }
+
+    fn flush(&self) {}
+}
+
+#[cfg(feature = "logger")]
+impl DebugConsole {
+    pub(crate) fn log_init() {
+        use log::LevelFilter;
+        log::set_logger(&DebugConsole).unwrap();
+        log::set_max_level(match option_env!("LOG") {
+            Some("error") => LevelFilter::Error,
+            Some("warn") => LevelFilter::Warn,
+            Some("info") => LevelFilter::Info,
+            Some("debug") => LevelFilter::Debug,
+            Some("trace") => LevelFilter::Trace,
+            _ => LevelFilter::Debug,
+        });
+    }
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/debug_console/riscv64.rs.html b/src/polyhal/components/debug_console/riscv64.rs.html new file mode 100644 index 0000000..b0db078 --- /dev/null +++ b/src/polyhal/components/debug_console/riscv64.rs.html @@ -0,0 +1,43 @@ +riscv64.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
use crate::components::debug_console::DebugConsole;
+
+
+/// Debug console function.
+impl DebugConsole {
+    #[inline]
+    #[allow(deprecated)]
+    pub fn putchar(ch: u8) {
+        sbi_rt::legacy::console_putchar(ch as _);
+    }
+
+    #[inline]
+    #[allow(deprecated)]
+    pub fn getchar() -> Option<u8> {
+        let c = sbi_rt::legacy::console_getchar() as u8;
+        match c == u8::MAX {
+            true => None,
+            _ => Some(c),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/instruction/mod.rs.html b/src/polyhal/components/instruction/mod.rs.html new file mode 100644 index 0000000..cb9d692 --- /dev/null +++ b/src/polyhal/components/instruction/mod.rs.html @@ -0,0 +1,23 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+
//! Instruction Module.
+//!
+//! This module contains the instruction of the different architectures.
+//!
+
+super::define_arch_mods!();
+
+/// Platform Instruction
+/// [Instruction::ebreak] Intruction Breakpoint
+///
+pub struct Instruction;
+
\ No newline at end of file diff --git a/src/polyhal/components/instruction/riscv64.rs.html b/src/polyhal/components/instruction/riscv64.rs.html new file mode 100644 index 0000000..9dd72bd --- /dev/null +++ b/src/polyhal/components/instruction/riscv64.rs.html @@ -0,0 +1,27 @@ +riscv64.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+
mod shutdown;
+use crate::components::instruction::Instruction;
+
+impl Instruction {
+    #[inline]
+    pub fn hlt() {
+        unsafe {
+            riscv::register::sstatus::clear_sie();
+            riscv::asm::wfi();
+            riscv::register::sstatus::set_sie();
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/instruction/riscv64/shutdown.rs.html b/src/polyhal/components/instruction/riscv64/shutdown.rs.html new file mode 100644 index 0000000..5d59c13 --- /dev/null +++ b/src/polyhal/components/instruction/riscv64/shutdown.rs.html @@ -0,0 +1,23 @@ +shutdown.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+
use crate::components::instruction::Instruction;
+
+impl Instruction {
+    /// Call SBI_SHUTDOWN to close the machine. Exit qemu if you are using qemu.
+    #[inline]
+    pub fn shutdown() -> ! {
+        // sbi_rt::legacy::shutdown();
+        sbi_rt::system_reset(sbi_rt::Shutdown, sbi_rt::NoReason);
+        unreachable!()
+    }
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/irq/mod.rs.html b/src/polyhal/components/irq/mod.rs.html new file mode 100644 index 0000000..e01a716 --- /dev/null +++ b/src/polyhal/components/irq/mod.rs.html @@ -0,0 +1,71 @@ +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
+
//! IRQ(Interrupt requests queue) module.
+//!
+//! How to use this interface.
+//! ```rust
+//! // Init irq
+//! IRQ::init();
+//! [IRQ::irq_enable]
+//! // Enable irq 3
+//! IRQ::irq_enable(3);
+//! [IRQ::irq_disable]
+//! // Disable irq 3
+//! IRQ::irq_disable(3);
+//! [IRQ::irq_enabled]
+//! // Check if irq is enabled
+//! // Return true if the irq is enabled.
+//! IRQ::irq_enabled(3);
+//! [IRQ::int_enable]
+//! // Enable interrupt
+//! IRQ::int_enable();
+//! [IRQ::int_disable]
+//! // Disable interrupt
+//! IRQ::int_disable();
+//! [IRQ::int_enabled]
+//! // Check if interrupt is enabled
+//! let enabled = IRQ::int_enabled();
+//! ```
+
+super::define_arch_mods!();
+
+pub struct IRQ;
+
+impl IRQ {}
+
+#[derive(Debug, Clone, Copy)]
+pub struct IRQVector(pub(crate) usize);
+
\ No newline at end of file diff --git a/src/polyhal/components/irq/riscv64.rs.html b/src/polyhal/components/irq/riscv64.rs.html new file mode 100644 index 0000000..43ac4f5 --- /dev/null +++ b/src/polyhal/components/irq/riscv64.rs.html @@ -0,0 +1,103 @@ +riscv64.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
+
use riscv::register::sstatus::{self, clear_sie, set_sie};
+
+use crate::components::irq::{IRQVector, IRQ};
+
+/// Implement IRQ operations for the IRQ interface.
+impl IRQ {
+    /// Enable irq for the given IRQ number.
+    #[inline]
+    pub fn irq_enable(_irq_num: usize) {
+        log::warn!("irq not implemented in riscv platform yet");
+    }
+
+    /// Disable irq for the given IRQ number.
+    #[inline]
+    pub fn irq_disable(_irq_num: usize) {
+        log::warn!("irq not implemented in riscv platform yet");
+    }
+
+    /// Enable interrupts.
+    #[inline]
+    pub fn int_enable() {
+        unsafe { set_sie() }
+    }
+
+    /// Disable interrupts.
+    #[inline]
+    pub fn int_disable() {
+        unsafe { clear_sie() }
+    }
+
+    /// Check if the interrupts was enabled.
+    #[inline]
+    pub fn int_enabled() -> bool {
+        sstatus::read().sie()
+    }
+}
+
+/// Implmente the irq vector methods
+impl IRQVector {
+    /// Get the irq number in this vector
+    #[inline]
+    pub fn irq_num(&self) -> usize {
+        log::warn!("ack not implemented in riscv platform yet");
+        self.0
+    }
+
+    /// Acknowledge the irq
+    pub fn ack(&self) {
+        log::warn!("ack not implemented in riscv platform yet");
+    }
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/kcontext/mod.rs.html b/src/polyhal/components/kcontext/mod.rs.html new file mode 100644 index 0000000..29084a3 --- /dev/null +++ b/src/polyhal/components/kcontext/mod.rs.html @@ -0,0 +1,37 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
//! Kernel Context module.
+//!
+//!
+
+super::define_arch_mods!();
+
+/// Kernel Context Arg Type.
+///
+/// Using this by Index and IndexMut trait bound on KContext.
+#[derive(Debug)]
+pub enum KContextArgs {
+    /// Kernel Stack Pointer
+    KSP,
+    /// Kernel Thread Pointer
+    KTP,
+    /// Kernel Program Counter
+    KPC,
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/kcontext/riscv64.rs.html b/src/polyhal/components/kcontext/riscv64.rs.html new file mode 100644 index 0000000..3eb5551 --- /dev/null +++ b/src/polyhal/components/kcontext/riscv64.rs.html @@ -0,0 +1,403 @@ +riscv64.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
+
use core::{
+    arch::asm,
+    ops::{Index, IndexMut},
+};
+
+use crate::PageTable;
+
+use crate::components::kcontext::KContextArgs;
+
+/// Save the task context registers.
+macro_rules! save_kcontext_regs {
+    () => {
+        "
+        sd      sp, 0*8(a0)
+        sd      tp, 1*8(a0)
+        sd      s0, 2*8(a0)
+        sd      s1, 3*8(a0)
+        sd      s2, 4*8(a0)
+        sd      s3, 5*8(a0)
+        sd      s4, 6*8(a0)
+        sd      s5, 7*8(a0)
+        sd      s6, 8*8(a0)
+        sd      s7, 9*8(a0)
+        sd      s8, 10*8(a0)
+        sd      s9, 11*8(a0)
+        sd      s10, 12*8(a0)
+        sd      s11, 13*8(a0)
+        sd      ra, 14*8(a0)
+        "
+    };
+}
+
+/// Restore the task context registers.
+macro_rules! restore_kcontext_regs {
+    () => {
+        "
+        ld      sp, 0*8(a1)
+        ld      tp, 1*8(a1)
+        ld      s0, 2*8(a1)
+        ld      s1, 3*8(a1)
+        ld      s2, 4*8(a1)
+        ld      s3, 5*8(a1)
+        ld      s4, 6*8(a1)
+        ld      s5, 7*8(a1)
+        ld      s6, 8*8(a1)
+        ld      s7, 9*8(a1)
+        ld      s8, 10*8(a1)
+        ld      s9, 11*8(a1)
+        ld      s10, 12*8(a1)
+        ld      s11, 13*8(a1)
+        ld      ra, 14*8(a1)
+        "
+    };
+}
+
+/// Return instruction wrapper.
+macro_rules! ret {
+    () => {
+        "ret"
+    };
+}
+
+/// Kernel Context
+///
+/// Kernel Context is used to switch context between kernel task.
+#[derive(Debug)]
+#[repr(C)]
+pub struct KContext {
+    /// Kernel Stack Pointer
+    ksp: usize,
+    /// Kernel Thread Pointer
+    ktp: usize,
+    /// Kernel S regs, s0 - s11, just callee-saved registers
+    /// just used in the context_switch function.
+    _sregs: [usize; 12],
+    /// Kernel Program Counter, Will return to this address.
+    kpc: usize,
+}
+
+impl KContext {
+    /// Create a new blank Kernel Context.
+    pub fn blank() -> Self {
+        Self {
+            ksp: 0,
+            ktp: 0,
+            _sregs: [0; 12],
+            kpc: 0,
+        }
+    }
+}
+
+/// Indexing operations for KContext
+///
+/// Using it just like the Vector.
+///
+/// #[derive(Debug)]
+/// pub enum KContextArgs {
+///     /// Kernel Stack Pointer
+///     KSP,
+///     /// Kernel Thread Pointer
+///     KTP,
+///     /// Kernel Program Counter
+///     KPC
+/// }
+///
+/// etc. Get reg of the kernel stack:
+///
+/// let ksp = KContext[KContextArgs::KSP]
+/// let kpc = KContext[KContextArgs::KPC]
+/// let ktp = KContext[KContextArgs::KTP]
+///
+impl Index<KContextArgs> for KContext {
+    type Output = usize;
+
+    fn index(&self, index: KContextArgs) -> &Self::Output {
+        match index {
+            KContextArgs::KSP => &self.ksp,
+            KContextArgs::KTP => &self.ktp,
+            KContextArgs::KPC => &self.kpc,
+        }
+    }
+}
+
+/// Indexing Mutable operations for KContext
+///
+/// Using it just like the Vector.
+///
+/// etc. Change the value of the kernel Context using IndexMut
+///
+/// ```Rust
+/// KContext[KContextArgs::KSP] = ksp;
+/// KContext[KContextArgs::KPC] = kpc;
+/// KContext[KContextArgs::KTP] = ktp;
+/// ```
+/// 
+impl IndexMut<KContextArgs> for KContext {
+    fn index_mut(&mut self, index: KContextArgs) -> &mut Self::Output {
+        match index {
+            KContextArgs::KSP => &mut self.ksp,
+            KContextArgs::KTP => &mut self.ktp,
+            KContextArgs::KPC => &mut self.kpc,
+        }
+    }
+}
+
+/// Context Switch
+///
+/// Save the context of current task and switch to new task.
+#[naked]
+pub unsafe extern "C" fn context_switch(from: *mut KContext, to: *const KContext) {
+    core::arch::asm!(
+        // Save Kernel Context.
+        save_kcontext_regs!(),
+        // Restore Kernel Context.
+        restore_kcontext_regs!(),
+        // Return to the caller.
+        ret!(),
+        options(noreturn)
+    )
+}
+
+/// Context Switch With Page Table
+///
+/// Save the context of current task and switch to new task.
+#[naked]
+pub unsafe extern "C" fn context_switch_pt(
+    from: *mut KContext,
+    to: *const KContext,
+    pt_token: PageTable,
+) {
+    core::arch::asm!(
+        // Save Kernel Context.
+        save_kcontext_regs!(),
+        // Switch to new page table.
+        "
+            srli    a2,   a2, 12
+            li      a3,   8 << 60
+            or      a2,   a2, a3
+            csrw    satp, a2
+            sfence.vma
+        ",
+        // Restore Kernel Context.
+        restore_kcontext_regs!(),
+        // Return to the caller.
+        ret!(),
+        options(noreturn)
+    )
+}
+
+#[naked]
+pub extern "C" fn read_current_tp() -> usize {
+    unsafe {
+        asm!(
+            "
+                mv      a0, tp
+                ret
+            ",
+            options(noreturn)
+        )
+    }
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/macros.rs.html b/src/polyhal/components/macros.rs.html new file mode 100644 index 0000000..0ccc399 --- /dev/null +++ b/src/polyhal/components/macros.rs.html @@ -0,0 +1,79 @@ +macros.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
+
#[cfg(target_arch = "loongarch64")]
+#[macro_export]
+macro_rules! pub_use_arch {
+    ($($name:ident),*) => {
+        $(
+            pub use self::loongarch64::$name;
+        )*
+    };
+}
+
+#[cfg(target_arch = "x86_64")]
+#[macro_export]
+macro_rules! pub_use_arch {
+    ($($name:ident),*) => {
+        $(
+            pub use self::x86_64::$name;
+        )*
+    };
+}
+
+#[cfg(target_arch = "riscv64")]
+#[macro_export]
+macro_rules! pub_use_arch {
+    ($($name:ident),*) => {
+        $(
+            pub use self::riscv64::$name;
+        )*
+    };
+}
+
+#[cfg(target_arch = "aarch64")]
+#[macro_export]
+macro_rules! pub_use_arch {
+    ($($name:ident),*) => {
+        $(
+            pub use self::aarch64::$name;
+        )*
+    };
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/mem/mod.rs.html b/src/polyhal/components/mem/mod.rs.html new file mode 100644 index 0000000..7849468 --- /dev/null +++ b/src/polyhal/components/mem/mod.rs.html @@ -0,0 +1,17 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+
super::define_arch_mods!();
+
+/// This is a barrier function.
+///
+/// This struct has two functions.
+/// [`Barrier::complete_sync`]: ensures the correct sequencing of instructions
+/// [`Barrier::ordering_sync`]: ensures the visibility and consistency of memory operations
+pub struct Barrier;
+
\ No newline at end of file diff --git a/src/polyhal/components/mem/riscv64.rs.html b/src/polyhal/components/mem/riscv64.rs.html new file mode 100644 index 0000000..1f5d8df --- /dev/null +++ b/src/polyhal/components/mem/riscv64.rs.html @@ -0,0 +1,19 @@ +riscv64.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+
use crate::components::mem::Barrier;
+
+impl Barrier {
+    #[inline]
+    pub fn complete_sync() {}
+
+    #[inline]
+    pub fn ordering_sync() {}
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/mod.rs.html b/src/polyhal/components/mod.rs.html new file mode 100644 index 0000000..edc1223 --- /dev/null +++ b/src/polyhal/components/mod.rs.html @@ -0,0 +1,49 @@ +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
+
//! General components of the multi-architecture.
+//!
+//!
+
+pub(crate) mod arch;
+pub mod boot;
+pub mod common;
+pub mod consts;
+pub mod debug_console;
+pub mod instruction;
+pub mod irq;
+pub mod kcontext;
+pub mod macros;
+pub mod mem;
+#[cfg(feature = "multicore")]
+pub mod multicore;
+pub mod pagetable;
+pub mod percpu;
+pub mod timer;
+#[cfg(feature = "trap")]
+pub mod trap;
+pub mod trapframe;
+
+use polyhal_macro::define_arch_mods;
+
\ No newline at end of file diff --git a/src/polyhal/components/multicore/mod.rs.html b/src/polyhal/components/multicore/mod.rs.html new file mode 100644 index 0000000..45cd0d0 --- /dev/null +++ b/src/polyhal/components/multicore/mod.rs.html @@ -0,0 +1,67 @@ +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
+
//! Multi-core Module.
+//!
+//! This is a leader for the multicore operation
+//!
+//! You can use this function to use the multicore operation
+//!
+//! Boot other calls after the multicore
+//! If you use this function call, you should call it after arch::init(..);
+//! This function will allocate the stack and map it for itself.
+//!
+//! ```rust
+//! Multicore::boot_all();
+//! ```
+//!
+//! Here will have more functionality about multicore in the future.
+//!
+
+use crate::{pub_use_arch, utils::MutexNoIrq};
+
+pub struct MultiCore;
+
+static CORE_SET: MutexNoIrq<u64> = MutexNoIrq::new(0);
+
+pub struct CpuCore;
+
+/// Initialize the core with boot_hart_id
+pub(crate) fn init(boot_hart_id: usize) {
+    let mut set = CORE_SET.lock();
+    *set |= 1 << boot_hart_id;
+}
+
+super::define_arch_mods!();
+pub_use_arch!(boot_core);
+
\ No newline at end of file diff --git a/src/polyhal/components/multicore/riscv64.rs.html b/src/polyhal/components/multicore/riscv64.rs.html new file mode 100644 index 0000000..a92a913 --- /dev/null +++ b/src/polyhal/components/multicore/riscv64.rs.html @@ -0,0 +1,131 @@ +riscv64.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
+
use crate::{
+    boot::secondary_start,
+    common::{frame_alloc, CPU_ID, CPU_NUM},
+    consts::{MULTI_CORE_AREA, MULTI_CORE_AREA_SIZE, VIRT_ADDR_START},
+    multicore::MultiCore,
+    MappingFlags, MappingSize, PageTable,
+};
+
+// TODO: Boot a core with top pointer of the stack
+pub fn boot_core(cpu: usize, sp_top: usize) {
+    if cpu == CPU_ID.read_current() {
+        return;
+    };
+
+    // PERCPU DATA ADDRESS RANGE END
+    let aux_core_func = (secondary_start as usize) & (!VIRT_ADDR_START);
+
+    log::info!("secondary addr: {:#x}", secondary_start as usize);
+    let ret = sbi_rt::hart_start(cpu, aux_core_func, sp_top);
+    if ret.is_ok() {
+        log::info!("hart {} Startting successfully", cpu);
+    } else {
+        log::warn!("hart {} Startting failed", cpu)
+    }
+}
+
+/// Implement the function for multicore
+impl MultiCore {
+    /// Boot all application cores.
+    pub fn boot_all() {
+        use crate::addr::VirtPage;
+        use crate::components::boot::secondary_start;
+
+        let page_table = PageTable::current();
+
+        (0..*CPU_NUM).into_iter().for_each(|cpu| {
+            if cpu == CPU_ID.read_current() {
+                return;
+            };
+
+            // PERCPU DATA ADDRESS RANGE END
+            let cpu_addr_end = MULTI_CORE_AREA + (cpu + 1) * MULTI_CORE_AREA_SIZE;
+            let aux_core_func = (secondary_start as usize) & (!VIRT_ADDR_START);
+
+            // Ready to build multi core area.
+            // default stack size is 512K
+            for i in 0..128 {
+                page_table.map_kernel(
+                    VirtPage::from_addr(cpu_addr_end - i * PageTable::PAGE_SIZE - 1),
+                    frame_alloc(),
+                    MappingFlags::RWX | MappingFlags::G,
+                    MappingSize::Page4KB,
+                )
+            }
+
+            log::info!("secondary addr: {:#x}", secondary_start as usize);
+            let ret = sbi_rt::hart_start(cpu, aux_core_func, cpu_addr_end);
+            if ret.is_ok() {
+                log::info!("hart {} Startting successfully", cpu);
+            } else {
+                log::warn!("hart {} Startting failed", cpu)
+            }
+        });
+    }
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/pagetable/mod.rs.html b/src/polyhal/components/pagetable/mod.rs.html new file mode 100644 index 0000000..98422e6 --- /dev/null +++ b/src/polyhal/components/pagetable/mod.rs.html @@ -0,0 +1,703 @@ +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
+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
+
super::define_arch_mods!();
+
+use core::ops::Deref;
+
+use crate::{components::common::frame_alloc, utils::bit, PhysAddr, PhysPage, VirtAddr, VirtPage};
+
+use super::common::frame_dealloc;
+
+/// The size of the page table.
+pub const PAGE_SIZE: usize = PageTable::PAGE_SIZE;
+/// The max address of the user virtual address.
+pub const USER_VADDR_END: usize = PageTable::USER_VADDR_END;
+
+/// Page table entry structure
+///
+/// Just define here. Should implement functions in specific architectures.
+#[derive(Copy, Clone, Debug)]
+pub(crate) struct PTE(pub usize);
+
+/// Page Table
+///
+/// This is just the page table defination.
+/// The implementation of the page table in the specific architecture mod.
+/// Such as:
+/// x86_64/page_table.rs
+/// riscv64/page_table/sv39.rs
+/// aarch64/page_table.rs
+/// loongarch64/page_table.rs
+#[repr(C)]
+#[derive(Debug, Clone, Copy)]
+pub struct PageTable(pub(crate) PhysAddr);
+
+impl PageTable {
+    /// Get the page table list through the physical address
+    #[inline]
+    pub(crate) fn get_pte_list(paddr: PhysAddr) -> &'static mut [PTE] {
+        paddr.slice_mut_with_len::<PTE>(Self::PTE_NUM_IN_PAGE)
+    }
+
+    /// Mapping a page to specific virtual page (user space address).
+    ///
+    /// Ensure that PageTable is which you want to map.
+    /// vpn: Virtual page will be mapped.
+    /// ppn: Physical page.
+    /// flags: Mapping flags, include Read, Write, Execute and so on.
+    /// size: MappingSize. Just support 4KB page currently.
+    pub fn map_page(&self, vpn: VirtPage, ppn: PhysPage, flags: MappingFlags, _size: MappingSize) {
+        assert!(
+            vpn.to_addr() <= Self::USER_VADDR_END,
+            "You only should use the address limited by user"
+        );
+        assert!(Self::PAGE_LEVEL >= 3, "Just level >= 3 supported currently");
+        let mut pte_list = Self::get_pte_list(self.0);
+        if Self::PAGE_LEVEL == 4 {
+            let pte = &mut pte_list[vpn.pn_index(3)];
+            if !pte.is_valid() {
+                *pte = PTE::new_table(frame_alloc());
+            }
+            pte_list = Self::get_pte_list(pte.address());
+        }
+        // level 3
+        {
+            let pte = &mut pte_list[vpn.pn_index(2)];
+            if !pte.is_valid() {
+                *pte = PTE::new_table(frame_alloc());
+            }
+            pte_list = Self::get_pte_list(pte.address());
+        }
+        // level 2
+        {
+            let pte = &mut pte_list[vpn.pn_index(1)];
+            if !pte.is_valid() {
+                *pte = PTE::new_table(frame_alloc());
+            }
+            pte_list = Self::get_pte_list(pte.address());
+        }
+        // level 1, map page
+        pte_list[vpn.pn_index(0)] = PTE::new_page(ppn, flags.into());
+        TLB::flush_vaddr(vpn.into());
+    }
+
+    /// Mapping a page to specific address(kernel space address).
+    ///
+    /// TODO: This method is not implemented.
+    /// TIPS: If we mapped to kernel, the page will be shared between different pagetable.
+    ///
+    /// Ensure that PageTable is which you want to map.
+    /// vpn: Virtual page will be mapped.
+    /// ppn: Physical page.
+    /// flags: Mapping flags, include Read, Write, Execute and so on.
+    /// size: MappingSize. Just support 4KB page currently.    
+    ///
+    /// How to implement shared.
+    pub fn map_kernel(
+        &self,
+        vpn: VirtPage,
+        ppn: PhysPage,
+        flags: MappingFlags,
+        _size: MappingSize,
+    ) {
+        assert!(
+            vpn.to_addr() >= Self::KERNEL_VADDR_START,
+            "Virt page should greater than Self::KERNEL_VADDR_START"
+        );
+        assert!(Self::PAGE_LEVEL >= 3, "Just level >= 3 supported currently");
+        let mut pte_list = Self::get_pte_list(self.0);
+        if Self::PAGE_LEVEL == 4 {
+            let pte = &mut pte_list[vpn.pn_index(3)];
+            if !pte.is_valid() {
+                *pte = PTE::new_table(frame_alloc());
+            }
+            pte_list = Self::get_pte_list(pte.address());
+        }
+        // level 3
+        {
+            let pte = &mut pte_list[vpn.pn_index(2)];
+            if !pte.is_valid() {
+                *pte = PTE::new_table(frame_alloc());
+            }
+            pte_list = Self::get_pte_list(pte.address());
+        }
+        // level 2
+        {
+            let pte = &mut pte_list[vpn.pn_index(1)];
+            if !pte.is_valid() {
+                *pte = PTE::new_table(frame_alloc());
+            }
+            pte_list = Self::get_pte_list(pte.address());
+        }
+        // level 1, map page
+        pte_list[vpn.pn_index(0)] = PTE::new_page(ppn, flags.into());
+        TLB::flush_vaddr(vpn.into());
+    }
+
+    /// Unmap a page from specific virtual page (user space address).
+    ///
+    /// Ensure the virtual page is exists.
+    /// vpn: Virtual address.
+    pub fn unmap_page(&self, vpn: VirtPage) {
+        let mut pte_list = Self::get_pte_list(self.0);
+        if Self::PAGE_LEVEL == 4 {
+            let pte = &mut pte_list[vpn.pn_index(3)];
+            if !pte.is_table() {
+                return;
+            };
+            pte_list = Self::get_pte_list(pte.address());
+        }
+        // level 3
+        {
+            let pte = &mut pte_list[vpn.pn_index(2)];
+            if !pte.is_table() {
+                return;
+            };
+            pte_list = Self::get_pte_list(pte.address());
+        }
+        // level 2
+        {
+            let pte = &mut pte_list[vpn.pn_index(1)];
+            if !pte.is_table() {
+                return;
+            };
+            pte_list = Self::get_pte_list(pte.address());
+        }
+        // level 1, map page
+        pte_list[vpn.pn_index(0)] = PTE(0);
+        TLB::flush_vaddr(vpn.into());
+    }
+
+    /// Translate a virtual adress to a physical address and mapping flags.
+    ///
+    /// Return None if the vaddr isn't mapped.
+    /// vpn: The virtual address will be translated.
+    pub fn translate(&self, vaddr: VirtAddr) -> Option<(PhysAddr, MappingFlags)> {
+        let vpn: VirtPage = vaddr.into();
+        let mut pte_list = Self::get_pte_list(self.0);
+        if Self::PAGE_LEVEL == 4 {
+            let pte = &mut pte_list[vpn.pn_index(3)];
+            if !pte.is_table() {
+                return None;
+            }
+            pte_list = Self::get_pte_list(pte.address());
+        }
+        // level 3
+        {
+            let pte = &mut pte_list[vpn.pn_index(2)];
+            if !pte.is_table() {
+                return None;
+            }
+            pte_list = Self::get_pte_list(pte.address());
+        }
+        // level 2
+        {
+            let pte = &mut pte_list[vpn.pn_index(1)];
+            if !pte.is_table() {
+                return None;
+            }
+            pte_list = Self::get_pte_list(pte.address());
+        }
+        // level 1, map page
+        let pte = pte_list[vpn.pn_index(0)];
+        Some((
+            PhysAddr(pte.address().0 + vaddr.pn_offest(0)),
+            pte.flags().into(),
+        ))
+    }
+
+    /// Release the page table entry.
+    ///
+    /// The page table entry in the user space address will be released.
+    /// [Page Table Wikipedia](https://en.wikipedia.org/wiki/Page_table).
+    /// You don't need to care about this if you just want to use.
+    pub fn release(&self) {
+        let drop_l2 = |pte_list: &[PTE]| {
+            pte_list.iter().for_each(|x| {
+                if x.is_table() {
+                    frame_dealloc(x.address().into());
+                }
+            });
+        };
+        let drop_l3 = |pte_list: &[PTE]| {
+            pte_list.iter().for_each(|x| {
+                if x.is_table() {
+                    drop_l2(Self::get_pte_list(x.address()));
+                    frame_dealloc(x.address().into());
+                }
+            });
+        };
+        let drop_l4 = |pte_list: &[PTE]| {
+            pte_list.iter().for_each(|x| {
+                if x.is_table() {
+                    drop_l3(Self::get_pte_list(x.address()));
+                    frame_dealloc(x.address().into());
+                }
+            });
+        };
+
+        // Drop all sub page table entry and clear root page.
+        let pte_list = &mut Self::get_pte_list(self.0)[..Self::GLOBAL_ROOT_PTE_RANGE];
+        if Self::PAGE_LEVEL == 4 {
+            drop_l4(pte_list);
+        } else {
+            drop_l3(pte_list);
+        }
+        pte_list.fill(PTE(0));
+    }
+}
+
+bitflags::bitflags! {
+    /// Mapping flags for page table.
+    #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
+    pub struct MappingFlags: u64 {
+        /// Persent
+        const P = bit!(0);
+        /// User Accessable Flag
+        const U = bit!(1);
+        /// Readable Flag
+        const R = bit!(2);
+        /// Writeable Flag
+        const W = bit!(3);
+        /// Executeable Flag
+        const X = bit!(4);
+        /// Accessed Flag
+        const A = bit!(5);
+        /// Dirty Flag, indicating that the page was written
+        const D = bit!(6);
+        /// Global Flag
+        const G = bit!(7);
+        /// Device Flag, indicating that the page was used for device memory
+        const Device = bit!(8);
+        /// Cache Flag, indicating that the page will be cached
+        const Cache = bit!(9);
+
+        /// Read | Write | Executeable Flags
+        const RWX = Self::R.bits() | Self::W.bits() | Self::X.bits();
+        /// User | Read | Write Flags
+        const URW = Self::U.bits() | Self::R.bits() | Self::W.bits();
+        /// User | Read | Executeable Flags
+        const URX = Self::U.bits() | Self::R.bits() | Self::X.bits();
+        /// User | Read | Write | Executeable Flags
+        const URWX = Self::URW.bits() | Self::X.bits();
+    }
+}
+
+/// This structure indicates size of the page that will be mapped.
+///
+/// TODO: Support More Page Size, 16KB or 32KB
+/// Just support 4KB right now.
+#[derive(Debug)]
+pub enum MappingSize {
+    Page4KB,
+    // Page2MB,
+    // Page1GB,
+}
+
+/// TLB Operation set.
+/// Such as flush_vaddr, flush_all.
+/// Just use it in the fn.
+///
+/// there are some methods in the TLB implementation
+///
+/// ### Flush the tlb entry through the specific virtual address
+///
+/// ```rust
+/// TLB::flush_vaddr(arg0);  arg0 should be VirtAddr
+/// ```
+/// ### Flush all tlb entries
+/// ```rust
+/// TLB::flush_all();
+/// ```
+pub struct TLB;
+
+/// Page Table Wrapper
+///
+/// You can use this wrapper to packing PageTable.
+/// If you release the PageTableWrapper,
+/// the PageTable will release its page table entry.
+#[derive(Debug)]
+pub struct PageTableWrapper(pub PageTable);
+
+impl Deref for PageTableWrapper {
+    type Target = PageTable;
+
+    fn deref(&self) -> &Self::Target {
+        &self.0
+    }
+}
+
+/// Allocate a new PageTableWrapper with new page table root
+///
+/// This operation will restore the page table.
+impl PageTableWrapper {
+    /// Alloc a new PageTableWrapper with new page table root
+    /// This operation will copy kernel page table space from booting page table.
+    #[inline]
+    pub fn alloc() -> Self {
+        let pt = PageTable(frame_alloc().into());
+        pt.restore();
+        Self(pt)
+    }
+}
+
+/// Page Table Release.
+///
+/// You must implement this trait to release page table.
+/// Include the page table entry and root page.
+impl Drop for PageTableWrapper {
+    fn drop(&mut self) {
+        self.0.release();
+        frame_dealloc(self.0 .0.into());
+    }
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/pagetable/riscv64.rs.html b/src/polyhal/components/pagetable/riscv64.rs.html new file mode 100644 index 0000000..6b6fc03 --- /dev/null +++ b/src/polyhal/components/pagetable/riscv64.rs.html @@ -0,0 +1,479 @@ +riscv64.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
+
use core::arch::riscv64::sfence_vma;
+
+use bitflags::bitflags;
+use riscv::register::satp;
+
+use crate::addr::{PhysAddr, PhysPage, VirtAddr, VirtPage};
+
+use crate::components::pagetable::{MappingFlags, PageTable, PTE, TLB};
+use crate::utils::bit;
+
+impl PTE {
+    #[inline]
+    pub const fn from_ppn(ppn: usize, flags: PTEFlags) -> Self {
+        // let flags = flags.union(PTEFlags::D);
+        let mut flags = flags;
+        if flags.contains(PTEFlags::R) | flags.contains(PTEFlags::X) {
+            flags = flags.union(PTEFlags::A)
+        }
+        if flags.contains(PTEFlags::W) {
+            flags = flags.union(PTEFlags::D)
+        }
+        // TIPS: This is prepare for the extend bits of T-HEAD C906
+        #[cfg(c906)]
+        if flags.contains(PTEFlags::G) && ppn == 0x8_0000 {
+            Self(
+                ppn << 10
+                    | flags
+                        .union(PTEFlags::C)
+                        .union(PTEFlags::B)
+                        .union(PTEFlags::K)
+                        .bits() as usize,
+            )
+        } else if flags.contains(PTEFlags::G) && ppn == 0 {
+            Self(ppn << 10 | flags.union(PTEFlags::SE).union(PTEFlags::SO).bits() as usize)
+        } else {
+            Self(ppn << 10 | flags.union(PTEFlags::C).bits() as usize)
+        }
+
+        #[cfg(not(c906))]
+        Self(ppn << 10 | flags.bits() as usize)
+    }
+
+    #[inline]
+    pub const fn from_addr(addr: usize, flags: PTEFlags) -> Self {
+        Self::from_ppn(addr >> 12, flags)
+    }
+
+    #[inline]
+    pub const fn flags(&self) -> PTEFlags {
+        PTEFlags::from_bits_truncate((self.0 & 0xff) as u64)
+    }
+
+    #[inline]
+    pub const fn is_valid(&self) -> bool {
+        self.flags().contains(PTEFlags::V) && self.0 > u8::MAX as usize
+    }
+
+    #[inline]
+    pub(crate) fn is_table(&self) -> bool {
+        return self.flags().contains(PTEFlags::V)
+            && !(self.flags().contains(PTEFlags::R)
+                || self.flags().contains(PTEFlags::W)
+                || self.flags().contains(PTEFlags::X));
+    }
+
+    #[inline]
+    pub(crate) fn new_table(ppn: PhysPage) -> Self {
+        Self((ppn.0 << 10) | (PTEFlags::V).bits() as usize)
+    }
+
+    #[inline]
+    pub(crate) fn new_page(ppn: PhysPage, flags: PTEFlags) -> Self {
+        Self((ppn.0 << 10) | flags.bits() as usize)
+    }
+
+    #[inline]
+    pub(crate) fn address(&self) -> PhysAddr {
+        PhysAddr((self.0 << 2) & 0xFFFF_FFFF_F000)
+    }
+}
+
+bitflags! {
+    #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
+    pub struct PTEFlags: u64 {
+        const V = bit!(0);
+        const R = bit!(1);
+        const W = bit!(2);
+        const X = bit!(3);
+        const U = bit!(4);
+        const G = bit!(5);
+        const A = bit!(6);
+        const D = bit!(7);
+
+        #[cfg(c906)]
+        const SO = bit!(63);
+        #[cfg(c906)]
+        const C = bit!(62);
+        #[cfg(c906)]
+        const B = bit!(61);
+        #[cfg(c906)]
+        const K = bit!(60);
+        #[cfg(c906)]
+        const SE = bit!(59);
+
+        const VRWX  = Self::V.bits() | Self::R.bits() | Self::W.bits() | Self::X.bits();
+        const ADUVRX = Self::A.bits() | Self::D.bits() | Self::U.bits() | Self::V.bits() | Self::R.bits() | Self::X.bits();
+        const ADVRWX = Self::A.bits() | Self::D.bits() | Self::VRWX.bits();
+        const ADGVRWX = Self::G.bits() | Self::ADVRWX.bits();
+    }
+}
+
+impl From<MappingFlags> for PTEFlags {
+    fn from(flags: MappingFlags) -> Self {
+        if flags.is_empty() {
+            Self::empty()
+        } else {
+            let mut res = Self::V;
+            if flags.contains(MappingFlags::R) {
+                res |= PTEFlags::R | PTEFlags::A;
+            }
+            if flags.contains(MappingFlags::W) {
+                res |= PTEFlags::W | PTEFlags::D;
+            }
+            if flags.contains(MappingFlags::X) {
+                res |= PTEFlags::X;
+            }
+            if flags.contains(MappingFlags::U) {
+                res |= PTEFlags::U;
+            }
+            res
+        }
+    }
+}
+
+impl From<PTEFlags> for MappingFlags {
+    fn from(value: PTEFlags) -> Self {
+        let mut mapping_flags = MappingFlags::empty();
+        if value.contains(PTEFlags::V) {
+            mapping_flags |= MappingFlags::P;
+        }
+        if value.contains(PTEFlags::R) {
+            mapping_flags |= MappingFlags::R;
+        }
+        if value.contains(PTEFlags::W) {
+            mapping_flags |= MappingFlags::W;
+        }
+        if value.contains(PTEFlags::X) {
+            mapping_flags |= MappingFlags::X;
+        }
+        if value.contains(PTEFlags::U) {
+            mapping_flags |= MappingFlags::U;
+        }
+        if value.contains(PTEFlags::A) {
+            mapping_flags |= MappingFlags::A;
+        }
+        if value.contains(PTEFlags::D) {
+            mapping_flags |= MappingFlags::D;
+        }
+
+        mapping_flags
+    }
+}
+
+impl PageTable {
+    /// The size of the page for this platform.
+    pub(crate) const PAGE_SIZE: usize = 0x1000;
+    pub(crate) const PAGE_LEVEL: usize = 3;
+    pub(crate) const PTE_NUM_IN_PAGE: usize = 0x200;
+    pub(crate) const GLOBAL_ROOT_PTE_RANGE: usize = 0x100;
+    pub(crate) const VADDR_BITS: usize = 39;
+    pub(crate) const USER_VADDR_END: usize = (1 << Self::VADDR_BITS) - 1;
+    pub(crate) const KERNEL_VADDR_START: usize = !Self::USER_VADDR_END;
+
+    #[inline]
+    pub fn current() -> Self {
+        Self(PhysAddr(satp::read().ppn() << 12))
+    }
+
+    #[inline]
+    pub fn kernel_pte_entry(&self) -> PhysAddr {
+        self.0
+    }
+
+    #[inline]
+    pub fn restore(&self) {
+        self.release();
+        let kernel_arr = Self::get_pte_list(Self::current().0);
+        let arr = Self::get_pte_list(self.0);
+        arr[0x100..].copy_from_slice(&kernel_arr[0x100..]);
+        arr[0..0x100].fill(PTE(0));
+    }
+
+    #[inline]
+    pub fn change(&self) {
+        // Write page table entry for
+        satp::write((8 << 60) | (self.0.0 >> 12));
+        TLB::flush_all();
+    }
+}
+
+impl VirtPage {
+    /// Get n level page table index of the given virtual address
+    #[inline]
+    pub fn pn_index(&self, n: usize) -> usize {
+        (self.0 >> 9 * n) & 0x1ff
+    }
+}
+
+impl VirtAddr {
+    /// Get n level page table offset of the given virtual address
+    #[inline]
+    pub fn pn_offest(&self, n: usize) -> usize {
+        self.0 % (1 << (12 + 9 * n))
+    }
+}
+
+/// TLB operations
+impl TLB {
+    /// flush the TLB entry by VirtualAddress
+    /// just use it directly
+    ///
+    /// TLB::flush_vaddr(arg0); // arg0 is the virtual address(VirtAddr)
+    #[inline]
+    pub fn flush_vaddr(vaddr: VirtAddr) {
+        unsafe {
+            sfence_vma(vaddr.0, 0);
+        }
+    }
+
+    /// flush all tlb entry
+    ///
+    /// how to use ?
+    /// just
+    /// TLB::flush_all();
+    #[inline]
+    pub fn flush_all() {
+        riscv::asm::sfence_vma_all();
+    }
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/percpu/mod.rs.html b/src/polyhal/components/percpu/mod.rs.html new file mode 100644 index 0000000..fc26926 --- /dev/null +++ b/src/polyhal/components/percpu/mod.rs.html @@ -0,0 +1,209 @@ +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
+
//! Per-cpu module.
+//!
+//!
+
+super::define_arch_mods!();
+
+use alloc::alloc::alloc;
+use core::{alloc::Layout, mem::size_of, ptr::copy_nonoverlapping};
+
+use super::pagetable::PAGE_SIZE;
+
+pub use polyhal_macro::def_percpu;
+
+#[repr(align(8))]
+struct PerCPUDATA([u8; PAGE_SIZE]);
+
+static BOOT_PERCPU_DATA_AREA: PerCPUDATA = PerCPUDATA([0; PAGE_SIZE]);
+
+/// This is a empty seat for percpu section.
+/// Force the linker to create the percpu section.
+#[link_section = "percpu"]
+#[used(linker)]
+static _PERCPU_SEAT: [usize; 0] = [0; 0];
+
+#[cfg(target_arch = "x86_64")]
+const PERCPU_RESERVED: usize = size_of::<PerCPUReserved>();
+#[cfg(not(target_arch = "x86_64"))]
+const PERCPU_RESERVED: usize = 0;
+
+/// Returns the base address of the per-CPU data area on the given CPU.
+///
+/// if `cpu_id` is 0, it returns the base address of all per-CPU data areas.
+pub fn percpu_area_init(cpu_id: usize) -> usize {
+    // Get initial per-CPU data area
+    extern "Rust" {
+        fn __start_percpu();
+        fn __stop_percpu();
+    }
+    let start = __start_percpu as usize;
+    let size = __stop_percpu as usize - start + PERCPU_RESERVED;
+
+    // Get the base address of the per-CPU data area
+    // If cpu_id is boot,core then use BOOT_PERCPU_DATA_AREA.
+    // else alloc area.
+    let dst = if cpu_id == 0 {
+        &BOOT_PERCPU_DATA_AREA as *const _ as usize as *mut u8
+    } else {
+        let layout =
+            Layout::from_size_align(size, size_of::<usize>()).expect("percpu area align failed");
+        unsafe { alloc(layout) }
+    };
+
+    // Init the area with original data.
+    unsafe {
+        copy_nonoverlapping(start as *const u8, dst.add(PERCPU_RESERVED), size);
+    }
+
+    dst as usize
+}
+
+/// Read the architecture-specific thread pointer register on the current CPU.
+pub fn get_local_thread_pointer() -> usize {
+    let tp;
+    unsafe {
+        cfg_if::cfg_if! {
+            if #[cfg(target_arch = "x86_64")] {
+                tp = x86::msr::rdmsr(x86::msr::IA32_GS_BASE) as usize
+            } else if #[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))] {
+                core::arch::asm!("mv {}, gp", out(reg) tp)
+            } else if #[cfg(target_arch = "aarch64")] {
+                core::arch::asm!("mrs {}, TPIDR_EL1", out(reg) tp)
+            } else if #[cfg(target_arch = "loongarch64")] {
+                core::arch::asm!("move {}, $r21", out(reg) tp)
+            }
+        }
+    }
+    tp
+}
+
+/// Set the architecture-specific thread pointer register to the per-CPU data
+/// area base on the current CPU.
+///
+/// `cpu_id` indicates which per-CPU data area to use.
+pub fn set_local_thread_pointer(cpu_id: usize) {
+    let tp = percpu_area_init(cpu_id);
+    unsafe {
+        cfg_if::cfg_if! {
+            if #[cfg(target_arch = "x86_64")] {
+                x86::msr::wrmsr(x86::msr::IA32_GS_BASE, tp as u64);
+                // Write cpu_local pointer to the first usize of the per-CPU data area
+                // Write the valid address to the second usize of the per-CPU data area
+                let percpu_reserved = PerCPUReserved::mut_from_ptr(tp as _);
+                percpu_reserved.self_ptr = tp;
+                percpu_reserved.valid_ptr = tp + PERCPU_RESERVED;
+            } else if #[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))] {
+                core::arch::asm!("mv gp, {}", in(reg) tp)
+            } else if #[cfg(target_arch = "aarch64")] {
+                core::arch::asm!("msr TPIDR_EL1, {}", in(reg) tp)
+            } else if #[cfg(target_arch = "loongarch64")] {
+                core::arch::asm!("move $r21, {}", in(reg) tp)
+            }
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/percpu/riscv64.rs.html b/src/polyhal/components/percpu/riscv64.rs.html new file mode 100644 index 0000000..29aec54 --- /dev/null +++ b/src/polyhal/components/percpu/riscv64.rs.html @@ -0,0 +1,43 @@ +riscv64.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+

+/// PolyHAL defined percpu reserved fields.
+/// Just used in the polyHAL and context switch.
+#[repr(C)]
+pub(crate) struct PerCPUReserved {
+    pub user_rsp: usize,
+    pub kernel_rsp: usize,
+    pub user_context: usize,
+}
+
+/// Get the offset of the specified percpu field.
+///
+/// PerCPU Arrange is that.
+///
+/// IN x86_64. The Reserved fields was used in manually.
+/// IN other architectures, the reserved fields was defined
+/// negative offset of the percpu pointer.
+pub(crate) macro PerCPUReservedOffset($field: ident) {
+    core::mem::offset_of!(PerCPUReserved, $field) as isize
+        - core::mem::size_of::<PerCPUReserved>() as isize
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/timer/mod.rs.html b/src/polyhal/components/timer/mod.rs.html new file mode 100644 index 0000000..f2e4ac0 --- /dev/null +++ b/src/polyhal/components/timer/mod.rs.html @@ -0,0 +1,11 @@ +mod.rs - source
1
+2
+3
+4
+5
+
//! Timer module.
+//!
+//!
+
+super::define_arch_mods!();
+
\ No newline at end of file diff --git a/src/polyhal/components/timer/riscv64.rs.html b/src/polyhal/components/timer/riscv64.rs.html new file mode 100644 index 0000000..5f77279 --- /dev/null +++ b/src/polyhal/components/timer/riscv64.rs.html @@ -0,0 +1,67 @@ +riscv64.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
+
// TODO: Get CLOCK_FREQUENCY CLOCK_FREQ
+// use crate::currrent_arch::boards::CLOCK_FREQ;
+use crate::time::Time;
+use riscv::register::{sie, time};
+
+const CLOCK_FREQ: usize = 12500000;
+
+impl Time {
+    #[inline]
+    pub fn get_freq() -> usize {
+        CLOCK_FREQ
+    }
+
+    #[inline]
+    pub fn now() -> Self {
+        Self(time::read())
+    }
+}
+
+// 设置下一次时钟中断触发时间
+#[inline]
+pub fn set_next_timeout() {
+    // 调用sbi设置定时器
+    sbi_rt::set_timer((time::read() + CLOCK_FREQ / 100) as _);
+}
+
+pub fn init() {
+    unsafe {
+        sie::set_stimer();
+    }
+    set_next_timeout();
+    log::info!("initialize timer interrupt");
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/trap/mod.rs.html b/src/polyhal/components/trap/mod.rs.html new file mode 100644 index 0000000..f86589b --- /dev/null +++ b/src/polyhal/components/trap/mod.rs.html @@ -0,0 +1,89 @@ +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
+
//! Define and initialize the trap handler.
+//!
+//!
+
+use super::irq::IRQVector;
+use super::trapframe::TrapFrame;
+
+super::define_arch_mods!();
+
+#[derive(Debug, Clone, Copy)]
+pub enum TrapType {
+    Breakpoint,
+    SysCall,
+    Timer,
+    Unknown,
+    SupervisorExternal,
+    StorePageFault(usize),
+    LoadPageFault(usize),
+    InstructionPageFault(usize),
+    IllegalInstruction(usize),
+    Irq(IRQVector),
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub enum EscapeReason {
+    NoReason,
+    IRQ,
+    Timer,
+    SysCall,
+}
+
+// TODO: Implement Into EscapeReason
+impl Into<EscapeReason> for TrapType {
+    fn into(self) -> EscapeReason {
+        match self {
+            TrapType::SysCall => EscapeReason::SysCall,
+            _ => EscapeReason::NoReason,
+        }
+    }
+}
+
+extern "Rust" {
+    pub(crate) fn _interrupt_for_arch(ctx: &mut TrapFrame, trap_type: TrapType, token: usize);
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/trap/riscv64.rs.html b/src/polyhal/components/trap/riscv64.rs.html new file mode 100644 index 0000000..8304d38 --- /dev/null +++ b/src/polyhal/components/trap/riscv64.rs.html @@ -0,0 +1,551 @@ +riscv64.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
+
use crate::components::{consts::VIRT_ADDR_START, timer, trapframe::TrapFrame};
+use core::arch::{asm, global_asm};
+use riscv::register::{
+    scause::{self, Exception, Interrupt, Trap},
+    stval, stvec,
+};
+
+use crate::components::trap::TrapType;
+use crate::components::trap::EscapeReason;
+
+global_asm!(
+    r"
+    .altmacro
+    .macro LOAD reg, offset
+        ld  \reg, \offset*8(sp)
+    .endm
+
+    .macro SAVE reg, offset
+        sd  \reg, \offset*8(sp)
+    .endm
+
+    .macro LOAD_N n
+        ld  x\n, \n*8(sp)
+    .endm
+
+    .macro SAVE_N n
+        sd  x\n, \n*8(sp)
+    .endm
+
+    .macro SAVE_GENERAL_REGS
+        SAVE    x1, 1
+        csrr    x1, sscratch
+        SAVE    x1, 2
+        .set    n, 3
+        .rept   29 
+            SAVE_N  %n
+        .set    n, n + 1
+        .endr
+
+        csrr    t0, sstatus
+        csrr    t1, sepc
+        SAVE    t0, 32
+        SAVE    t1, 33
+    .endm
+
+    .macro LOAD_GENERAL_REGS
+        LOAD    t0, 32
+        LOAD    t1, 33
+        csrw    sstatus, t0
+        csrw    sepc, t1
+
+        LOAD    x1, 1
+        .set    n, 3
+        .rept   29
+            LOAD_N  %n
+        .set    n, n + 1
+        .endr
+        LOAD    x2, 2
+    .endm
+
+    .macro LOAD_PERCPU dst, sym
+        lui  \dst, %hi(__PERCPU_\sym)
+        add  \dst, \dst, gp
+        ld   \dst, %lo(__PERCPU_\sym)(\dst)
+    .endm
+
+    .macro SAVE_PERCPU sym, temp, src
+        lui  \temp, %hi(__PERCPU_\sym)
+        add  \temp, \temp, gp
+        sd   \src,  %lo(__PERCPU_\sym)(\temp)
+    .endm
+"
+);
+
+#[no_mangle]
+#[polyhal_macro::def_percpu]
+static KERNEL_RSP: usize = 0;
+
+#[no_mangle]
+#[polyhal_macro::def_percpu]
+static USER_RSP: usize = 0;
+
+// Initialize the trap handler.
+pub(crate) fn init() {
+    unsafe {
+        stvec::write(kernelvec as usize, stvec::TrapMode::Direct);
+    }
+
+    // Initialize the timer component
+    crate::components::timer::init();
+}
+
+// 内核中断回调
+#[no_mangle]
+fn kernel_callback(context: &mut TrapFrame) -> TrapType {
+    let scause = scause::read();
+    let stval = stval::read();
+    let trap_type = match scause.cause() {
+        // 中断异常
+        Trap::Exception(Exception::Breakpoint) => {
+            context.sepc += 2;
+            TrapType::Breakpoint
+        }
+        Trap::Exception(Exception::LoadFault) => {
+            if stval > VIRT_ADDR_START {
+                panic!("kernel error: {:#x}", stval);
+            }
+            TrapType::Unknown
+        }
+        Trap::Exception(Exception::UserEnvCall) => TrapType::SysCall,
+        // 时钟中断
+        Trap::Interrupt(Interrupt::SupervisorTimer) => {
+            timer::set_next_timeout();
+            TrapType::Timer
+        }
+        Trap::Exception(Exception::StorePageFault) => TrapType::StorePageFault(stval),
+        Trap::Exception(Exception::StoreFault) => TrapType::StorePageFault(stval),
+        Trap::Exception(Exception::InstructionPageFault) => TrapType::InstructionPageFault(stval),
+        Trap::Exception(Exception::IllegalInstruction) => TrapType::IllegalInstruction(stval),
+        Trap::Exception(Exception::LoadPageFault) => TrapType::LoadPageFault(stval),
+        Trap::Interrupt(Interrupt::SupervisorExternal) => TrapType::SupervisorExternal,
+        _ => {
+            log::error!(
+                "内核态中断发生: {:#x} {:?}  stval {:#x}  sepc: {:#x}",
+                scause.bits(),
+                scause.cause(),
+                stval,
+                context.sepc
+            );
+            panic!("未知中断: {:#x?}", context);
+        }
+    };
+    unsafe { crate::components::trap::_interrupt_for_arch(context, trap_type, 0) };
+    trap_type
+}
+
+#[naked]
+pub unsafe extern "C" fn kernelvec() {
+    asm!(
+        // 宏定义
+        r"
+            .align 4
+            .altmacro
+        
+            csrrw   sp, sscratch, sp
+            bnez    sp, uservec
+            csrr    sp, sscratch
+
+            addi    sp, sp, -{cx_size}
+            
+            SAVE_GENERAL_REGS
+            csrw    sscratch, x0
+
+            mv      a0, sp
+
+            call kernel_callback
+
+            LOAD_GENERAL_REGS
+            sret
+        ",
+        cx_size = const crate::components::trapframe::TRAPFRAME_SIZE,
+        options(noreturn)
+    )
+}
+
+#[naked]
+#[no_mangle]
+extern "C" fn user_restore(context: *mut TrapFrame) {
+    unsafe {
+        asm!(
+            r"
+                .align 4
+                .altmacro
+            ",
+            // 在内核态栈中开一个空间来存储内核态信息
+            // 下次发生中断必然会进入中断入口然后恢复这个上下文.
+            // 仅保存 Callee-saved regs、gp、tp、ra.
+            "   addi    sp, sp, -18*8
+                
+                sd      sp, 8*1(sp)
+                sd      gp, 8*2(sp)
+                sd      tp, 8*3(sp)
+                sd      s0, 8*4(sp)
+                sd      s1, 8*5(sp)
+                sd      s2, 8*6(sp)
+                sd      s3, 8*7(sp)
+                sd      s4, 8*8(sp)
+                sd      s5, 8*9(sp)
+                sd      s6, 8*10(sp)
+                sd      s7, 8*11(sp)
+                sd      s8, 8*12(sp)
+                sd      s9, 8*13(sp)
+                sd      s10, 8*14(sp)
+                sd      s11, 8*15(sp)
+                sd      a0,  8*16(sp)
+                sd      ra,  8*17(sp)
+            ",
+            // 将栈信息保存到用户栈.
+            // a0 是传入的Context, 然后下面会再次恢复 sp 地址.
+            "   sd      sp, 8*0(a0)
+                csrw    sscratch, a0
+                mv      sp, a0
+            
+                .short  0x2452      # fld  fs0, 272(sp)
+                .short  0x24f2      # fld  fs1, 280(sp)
+
+                LOAD_GENERAL_REGS
+                sret
+            ",
+            options(noreturn)
+        )
+    }
+}
+
+#[naked]
+#[no_mangle]
+#[allow(named_asm_labels)]
+pub unsafe extern "C" fn uservec() {
+    asm!(
+        r"
+        .altmacro
+    ",
+        // 保存 general registers, 除了 sp
+        "
+        SAVE_GENERAL_REGS
+        csrw    sscratch, x0
+
+        .word   0x10813827          # fsd fs0, 272(sp)
+        .word   0x10913c27          # fsd fs1, 280(sp)
+
+        mv      a0, sp
+        ld      sp, 0*8(a0)
+        sd      x0, 0*8(a0)
+    ",
+        // 恢复内核上下文信息, 仅恢复 callee-saved 寄存器和 ra、gp、tp
+        "  
+        ld      gp, 8*2(sp)
+        ld      tp, 8*3(sp)
+        ld      s0, 8*4(sp)
+        ld      s1, 8*5(sp)
+        ld      s2, 8*6(sp)
+        ld      s3, 8*7(sp)
+        ld      s4, 8*8(sp)
+        ld      s5, 8*9(sp)
+        ld      s6, 8*10(sp)
+        ld      s7, 8*11(sp)
+        ld      s8, 8*12(sp)
+        ld      s9, 8*13(sp)
+        ld      s10, 8*14(sp)
+        ld      s11, 8*15(sp)
+        ld      ra,  8*17(sp)
+        
+        ld      sp, 8(sp)
+    ",
+        // 回收栈
+        "addi sp, sp, 18*8
+        ret
+    ",
+        options(noreturn)
+    );
+}
+
+/// Return EscapeReson related to interrupt type.
+pub fn run_user_task(context: &mut TrapFrame) -> EscapeReason {
+    user_restore(context);
+    kernel_callback(context).into()
+}
+
+/// Run user task until interrupt is received.
+pub fn run_user_task_forever(context: &mut TrapFrame) -> ! {
+    loop {
+        user_restore(context);
+        kernel_callback(context);
+    }
+}
+
\ No newline at end of file diff --git a/src/polyhal/components/trapframe/mod.rs.html b/src/polyhal/components/trapframe/mod.rs.html new file mode 100644 index 0000000..c23a4b1 --- /dev/null +++ b/src/polyhal/components/trapframe/mod.rs.html @@ -0,0 +1,53 @@ +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
+
//! Trapframe module.
+//!
+//!
+
+use core::mem::size_of;
+
+super::define_arch_mods!();
+
+/// Trap Frame Arg Type
+///
+/// Using this by Index and IndexMut trait bound on TrapFrame
+#[derive(Debug)]
+pub enum TrapFrameArgs {
+    SEPC,
+    RA,
+    SP,
+    RET,
+    ARG0,
+    ARG1,
+    ARG2,
+    TLS,
+    SYSCALL,
+}
+
+/// The size of the [TrapFrame]
+pub const TRAPFRAME_SIZE: usize = size_of::<TrapFrame>();
+
\ No newline at end of file diff --git a/src/polyhal/components/trapframe/riscv64.rs.html b/src/polyhal/components/trapframe/riscv64.rs.html new file mode 100644 index 0000000..fdf91ac --- /dev/null +++ b/src/polyhal/components/trapframe/riscv64.rs.html @@ -0,0 +1,273 @@ +riscv64.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
+
use core::{
+    fmt::Debug,
+    ops::{Index, IndexMut},
+};
+
+use riscv::register::sstatus::{self, Sstatus, SPP};
+
+use crate::components::trapframe::TrapFrameArgs;
+
+#[repr(C)]
+#[derive(Clone)]
+// 上下文
+pub struct TrapFrame {
+    pub x: [usize; 32], // 32 个通用寄存器
+    pub sstatus: Sstatus,
+    pub sepc: usize,
+    pub fsx: [usize; 2],
+}
+
+impl Debug for TrapFrame {
+    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+        f.debug_struct("Context")
+            .field("ra", &self.x[1])
+            .field("sp", &self.x[2])
+            .field("gp", &self.x[3])
+            .field("tp", &self.x[4])
+            .field("t0", &self.x[5])
+            .field("t1", &self.x[6])
+            .field("t2", &self.x[7])
+            .field("s0", &self.x[8])
+            .field("s1", &self.x[9])
+            .field("a0", &self.x[10])
+            .field("a1", &self.x[11])
+            .field("a2", &self.x[12])
+            .field("a3", &self.x[13])
+            .field("a4", &self.x[14])
+            .field("a5", &self.x[15])
+            .field("a6", &self.x[16])
+            .field("a7", &self.x[17])
+            .field("s2", &self.x[18])
+            .field("s3", &self.x[19])
+            .field("s4", &self.x[20])
+            .field("s5", &self.x[21])
+            .field("s6", &self.x[22])
+            .field("s7", &self.x[23])
+            .field("s8", &self.x[24])
+            .field("s9", &self.x[25])
+            .field("s10", &self.x[26])
+            .field("s11", &self.x[27])
+            .field("t3", &self.x[28])
+            .field("t4", &self.x[29])
+            .field("t5", &self.x[30])
+            .field("t6", &self.x[31])
+            .field("sstatus", &self.sstatus)
+            .field("sepc", &self.sepc)
+            .field("fsx", &self.fsx)
+            .finish()
+    }
+}
+
+impl TrapFrame {
+    // 创建上下文信息
+    #[inline]
+    pub fn new() -> Self {
+        TrapFrame {
+            x: [0usize; 32],
+            sstatus: sstatus::read(),
+            sepc: 0,
+            fsx: [0; 2],
+        }
+    }
+
+    #[inline]
+    pub fn args(&self) -> [usize; 6] {
+        self.x[10..16].try_into().expect("args slice force convert")
+    }
+
+    /// Check if the trapframe was from user.
+    #[inline]
+    pub fn from_user(&self) -> bool {
+        self.sstatus.spp() == SPP::User
+    }
+
+    #[inline]
+    pub fn syscall_ok(&mut self) {
+        self.sepc += 4;
+    }
+}
+
+impl Index<TrapFrameArgs> for TrapFrame {
+    type Output = usize;
+
+    fn index(&self, index: TrapFrameArgs) -> &Self::Output {
+        match index {
+            TrapFrameArgs::SEPC => &self.sepc,
+            TrapFrameArgs::RA => &self.x[1],
+            TrapFrameArgs::SP => &self.x[2],
+            TrapFrameArgs::RET => &self.x[10],
+            TrapFrameArgs::ARG0 => &self.x[10],
+            TrapFrameArgs::ARG1 => &self.x[11],
+            TrapFrameArgs::ARG2 => &self.x[12],
+            TrapFrameArgs::TLS => &self.x[4],
+            TrapFrameArgs::SYSCALL => &self.x[17],
+        }
+    }
+}
+
+impl IndexMut<TrapFrameArgs> for TrapFrame {
+    fn index_mut(&mut self, index: TrapFrameArgs) -> &mut Self::Output {
+        match index {
+            TrapFrameArgs::SEPC => &mut self.sepc,
+            TrapFrameArgs::RA => &mut self.x[1],
+            TrapFrameArgs::SP => &mut self.x[2],
+            TrapFrameArgs::RET => &mut self.x[10],
+            TrapFrameArgs::ARG0 => &mut self.x[10],
+            TrapFrameArgs::ARG1 => &mut self.x[11],
+            TrapFrameArgs::ARG2 => &mut self.x[12],
+            TrapFrameArgs::TLS => &mut self.x[4],
+            TrapFrameArgs::SYSCALL => &mut self.x[17],
+        }
+    }
+}
+
+/// Kernel Token
+///
+/// Store the kernel runtime info before
+#[repr(C)]
+pub struct KernelToken {
+    _reserved: usize,
+    pub sp: usize,
+    pub gp: usize,
+    pub tp: usize,
+    _s: [usize; 12],
+    pub a0: usize,
+    pub ra: usize,
+}
+
\ No newline at end of file diff --git a/src/polyhal/drivers/interrupt/mod.rs.html b/src/polyhal/drivers/interrupt/mod.rs.html new file mode 100644 index 0000000..65037ed --- /dev/null +++ b/src/polyhal/drivers/interrupt/mod.rs.html @@ -0,0 +1,3 @@ +mod.rs - source
1
+

+
\ No newline at end of file diff --git a/src/polyhal/drivers/mod.rs.html b/src/polyhal/drivers/mod.rs.html new file mode 100644 index 0000000..ac5d961 --- /dev/null +++ b/src/polyhal/drivers/mod.rs.html @@ -0,0 +1,5 @@ +mod.rs - source
1
+2
+
pub(crate) mod interrupt;
+pub(crate) mod uart;
+
\ No newline at end of file diff --git a/src/polyhal/drivers/uart/mod.rs.html b/src/polyhal/drivers/uart/mod.rs.html new file mode 100644 index 0000000..e01fef8 --- /dev/null +++ b/src/polyhal/drivers/uart/mod.rs.html @@ -0,0 +1,3 @@ +mod.rs - source
1
+

+
\ No newline at end of file diff --git a/src/polyhal/lib.rs.html b/src/polyhal/lib.rs.html new file mode 100644 index 0000000..9d8cbd1 --- /dev/null +++ b/src/polyhal/lib.rs.html @@ -0,0 +1,545 @@ +lib.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
+
#![no_std]
+#![no_main]
+#![feature(naked_functions)]
+#![feature(asm_const)]
+#![feature(cfg_version)]
+#![feature(decl_macro)]
+#![feature(cfg_match)]
+#![feature(offset_of)]
+#![feature(used_with_arg)]
+#![cfg_attr(not(version("1.79")), feature(stdsimd))]
+#![feature(const_mut_refs)]
+#![feature(const_slice_from_raw_parts_mut)]
+#![feature(const_trait_impl)]
+#![cfg_attr(target_arch = "riscv64", feature(riscv_ext_intrinsics))]
+#![cfg_attr(target_arch = "aarch64", feature(const_option))]
+// For test
+#![feature(custom_test_frameworks)]
+#![test_runner(crate::tests::test_runner)]
+#![reexport_test_harness_main = "test_main"]
+
+//! This is a crate to help you supporting multiple platforms.
+//!
+//! If you want to use this crate, you should implement the following trait in your code.
+//!
+//! ```rust
+//! /// impl
+//! pub struct PageAllocImpl;
+//!
+//! impl PageAlloc for PageAllocImpl {
+//!     fn alloc(&self) -> PhysPage {
+//!         frame_alloc()
+//!     }
+//!
+//!     fn dealloc(&self, ppn: PhysPage) {
+//!         frame::frame_dealloc(ppn)
+//!     }
+//! }
+//!
+//! /// kernel interrupt
+//! #[polyhal::arch_interrupt]
+//! fn kernel_interrupt(ctx: &mut TrapFrame, trap_type: TrapType) {
+//!     // println!("trap_type @ {:x?} {:#x?}", trap_type, ctx);
+//!     match trap_type {
+//!         Breakpoint => return,
+//!         UserEnvCall => {
+//!             // jump to next instruction anyway
+//!             ctx.syscall_ok();
+//!             log::info!("Handle a syscall");
+//!         }
+//!         StorePageFault(_paddr) | LoadPageFault(_paddr) | InstructionPageFault(_paddr) => {
+//!             log::info!("page fault");
+//!         }
+//!         IllegalInstruction(_) => {
+//!             log::info!("illegal instruction");
+//!         }
+//!         Time => {
+//!             log::info!("Timer");
+//!         }
+//!         _ => {
+//!             log::warn!("unsuspended trap type: {:?}", trap_type);
+//!         }
+//!     }
+//! }
+//!
+//! #[polyhal::arch_entry]
+//! /// kernel main function, entry point.
+//! fn main(hartid: usize) {
+//!     if hartid != 0 {
+//!         return;
+//!     }
+//!
+//!     println!("[kernel] Hello, world!");
+//!     allocator::init_allocator();
+//!     logging::init(Some("trace"));
+//!     println!("init logging");
+//!
+//!     // Init page alloc for polyhal
+//!     polyhal::init(&PageAllocImpl);
+//!
+//!     get_mem_areas().into_iter().for_each(|(start, size)| {
+//!         println!("init memory region {:#x} - {:#x}", start, start + size);
+//!         frame::add_frame_range(start, start + size);
+//!     });
+//!     panic!("end of rust_main!");
+//! }
+//!
+//! ```
+//!
+//! The main(hardid: usize) is the entry point.
+//!
+//! You can find details in the example.
+//!
+//! In this crate you can find some interfaces to use.
+//! These interfaces are classified into some structures.
+//!
+//! [PhysPage]: PhysicalPage And its associated functions.
+//!
+//! [PhysAddr](addr::PhysAddr): PhysicalAddr And its associated functions.
+//!
+//! [VirtPage](addr::VirtPage): VirtualPage And its associated functions.
+//!
+//! [VirtAddr](addr::VirtAddr): VirtualAddr And its associated functions.
+//!
+//! [IRQ](irq::IRQ): Interrupt ReQuest management, includes enable and disable.
+//!
+//! [Barrier](mem::Barrier): Memory barrier operations.
+//!
+//! [MultiCore](multicore::MultiCore): MultiCore operations. Now only [multicore::MultiCore::boot_all] is available.
+//!
+//! [PageTable]: PageTable and its associated functions.
+//!
+//! [MappingFlags](pagetable::MappingFlags): MappingFlags, This is an abstraction of pagetable flags.
+//!
+//! [TLB](pagetable::TLB): TLB operations.
+//!
+//! [PageTableWrapper](pagetable::PageTableWrapper): PageTableWrapper. It will dealloc all pagetable leaf when it was dropping.
+//!
+//! [Time](time::Time): Time and its associated functions.
+//!
+//! [Instruction](instruction::Instruction): Some platform instruction.
+//!
+//! There also provides a debugging console(recommanded only for debugging).
+//!
+//! [DebugConsole](debug::DebugConsole): A console for debugging.
+//!
+//! This crate provides a [TrapFrame], you can operate it through index with [TrapFrameArgs].
+//!
+//! If you are using kernel task. You should to enable feature `kcontext`.
+//! Then you can use kernel task context structure [KContext], and manipulate it with [KContextArgs].
+//!
+//! You can switch kcontext through [context_switch_pt] or [context_switch]
+//!
+//! There are also some consts.
+//!
+//! [VIRT_ADDR_START]: This is a higher half kernel offset address.
+//! [USER_VADDR_END]: End of the user address range.
+//! [PAGE_SIZE]: The size of the page.
+//!
+//! You can get some device information using the functions below.
+//! [get_mem_areas]: Get the avaliable memorys.
+//! [get_fdt]: Get the Fdt structure(fdt is a rust dtb operation crate).
+//! [get_cpu_num]: Get the number of cpus.
+//!
+//! TIPS: You should have finished [init] before using [get_mem_areas] and [get_fdt].
+
+extern crate alloc;
+
+extern crate log;
+
+pub mod addr;
+mod components;
+pub use components::*;
+pub(crate) mod drivers;
+pub mod time;
+pub mod utils;
+use core::mem::size_of;
+
+#[cfg(feature = "boot")]
+pub use polyhal_macro::arch_entry;
+#[cfg(feature = "trap")]
+pub use polyhal_macro::arch_interrupt;
+
+// Re export the Module like Structure.
+pub use addr::{PhysAddr, PhysPage, VirtAddr, VirtPage};
+// pub use multicore::MultiCore;
+pub use components::pagetable::{MappingFlags, MappingSize, PageTable, PageTableWrapper};
+pub use time::Time;
+
+pub(crate) fn clear_bss() {
+    extern "C" {
+        fn _sbss();
+        fn _ebss();
+    }
+    unsafe {
+        core::slice::from_raw_parts_mut(
+            _sbss as usize as *mut u128,
+            (_ebss as usize - _sbss as usize) / size_of::<u128>(),
+        )
+        .fill(0);
+    }
+}
+
+#[cfg(test)]
+pub mod tests {
+    use crate::api::frame_alloc;
+    use crate::debug::{print, println};
+    use crate::get_mem_areas;
+    use crate::shutdown;
+    use crate::PageAlloc;
+    use crate::PhysPage;
+    use crate::TrapFrame;
+    use crate::TrapType;
+    use buddy_system_allocator::LockedHeap;
+    use core::panic::PanicInfo;
+
+    pub fn test_runner(tests: &[&dyn Fn()]) {
+        crate::debug::println!("Running {} tests", tests.len());
+        for test in tests {
+            test();
+        }
+    }
+
+    #[test_case]
+    fn trivial_assertion() {
+        print!("trivial assertion... ");
+        assert_eq!(1, 1);
+        println!("[ok]");
+    }
+
+    #[global_allocator]
+    static HEAP_ALLOCATOR: LockedHeap<32> = LockedHeap::<32>::empty();
+
+    #[panic_handler]
+    fn panic(info: &core::panic::PanicInfo) -> ! {
+        crate::debug::println!("{}", info);
+        crate::shutdown()
+    }
+
+    const KERNEL_HEAP_SIZE: usize = 0x200_0000;
+
+    static mut HEAP_SPACE: [u8; KERNEL_HEAP_SIZE] = [0; KERNEL_HEAP_SIZE];
+
+    pub fn init_allocator() {
+        unsafe {
+            HEAP_ALLOCATOR
+                .lock()
+                .init(HEAP_SPACE.as_ptr() as usize, KERNEL_HEAP_SIZE);
+        }
+    }
+
+    pub struct PageAllocImpl;
+
+    impl PageAlloc for PageAllocImpl {
+        fn alloc(&self) -> PhysPage {
+            // frame_alloc()
+            todo!("alloc page")
+        }
+
+        fn dealloc(&self, ppn: PhysPage) {
+            // frame::frame_dealloc(ppn)
+            todo!("dealloc page");
+        }
+    }
+
+    /// kernel interrupt
+    #[crate::arch_interrupt]
+    fn kernel_interrupt(ctx: &mut TrapFrame, trap_type: TrapType) {
+        // println!("trap_type @ {:x?} {:#x?}", trap_type, ctx);
+    }
+
+    #[crate::arch_entry]
+    /// kernel main function, entry point.
+    fn main(hartid: usize) {
+        if hartid != 0 {
+            return;
+        }
+
+        println!("[kernel] Hello, world!");
+        init_allocator();
+
+        // Init page alloc for polyhal
+        crate::init(&PageAllocImpl);
+
+        crate::test_main();
+
+        // get_mem_areas().into_iter().for_each(|(start, size)| {
+        //     println!("init memory region {:#x} - {:#x}", start, start + size);
+        //     frame::add_frame_range(start, start + size);
+        // });
+        panic!("end of rust_main!");
+    }
+}
+
\ No newline at end of file diff --git a/src/polyhal/time.rs.html b/src/polyhal/time.rs.html new file mode 100644 index 0000000..d05d14d --- /dev/null +++ b/src/polyhal/time.rs.html @@ -0,0 +1,141 @@ +time.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
+
/// Time struct and its interface
+///
+/// You can use this to get time from ticks
+///
+/// ### get current time
+/// ```rust
+/// Time::now();
+/// ```
+///
+/// ### get current cpu's frequency
+/// ```rust
+/// Time::get_freq();
+/// ```
+///
+/// ### get how many nanoseconds have passed.
+/// ```rust
+/// Time::now().to_nsec();
+/// ```
+///
+/// ### get how many microseconds have passed.
+/// ```rust
+/// Time::now().to_usec();
+/// ```
+///
+/// ### get how many millisecond have passed.
+/// ```rust
+/// Time::now().to_msec();
+/// ```
+///
+/// ### get how may ticks have passed
+/// ```rust
+/// Time::now().raw();
+/// ```
+///
+/// ### convert ticks to time
+/// ```rust
+/// Time::from_raw(Time::now().raw());
+/// ```
+///
+
+#[derive(Clone, Copy, Debug)]
+pub struct Time(pub(crate) usize);
+
+impl Time {
+    #[inline]
+    pub fn to_msec(&self) -> usize {
+        self.0 * 1_000 / Self::get_freq()
+    }
+
+    #[inline]
+    pub fn to_usec(&self) -> usize {
+        self.0 * 1_000_000 / Self::get_freq()
+    }
+
+    /// Converts hardware ticks to nanoseconds.
+    #[inline]
+    pub fn to_nsec(&self) -> usize {
+        self.0 * 1_000_000_000 / Self::get_freq()
+    }
+
+    #[inline]
+    pub fn raw(&self) -> usize {
+        self.0
+    }
+
+    #[inline]
+    pub fn from_raw(raw: usize) -> Self {
+        Self(raw)
+    }
+}
+
\ No newline at end of file diff --git a/src/polyhal/utils/lazy_init.rs.html b/src/polyhal/utils/lazy_init.rs.html new file mode 100644 index 0000000..7c27cde --- /dev/null +++ b/src/polyhal/utils/lazy_init.rs.html @@ -0,0 +1,223 @@ +lazy_init.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
+
use core::cell::UnsafeCell;
+use core::fmt;
+use core::mem::MaybeUninit;
+use core::ops::{Deref, DerefMut};
+use core::sync::atomic::{AtomicBool, Ordering};
+
+pub struct LazyInit<T> {
+    inited: AtomicBool,
+    data: UnsafeCell<MaybeUninit<T>>,
+}
+
+unsafe impl<T: Send + Sync> Sync for LazyInit<T> {}
+unsafe impl<T: Send> Send for LazyInit<T> {}
+
+impl<T> LazyInit<T> {
+    pub const fn new() -> Self {
+        Self {
+            inited: AtomicBool::new(false),
+            data: UnsafeCell::new(MaybeUninit::uninit()),
+        }
+    }
+
+    pub fn init_by(&self, data: T) {
+        assert!(!self.is_init());
+        unsafe { (*self.data.get()).as_mut_ptr().write(data) };
+        self.inited.store(true, Ordering::Release);
+    }
+
+    pub fn is_init(&self) -> bool {
+        self.inited.load(Ordering::Acquire)
+    }
+
+    pub fn try_get(&self) -> Option<&T> {
+        if self.is_init() {
+            unsafe { Some(&*(*self.data.get()).as_ptr()) }
+        } else {
+            None
+        }
+    }
+
+    fn check_init(&self) {
+        if !self.is_init() {
+            panic!(
+                "Use uninitialized value: {:?}",
+                core::any::type_name::<Self>()
+            )
+        }
+    }
+
+    #[inline]
+    fn get(&self) -> &T {
+        self.check_init();
+        unsafe { self.get_unchecked() }
+    }
+
+    #[inline]
+    fn get_mut(&mut self) -> &mut T {
+        self.check_init();
+        unsafe { self.get_mut_unchecked() }
+    }
+
+    /// # Safety
+    ///
+    /// Must be called after initialization.
+    #[inline]
+    pub unsafe fn get_unchecked(&self) -> &T {
+        &*(*self.data.get()).as_ptr()
+    }
+
+    /// # Safety
+    ///
+    /// Must be called after initialization.
+    #[inline]
+    pub unsafe fn get_mut_unchecked(&mut self) -> &mut T {
+        &mut *(*self.data.get()).as_mut_ptr()
+    }
+}
+
+impl<T: fmt::Debug> fmt::Debug for LazyInit<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self.try_get() {
+            Some(s) => write!(f, "LazyInit {{ data: ")
+                .and_then(|()| s.fmt(f))
+                .and_then(|()| write!(f, "}}")),
+            None => write!(f, "LazyInit {{ <uninitialized> }}"),
+        }
+    }
+}
+
+impl<T> Deref for LazyInit<T> {
+    type Target = T;
+    #[inline]
+    fn deref(&self) -> &T {
+        self.get()
+    }
+}
+
+impl<T> DerefMut for LazyInit<T> {
+    #[inline]
+    fn deref_mut(&mut self) -> &mut T {
+        self.get_mut()
+    }
+}
+
+impl<T> Drop for LazyInit<T> {
+    fn drop(&mut self) {
+        if self.is_init() {
+            unsafe { core::ptr::drop_in_place((*self.data.get()).as_mut_ptr()) };
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/polyhal/utils/macros.rs.html b/src/polyhal/utils/macros.rs.html new file mode 100644 index 0000000..4478604 --- /dev/null +++ b/src/polyhal/utils/macros.rs.html @@ -0,0 +1,17 @@ +macros.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+
/// bit macro will generate the number through a shift value.
+///
+/// Here is an example.
+/// You can use bit!(0) instead of 1 << 0.
+/// bit!(39) instead of 1 << 39.
+pub macro bit($x: expr) {
+    1 << $x
+}
+
\ No newline at end of file diff --git a/src/polyhal/utils/mod.rs.html b/src/polyhal/utils/mod.rs.html new file mode 100644 index 0000000..58d5e6d --- /dev/null +++ b/src/polyhal/utils/mod.rs.html @@ -0,0 +1,15 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+
mod lazy_init;
+mod macros;
+mod mutex_no_irq;
+
+pub use lazy_init::LazyInit;
+pub use macros::bit;
+pub use mutex_no_irq::{MutexNoIrq, MutexNoIrqGuard};
+
\ No newline at end of file diff --git a/src/polyhal/utils/mutex_no_irq.rs.html b/src/polyhal/utils/mutex_no_irq.rs.html new file mode 100644 index 0000000..8d71979 --- /dev/null +++ b/src/polyhal/utils/mutex_no_irq.rs.html @@ -0,0 +1,193 @@ +mutex_no_irq.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
+
use core::ops::{Deref, DerefMut};
+use spin::{Mutex, MutexGuard};
+
+use crate::components::irq::IRQ;
+
+pub struct MutexNoIrq<T: ?Sized> {
+    lock: Mutex<T>,
+}
+
+/// Irq Status Struct.
+/// This structure contains the status of the current IRQ
+/// And it will restore irq status after dropping.
+struct IrqStatus {
+    irq_enabled: bool,
+}
+
+/// Restore the IRQ status when dropping
+impl Drop for IrqStatus {
+    fn drop(&mut self) {
+        if self.irq_enabled {
+            IRQ::int_enable();
+        }
+    }
+}
+
+/// Implement Sync for MutexNoIrq
+unsafe impl<T: ?Sized + Send> Sync for MutexNoIrq<T> {}
+/// Implement Send for MutexNoIrq
+unsafe impl<T: ?Sized + Send> Send for MutexNoIrq<T> {}
+
+impl<T> MutexNoIrq<T> {
+    pub const fn new(data: T) -> MutexNoIrq<T> {
+        MutexNoIrq {
+            lock: Mutex::new(data),
+        }
+    }
+
+    #[inline(always)]
+    pub fn into_inner(self) -> T {
+        self.lock.into_inner()
+    }
+}
+
+impl<T: ?Sized> MutexNoIrq<T> {
+    #[inline]
+    pub fn lock(&self) -> MutexNoIrqGuard<T> {
+        loop {
+            if let Some(guard) = self.try_lock() {
+                return guard;
+            }
+        }
+    }
+
+    #[inline]
+    pub fn is_locked(&self) -> bool {
+        self.lock.is_locked()
+    }
+
+    pub unsafe fn force_unlock(&self) {
+        self.lock.force_unlock()
+    }
+
+    #[inline]
+    pub fn try_lock(&self) -> Option<MutexNoIrqGuard<T>> {
+        if self.lock.is_locked() {
+            return None;
+        }
+        let _irq_status = IrqStatus {
+            irq_enabled: IRQ::int_enabled(),
+        };
+        IRQ::int_disable();
+        self.lock
+            .try_lock()
+            .map(|guard| MutexNoIrqGuard { guard, _irq_status })
+    }
+}
+
+/// The Mutex Guard.
+pub struct MutexNoIrqGuard<'a, T: ?Sized + 'a> {
+    guard: MutexGuard<'a, T>,
+    _irq_status: IrqStatus,
+}
+
+impl<'a, T: ?Sized> Deref for MutexNoIrqGuard<'a, T> {
+    type Target = T;
+
+    fn deref(&self) -> &T {
+        &(self.guard)
+    }
+}
+
+impl<'a, T: ?Sized> DerefMut for MutexNoIrqGuard<'a, T> {
+    fn deref_mut(&mut self) -> &mut T {
+        &mut (self.guard)
+    }
+}
+
\ No newline at end of file diff --git a/static.files/COPYRIGHT-23e9bde6c69aea69.txt b/static.files/COPYRIGHT-23e9bde6c69aea69.txt new file mode 100644 index 0000000..1447df7 --- /dev/null +++ b/static.files/COPYRIGHT-23e9bde6c69aea69.txt @@ -0,0 +1,50 @@ +# REUSE-IgnoreStart + +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. + +# REUSE-IgnoreEnd diff --git a/static.files/FiraSans-LICENSE-db4b642586e02d97.txt b/static.files/FiraSans-LICENSE-db4b642586e02d97.txt new file mode 100644 index 0000000..d7e9c14 --- /dev/null +++ b/static.files/FiraSans-LICENSE-db4b642586e02d97.txt @@ -0,0 +1,98 @@ +// REUSE-IgnoreStart + +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. + +// REUSE-IgnoreEnd diff --git a/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 b/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 new file mode 100644 index 0000000..7a1e5fc Binary files /dev/null and b/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 differ diff --git a/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 b/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 new file mode 100644 index 0000000..e766e06 Binary files /dev/null and b/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 differ diff --git a/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt b/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt new file mode 100644 index 0000000..16fe87b --- /dev/null +++ b/static.files/LICENSE-APACHE-b91fa81cba47b86a.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/static.files/LICENSE-MIT-65090b722b3f6c56.txt b/static.files/LICENSE-MIT-65090b722b3f6c56.txt new file mode 100644 index 0000000..31aa793 --- /dev/null +++ b/static.files/LICENSE-MIT-65090b722b3f6c56.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/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 b/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 new file mode 100644 index 0000000..1866ad4 Binary files /dev/null and b/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 differ diff --git a/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt b/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt new file mode 100644 index 0000000..4b3edc2 --- /dev/null +++ b/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt @@ -0,0 +1,103 @@ +// REUSE-IgnoreStart + +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. + +// REUSE-IgnoreEnd diff --git a/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 b/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 new file mode 100644 index 0000000..462c34e Binary files /dev/null and b/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 differ diff --git a/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt b/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt new file mode 100644 index 0000000..0d2941e --- /dev/null +++ b/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt @@ -0,0 +1,97 @@ +// REUSE-IgnoreStart + +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. + +// REUSE-IgnoreEnd diff --git a/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 b/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 new file mode 100644 index 0000000..10b558e Binary files /dev/null and b/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 differ diff --git a/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 b/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 new file mode 100644 index 0000000..5ec64ee Binary files /dev/null and b/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 differ diff --git a/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 b/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 new file mode 100644 index 0000000..181a07f Binary files /dev/null and b/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 differ diff --git a/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 b/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 new file mode 100644 index 0000000..2ae08a7 Binary files /dev/null and b/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 differ diff --git a/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md b/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md new file mode 100644 index 0000000..175fa4f --- /dev/null +++ b/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md @@ -0,0 +1,98 @@ + + +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. +Copyright 2014 - 2023 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/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 b/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 new file mode 100644 index 0000000..0263fc3 Binary files /dev/null and b/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 differ diff --git a/static.files/clipboard-7571035ce49a181d.svg b/static.files/clipboard-7571035ce49a181d.svg new file mode 100644 index 0000000..8adbd99 --- /dev/null +++ b/static.files/clipboard-7571035ce49a181d.svg @@ -0,0 +1 @@ + diff --git a/static.files/favicon-16x16-8b506e7a72182f1c.png b/static.files/favicon-16x16-8b506e7a72182f1c.png new file mode 100644 index 0000000..ea4b45c Binary files /dev/null and b/static.files/favicon-16x16-8b506e7a72182f1c.png differ diff --git a/static.files/favicon-2c020d218678b618.svg b/static.files/favicon-2c020d218678b618.svg new file mode 100644 index 0000000..8b34b51 --- /dev/null +++ b/static.files/favicon-2c020d218678b618.svg @@ -0,0 +1,24 @@ + + + + + diff --git a/static.files/favicon-32x32-422f7d1d52889060.png b/static.files/favicon-32x32-422f7d1d52889060.png new file mode 100644 index 0000000..69b8613 Binary files /dev/null and b/static.files/favicon-32x32-422f7d1d52889060.png differ diff --git a/static.files/main-77dede896d6ac08e.js b/static.files/main-77dede896d6ac08e.js new file mode 100644 index 0000000..d511f28 --- /dev/null +++ b/static.files/main-77dede896d6ac08e.js @@ -0,0 +1,11 @@ +"use strict";window.RUSTDOC_TOOLTIP_HOVER_MS=300;window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS=450;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 blurHandler(event,parentElem,hideCallback){if(!parentElem.contains(document.activeElement)&&!parentElem.contains(event.relatedTarget)){hideCallback()}}window.rootPath=getVar("root-path");window.currentCrate=getVar("current-crate");function setMobileTopbar(){const mobileTopbar=document.querySelector(".mobile-topbar");const locationTitle=document.querySelector(".sidebar h2.location");if(mobileTopbar){const mobileTitle=document.createElement("h2");mobileTitle.className="location";if(hasClass(document.querySelector(".rustdoc"),"crate")){mobileTitle.innerText=`Crate ${window.currentCrate}`}else if(locationTitle){mobileTitle.innerHTML=locationTitle.innerHTML}mobileTopbar.appendChild(mobileTitle)}}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 preLoadCss(cssUrl){const link=document.createElement("link");link.href=cssUrl;link.rel="preload";link.as="style";document.getElementsByTagName("head")[0].appendChild(link)}(function(){const isHelpPage=window.location.pathname.endsWith("/help.html");function loadScript(url){const script=document.createElement("script");script.src=url;document.head.append(script)}getSettingsButton().onclick=event=>{if(event.ctrlKey||event.altKey||event.metaKey){return}window.hideAllModals(false);addClass(getSettingsButton(),"rotate");event.preventDefault();loadScript(getVar("static-root-path")+getVar("settings-js"));setTimeout(()=>{const themes=getVar("themes").split(",");for(const theme of themes){if(theme!==""){preLoadCss(getVar("root-path")+theme+".css")}}},0)};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},removeQueryParameters:()=>{document.title=searchState.titleBeforeSearch;if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.hash)}},hideResults:()=>{switchDisplayedElement(null);searchState.removeQueryParameters()},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(getVar("static-root-path")+getVar("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){searchState.setLoadingSearch();loadSearch()}},setLoadingSearch:()=>{const search=searchState.outputElement();search.innerHTML="

"+searchState.loadingText+"

";searchState.showResults(search)},};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()}}const pageId=window.location.hash.replace(/^#/,"");if(savedHash!==pageId){savedHash=pageId;if(pageId!==""){expandSection(pageId)}}if(savedHash.startsWith("impl-")){const splitAt=savedHash.indexOf("/");if(splitAt!==-1){const implId=savedHash.slice(0,splitAt);const assocId=savedHash.slice(splitAt+1);const implElem=document.getElementById(implId);if(implElem&&implElem.parentElement.tagName==="SUMMARY"&&implElem.parentElement.parentElement.tagName==="DETAILS"){onEachLazy(implElem.parentElement.parentElement.querySelectorAll(`[id^="${assocId}"]`),item=>{const numbered=/([^-]+)-([0-9]+)/.exec(item.id);if(item.id===assocId||(numbered&&numbered[1]===assocId)){openParentDetails(item);item.scrollIntoView();setTimeout(()=>{window.location.replace("#"+item.id)},0)}})}}}}function onHashChange(ev){hideSidebar();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();searchState.hideResults();ev.preventDefault();searchState.defocus();window.hideAllModals(true)}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"&&document.activeElement.type!=="radio"){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"+":ev.preventDefault();expandAllDocs();break;case"-":ev.preventDefault();collapseAllDocs();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 modpath=hasClass(document.querySelector(".rustdoc"),"mod")?"../":"";const h3=document.createElement("h3");h3.innerHTML=`${longty}`;const ul=document.createElement("ul");ul.className="block "+shortty;for(const name of filtered){let path;if(shortty==="mod"){path=`${modpath}${name}/index.html`}else{path=`${modpath}${shortty}.${name}.html`}let current_page=document.location.href.toString();if(current_page.endsWith("/")){current_page+="index.html"}const link=document.createElement("a");link.href=path;if(link.href===current_page){link.className="current"}link.textContent=name;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebar.appendChild(h3);sidebar.appendChild(ul)}if(sidebar){block("primitive","primitives","Primitive Types");block("mod","modules","Modules");block("macro","macros","Macros");block("struct","structs","Structs");block("enum","enums","Enums");block("constant","constants","Constants");block("static","static","Statics");block("trait","traits","Traits");block("fn","functions","Functions");block("type","types","Type Aliases");block("union","unions","Unions");block("foreigntype","foreign-types","Foreign Types");block("keyword","keywords","Keywords");block("opaque","opaque-types","Opaque Types");block("attr","attributes","Attribute Macros");block("derive","derives","Derive Macros");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();const TEXT_IDX=0;const SYNTHETIC_IDX=1;const TYPES_IDX=2;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(".main-heading h1 > .trait").textContent;const baseIdName="impl-"+traitName+"-";const libs=Object.getOwnPropertyNames(imp);const script=document.querySelector("script[data-ignore-extern-crates]");const ignoreExternCrates=new Set((script?script.getAttribute("data-ignore-extern-crates"):"").split(","));for(const lib of libs){if(lib===window.currentCrate||ignoreExternCrates.has(lib)){continue}const structs=imp[lib];struct_loop:for(const struct of structs){const list=struct[SYNTHETIC_IDX]?synthetic_implementors:implementors;if(struct[SYNTHETIC_IDX]){for(const struct_type of struct[TYPES_IDX]){if(inlined_types.has(struct_type)){continue struct_loop}inlined_types.add(struct_type)}}const code=document.createElement("h3");code.innerHTML=struct[TEXT_IDX];addClass(code,"code-header");onEachLazy(code.getElementsByTagName("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){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)}window.register_type_impls=imp=>{if(!imp||!imp[window.currentCrate]){return}window.pending_type_impls=null;const idMap=new Map();let implementations=document.getElementById("implementations-list");let trait_implementations=document.getElementById("trait-implementations-list");let trait_implementations_header=document.getElementById("trait-implementations");const script=document.querySelector("script[data-self-path]");const selfPath=script?script.getAttribute("data-self-path"):null;const mainContent=document.querySelector("#main-content");const sidebarSection=document.querySelector(".sidebar section");let methods=document.querySelector(".sidebar .block.method");let associatedTypes=document.querySelector(".sidebar .block.associatedtype");let associatedConstants=document.querySelector(".sidebar .block.associatedconstant");let sidebarTraitList=document.querySelector(".sidebar .block.trait-implementation");for(const impList of imp[window.currentCrate]){const types=impList.slice(2);const text=impList[0];const isTrait=impList[1]!==0;const traitName=impList[1];if(types.indexOf(selfPath)===-1){continue}let outputList=isTrait?trait_implementations:implementations;if(outputList===null){const outputListName=isTrait?"Trait Implementations":"Implementations";const outputListId=isTrait?"trait-implementations-list":"implementations-list";const outputListHeaderId=isTrait?"trait-implementations":"implementations";const outputListHeader=document.createElement("h2");outputListHeader.id=outputListHeaderId;outputListHeader.innerText=outputListName;outputList=document.createElement("div");outputList.id=outputListId;if(isTrait){const link=document.createElement("a");link.href=`#${outputListHeaderId}`;link.innerText="Trait Implementations";const h=document.createElement("h3");h.appendChild(link);trait_implementations=outputList;trait_implementations_header=outputListHeader;sidebarSection.appendChild(h);sidebarTraitList=document.createElement("ul");sidebarTraitList.className="block trait-implementation";sidebarSection.appendChild(sidebarTraitList);mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}else{implementations=outputList;if(trait_implementations){mainContent.insertBefore(outputListHeader,trait_implementations_header);mainContent.insertBefore(outputList,trait_implementations_header)}else{const mainContent=document.querySelector("#main-content");mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}}}const template=document.createElement("template");template.innerHTML=text;onEachLazy(template.content.querySelectorAll("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});onEachLazy(template.content.querySelectorAll("[id]"),el=>{let i=0;if(idMap.has(el.id)){i=idMap.get(el.id)}else if(document.getElementById(el.id)){i=1;while(document.getElementById(`${el.id}-${2 * i}`)){i=2*i}while(document.getElementById(`${el.id}-${i}`)){i+=1}}if(i!==0){const oldHref=`#${el.id}`;const newHref=`#${el.id}-${i}`;el.id=`${el.id}-${i}`;onEachLazy(template.content.querySelectorAll("a[href]"),link=>{if(link.getAttribute("href")===oldHref){link.href=newHref}})}idMap.set(el.id,i+1)});const templateAssocItems=template.content.querySelectorAll("section.tymethod, "+"section.method, section.associatedtype, section.associatedconstant");if(isTrait){const li=document.createElement("li");const a=document.createElement("a");a.href=`#${template.content.querySelector(".impl").id}`;a.textContent=traitName;li.appendChild(a);sidebarTraitList.append(li)}else{onEachLazy(templateAssocItems,item=>{let block=hasClass(item,"associatedtype")?associatedTypes:(hasClass(item,"associatedconstant")?associatedConstants:(methods));if(!block){const blockTitle=hasClass(item,"associatedtype")?"Associated Types":(hasClass(item,"associatedconstant")?"Associated Constants":("Methods"));const blockClass=hasClass(item,"associatedtype")?"associatedtype":(hasClass(item,"associatedconstant")?"associatedconstant":("method"));const blockHeader=document.createElement("h3");const blockLink=document.createElement("a");blockLink.href="#implementations";blockLink.innerText=blockTitle;blockHeader.appendChild(blockLink);block=document.createElement("ul");block.className=`block ${blockClass}`;const insertionReference=methods||sidebarTraitList;if(insertionReference){const insertionReferenceH=insertionReference.previousElementSibling;sidebarSection.insertBefore(blockHeader,insertionReferenceH);sidebarSection.insertBefore(block,insertionReferenceH)}else{sidebarSection.appendChild(blockHeader);sidebarSection.appendChild(block)}if(hasClass(item,"associatedtype")){associatedTypes=block}else if(hasClass(item,"associatedconstant")){associatedConstants=block}else{methods=block}}const li=document.createElement("li");const a=document.createElement("a");a.innerText=item.id.split("-")[0].split(".")[1];a.href=`#${item.id}`;li.appendChild(a);block.appendChild(li)})}outputList.appendChild(template.content)}for(const list of[methods,associatedTypes,associatedConstants,sidebarTraitList]){if(!list){continue}const newChildren=Array.prototype.slice.call(list.children);newChildren.sort((a,b)=>{const aI=a.innerText;const bI=b.innerText;return aIbI?1:0});list.replaceChildren(...newChildren)}};if(window.pending_type_impls){window.register_type_impls(window.pending_type_impls)}function addSidebarCrates(){if(!window.ALL_CRATES){return}const sidebarElems=document.getElementsByClassName("sidebar-elems")[0];if(!sidebarElems){return}const h3=document.createElement("h3");h3.innerHTML="Crates";const ul=document.createElement("ul");ul.className="block crate";for(const crate of window.ALL_CRATES){const link=document.createElement("a");link.href=window.rootPath+crate+"/index.html";if(window.rootPath!=="./"&&crate===window.currentCrate){link.className="current"}link.textContent=crate;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebarElems.appendChild(h3);sidebarElems.appendChild(ul)}function expandAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);removeClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hasClass(e,"type-contents-toggle")&&!hasClass(e,"more-examples-toggle")){e.open=true}});innerToggle.title="collapse all docs";innerToggle.children[0].innerText="\u2212"}function collapseAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);addClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(e.parentNode.id!=="implementations-list"||(!hasClass(e,"implementors-toggle")&&!hasClass(e,"type-contents-toggle"))){e.open=false}});innerToggle.title="expand all docs";innerToggle.children[0].innerText="+"}function toggleAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);if(!innerToggle){return}if(hasClass(innerToggle,"will-expand")){expandAllDocs()}else{collapseAllDocs()}}(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("toggle"),e=>{if(!hideLargeItemContents&&hasClass(e,"type-contents-toggle")){e.open=true}if(hideMethodDocs&&hasClass(e,"method-toggle")){e.open=false}})}());window.rustdoc_add_line_numbers_to_examples=()=>{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");if(line_numbers.length>0){return}const count=x.textContent.split("\n").length;const elems=[];for(let i=0;i{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");for(const node of line_numbers){parent.removeChild(node)}})};if(getSettingValue("line-numbers")==="true"){window.rustdoc_add_line_numbers_to_examples()}function showSidebar(){window.hideAllModals(false);const sidebar=document.getElementsByClassName("sidebar")[0];addClass(sidebar,"shown")}function hideSidebar(){const sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"shown")}window.addEventListener("resize",()=>{if(window.CURRENT_TOOLTIP_ELEMENT){const base=window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE;const force_visible=base.TOOLTIP_FORCE_VISIBLE;hideTooltip(false);if(force_visible){showTooltip(base);base.TOOLTIP_FORCE_VISIBLE=true}}});const mainElem=document.getElementById(MAIN_ID);if(mainElem){mainElem.addEventListener("click",hideSidebar)}onEachLazy(document.querySelectorAll("a[href^='#']"),el=>{el.addEventListener("click",()=>{expandSection(el.hash.slice(1));hideSidebar()})});onEachLazy(document.querySelectorAll(".toggle > summary:not(.hideme)"),el=>{el.addEventListener("click",e=>{if(e.target.tagName!=="SUMMARY"&&e.target.tagName!=="A"){e.preventDefault()}})});function showTooltip(e){const notable_ty=e.getAttribute("data-notable-ty");if(!window.NOTABLE_TRAITS&¬able_ty){const data=document.getElementById("notable-traits-data");if(data){window.NOTABLE_TRAITS=JSON.parse(data.innerText)}else{throw new Error("showTooltip() called with notable without any notable traits!")}}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE===e){clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);return}window.hideAllModals(false);const wrapper=document.createElement("div");if(notable_ty){wrapper.innerHTML="
"+window.NOTABLE_TRAITS[notable_ty]+"
"}else{if(e.getAttribute("title")!==null){e.setAttribute("data-title",e.getAttribute("title"));e.removeAttribute("title")}if(e.getAttribute("data-title")!==null){const titleContent=document.createElement("div");titleContent.className="content";titleContent.appendChild(document.createTextNode(e.getAttribute("data-title")));wrapper.appendChild(titleContent)}}wrapper.className="tooltip popover";const focusCatcher=document.createElement("div");focusCatcher.setAttribute("tabindex","0");focusCatcher.onfocus=hideTooltip;wrapper.appendChild(focusCatcher);const pos=e.getBoundingClientRect();wrapper.style.top=(pos.top+window.scrollY+pos.height)+"px";wrapper.style.left=0;wrapper.style.right="auto";wrapper.style.visibility="hidden";const body=document.getElementsByTagName("body")[0];body.appendChild(wrapper);const wrapperPos=wrapper.getBoundingClientRect();const finalPos=pos.left+window.scrollX-wrapperPos.width+24;if(finalPos>0){wrapper.style.left=finalPos+"px"}else{wrapper.style.setProperty("--popover-arrow-offset",(wrapperPos.right-pos.right+4)+"px")}wrapper.style.visibility="";window.CURRENT_TOOLTIP_ELEMENT=wrapper;window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE=e;clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);wrapper.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}clearTooltipHoverTimeout(e)};wrapper.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&!e.contains(ev.relatedTarget)){setTooltipHoverTimeout(e,false);addClass(wrapper,"fade-out")}}}function setTooltipHoverTimeout(element,show){clearTooltipHoverTimeout(element);if(!show&&!window.CURRENT_TOOLTIP_ELEMENT){return}if(show&&window.CURRENT_TOOLTIP_ELEMENT){return}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE!==element){return}element.TOOLTIP_HOVER_TIMEOUT=setTimeout(()=>{if(show){showTooltip(element)}else if(!element.TOOLTIP_FORCE_VISIBLE){hideTooltip(false)}},show?window.RUSTDOC_TOOLTIP_HOVER_MS:window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS)}function clearTooltipHoverTimeout(element){if(element.TOOLTIP_HOVER_TIMEOUT!==undefined){removeClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out");clearTimeout(element.TOOLTIP_HOVER_TIMEOUT);delete element.TOOLTIP_HOVER_TIMEOUT}}function tooltipBlurHandler(event){if(window.CURRENT_TOOLTIP_ELEMENT&&!window.CURRENT_TOOLTIP_ELEMENT.contains(document.activeElement)&&!window.CURRENT_TOOLTIP_ELEMENT.contains(event.relatedTarget)&&!window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.contains(document.activeElement)&&!window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.contains(event.relatedTarget)){setTimeout(()=>hideTooltip(false),0)}}function hideTooltip(focus){if(window.CURRENT_TOOLTIP_ELEMENT){if(window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE){if(focus){window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.focus()}window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE=false}const body=document.getElementsByTagName("body")[0];body.removeChild(window.CURRENT_TOOLTIP_ELEMENT);clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);window.CURRENT_TOOLTIP_ELEMENT=null}}onEachLazy(document.getElementsByClassName("tooltip"),e=>{e.onclick=()=>{e.TOOLTIP_FORCE_VISIBLE=e.TOOLTIP_FORCE_VISIBLE?false:true;if(window.CURRENT_TOOLTIP_ELEMENT&&!e.TOOLTIP_FORCE_VISIBLE){hideTooltip(true)}else{showTooltip(e);window.CURRENT_TOOLTIP_ELEMENT.setAttribute("tabindex","0");window.CURRENT_TOOLTIP_ELEMENT.focus();window.CURRENT_TOOLTIP_ELEMENT.onblur=tooltipBlurHandler}return false};e.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointermove=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&window.CURRENT_TOOLTIP_ELEMENT&&!window.CURRENT_TOOLTIP_ELEMENT.contains(ev.relatedTarget)){setTooltipHoverTimeout(e,false);addClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out")}}});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")){showSidebar()}else{hideSidebar()}})}function helpBlurHandler(event){blurHandler(event,getHelpButton(),window.hidePopoverMenus)}function buildHelpMenu(){const book_info=document.createElement("span");const channel=getVar("channel");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=[`For a full list of all search features, take a look here.`,"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 or String, enum:Cow -> bool)","You can look for items with an exact name by putting double quotes around \ + your request: \"string\"","Look for functions that accept or return \ + slices and \ + arrays by writing \ + square brackets (e.g., -> [u8] or [] -> Option)","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");if(!isHelpPage){container.className="popover"}container.id="help";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);if(isHelpPage){const help_section=document.createElement("section");help_section.appendChild(container);document.getElementById("main-content").appendChild(help_section);container.style.display="block"}else{const help_button=getHelpButton();help_button.appendChild(container);container.onblur=helpBlurHandler;help_button.onblur=helpBlurHandler;help_button.children[0].onblur=helpBlurHandler}return container}window.hideAllModals=switchFocus=>{hideSidebar();window.hidePopoverMenus();hideTooltip(switchFocus)};window.hidePopoverMenus=()=>{onEachLazy(document.querySelectorAll(".search-form .popover"),elem=>{elem.style.display="none"})};function getHelpMenu(buildNeeded){let menu=getHelpButton().querySelector(".popover");if(!menu&&buildNeeded){menu=buildHelpMenu()}return menu}function showHelp(){getHelpButton().querySelector("a").focus();const menu=getHelpMenu(true);if(menu.style.display==="none"){window.hideAllModals();menu.style.display=""}}if(isHelpPage){showHelp();document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault()})}else{document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault();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;const but=document.getElementById("copy-path");if(!but){return}but.onclick=()=>{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/static.files/normalize-76eba96aa4d2e634.css b/static.files/normalize-76eba96aa4d2e634.css new file mode 100644 index 0000000..469959f --- /dev/null +++ b/static.files/normalize-76eba96aa4d2e634.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/static.files/noscript-5d8b3c7633ad77ba.css b/static.files/noscript-5d8b3c7633ad77ba.css new file mode 100644 index 0000000..8c63ef0 --- /dev/null +++ b/static.files/noscript-5d8b3c7633ad77ba.css @@ -0,0 +1 @@ + #main-content .attributes{margin-left:0 !important;}#copy-path{display:none;}nav.sub{display:none;}.src .sidebar{display:none;}.notable-traits{display:none;}:root{--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--settings-input-border-color:#717171;--settings-button-color:#000;--settings-button-border-focus:#717171;--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;--border-color:#e0e0e0;--button-background-color:#fff;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:none;--search-input-focused-border-color:#66afe9;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(35%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ad378a;--trait-link-color:#6e4fc9;--assoc-item-link-color:#3873ad;--function-link-color:#ad7c37;--macro-link-color:#068000;--keyword-link-color:#3873ad;--mod-link-color:#3873ad;--link-color:#3873ad;--sidebar-link-color:#356da4;--sidebar-current-link-background-color:#fff;--search-result-link-focus-background-color:#ccc;--search-result-border-color:#aaa3;--search-color:#000;--search-error-code-background-color:#d0cccc;--search-results-alias-color:#000;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#e6e6e6;--search-tab-button-not-selected-background:#e6e6e6;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#fff;--stab-background-color:#fff5d6;--stab-code-color:#000;--code-highlight-kw-color:#8959a8;--code-highlight-kw-2-color:#4271ae;--code-highlight-lifetime-color:#b76514;--code-highlight-prelude-color:#4271ae;--code-highlight-prelude-val-color:#c82829;--code-highlight-number-color:#718c00;--code-highlight-string-color:#718c00;--code-highlight-literal-color:#c82829;--code-highlight-attribute-color:#c82829;--code-highlight-self-color:#c82829;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8e908c;--code-highlight-doc-comment-color:#4d4d4c;--src-line-numbers-span-color:#c67e2d;--src-line-number-highlighted-background-color:#fdffd3;--test-arrow-color:#f5f5f5;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#f5f5f5;--test-arrow-hover-background-color:rgb(78,139,202);--target-background-color:#fdffd3;--target-border-color:#ad7c37;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:initial;--crate-search-div-filter:invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg) brightness(114%) contrast(76%);--crate-search-div-hover-filter:invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);--crate-search-hover-border:#717171;--src-sidebar-background-selected:#fff;--src-sidebar-background-hover:#e0e0e0;--table-alt-row-background-color:#f5f5f5;--codeblock-link-background:#eee;--scrape-example-toggle-line-background:#ccc;--scrape-example-toggle-line-hover-background:#999;--scrape-example-code-line-highlight:#fcffd6;--scrape-example-code-line-highlight-focus:#f6fdb0;--scrape-example-help-border-color:#555;--scrape-example-help-color:#333;--scrape-example-help-hover-border-color:#000;--scrape-example-help-hover-color:#000;--scrape-example-code-wrapper-background-start:rgba(255,255,255,1);--scrape-example-code-wrapper-background-end:rgba(255,255,255,0);}@media (prefers-color-scheme:dark){:root{--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--settings-input-border-color:#999;--settings-button-color:#000;--settings-button-border-focus:#ffb900;--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;--border-color:#e0e0e0;--button-background-color:#f0f0f0;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--search-input-focused-border-color:#008dfd;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(65%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#2dbfb8;--trait-link-color:#b78cf2;--assoc-item-link-color:#d2991d;--function-link-color:#2bab63;--macro-link-color:#09bd00;--keyword-link-color:#d2991d;--mod-link-color:#d2991d;--link-color:#d2991d;--sidebar-link-color:#fdbf35;--sidebar-current-link-background-color:#444;--search-result-link-focus-background-color:#616161;--search-result-border-color:#aaa3;--search-color:#111;--search-error-code-background-color:#484848;--search-results-alias-color:#fff;--search-results-grey-color:#ccc;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#252525;--search-tab-button-not-selected-background:#252525;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#353535;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ab8ac1;--code-highlight-kw-2-color:#769acb;--code-highlight-lifetime-color:#d97f26;--code-highlight-prelude-color:#769acb;--code-highlight-prelude-val-color:#ee6868;--code-highlight-number-color:#83a300;--code-highlight-string-color:#83a300;--code-highlight-literal-color:#ee6868;--code-highlight-attribute-color:#ee6868;--code-highlight-self-color:#ee6868;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8d8d8b;--code-highlight-doc-comment-color:#8ca375;--src-line-numbers-span-color:#3b91e2;--src-line-number-highlighted-background-color:#0a042f;--test-arrow-color:#dedede;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#dedede;--test-arrow-hover-background-color:#4e8bca;--target-background-color:#494a3d;--target-border-color:#bb7410;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--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);--crate-search-div-filter:invert(94%) sepia(0%) saturate(721%) hue-rotate(255deg) brightness(90%) contrast(90%);--crate-search-div-hover-filter:invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);--crate-search-hover-border:#2196f3;--src-sidebar-background-selected:#333;--src-sidebar-background-hover:#444;--table-alt-row-background-color:#2a2a2a;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(53,53,53,1);--scrape-example-code-wrapper-background-end:rgba(53,53,53,0);}} \ No newline at end of file diff --git a/static.files/rust-logo-151179464ae7ed46.svg b/static.files/rust-logo-151179464ae7ed46.svg new file mode 100644 index 0000000..62424d8 --- /dev/null +++ b/static.files/rust-logo-151179464ae7ed46.svg @@ -0,0 +1,61 @@ + + + diff --git a/static.files/rustdoc-e6a78389201e676c.css b/static.files/rustdoc-e6a78389201e676c.css new file mode 100644 index 0000000..a7efc73 --- /dev/null +++ b/static.files/rustdoc-e6a78389201e676c.css @@ -0,0 +1,10 @@ + :root{--nav-sub-mobile-padding:8px;--search-typename-width:6.75rem;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:400;src:local('Fira Sans'),url("FiraSans-Regular-018c141bf0843ffd.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-8f9a781e4970d388.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-46f98efaafac5295.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-acdfaf1a8af734b1.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-a2c9cd1067f8b328.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url("SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:italic;font-weight:400;src:url("SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:600;src:url("SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'NanumBarunGothic';src:url("NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2") format("woff2");font-display:swap;unicode-range:U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF;}*{box-sizing:border-box;}body{font:1rem/1.5 "Source Serif 4",NanumBarunGothic,serif;margin:0;position:relative;overflow-wrap:break-word;overflow-wrap:anywhere;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:25px 0 15px 0;padding-bottom:6px;}.docblock h3,.docblock h4,h5,h6{margin:15px 0 5px 0;}.docblock>h2:first-child,.docblock>h3:first-child,.docblock>h4:first-child,.docblock>h5:first-child,.docblock>h6:first-child{margin-top:0;}.main-heading h1{margin:0;padding:0;flex-grow:1;overflow-wrap:break-word;overflow-wrap:anywhere;}.main-heading{display:flex;flex-wrap:wrap;padding-bottom:6px;margin-bottom:15px;}.content h2,.top-doc .docblock>h3,.top-doc .docblock>h4{border-bottom:1px solid var(--headings-border-bottom-color);}h1,h2{line-height:1.25;padding-top:3px;padding-bottom:9px;}h3.code-header{font-size:1.125rem;}h4.code-header{font-size:1rem;}.code-header{font-weight:600;margin:0;padding:0;white-space:pre-wrap;}#crate-search,h1,h2,h3,h4,h5,h6,.sidebar,.mobile-topbar,.search-input,.search-results .result-name,.item-name>a,.out-of-band,span.since,a.src,#help-button>a,summary.hideme,.scraped-example-list,ul.all-items{font-family:"Fira Sans",Arial,NanumBarunGothic,sans-serif;}#toggle-all-docs,a.anchor,.section-header a,#src-sidebar a,.rust a,.sidebar h2 a,.sidebar h3 a,.mobile-topbar h2 a,h1 a,.search-results a,.stab,.result-name i{color:var(--main-color);}span.enum,a.enum,span.struct,a.struct,span.union,a.union,span.primitive,a.primitive,span.type,a.type,span.foreigntype,a.foreigntype{color:var(--type-link-color);}span.trait,a.trait,span.traitalias,a.traitalias{color:var(--trait-link-color);}span.associatedtype,a.associatedtype,span.constant,a.constant,span.static,a.static{color:var(--assoc-item-link-color);}span.fn,a.fn,span.method,a.method,span.tymethod,a.tymethod{color:var(--function-link-color);}span.attr,a.attr,span.derive,a.derive,span.macro,a.macro{color:var(--macro-link-color);}span.mod,a.mod{color:var(--mod-link-color);}span.keyword,a.keyword{color:var(--keyword-link-color);}a{color:var(--link-color);text-decoration:none;}ol,ul{padding-left:24px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:.625em;}p,.docblock>.warning{margin:0 0 .75em 0;}p:last-child,.docblock>.warning:last-child{margin:0;}button{padding:1px 6px;cursor:pointer;}button#toggle-all-docs{padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.rustdoc{display:flex;flex-direction:row;flex-wrap:nowrap;}main{position:relative;flex-grow:1;padding:10px 15px 40px 45px;min-width:0;}.src main{padding:15px;}.width-limiter{max-width:960px;margin-right:auto;}details:not(.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;line-height:1.5;}pre.item-decl{overflow-x:auto;}.item-decl .type-contents-toggle{contain:initial;}.src .content pre{padding:20px;}.rustdoc.src .example-wrap pre.src-line-numbers{padding:20px 0 20px 4px;}img{max-width:100%;}.sub-logo-container,.logo-container{line-height:0;display:block;}.sub-logo-container{margin-right:32px;}.sub-logo-container>img{height:60px;width:60px;object-fit:contain;}.rust-logo{filter:var(--rust-logo-filter);}.sidebar{font-size:0.875rem;flex:0 0 200px;overflow-y:scroll;overscroll-behavior:contain;position:sticky;height:100vh;top:0;left:0;}.rustdoc.src .sidebar{flex-basis:50px;border-right:1px solid;overflow-x:hidden;overflow-y:hidden;z-index:1;}.sidebar,.mobile-topbar,.sidebar-menu-toggle,#src-sidebar-toggle,#src-sidebar{background-color:var(--sidebar-background-color);}#src-sidebar-toggle>button:hover,#src-sidebar-toggle>button:focus{background-color:var(--sidebar-background-color-hover);}.src .sidebar>*:not(#src-sidebar-toggle){visibility:hidden;}.src-sidebar-expanded .src .sidebar{overflow-y:auto;flex-basis:300px;}.src-sidebar-expanded .src .sidebar>*:not(#src-sidebar-toggle){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;}.logo-container>img{height:48px;width:48px;}ul.block,.block li{padding:0;margin:0;list-style:none;}.sidebar-elems a,.sidebar>h2 a{display:block;padding:0.25rem;margin-left:-0.25rem;}.sidebar h2{overflow-wrap:anywhere;padding:0;margin:0.7rem 0;}.sidebar h3{font-size:1.125rem;padding:0;margin:0;}.sidebar-elems,.sidebar>.version,.sidebar>h2{padding-left:24px;}.sidebar a{color:var(--sidebar-link-color);}.sidebar .current,.sidebar .current a,.sidebar-crate a.logo-container:hover+h2 a,.sidebar a:hover:not(.logo-container){background-color:var(--sidebar-current-link-background-color);}.sidebar-elems .block{margin-bottom:2em;}.sidebar-elems .block li a{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}.sidebar-crate{display:flex;align-items:center;justify-content:center;margin:14px 32px 1rem;row-gap:10px;column-gap:32px;flex-wrap:wrap;}.sidebar-crate h2{flex-grow:1;margin:0 -8px;align-self:start;}.sidebar-crate .logo-container{margin:0 -16px 0 -16px;text-align:center;}.sidebar-crate h2 a{display:block;margin:0 calc(-24px + 0.25rem) 0 -0.5rem;padding:calc((16px - 0.57rem ) / 2 ) 0.25rem;padding-left:0.5rem;}.sidebar-crate h2 .version{display:block;font-weight:normal;font-size:1rem;overflow-wrap:break-word;margin-top:calc((-16px + 0.57rem ) / 2 );}.sidebar-crate+.version{margin-top:-1rem;margin-bottom:1rem;}.mobile-topbar{display:none;}.rustdoc .example-wrap{display:flex;position:relative;margin-bottom:10px;}.rustdoc .example-wrap:last-child{margin-bottom:0px;}.rustdoc .example-wrap pre{margin:0;flex-grow:1;}.rustdoc:not(.src) .example-wrap pre{overflow:auto hidden;}.rustdoc .example-wrap pre.example-line-numbers,.rustdoc .example-wrap pre.src-line-numbers{flex-grow:0;min-width:fit-content;overflow:initial;text-align:right;-webkit-user-select:none;user-select:none;padding:14px 8px;color:var(--src-line-numbers-span-color);}.rustdoc .example-wrap pre.src-line-numbers{padding:14px 0;}.src-line-numbers a,.src-line-numbers span{color:var(--src-line-numbers-span-color);padding:0 8px;}.src-line-numbers :target{background-color:transparent;border-right:none;padding:0 8px;}.src-line-numbers .line-highlighted{background-color:var(--src-line-number-highlighted-background-color);}.search-loading{text-align:center;}.docblock-short{overflow-wrap:break-word;overflow-wrap:anywhere;}.docblock :not(pre)>code,.docblock-short 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{margin-left:24px;position:relative;}.docblock>:not(.more-examples-toggle):not(.example-wrap){max-width:100%;overflow-x:auto;}.out-of-band{flex-grow:0;font-size:1.125rem;}.docblock code,.docblock-short code,pre,.rustdoc.src .example-wrap{background-color:var(--code-block-background-color);}#main-content{position:relative;}.docblock table{margin:.5em 0;border-collapse:collapse;}.docblock table td,.docblock table th{padding:.5em;border:1px solid var(--border-color);}.docblock table tbody tr:nth-child(2n){background:var(--table-alt-row-background-color);}.method .where,.fn .where,.where.fmt-newline{display:block;white-space:pre-wrap;font-size:0.875rem;}.item-info{display:block;margin-left:24px;}.item-info code{font-size:0.875rem;}#main-content>.item-info{margin-left:0;}nav.sub{flex-grow:1;flex-flow:row nowrap;margin:4px 0 25px 0;display:flex;align-items:center;}.search-form{position:relative;display:flex;height:34px;flex-grow:1;}.src nav.sub{margin:0 0 15px 0;}.section-header{display:block;position:relative;}.section-header:hover>.anchor,.impl:hover>.anchor,.trait-impl:hover>.anchor,.variant:hover>.anchor{display:initial;}.anchor{display:none;position:absolute;left:-0.5em;background:none !important;}.anchor.field{left:-5px;}.section-header>.anchor{left:-15px;padding-right:8px;}h2.section-header>.anchor{padding-right:6px;}.main-heading a:hover,.example-wrap .rust a:hover,.all-items a:hover,.docblock a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,.docblock-short a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,.item-info a{text-decoration:underline;}.crate.block a.current{font-weight:500;}table,.item-table{overflow-wrap:break-word;}.item-table{display:table;padding:0;margin:0;}.item-table>li{display:table-row;}.item-table>li>div{display:table-cell;}.item-table>li>.item-name{padding-right:1.25rem;}.search-results-title{margin-top:0;white-space:nowrap;display:flex;align-items:baseline;}#crate-search-div{position:relative;min-width:5em;}#crate-search{min-width:115px;padding:0 23px 0 4px;max-width:100%;text-overflow:ellipsis;border:1px solid var(--border-color);border-radius:4px;outline:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;text-indent:0.01px;background-color:var(--main-background-color);color:inherit;line-height:1.5;font-weight:500;}#crate-search:hover,#crate-search:focus{border-color:var(--crate-search-hover-border);}#crate-search-div::after{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0;content:"";background-repeat:no-repeat;background-size:20px;background-position:calc(100% - 2px) 56%;background-image:url('data:image/svg+xml, \ + ');filter:var(--crate-search-div-filter);}#crate-search-div:hover::after,#crate-search-div:focus-within::after{filter:var(--crate-search-div-hover-filter);}#crate-search>option{font-size:1rem;}.search-input{-webkit-appearance:none;outline:none;border:1px solid var(--border-color);border-radius:2px;padding:8px;font-size:1rem;flex-grow:1;background-color:var(--button-background-color);color:var(--search-color);}.search-input:focus{border-color:var(--search-input-focused-border-color);}.search-results{display:none;}.search-results.active{display:block;}.search-results>a{display:flex;margin-left:2px;margin-right:2px;border-bottom:1px solid var(--search-result-border-color);gap:1em;}.search-results>a>div.desc{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex:2;}.search-results a:hover,.search-results a:focus{background-color:var(--search-result-link-focus-background-color);}.search-results .result-name{display:flex;align-items:center;justify-content:start;flex:3;}.search-results .result-name .alias{color:var(--search-results-alias-color);}.search-results .result-name .grey{color:var(--search-results-grey-color);}.search-results .result-name .typename{color:var(--search-results-grey-color);font-size:0.875rem;width:var(--search-typename-width);}.search-results .result-name .path{word-break:break-all;max-width:calc(100% - var(--search-typename-width));display:inline-block;}.search-results .result-name .path>*{display:inline;}.popover{position:absolute;top:100%;right:0;z-index:2;margin-top:7px;border-radius:3px;border:1px solid var(--border-color);background-color:var(--main-background-color);color:var(--main-color);--popover-arrow-offset:11px;}.popover::before{content:'';position:absolute;right:var(--popover-arrow-offset);border:solid var(--border-color);border-width:1px 1px 0 0;background-color:var(--main-background-color);padding:4px;transform:rotate(-45deg);top:-5px;}.setting-line{margin:1.2em 0.6em;}.setting-radio input,.setting-check input{margin-right:0.3em;height:1.2rem;width:1.2rem;border:2px solid var(--settings-input-border-color);outline:none;-webkit-appearance:none;cursor:pointer;}.setting-radio input{border-radius:50%;}.setting-radio span,.setting-check span{padding-bottom:1px;}.setting-radio{margin-top:0.1em;margin-bottom:0.1em;min-width:3.8em;padding:0.3em;display:inline-flex;align-items:center;cursor:pointer;}.setting-radio+.setting-radio{margin-left:0.5em;}.setting-check{margin-right:20px;display:flex;align-items:center;cursor:pointer;}.setting-radio input:checked{box-shadow:inset 0 0 0 3px var(--main-background-color);background-color:var(--settings-input-color);}.setting-check input:checked{background-color:var(--settings-input-color);border-width:1px;content:url('data:image/svg+xml,\ + \ + ');}.setting-radio input:focus,.setting-check input:focus{box-shadow:0 0 1px 1px var(--settings-input-color);}.setting-radio input:checked:focus{box-shadow:inset 0 0 0 3px var(--main-background-color),0 0 2px 2px var(--settings-input-color);}.setting-radio input:hover,.setting-check input:hover{border-color:var(--settings-input-color) !important;}#help.popover{max-width:600px;--popover-arrow-offset:48px;}#help dt{float:left;clear:left;margin-right:0.5rem;}#help span.top,#help span.bottom{text-align:center;display:block;font-size:1.125rem;}#help span.top{margin:10px 0;border-bottom:1px solid var(--border-color);padding-bottom:4px;margin-bottom:6px;}#help span.bottom{clear:both;border-top:1px solid var(--border-color);}.side-by-side>div{width:50%;float:left;padding:0 20px 20px 17px;}.item-info .stab{min-height:36px;display:flex;padding:3px;margin-bottom:5px;align-items:center;vertical-align:text-bottom;}.item-name .stab{margin-left:0.3125em;}.stab{padding:0 2px;font-size:0.875rem;font-weight:normal;color:var(--main-color);background-color:var(--stab-background-color);width:fit-content;white-space:pre-wrap;border-radius:3px;display:inline;vertical-align:baseline;}.stab.portability>code{background:none;color:var(--stab-code-color);}.stab .emoji{font-size:1.25rem;margin-right:0.3rem;}.emoji{text-shadow:1px 0 0 black,-1px 0 0 black,0 1px 0 black,0 -1px 0 black;}.since{font-weight:normal;font-size:initial;}.rightside{padding-left:12px;float:right;}.rightside:not(a),.out-of-band{color:var(--right-side-color);}pre.rust{tab-size:4;-moz-tab-size:4;}pre.rust .kw{color:var(--code-highlight-kw-color);}pre.rust .kw-2{color:var(--code-highlight-kw-2-color);}pre.rust .lifetime{color:var(--code-highlight-lifetime-color);}pre.rust .prelude-ty{color:var(--code-highlight-prelude-color);}pre.rust .prelude-val{color:var(--code-highlight-prelude-val-color);}pre.rust .string{color:var(--code-highlight-string-color);}pre.rust .number{color:var(--code-highlight-number-color);}pre.rust .bool-val{color:var(--code-highlight-literal-color);}pre.rust .self{color:var(--code-highlight-self-color);}pre.rust .attr{color:var(--code-highlight-attribute-color);}pre.rust .macro,pre.rust .macro-nonterminal{color:var(--code-highlight-macro-color);}pre.rust .question-mark{font-weight:bold;color:var(--code-highlight-question-mark-color);}pre.rust .comment{color:var(--code-highlight-comment-color);}pre.rust .doccomment{color:var(--code-highlight-doc-comment-color);}.rustdoc.src .example-wrap pre.rust a{background:var(--codeblock-link-background);}.example-wrap.compile_fail,.example-wrap.should_panic{border-left:2px solid var(--codeblock-error-color);}.ignore.example-wrap{border-left:2px solid var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover,.example-wrap.should_panic:hover{border-left:2px solid var(--codeblock-error-hover-color);}.example-wrap.ignore:hover{border-left:2px solid var(--codeblock-ignore-hover-color);}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip{color:var(--codeblock-error-color);}.example-wrap.ignore .tooltip{color:var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover .tooltip,.example-wrap.should_panic:hover .tooltip{color:var(--codeblock-error-hover-color);}.example-wrap.ignore:hover .tooltip{color:var(--codeblock-ignore-hover-color);}.example-wrap .tooltip{position:absolute;display:block;left:-25px;top:5px;margin:0;line-height:1;}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip,.example-wrap.ignore .tooltip{font-weight:bold;font-size:1.25rem;}.content .docblock .warning{border-left:2px solid var(--warning-border-color);padding:14px;position:relative;overflow-x:visible !important;}.content .docblock .warning::before{color:var(--warning-border-color);content:"ⓘ";position:absolute;left:-25px;top:5px;font-weight:bold;font-size:1.25rem;}a.test-arrow{visibility:hidden;position:absolute;padding:5px 10px 5px 10px;border-radius:5px;font-size:1.375rem;top:5px;right:5px;z-index:1;color:var(--test-arrow-color);background-color:var(--test-arrow-background-color);}a.test-arrow:hover{color:var(--test-arrow-hover-color);background-color:var(--test-arrow-hover-background-color);}.example-wrap:hover .test-arrow{visibility:visible;}.code-attribute{font-weight:300;color:var(--code-attribute-color);}.item-spacer{width:100%;height:12px;display:block;}.out-of-band>span.since{font-size:1.25rem;}.sub-variant h4{font-size:1rem;font-weight:400;margin-top:0;margin-bottom:0;}.sub-variant{margin-left:24px;margin-bottom:40px;}.sub-variant>.sub-variant-field{margin-left:24px;}:target{padding-right:3px;background-color:var(--target-background-color);border-right:3px solid var(--target-border-color);}.code-header a.tooltip{color:inherit;margin-right:15px;position:relative;}.code-header a.tooltip:hover{color:var(--link-color);}a.tooltip:hover::after{position:absolute;top:calc(100% - 10px);left:-15px;right:-15px;height:20px;content:"\00a0";}.fade-out{opacity:0;transition:opacity 0.45s cubic-bezier(0,0,0.1,1.0);}.popover.tooltip .content{margin:0.25em 0.5em;}.popover.tooltip .content pre,.popover.tooltip .content code{background:transparent;margin:0;padding:0;font-size:1.25rem;white-space:pre-wrap;}.popover.tooltip .content>h3:first-child{margin:0 0 5px 0;}.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;}#search-tabs{display:flex;flex-direction:row;gap:1px;margin-bottom:4px;}#search-tabs button{text-align:center;font-size:1.125rem;border:0;border-top:2px solid;flex:1;line-height:1.5;color:inherit;}#search-tabs button:not(.selected){background-color:var(--search-tab-button-not-selected-background);border-top-color:var(--search-tab-button-not-selected-border-top-color);}#search-tabs button:hover,#search-tabs button.selected{background-color:var(--search-tab-button-selected-background);border-top-color:var(--search-tab-button-selected-border-top-color);}#search-tabs .count{font-size:1rem;font-variant-numeric:tabular-nums;color:var(--search-tab-title-count-color);}#search .error code{border-radius:3px;background-color:var(--search-error-code-background-color);}.search-corrections{font-weight:normal;}#src-sidebar-toggle{position:sticky;top:0;left:0;font-size:1.25rem;border-bottom:1px solid;display:flex;height:40px;justify-content:stretch;align-items:stretch;z-index:10;}#src-sidebar{width:100%;overflow:auto;}#src-sidebar>.title{font-size:1.5rem;text-align:center;border-bottom:1px solid var(--border-color);margin-bottom:6px;}#src-sidebar div.files>a:hover,details.dir-entry summary:hover,#src-sidebar div.files>a:focus,details.dir-entry summary:focus{background-color:var(--src-sidebar-background-hover);}#src-sidebar div.files>a.selected{background-color:var(--src-sidebar-background-selected);}#src-sidebar-toggle>button{font-size:inherit;font-weight:bold;background:none;color:inherit;text-align:center;border:none;outline:none;flex:1 1;-webkit-appearance:none;opacity:1;}#settings-menu,#help-button{margin-left:4px;display:flex;}#settings-menu>a,#help-button>a{display:flex;align-items:center;justify-content:center;background-color:var(--button-background-color);border:1px solid var(--border-color);border-radius:2px;color:var(--settings-button-color);font-size:20px;width:33px;}#settings-menu>a:hover,#settings-menu>a:focus,#help-button>a:hover,#help-button>a:focus{border-color:var(--settings-button-border-focus);}#copy-path{color:var(--copy-path-button-color);background:var(--main-background-color);height:34px;margin-left:10px;padding:0;padding-left:2px;border:0;width:33px;}#copy-path>img{filter:var(--copy-path-img-filter);}#copy-path:hover>img{filter:var(--copy-path-img-hover-filter);}@keyframes rotating{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}#settings-menu.rotate>a img{animation:rotating 2s linear infinite;}kbd{display:inline-block;padding:3px 5px;font:15px monospace;line-height:10px;vertical-align:middle;border:solid 1px var(--border-color);border-radius:3px;color:var(--kbd-color);background-color:var(--kbd-background);box-shadow:inset 0 -1px 0 var(--kbd-box-shadow-color);}ul.all-items>li{list-style:none;}details.dir-entry{padding-left:4px;}details.dir-entry>summary{margin:0 0 0 -4px;padding:0 0 0 4px;cursor:pointer;}details.dir-entry div.folders,details.dir-entry div.files{padding-left:23px;}details.dir-entry a{display:block;}details.toggle{contain:layout;position:relative;}details.toggle>summary.hideme{cursor:pointer;font-size:1rem;}details.toggle>summary{list-style:none;outline:none;}details.toggle>summary::-webkit-details-marker,details.toggle>summary::marker{display:none;}details.toggle>summary.hideme>span{margin-left:9px;}details.toggle>summary::before{background:url('data:image/svg+xml,') no-repeat top left;content:"";cursor:pointer;width:16px;height:16px;display:inline-block;vertical-align:middle;opacity:.5;filter:var(--toggle-filter);}details.toggle>summary.hideme>span,.more-examples-toggle summary,.more-examples-toggle .hide-more{color:var(--toggles-color);}details.toggle>summary::after{content:"Expand";overflow:hidden;width:0;height:0;position:absolute;}details.toggle>summary.hideme::after{content:"";}details.toggle>summary:focus::before,details.toggle>summary:hover::before{opacity:1;}details.toggle>summary:focus-visible::before{outline:1px dotted #000;outline-offset:1px;}details.non-exhaustive{margin-bottom:8px;}details.toggle>summary.hideme::before{position:relative;}details.toggle>summary:not(.hideme)::before{position:absolute;left:-24px;top:4px;}.impl-items>details.toggle>summary:not(.hideme)::before{position:absolute;left:-24px;}details.toggle[open] >summary.hideme{position:absolute;}details.toggle[open] >summary.hideme>span{display:none;}details.toggle[open] >summary::before{background:url('data:image/svg+xml,') no-repeat top left;}details.toggle[open] >summary::after{content:"Collapse";}.docblock summary>*{display:inline-block;}.docblock>.example-wrap:first-child .tooltip{margin-top:16px;}@media (max-width:850px){#search-tabs .count{display:block;}}@media (max-width:700px){*[id]{scroll-margin-top:45px;}.rustdoc{display:block;}main{padding-left:15px;padding-top:0px;}.main-heading{flex-direction:column;}.out-of-band{text-align:left;margin-left:initial;padding:initial;}.out-of-band .since::before{content:"Since ";}.sidebar .logo-container,.sidebar .location{display:none;}.sidebar{position:fixed;top:45px;left:-1000px;z-index:11;height:calc(100vh - 45px);width:200px;}.src main,.rustdoc.src .sidebar{top:0;padding:0;height:100vh;border:0;}.sidebar.shown,.src-sidebar-expanded .src .sidebar,.rustdoc:not(.src) .sidebar:focus-within{left:0;}.mobile-topbar h2{padding-bottom:0;margin:auto 0.5em auto auto;overflow:hidden;font-size:24px;}.mobile-topbar h2 a{display:block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;}.mobile-topbar .logo-container>img{max-width:35px;max-height:35px;margin:5px 0 5px 20px;}.mobile-topbar{display:flex;flex-direction:row;position:sticky;z-index:10;font-size:2rem;height:45px;width:100%;left:0;top:0;}.sidebar-menu-toggle{width:45px;font-size:32px;border:none;color:var(--main-color);}.sidebar-elems{margin-top:1em;}.anchor{display:none !important;}#main-content>details.toggle>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}#src-sidebar-toggle{position:fixed;left:1px;top:100px;width:30px;font-size:1.5rem;padding:0;z-index:10;border-top-right-radius:3px;border-bottom-right-radius:3px;border:1px solid;border-left:0;}.src-sidebar-expanded #src-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;}#copy-path,#help-button{display:none;}.item-table,.item-row,.item-table>li,.item-table>li>div,.search-results>a,.search-results>a>div{display:block;}.search-results>a{padding:5px 0px;}.search-results>a>div.desc,.item-table>li>div.desc{padding-left:2em;}.search-results .result-name{display:block;}.search-results .result-name .typename{width:initial;margin-right:0;}.search-results .result-name .typename,.search-results .result-name .path{display:inline;}.src-sidebar-expanded .src .sidebar{max-width:100vw;width:100vw;}details.toggle:not(.top-doc)>summary{margin-left:10px;}.impl-items>details.toggle>summary:not(.hideme)::before,#main-content>details.toggle:not(.top-doc)>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}.impl-items>.item-info{margin-left:34px;}.src nav.sub{margin:0;padding:var(--nav-sub-mobile-padding);}}@media (min-width:701px){.scraped-example-title{position:absolute;z-index:10;background:var(--main-background-color);bottom:8px;right:5px;padding:2px 4px;box-shadow:0 0 4px var(--main-background-color);}}@media print{nav.sidebar,nav.sub,.out-of-band,a.src,#copy-path,details.toggle[open] >summary::before,details.toggle>summary::before,details.toggle.top-doc>summary{display:none;}.docblock{margin-left:0;}main{padding:10px;}}@media (max-width:464px){.docblock{margin-left:12px;}.docblock code{overflow-wrap:break-word;overflow-wrap:anywhere;}nav.sub{flex-direction:column;}.search-form{align-self:stretch;}.sub-logo-container>img{height:35px;width:35px;margin-bottom:var(--nav-sub-mobile-padding);}}.variant,.implementors-toggle>summary,.impl,#implementors-list>.docblock,.impl-items>section,.impl-items>.toggle>summary,.methods>section,.methods>.toggle>summary{margin-bottom:0.75em;}.variants>.docblock,.implementors-toggle>.docblock,.impl-items>.toggle[open]:not(:last-child),.methods>.toggle[open]:not(:last-child),.implementors-toggle[open]:not(:last-child){margin-bottom:2em;}#trait-implementations-list .impl-items>.toggle:not(:last-child),#synthetic-implementations-list .impl-items>.toggle:not(:last-child),#blanket-implementations-list .impl-items>.toggle:not(:last-child){margin-bottom:1em;}.scraped-example-list .scrape-help{margin-left:10px;padding:0 4px;font-weight:normal;font-size:12px;position:relative;bottom:1px;border:1px solid var(--scrape-example-help-border-color);border-radius:50px;color:var(--scrape-example-help-color);}.scraped-example-list .scrape-help:hover{border-color:var(--scrape-example-help-hover-border-color);color:var(--scrape-example-help-hover-color);}.scraped-example{position:relative;}.scraped-example .code-wrapper{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;}.scraped-example:not(.expanded) .code-wrapper{max-height:calc(1.5em * 5 + 10px);}.scraped-example:not(.expanded) .code-wrapper pre{overflow-y:hidden;padding-bottom:0;max-height:calc(1.5em * 5 + 10px);}.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper,.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper pre{max-height:calc(1.5em * 10 + 10px);}.scraped-example .code-wrapper .next,.scraped-example .code-wrapper .prev,.scraped-example .code-wrapper .expand{color:var(--main-color);position:absolute;top:0.25em;z-index:1;padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.scraped-example .code-wrapper .prev{right:2.25em;}.scraped-example .code-wrapper .next{right:1.25em;}.scraped-example .code-wrapper .expand{right:0.25em;}.scraped-example:not(.expanded) .code-wrapper::before,.scraped-example:not(.expanded) .code-wrapper::after{content:" ";width:100%;height:5px;position:absolute;z-index:1;}.scraped-example:not(.expanded) .code-wrapper::before{top:0;background:linear-gradient(to bottom,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example:not(.expanded) .code-wrapper::after{bottom:0;background:linear-gradient(to top,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example .code-wrapper .example-wrap{width:100%;overflow-y:hidden;margin-bottom:0;}.scraped-example:not(.expanded) .code-wrapper .example-wrap{overflow-x:hidden;}.scraped-example .example-wrap .rust span.highlight{background:var(--scrape-example-code-line-highlight);}.scraped-example .example-wrap .rust span.highlight.focus{background:var(--scrape-example-code-line-highlight-focus);}.more-examples-toggle{max-width:calc(100% + 25px);margin-top:10px;margin-left:-25px;}.more-examples-toggle .hide-more{margin-left:25px;cursor:pointer;}.more-scraped-examples{margin-left:25px;position:relative;}.toggle-line{position:absolute;top:5px;bottom:0;right:calc(100% + 10px);padding:0 4px;cursor:pointer;}.toggle-line-inner{min-width:2px;height:100%;background:var(--scrape-example-toggle-line-background);}.toggle-line:hover .toggle-line-inner{background:var(--scrape-example-toggle-line-hover-background);}.more-scraped-examples .scraped-example,.example-links{margin-top:20px;}.more-scraped-examples .scraped-example:first-child{margin-top:5px;}.example-links ul{margin-bottom:0;}:root[data-theme="light"]{--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--settings-input-border-color:#717171;--settings-button-color:#000;--settings-button-border-focus:#717171;--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;--border-color:#e0e0e0;--button-background-color:#fff;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:none;--search-input-focused-border-color:#66afe9;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(35%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ad378a;--trait-link-color:#6e4fc9;--assoc-item-link-color:#3873ad;--function-link-color:#ad7c37;--macro-link-color:#068000;--keyword-link-color:#3873ad;--mod-link-color:#3873ad;--link-color:#3873ad;--sidebar-link-color:#356da4;--sidebar-current-link-background-color:#fff;--search-result-link-focus-background-color:#ccc;--search-result-border-color:#aaa3;--search-color:#000;--search-error-code-background-color:#d0cccc;--search-results-alias-color:#000;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#e6e6e6;--search-tab-button-not-selected-background:#e6e6e6;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#fff;--stab-background-color:#fff5d6;--stab-code-color:#000;--code-highlight-kw-color:#8959a8;--code-highlight-kw-2-color:#4271ae;--code-highlight-lifetime-color:#b76514;--code-highlight-prelude-color:#4271ae;--code-highlight-prelude-val-color:#c82829;--code-highlight-number-color:#718c00;--code-highlight-string-color:#718c00;--code-highlight-literal-color:#c82829;--code-highlight-attribute-color:#c82829;--code-highlight-self-color:#c82829;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8e908c;--code-highlight-doc-comment-color:#4d4d4c;--src-line-numbers-span-color:#c67e2d;--src-line-number-highlighted-background-color:#fdffd3;--test-arrow-color:#f5f5f5;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#f5f5f5;--test-arrow-hover-background-color:rgb(78,139,202);--target-background-color:#fdffd3;--target-border-color:#ad7c37;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:initial;--crate-search-div-filter:invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg) brightness(114%) contrast(76%);--crate-search-div-hover-filter:invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);--crate-search-hover-border:#717171;--src-sidebar-background-selected:#fff;--src-sidebar-background-hover:#e0e0e0;--table-alt-row-background-color:#f5f5f5;--codeblock-link-background:#eee;--scrape-example-toggle-line-background:#ccc;--scrape-example-toggle-line-hover-background:#999;--scrape-example-code-line-highlight:#fcffd6;--scrape-example-code-line-highlight-focus:#f6fdb0;--scrape-example-help-border-color:#555;--scrape-example-help-color:#333;--scrape-example-help-hover-border-color:#000;--scrape-example-help-hover-color:#000;--scrape-example-code-wrapper-background-start:rgba(255,255,255,1);--scrape-example-code-wrapper-background-end:rgba(255,255,255,0);}:root[data-theme="dark"]{--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--settings-input-border-color:#999;--settings-button-color:#000;--settings-button-border-focus:#ffb900;--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;--border-color:#e0e0e0;--button-background-color:#f0f0f0;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--search-input-focused-border-color:#008dfd;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(65%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#2dbfb8;--trait-link-color:#b78cf2;--assoc-item-link-color:#d2991d;--function-link-color:#2bab63;--macro-link-color:#09bd00;--keyword-link-color:#d2991d;--mod-link-color:#d2991d;--link-color:#d2991d;--sidebar-link-color:#fdbf35;--sidebar-current-link-background-color:#444;--search-result-link-focus-background-color:#616161;--search-result-border-color:#aaa3;--search-color:#111;--search-error-code-background-color:#484848;--search-results-alias-color:#fff;--search-results-grey-color:#ccc;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#252525;--search-tab-button-not-selected-background:#252525;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#353535;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ab8ac1;--code-highlight-kw-2-color:#769acb;--code-highlight-lifetime-color:#d97f26;--code-highlight-prelude-color:#769acb;--code-highlight-prelude-val-color:#ee6868;--code-highlight-number-color:#83a300;--code-highlight-string-color:#83a300;--code-highlight-literal-color:#ee6868;--code-highlight-attribute-color:#ee6868;--code-highlight-self-color:#ee6868;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8d8d8b;--code-highlight-doc-comment-color:#8ca375;--src-line-numbers-span-color:#3b91e2;--src-line-number-highlighted-background-color:#0a042f;--test-arrow-color:#dedede;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#dedede;--test-arrow-hover-background-color:#4e8bca;--target-background-color:#494a3d;--target-border-color:#bb7410;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--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);--crate-search-div-filter:invert(94%) sepia(0%) saturate(721%) hue-rotate(255deg) brightness(90%) contrast(90%);--crate-search-div-hover-filter:invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);--crate-search-hover-border:#2196f3;--src-sidebar-background-selected:#333;--src-sidebar-background-hover:#444;--table-alt-row-background-color:#2a2a2a;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(53,53,53,1);--scrape-example-code-wrapper-background-end:rgba(53,53,53,0);}:root[data-theme="ayu"]{--main-background-color:#0f1419;--main-color:#c5c5c5;--settings-input-color:#ffb454;--settings-input-border-color:#999;--settings-button-color:#fff;--settings-button-border-focus:#e0e0e0;--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;--border-color:#5c6773;--button-background-color:#141920;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--search-input-focused-border-color:#5c6773;--copy-path-button-color:#fff;--copy-path-img-filter:invert(70%);--copy-path-img-hover-filter:invert(100%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ffa0a5;--trait-link-color:#39afd7;--assoc-item-link-color:#39afd7;--function-link-color:#fdd687;--macro-link-color:#a37acc;--keyword-link-color:#39afd7;--mod-link-color:#39afd7;--link-color:#39afd7;--sidebar-link-color:#53b1db;--sidebar-current-link-background-color:transparent;--search-result-link-focus-background-color:#3c3c3c;--search-result-border-color:#aaa3;--search-color:#fff;--search-error-code-background-color:#4f4c4c;--search-results-alias-color:#c5c5c5;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:none;--search-tab-button-not-selected-background:transparent !important;--search-tab-button-selected-border-top-color:none;--search-tab-button-selected-background:#141920 !important;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ff7733;--code-highlight-kw-2-color:#ff7733;--code-highlight-lifetime-color:#ff7733;--code-highlight-prelude-color:#69f2df;--code-highlight-prelude-val-color:#ff7733;--code-highlight-number-color:#b8cc52;--code-highlight-string-color:#b8cc52;--code-highlight-literal-color:#ff7733;--code-highlight-attribute-color:#e6e1cf;--code-highlight-self-color:#36a3d9;--code-highlight-macro-color:#a37acc;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#788797;--code-highlight-doc-comment-color:#a1ac88;--src-line-numbers-span-color:#5c6773;--src-line-number-highlighted-background-color:rgba(255,236,164,0.06);--test-arrow-color:#788797;--test-arrow-background-color:rgba(57,175,215,0.09);--test-arrow-hover-color:#c5c5c5;--test-arrow-hover-background-color:rgba(57,175,215,0.368);--target-background-color:rgba(255,236,164,0.06);--target-border-color:rgba(255,180,76,0.85);--kbd-color:#c5c5c5;--kbd-background:#314559;--kbd-box-shadow-color:#5c6773;--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);--crate-search-div-filter:invert(41%) sepia(12%) saturate(487%) hue-rotate(171deg) brightness(94%) contrast(94%);--crate-search-div-hover-filter:invert(98%) sepia(12%) saturate(81%) hue-rotate(343deg) brightness(113%) contrast(76%);--crate-search-hover-border:#e0e0e0;--src-sidebar-background-selected:#14191f;--src-sidebar-background-hover:#14191f;--table-alt-row-background-color:#191f26;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(15,20,25,1);--scrape-example-code-wrapper-background-end:rgba(15,20,25,0);}:root[data-theme="ayu"] h1,:root[data-theme="ayu"] h2,:root[data-theme="ayu"] h3,:root[data-theme="ayu"] h4,:where(:root[data-theme="ayu"]) h1 a,:root[data-theme="ayu"] .sidebar h2 a,:root[data-theme="ayu"] .sidebar h3 a,:root[data-theme="ayu"] #source-sidebar>.title{color:#fff;}:root[data-theme="ayu"] .docblock code{color:#ffb454;}:root[data-theme="ayu"] .docblock a>code{color:#39AFD7 !important;}:root[data-theme="ayu"] .code-header,:root[data-theme="ayu"] .docblock pre>code,:root[data-theme="ayu"] pre,:root[data-theme="ayu"] pre>code,:root[data-theme="ayu"] .item-info code,:root[data-theme="ayu"] .rustdoc.source .example-wrap{color:#e6e1cf;}:root[data-theme="ayu"] .sidebar .current,:root[data-theme="ayu"] .sidebar a:hover,:root[data-theme="ayu"] #src-sidebar div.files>a:hover,:root[data-theme="ayu"] details.dir-entry summary:hover,:root[data-theme="ayu"] #src-sidebar div.files>a:focus,:root[data-theme="ayu"] details.dir-entry summary:focus,:root[data-theme="ayu"] #src-sidebar div.files>a.selected{color:#ffb44c;}:root[data-theme="ayu"] .sidebar-elems .location{color:#ff7733;}:root[data-theme="ayu"] .src-line-numbers .line-highlighted{color:#708090;padding-right:7px;border-right:1px solid #ffb44c;}:root[data-theme="ayu"] .search-results a:hover,:root[data-theme="ayu"] .search-results a:focus{color:#fff !important;background-color:#3c3c3c;}:root[data-theme="ayu"] .search-results a{color:#0096cf;}:root[data-theme="ayu"] .search-results a div.desc{color:#c5c5c5;}:root[data-theme="ayu"] .result-name .primitive>i,:root[data-theme="ayu"] .result-name .keyword>i{color:#788797;}:root[data-theme="ayu"] #search-tabs>button.selected{border-bottom:1px solid #ffb44c !important;border-top:none;}:root[data-theme="ayu"] #search-tabs>button:not(.selected){border:none;background-color:transparent !important;}:root[data-theme="ayu"] #search-tabs>button:hover{border-bottom:1px solid rgba(242,151,24,0.3);}:root[data-theme="ayu"] #settings-menu>a img{filter:invert(100);} \ No newline at end of file diff --git a/static.files/scrape-examples-ef1e698c1d417c0c.js b/static.files/scrape-examples-ef1e698c1d417c0c.js new file mode 100644 index 0000000..ba830e3 --- /dev/null +++ b/static.files/scrape-examples-ef1e698c1d417c0c.js @@ -0,0 +1 @@ +"use strict";(function(){const DEFAULT_MAX_LINES=5;const HIDDEN_MAX_LINES=10;function scrollToLoc(elt,loc,isHidden){const lines=elt.querySelector(".src-line-numbers");let scrollOffset;const maxLines=isHidden?HIDDEN_MAX_LINES:DEFAULT_MAX_LINES;if(loc[1]-loc[0]>maxLines){const line=Math.max(0,loc[0]-1);scrollOffset=lines.children[line].offsetTop}else{const wrapper=elt.querySelector(".code-wrapper");const halfHeight=wrapper.offsetHeight/2;const offsetTop=lines.children[loc[0]].offsetTop;const lastLine=lines.children[loc[1]];const offsetBot=lastLine.offsetTop+lastLine.offsetHeight;const offsetMid=(offsetTop+offsetBot)/2;scrollOffset=offsetMid-halfHeight}lines.scrollTo(0,scrollOffset);elt.querySelector(".rust").scrollTo(0,scrollOffset)}function updateScrapedExample(example,isHidden){const locs=JSON.parse(example.attributes.getNamedItem("data-locs").textContent);let locIndex=0;const highlights=Array.prototype.slice.call(example.querySelectorAll(".highlight"));const link=example.querySelector(".scraped-example-title a");if(locs.length>1){const onChangeLoc=changeIndex=>{removeClass(highlights[locIndex],"focus");changeIndex();scrollToLoc(example,locs[locIndex][0],isHidden);addClass(highlights[locIndex],"focus");const url=locs[locIndex][1];const title=locs[locIndex][2];link.href=url;link.innerHTML=title};example.querySelector(".prev").addEventListener("click",()=>{onChangeLoc(()=>{locIndex=(locIndex-1+locs.length)%locs.length})});example.querySelector(".next").addEventListener("click",()=>{onChangeLoc(()=>{locIndex=(locIndex+1)%locs.length})})}const expandButton=example.querySelector(".expand");if(expandButton){expandButton.addEventListener("click",()=>{if(hasClass(example,"expanded")){removeClass(example,"expanded");scrollToLoc(example,locs[0][0],isHidden)}else{addClass(example,"expanded")}})}scrollToLoc(example,locs[0][0],isHidden)}const firstExamples=document.querySelectorAll(".scraped-example-list > .scraped-example");onEachLazy(firstExamples,el=>updateScrapedExample(el,false));onEachLazy(document.querySelectorAll(".more-examples-toggle"),toggle=>{onEachLazy(toggle.querySelectorAll(".toggle-line, .hide-more"),button=>{button.addEventListener("click",()=>{toggle.open=false})});const moreExamples=toggle.querySelectorAll(".scraped-example");toggle.querySelector("summary").addEventListener("click",()=>{setTimeout(()=>{onEachLazy(moreExamples,el=>updateScrapedExample(el,true))})},{once:true})})})() \ No newline at end of file diff --git a/static.files/search-5a66c239c06b3a66.js b/static.files/search-5a66c239c06b3a66.js new file mode 100644 index 0000000..ac39292 --- /dev/null +++ b/static.files/search-5a66c239c06b3a66.js @@ -0,0 +1,5 @@ +"use strict";if(!Array.prototype.toSpliced){Array.prototype.toSpliced=function(){const me=this.slice();Array.prototype.splice.apply(me,arguments);return me}}(function(){const itemTypes=["keyword","primitive","mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","associatedtype","constant","associatedconstant","union","foreigntype","existential","attr","derive","traitalias","generic",];const longItemTypes=["keyword","primitive type","module","extern crate","re-export","struct","enum","function","type alias","static","trait","","trait method","method","struct field","enum variant","macro","assoc type","constant","assoc const","union","foreign type","existential type","attribute macro","derive macro","trait alias",];const TY_GENERIC=itemTypes.indexOf("generic");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("search-tabs").childNodes,elem=>{if(nb===iter){addClass(elem,"selected");foundCurrentTab=true}else{removeClass(elem,"selected")}iter+=1});const isTypeSearch=(nb>0||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;const correctionsElem=document.getElementsByClassName("search-corrections");if(isTypeSearch){removeClass(correctionsElem[0],"hidden")}else{addClass(correctionsElem[0],"hidden")}}else if(nb!==0){printTab(0)}}const editDistanceState={current:[],prev:[],prevPrev:[],calculate:function calculate(a,b,limit){if(a.lengthlimit){return limit+1}while(b.length>0&&b[0]===a[0]){a=a.substring(1);b=b.substring(1)}while(b.length>0&&b[b.length-1]===a[a.length-1]){a=a.substring(0,a.length-1);b=b.substring(0,b.length-1)}if(b.length===0){return minDist}const aLength=a.length;const bLength=b.length;for(let i=0;i<=bLength;++i){this.current[i]=0;this.prev[i]=i;this.prevPrev[i]=Number.MAX_VALUE}for(let i=1;i<=aLength;++i){this.current[0]=i;const aIdx=i-1;for(let j=1;j<=bLength;++j){const bIdx=j-1;const substitutionCost=a[aIdx]===b[bIdx]?0:1;this.current[j]=Math.min(this.prev[j]+1,this.current[j-1]+1,this.prev[j-1]+substitutionCost);if((i>1)&&(j>1)&&(a[aIdx]===b[bIdx-1])&&(a[aIdx-1]===b[bIdx])){this.current[j]=Math.min(this.current[j],this.prevPrev[j-2]+1)}}const prevPrevTmp=this.prevPrev;this.prevPrev=this.prev;this.prev=this.current;this.current=prevPrevTmp}const distance=this.prev[bLength];return distance<=limit?distance:(limit+1)},};function editDistance(a,b,limit){return editDistanceState.calculate(a,b,limit)}function initSearch(rawSearchIndex){const MAX_RESULTS=200;const NO_TYPE_FILTER=-1;let searchIndex;let currentResults;let typeNameIdMap;const ALIASES=new Map();let typeNameIdOfArray;let typeNameIdOfSlice;let typeNameIdOfArrayOrSlice;function buildTypeMapIndex(name){if(name===""||name===null){return null}if(typeNameIdMap.has(name)){return typeNameIdMap.get(name)}else{const id=typeNameIdMap.size;typeNameIdMap.set(name,id);return id}}function isSpecialStartCharacter(c){return"<\"".indexOf(c)!==-1}function isEndCharacter(c){return"=,>-]".indexOf(c)!==-1}function isStopCharacter(c){return isEndCharacter(c)}function isErrorCharacter(c){return"()".indexOf(c)!==-1}function itemTypeFromName(typename){const index=itemTypes.findIndex(i=>i===typename);if(index<0){throw["Unknown type filter ",typename]}return index}function getStringElem(query,parserState,isInGenerics){if(isInGenerics){throw["Unexpected ","\""," in generics"]}else if(query.literalSearch){throw["Cannot have more than one literal search element"]}else if(parserState.totalElems-parserState.genericsElems>0){throw["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["Unclosed ","\""]}else if(parserState.userQuery[end]!=="\""){throw["Unexpected ",parserState.userQuery[end]," in a string element"]}else if(start===end){throw["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===","||c==="="}function isPathSeparator(c){return c===":"||c===" "}function prevIs(parserState,lookingFor){let pos=parserState.pos;while(pos>0){const c=parserState.userQuery[pos-1];if(c===lookingFor){return true}else if(c!==" "){break}pos-=1}return false}function isLastElemGeneric(elems,parserState){return(elems.length>0&&elems[elems.length-1].generics.length>0)||prevIs(parserState,">")}function skipWhitespace(parserState){while(parserState.pos0){throw["Cannot have more than one element if you use quotes"]}const typeFilter=parserState.typeFilter;parserState.typeFilter=null;if(name==="!"){if(typeFilter!==null&&typeFilter!=="primitive"){throw["Invalid search type: primitive never type ","!"," and ",typeFilter," both specified",]}if(generics.length!==0){throw["Never type ","!"," does not accept generic parameters",]}const bindingName=parserState.isInBinding;parserState.isInBinding=null;return{name:"never",id:null,fullPath:["never"],pathWithoutLast:[],pathLast:"never",generics:[],bindings:new Map(),typeFilter:"primitive",bindingName,}}const quadcolon=/::\s*::/.exec(path);if(path.startsWith("::")){throw["Paths cannot start with ","::"]}else if(path.endsWith("::")){throw["Paths cannot end with ","::"]}else if(quadcolon!==null){throw["Unexpected ",quadcolon[0]]}const pathSegments=path.split(/(?:::\s*)|(?:\s+(?:::\s*)?)/);if(pathSegments.length===0||(pathSegments.length===1&&pathSegments[0]==="")){if(generics.length>0||prevIs(parserState,">")){throw["Found generics without a path"]}else{throw["Unexpected ",parserState.userQuery[parserState.pos]]}}for(const[i,pathSegment]of pathSegments.entries()){if(pathSegment==="!"){if(i!==0){throw["Never type ","!"," is not associated item"]}pathSegments[i]="never"}}parserState.totalElems+=1;if(isInGenerics){parserState.genericsElems+=1}const bindingName=parserState.isInBinding;parserState.isInBinding=null;const bindings=new Map();return{name:name.trim(),id:null,fullPath:pathSegments,pathWithoutLast:pathSegments.slice(0,pathSegments.length-1),pathLast:pathSegments[pathSegments.length-1],generics:generics.filter(gen=>{if(gen.bindingName!==null){bindings.set(gen.bindingName.name,[gen,...gen.bindingName.generics]);return false}return true}),bindings,typeFilter,bindingName,}}function getIdentEndPosition(parserState){const start=parserState.pos;let end=parserState.pos;let foundExclamation=-1;while(parserState.pos=end){throw["Found generics without a path"]}parserState.pos+=1;getItemsBefore(query,parserState,generics,">")}if(isStringElem){skipWhitespace(parserState)}if(start>=end&&generics.length===0){return}if(parserState.userQuery[parserState.pos]==="="){if(parserState.isInBinding){throw["Cannot write ","="," twice in a binding"]}if(!isInGenerics){throw["Type parameter ","="," must be within generics list"]}const name=parserState.userQuery.slice(start,end).trim();if(name==="!"){throw["Type parameter ","="," key cannot be ","!"," never type"]}if(name.includes("!")){throw["Type parameter ","="," key cannot be ","!"," macro"]}if(name.includes("::")){throw["Type parameter ","="," key cannot contain ","::"," path"]}if(name.includes(":")){throw["Type parameter ","="," key cannot contain ",":"," type"]}parserState.isInBinding={name,generics}}else{elems.push(createQueryElement(query,parserState,parserState.userQuery.slice(start,end),generics,isInGenerics))}}}function getItemsBefore(query,parserState,elems,endChar){let foundStopChar=true;let start=parserState.pos;const oldTypeFilter=parserState.typeFilter;parserState.typeFilter=null;const oldIsInBinding=parserState.isInBinding;parserState.isInBinding=null;let extra="";if(endChar===">"){extra="<"}else if(endChar==="]"){extra="["}else if(endChar===""){extra="->"}else{extra=endChar}while(parserState.pos"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(endChar!==""){throw["Expected ",",",", ","=",", or ",endChar,...extra,", found ",c,]}throw["Expected ",","," or ","=",...extra,", found ",c,]}const posBefore=parserState.pos;start=parserState.pos;getNextElem(query,parserState,elems,endChar!=="");if(endChar!==""&&parserState.pos>=parserState.length){throw["Unclosed ",extra]}if(posBefore===parserState.pos){parserState.pos+=1}foundStopChar=false}if(parserState.pos>=parserState.length&&endChar!==""){throw["Unclosed ",extra]}parserState.pos+=1;parserState.typeFilter=oldTypeFilter;parserState.isInBinding=oldIsInBinding}function checkExtraTypeFilterCharacters(start,parserState){const query=parserState.userQuery.slice(start,parserState.pos).trim();for(const c in query){if(!isIdentCharacter(query[c])){throw["Unexpected ",query[c]," in type filter (before ",":",")",]}}}function parseInput(query,parserState){let foundStopChar=true;let start=parserState.pos;while(parserState.pos"){if(isReturnArrow(parserState)){break}throw["Unexpected ",c," (did you mean ","->","?)"]}throw["Unexpected ",c]}else if(c===":"&&!isPathStart(parserState)){if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}else if(query.elems.length===0){throw["Expected type filter before ",":"]}else if(query.literalSearch){throw["Cannot use quotes on type filter"]}const typeFilterElem=query.elems.pop();checkExtraTypeFilterCharacters(start,parserState);parserState.typeFilter=typeFilterElem.name;parserState.pos+=1;parserState.totalElems-=1;query.literalSearch=false;foundStopChar=true;continue}else if(c===" "){skipWhitespace(parserState);continue}if(!foundStopChar){let extra="";if(isLastElemGeneric(query.elems,parserState)){extra=[" after ",">"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(parserState.typeFilter!==null){throw["Expected ",","," or ","->",...extra,", found ",c,]}throw["Expected ",",",", ",":"," or ","->",...extra,", found ",c,]}const before=query.elems.length;start=parserState.pos;getNextElem(query,parserState,query.elems,false);if(query.elems.length===before){parserState.pos+=1}foundStopChar=false}if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}while(parserState.pos"]}break}else{parserState.pos+=1}}}function newParsedQuery(userQuery){return{original:userQuery,userQuery:userQuery.toLowerCase(),elems:[],returned:[],foundElems:0,totalElems:0,literalSearch:false,error:null,correction:null,proposeCorrectionFrom:null,proposeCorrectionTo: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){function convertTypeFilterOnElem(elem){if(elem.typeFilter!==null){let typeFilter=elem.typeFilter;if(typeFilter==="const"){typeFilter="constant"}elem.typeFilter=itemTypeFromName(typeFilter)}else{elem.typeFilter=NO_TYPE_FILTER}for(const elem2 of elem.generics){convertTypeFilterOnElem(elem2)}for(const constraints of elem.bindings.values()){for(const constraint of constraints){convertTypeFilterOnElem(constraint)}}}userQuery=userQuery.trim().replace(/\r|\n|\t/g," ");const parserState={length:userQuery.length,pos:0,totalElems:0,genericsElems:0,typeFilter:null,isInBinding:null,userQuery:userQuery.toLowerCase(),};let query=newParsedQuery(userQuery);try{parseInput(query,parserState);for(const elem of query.elems){convertTypeFilterOnElem(elem)}for(const elem of query.returned){convertTypeFilterOnElem(elem)}}catch(err){query=newParsedQuery(userQuery);query.error=err;return query}if(!query.literalSearch){query.literalSearch=parserState.totalElems>1}query.foundElems=query.elems.length+query.returned.length;query.totalElems=parserState.totalElems;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=new Map(),results_in_args=new Map(),results_returned=new Map();function transformResults(results){const duplicates=new Set();const out=[];for(const result of results){if(result.id!==-1){const obj=searchIndex[result.id];obj.dist=result.dist;const res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=obj.displayPath+obj.name;obj.fullPath+="|"+obj.ty;if(duplicates.has(obj.fullPath)){continue}duplicates.add(obj.fullPath);obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}return out}function sortResults(results,isType,preferredCrate){if(results.size===0){return[]}const userQuery=parsedQuery.userQuery;const result_list=[];for(const result of results.values()){result.word=searchWords[result.id];result.item=searchIndex[result.id]||{};result_list.push(result)}result_list.sort((aaa,bbb)=>{let a,b;a=(aaa.word!==userQuery);b=(bbb.word!==userQuery);if(a!==b){return a-b}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.path_dist;b=bbb.path_dist;if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}a=(aaa.dist);b=(bbb.dist);if(a!==b){return a-b}a=aaa.item.deprecated;b=bbb.item.deprecated;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.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 result_list){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(result_list)}function unifyFunctionTypes(fnTypesIn,queryElems,whereClause,mgensIn,solutionCb){const mgens=mgensIn===null?null:new Map(mgensIn);if(queryElems.length===0){return!solutionCb||solutionCb(mgens)}if(!fnTypesIn||fnTypesIn.length===0){return false}const ql=queryElems.length;const fl=fnTypesIn.length;if(ql===1&&queryElems[0].generics.length===0&&queryElems[0].bindings.size===0){const queryElem=queryElems[0];for(const fnType of fnTypesIn){if(!unifyFunctionTypeIsMatchCandidate(fnType,queryElem,whereClause,mgens)){continue}if(fnType.id<0&&queryElem.id<0){if(mgens&&mgens.has(fnType.id)&&mgens.get(fnType.id)!==queryElem.id){continue}const mgensScratch=new Map(mgens);mgensScratch.set(fnType.id,queryElem.id);if(!solutionCb||solutionCb(mgensScratch)){return true}}else if(!solutionCb||solutionCb(mgens?new Map(mgens):null)){return true}}for(const fnType of fnTypesIn){if(!unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens)){continue}if(fnType.id<0){if(mgens&&mgens.has(fnType.id)&&mgens.get(fnType.id)!==0){continue}const mgensScratch=new Map(mgens);mgensScratch.set(fnType.id,0);if(unifyFunctionTypes(whereClause[(-fnType.id)-1],queryElems,whereClause,mgensScratch,solutionCb)){return true}}else if(unifyFunctionTypes(fnType.generics,queryElems,whereClause,mgens?new Map(mgens):null,solutionCb)){return true}}return false}const fnTypes=fnTypesIn.slice();const flast=fl-1;const qlast=ql-1;const queryElem=queryElems[qlast];let queryElemsTmp=null;for(let i=flast;i>=0;i-=1){const fnType=fnTypes[i];if(!unifyFunctionTypeIsMatchCandidate(fnType,queryElem,whereClause,mgens)){continue}let mgensScratch;if(fnType.id<0){mgensScratch=new Map(mgens);if(mgensScratch.has(fnType.id)&&mgensScratch.get(fnType.id)!==queryElem.id){continue}mgensScratch.set(fnType.id,queryElem.id)}else{mgensScratch=mgens}fnTypes[i]=fnTypes[flast];fnTypes.length=flast;if(!queryElemsTmp){queryElemsTmp=queryElems.slice(0,qlast)}const passesUnification=unifyFunctionTypes(fnTypes,queryElemsTmp,whereClause,mgensScratch,mgensScratch=>{if(fnType.generics.length===0&&queryElem.generics.length===0&&fnType.bindings.size===0&&queryElem.bindings.size===0){return!solutionCb||solutionCb(mgensScratch)}const solution=unifyFunctionTypeCheckBindings(fnType,queryElem,whereClause,mgensScratch);if(!solution){return false}const simplifiedGenerics=solution.simplifiedGenerics;for(const simplifiedMgens of solution.mgens){const passesUnification=unifyFunctionTypes(simplifiedGenerics,queryElem.generics,whereClause,simplifiedMgens,solutionCb);if(passesUnification){return true}}return false});if(passesUnification){return true}fnTypes[flast]=fnTypes[i];fnTypes[i]=fnType;fnTypes.length=fl}for(let i=flast;i>=0;i-=1){const fnType=fnTypes[i];if(!unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens)){continue}let mgensScratch;if(fnType.id<0){mgensScratch=new Map(mgens);if(mgensScratch.has(fnType.id)&&mgensScratch.get(fnType.id)!==0){continue}mgensScratch.set(fnType.id,0)}else{mgensScratch=mgens}const generics=fnType.id<0?whereClause[(-fnType.id)-1]:fnType.generics;const bindings=fnType.bindings?Array.from(fnType.bindings.values()).flat():[];const passesUnification=unifyFunctionTypes(fnTypes.toSpliced(i,1,...generics,...bindings),queryElems,whereClause,mgensScratch,solutionCb);if(passesUnification){return true}}return false}function unifyFunctionTypeIsMatchCandidate(fnType,queryElem,whereClause,mgensIn){if(!typePassesFilter(queryElem.typeFilter,fnType.ty)){return false}if(fnType.id<0&&queryElem.id<0){if(mgensIn){if(mgensIn.has(fnType.id)&&mgensIn.get(fnType.id)!==queryElem.id){return false}for(const[fid,qid]of mgensIn.entries()){if(fnType.id!==fid&&queryElem.id===qid){return false}if(fnType.id===fid&&queryElem.id!==qid){return false}}}return true}else{if(queryElem.id===typeNameIdOfArrayOrSlice&&(fnType.id===typeNameIdOfSlice||fnType.id===typeNameIdOfArray)){}else if(fnType.id!==queryElem.id||queryElem.id===null){return false}if((fnType.generics.length+fnType.bindings.size)===0&&queryElem.generics.length!==0){return false}if(fnType.bindings.size0){const fnTypePath=fnType.path!==undefined&&fnType.path!==null?fnType.path.split("::"):[];if(queryElemPathLength>fnTypePath.length){return false}let i=0;for(const path of fnTypePath){if(path===queryElem.pathWithoutLast[i]){i+=1;if(i>=queryElemPathLength){break}}}if(i0){let mgensSolutionSet=[mgensIn];for(const[name,constraints]of queryElem.bindings.entries()){if(mgensSolutionSet.length===0){return false}if(!fnType.bindings.has(name)){return false}const fnTypeBindings=fnType.bindings.get(name);mgensSolutionSet=mgensSolutionSet.flatMap(mgens=>{const newSolutions=[];unifyFunctionTypes(fnTypeBindings,constraints,whereClause,mgens,newMgens=>{newSolutions.push(newMgens);return false});return newSolutions})}if(mgensSolutionSet.length===0){return false}const binds=Array.from(fnType.bindings.entries()).flatMap(entry=>{const[name,constraints]=entry;if(queryElem.bindings.has(name)){return[]}else{return constraints}});if(simplifiedGenerics.length>0){simplifiedGenerics=[...simplifiedGenerics,...binds]}else{simplifiedGenerics=binds}return{simplifiedGenerics,mgens:mgensSolutionSet}}return{simplifiedGenerics,mgens:[mgensIn]}}function unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens){if(fnType.id<0&&queryElem.id>=0){if(!whereClause){return false}if(mgens&&mgens.has(fnType.id)&&mgens.get(fnType.id)!==0){return false}const mgensTmp=new Map(mgens);mgensTmp.set(fnType.id,null);return checkIfInList(whereClause[(-fnType.id)-1],queryElem,whereClause,mgensTmp)}else if(fnType.generics.length>0||fnType.bindings.size>0){const simplifiedGenerics=[...fnType.generics,...Array.from(fnType.bindings.values()).flat(),];return checkIfInList(simplifiedGenerics,queryElem,whereClause,mgens)}return false}function checkIfInList(list,elem,whereClause,mgens){for(const entry of list){if(checkType(entry,elem,whereClause,mgens)){return true}}return false}function checkType(row,elem,whereClause,mgens){if(row.bindings.size===0&&elem.bindings.size===0){if(elem.id<0){return row.id<0||checkIfInList(row.generics,elem,whereClause,mgens)}if(row.id>0&&elem.id>0&&elem.pathWithoutLast.length===0&&typePassesFilter(elem.typeFilter,row.ty)&&elem.generics.length===0&&elem.id!==typeNameIdOfArrayOrSlice){return row.id===elem.id||checkIfInList(row.generics,elem,whereClause,mgens)}}return unifyFunctionTypes([row],[elem],whereClause,mgens)}function checkPath(contains,ty,maxEditDistance){if(contains.length===0){return 0}let ret_dist=maxEditDistance+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;pathiter:for(let i=length-clength;i>=0;i-=1){let dist_total=0;for(let x=0;xmaxEditDistance){continue pathiter}dist_total+=dist}ret_dist=Math.min(ret_dist,Math.round(dist_total/clength))}return ret_dist}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,deprecated:item.deprecated,implDisambiguator:item.implDisambiguator,}}function handleAliases(ret,query,filterCrates,currentCrate){const lowerQuery=query.toLowerCase();const aliases=[];const crateAliases=[];if(filterCrates!==null){if(ALIASES.has(filterCrates)&&ALIASES.get(filterCrates).has(lowerQuery)){const query_aliases=ALIASES.get(filterCrates).get(lowerQuery);for(const alias of query_aliases){aliases.push(createAliasFromItem(searchIndex[alias]))}}}else{for(const[crate,crateAliasesIndex]of ALIASES){if(crateAliasesIndex.has(lowerQuery)){const pushTo=crate===currentCrate?crateAliases:aliases;const query_aliases=crateAliasesIndex.get(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,dist,path_dist,maxEditDistance){const inBounds=dist<=maxEditDistance||index!==-1;if(dist===0||(!parsedQuery.literalSearch&&inBounds)){if(results.has(fullId)){const result=results.get(fullId);if(result.dontValidate||result.dist<=dist){return}}results.set(fullId,{id:id,index:index,dontValidate:parsedQuery.literalSearch,dist:dist,path_dist:path_dist,})}}function handleSingleArg(row,pos,elem,results_others,results_in_args,results_returned,maxEditDistance){if(!row||(filterCrates!==null&&row.crate!==filterCrates)){return}let index=-1,path_dist=0;const fullId=row.id;const searchWord=searchWords[pos];const in_args=row.type&&row.type.inputs&&checkIfInList(row.type.inputs,elem,row.type.where_clause);if(in_args){addIntoResults(results_in_args,fullId,pos,-1,0,0,maxEditDistance)}const returned=row.type&&row.type.output&&checkIfInList(row.type.output,elem,row.type.where_clause);if(returned){addIntoResults(results_returned,fullId,pos,-1,0,0,maxEditDistance)}if(!typePassesFilter(elem.typeFilter,row.ty)){return}const row_index=row.normalizedName.indexOf(elem.pathLast);const word_index=searchWord.indexOf(elem.pathLast);if(row_index===-1){index=word_index}else if(word_index===-1){index=row_index}else if(word_index1){path_dist=checkPath(elem.pathWithoutLast,row,maxEditDistance);if(path_dist>maxEditDistance){return}}if(parsedQuery.literalSearch){if(searchWord===elem.name){addIntoResults(results_others,fullId,pos,index,0,path_dist)}return}const dist=editDistance(searchWord,elem.pathLast,maxEditDistance);if(index===-1&&dist+path_dist>maxEditDistance){return}addIntoResults(results_others,fullId,pos,index,dist,path_dist,maxEditDistance)}function handleArgs(row,pos,results){if(!row||(filterCrates!==null&&row.crate!==filterCrates)||!row.type){return}if(!unifyFunctionTypes(row.type.inputs,parsedQuery.elems,row.type.where_clause,null,mgens=>{return unifyFunctionTypes(row.type.output,parsedQuery.returned,row.type.where_clause,mgens)})){return}addIntoResults(results,row.id,pos,0,0,0,Number.MAX_VALUE)}function innerRunQuery(){let elem,i,nSearchWords,in_returned,row;let queryLen=0;for(const elem of parsedQuery.elems){queryLen+=elem.name.length}for(const elem of parsedQuery.returned){queryLen+=elem.name.length}const maxEditDistance=Math.floor(queryLen/3);const genericSymbols=new Map();function convertNameToId(elem){if(typeNameIdMap.has(elem.pathLast)){elem.id=typeNameIdMap.get(elem.pathLast)}else if(!parsedQuery.literalSearch){let match=null;let matchDist=maxEditDistance+1;let matchName="";for(const[name,id]of typeNameIdMap){const dist=editDistance(name,elem.pathLast,maxEditDistance);if(dist<=matchDist&&dist<=maxEditDistance){if(dist===matchDist&&matchName>name){continue}match=id;matchDist=dist;matchName=name}}if(match!==null){parsedQuery.correction=matchName}elem.id=match}if((elem.id===null&&parsedQuery.totalElems>1&&elem.typeFilter===-1&&elem.generics.length===0&&elem.bindings.size===0)||elem.typeFilter===TY_GENERIC){if(genericSymbols.has(elem.name)){elem.id=genericSymbols.get(elem.name)}else{elem.id=-(genericSymbols.size+1);genericSymbols.set(elem.name,elem.id)}if(elem.typeFilter===-1&&elem.name.length>=3){const maxPartDistance=Math.floor(elem.name.length/3);let matchDist=maxPartDistance+1;let matchName="";for(const name of typeNameIdMap.keys()){const dist=editDistance(name,elem.name,maxPartDistance);if(dist<=matchDist&&dist<=maxPartDistance){if(dist===matchDist&&matchName>name){continue}matchDist=dist;matchName=name}}if(matchName!==""){parsedQuery.proposeCorrectionFrom=elem.name;parsedQuery.proposeCorrectionTo=matchName}}elem.typeFilter=TY_GENERIC}if(elem.generics.length>0&&elem.typeFilter===TY_GENERIC){parsedQuery.error=["Generic type parameter ",elem.name," does not accept generic parameters",]}for(const elem2 of elem.generics){convertNameToId(elem2)}elem.bindings=new Map(Array.from(elem.bindings.entries()).map(entry=>{const[name,constraints]=entry;if(!typeNameIdMap.has(name)){parsedQuery.error=["Type parameter ",name," does not exist",]}for(const elem2 of constraints){convertNameToId(elem2)}return[typeNameIdMap.get(name),constraints]}))}for(const elem of parsedQuery.elems){convertNameToId(elem)}for(const elem of parsedQuery.returned){convertNameToId(elem)}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)||editDistance(name,key,maxEditDistance)<=maxEditDistance)){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("#search-tabs button").item(searchState.currentTab);searchState.focusedByTab[searchState.currentTab]=null;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+"::"}if(item.implDisambiguator!==null){anchor=item.implDisambiguator+"/"+anchor}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 pathSplitter(path){const tmp=""+path.replace(/::/g,"::");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}function addTab(array,query,display){const extraClass=display?" 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];const longType=longItemTypes[item.ty];const typeName=longType.length!==0?`${longType}`:"?";length+=1;const link=document.createElement("a");link.className="result-"+type;link.href=item.href;const resultName=document.createElement("div");resultName.className="result-name";resultName.insertAdjacentHTML("beforeend",`${typeName}`);link.appendChild(resultName);let alias=" ";if(item.is_alias){alias=`
\ +${item.alias} - see \ +
`}resultName.insertAdjacentHTML("beforeend",`
${alias}\ +${item.displayPath}${name}\ +
`);const description=document.createElement("div");description.className="desc";description.insertAdjacentHTML("beforeend",item.desc);link.appendChild(description);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){const fmtNbElems=nbElems<10?`\u{2007}(${nbElems})\u{2007}\u{2007}`:nbElems<100?`\u{2007}(${nbElems})\u{2007}`:`\u{2007}(${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")){window.onunload=()=>{};searchState.removeQueryParameters();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 output=`

Results${crates}

`;if(results.query.error!==null){const error=results.query.error;error.forEach((value,index)=>{value=value.split("<").join("<").split(">").join(">");if(index%2!==0){error[index]=`${value.replaceAll(" ", " ")}`}else{error[index]=value}});output+=`

Query parser error: "${error.join("")}".

`;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}if(results.query.correction!==null){const orig=results.query.returned.length>0?results.query.returned[0].name:results.query.elems[0].name;output+="

"+`Type "${orig}" not found. `+"Showing results for closest type name "+`"${results.query.correction}" instead.

`}if(results.query.proposeCorrectionFrom!==null){const orig=results.query.proposeCorrectionFrom;const targ=results.query.proposeCorrectionTo;output+="

"+`Type "${orig}" not found and used as generic parameter. `+`Consider searching for "${targ}" instead.

`}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("search-tabs").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 updateSearchHistory(url){if(!browserSupportsHistoryApi()){return}const params=searchState.getQueryStringParams();if(!history.state&&!params.search){history.pushState(null,"",url)}else{history.replaceState(null,"",url)}}function search(forced){const query=parseQuery(searchState.input.value.trim());let filterCrates=getFilterCrates();if(!forced&&query.userQuery===currentResults){if(query.userQuery.length>0){putBackSearch()}return}searchState.setLoadingSearch();const params=searchState.getQueryStringParams();if(filterCrates===null&¶ms["filter-crate"]!==undefined){filterCrates=params["filter-crate"]}searchState.title="Results for "+query.original+" - Rust";updateSearchHistory(buildUrl(query.original,filterCrates));showResults(execQuery(query,searchWords,filterCrates,window.currentCrate),params.go_to_first,filterCrates)}function buildItemSearchTypeAll(types,lowercasePaths){return types.map(type=>buildItemSearchType(type,lowercasePaths))}function buildItemSearchType(type,lowercasePaths){const PATH_INDEX_DATA=0;const GENERICS_DATA=1;const BINDINGS_DATA=2;let pathIndex,generics,bindings;if(typeof type==="number"){pathIndex=type;generics=[];bindings=new Map()}else{pathIndex=type[PATH_INDEX_DATA];generics=buildItemSearchTypeAll(type[GENERICS_DATA],lowercasePaths);if(type.length>BINDINGS_DATA){bindings=new Map(type[BINDINGS_DATA].map(binding=>{const[assocType,constraints]=binding;return[buildItemSearchType(assocType,lowercasePaths).id,buildItemSearchTypeAll(constraints,lowercasePaths),]}))}else{bindings=new Map()}}if(pathIndex<0){return{id:pathIndex,ty:TY_GENERIC,path:null,generics,bindings,}}if(pathIndex===0){return{id:null,ty:null,path:null,generics,bindings,}}const item=lowercasePaths[pathIndex-1];return{id:buildTypeMapIndex(item.name),ty:item.ty,path:item.path,generics,bindings,}}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"){inputs=[buildItemSearchType(functionSearchType[INPUTS_DATA],lowercasePaths)]}else{inputs=buildItemSearchTypeAll(functionSearchType[INPUTS_DATA],lowercasePaths)}if(functionSearchType.length>1){if(typeof functionSearchType[OUTPUT_DATA]==="number"){output=[buildItemSearchType(functionSearchType[OUTPUT_DATA],lowercasePaths)]}else{output=buildItemSearchTypeAll(functionSearchType[OUTPUT_DATA],lowercasePaths)}}else{output=[]}const where_clause=[];const l=functionSearchType.length;for(let i=2;i2){path=itemPaths.has(elem[2])?itemPaths.get(elem[2]):lastPath;lastPath=path}lowercasePaths.push({ty:ty,name:name.toLowerCase(),path:path});paths[i]={ty:ty,name:name,path:path}}lastPath="";len=itemTypes.length;for(let i=0;i0?paths[itemParentIdxs[i]-1]:undefined,type:buildFunctionSearchType(itemFunctionSearchTypes[i],lowercasePaths),id:id,normalizedName:word.indexOf("_")===-1?word:word.replace(/_/g,""),deprecated:deprecatedItems.has(i),implDisambiguator:implDisambiguator.has(i)?implDisambiguator.get(i):null,};id+=1;searchIndex.push(row);lastPath=row.path;crateSize+=1}if(aliases){const currentCrateAliases=new Map();ALIASES.set(crate,currentCrateAliases);for(const alias_name in aliases){if(!hasOwnPropertyRustdoc(aliases,alias_name)){continue}let currentNameAliases;if(currentCrateAliases.has(alias_name)){currentNameAliases=currentCrateAliases.get(alias_name)}else{currentNameAliases=[];currentCrateAliases.set(alias_name,currentNameAliases)}for(const local_alias of aliases[alias_name]){currentNameAliases.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){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;e.preventDefault();search()}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 query=searchState.input.value.trim();updateSearchHistory(buildUrl(query,null))}currentResults=null;search(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/static.files/settings-fe03fdc259827cd2.js b/static.files/settings-fe03fdc259827cd2.js new file mode 100644 index 0000000..743537e --- /dev/null +++ b/static.files/settings-fe03fdc259827cd2.js @@ -0,0 +1,17 @@ +"use strict";(function(){const isSettingsPage=window.location.pathname.endsWith("/settings.html");function changeSetting(settingName,value){if(settingName==="theme"){const useSystem=value==="system preference"?"true":"false";updateLocalStorage("use-system-theme",useSystem)}updateLocalStorage(settingName,value);switch(settingName){case"theme":case"preferred-dark-theme":case"preferred-light-theme":updateTheme();updateLightAndDark();break;case"line-numbers":if(value===true){window.rustdoc_add_line_numbers_to_examples()}else{window.rustdoc_remove_line_numbers_from_examples()}break}}function showLightAndDark(){removeClass(document.getElementById("preferred-light-theme"),"hidden");removeClass(document.getElementById("preferred-dark-theme"),"hidden")}function hideLightAndDark(){addClass(document.getElementById("preferred-light-theme"),"hidden");addClass(document.getElementById("preferred-dark-theme"),"hidden")}function updateLightAndDark(){const useSystem=getSettingValue("use-system-theme");if(useSystem==="true"||(useSystem===null&&getSettingValue("theme")===null)){showLightAndDark()}else{hideLightAndDark()}}function setEvents(settingsElement){updateLightAndDark();onEachLazy(settingsElement.querySelectorAll("input[type=\"checkbox\"]"),toggle=>{const settingId=toggle.id;const settingValue=getSettingValue(settingId);if(settingValue!==null){toggle.checked=settingValue==="true"}toggle.onchange=()=>{changeSetting(toggle.id,toggle.checked)}});onEachLazy(settingsElement.querySelectorAll("input[type=\"radio\"]"),elem=>{const settingId=elem.name;let settingValue=getSettingValue(settingId);if(settingId==="theme"){const useSystem=getSettingValue("use-system-theme");if(useSystem==="true"||settingValue===null){settingValue=useSystem==="false"?"light":"system preference"}}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){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":"";const full=`${js_data_name}-${option.replace(/ /g,"-")}`;output+=`\ + `});output+=`\ +
+
`}else{const checked=setting["default"]===true?" checked":"";output+=`\ +
\ + \ +
`}}return output}function buildSettingsPage(){const theme_names=getVar("themes").split(",").filter(t=>t);theme_names.push("light","dark","ayu");const settings=[{"name":"Theme","js_name":"theme","default":"system preference","options":theme_names.concat("system preference"),},{"name":"Preferred light theme","js_name":"preferred-light-theme","default":"light","options":theme_names,},{"name":"Preferred dark theme","js_name":"preferred-dark-theme","default":"dark","options":theme_names,},{"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";if(!isSettingsPage){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=event=>{event.preventDefault()}}else{const settingsButton=getSettingsButton();const settingsMenu=document.getElementById("settings");settingsButton.onclick=event=>{if(settingsMenu.contains(event.target)){return}event.preventDefault();const shouldDisplaySettings=settingsMenu.style.display==="none";window.hideAllModals();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/static.files/src-script-3280b574d94e47b4.js b/static.files/src-script-3280b574d94e47b4.js new file mode 100644 index 0000000..9ea8892 --- /dev/null +++ b/static.files/src-script-3280b574d94e47b4.js @@ -0,0 +1 @@ +"use strict";(function(){const rootPath=getVar("root-path");const NAME_OFFSET=0;const DIRS_OFFSET=1;const FILES_OFFSET=2;const RUSTDOC_MOBILE_BREAKPOINT=700;function closeSidebarIfMobile(){if(window.innerWidth"){addClass(document.documentElement,"src-sidebar-expanded");child.innerText="<";updateLocalStorage("source-sidebar-show","true")}else{removeClass(document.documentElement,"src-sidebar-expanded");child.innerText=">";updateLocalStorage("source-sidebar-show","false")}}function createSidebarToggle(){const sidebarToggle=document.createElement("div");sidebarToggle.id="src-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 createSrcSidebar(){const container=document.querySelector("nav.sidebar");const sidebarToggle=createSidebarToggle();container.insertBefore(sidebarToggle,container.firstChild);const sidebar=document.createElement("div");sidebar.id="src-sidebar";let hasFoundFile=false;const title=document.createElement("div");title.className="title";title.innerText="Files";sidebar.appendChild(title);Object.keys(srcIndex).forEach(key=>{srcIndex[key][NAME_OFFSET]=key;hasFoundFile=createDirEntry(srcIndex[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 highlightSrcLines(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("a"),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 handleSrcHighlight=(function(){let prev_line_id=0;const set_fragment=name=>{const x=window.scrollX,y=window.scrollY;if(browserSupportsHistoryApi()){history.replaceState(null,null,"#"+name);highlightSrcLines()}else{location.replace("#"+name)}window.scrollTo(x,y)};return ev=>{let cur_line_id=parseInt(ev.target.id,10);if(isNaN(cur_line_id)||ev.ctrlKey||ev.altKey||ev.metaKey){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 highlightSrcLines(match)}});onEachLazy(document.getElementsByClassName("src-line-numbers"),el=>{el.addEventListener("click",handleSrcHighlight)});highlightSrcLines();window.createSrcSidebar=createSrcSidebar})() \ No newline at end of file diff --git a/static.files/storage-fec3eaa3851e447d.js b/static.files/storage-fec3eaa3851e447d.js new file mode 100644 index 0000000..a687118 --- /dev/null +++ b/static.files/storage-fec3eaa3851e447d.js @@ -0,0 +1 @@ +"use strict";const builtinThemes=["light","dark","ayu"];const darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");const settingsDataset=(function(){const settingsElement=document.getElementById("default-settings");return settingsElement&&settingsElement.dataset?settingsElement.dataset:null})();function getSettingValue(settingName){const current=getCurrentValue(settingName);if(current===null&&settingsDataset!==null){const def=settingsDataset[settingName.replace(/-/g,"_")];if(def!==undefined){return def}}return current}const localStoredTheme=getSettingValue("theme");function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(elem&&elem.classList){elem.classList.add(className)}}function removeClass(elem,className){if(elem&&elem.classList){elem.classList.remove(className)}}function onEach(arr,func,reversed){if(arr&&arr.length>0){if(reversed){for(let i=arr.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}}const getVar=(function getVar(name){const el=document.querySelector("head > meta[name='rustdoc-vars']");return el?el.attributes["data-"+name].value:null});function switchTheme(newThemeName,saveTheme){if(saveTheme){updateLocalStorage("theme",newThemeName)}document.documentElement.setAttribute("data-theme",newThemeName);if(builtinThemes.indexOf(newThemeName)!==-1){if(window.currentTheme){window.currentTheme.parentNode.removeChild(window.currentTheme);window.currentTheme=null}}else{const newHref=getVar("root-path")+newThemeName+getVar("resource-suffix")+".css";if(!window.currentTheme){if(document.readyState==="loading"){document.write(``);window.currentTheme=document.getElementById("themeStyle")}else{window.currentTheme=document.createElement("link");window.currentTheme.rel="stylesheet";window.currentTheme.id="themeStyle";window.currentTheme.href=newHref;document.documentElement.appendChild(window.currentTheme)}}else if(newHref!==window.currentTheme.href){window.currentTheme.href=newHref}}}const updateTheme=(function(){const mql=window.matchMedia("(prefers-color-scheme: dark)");function updateTheme(){if(getSettingValue("use-system-theme")!=="false"){const lightTheme=getSettingValue("preferred-light-theme")||"light";const darkTheme=getSettingValue("preferred-dark-theme")||"dark";updateLocalStorage("use-system-theme","true");switchTheme(mql.matches?darkTheme:lightTheme,true)}else{switchTheme(getSettingValue("theme"),false)}}mql.addEventListener("change",updateTheme);return updateTheme})();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)}}updateTheme();if(getSettingValue("source-sidebar-show")==="true"){addClass(document.documentElement,"src-sidebar-expanded")}window.addEventListener("pageshow",ev=>{if(ev.persisted){setTimeout(updateTheme,0)}}) \ No newline at end of file diff --git a/static.files/wheel-7b819b6101059cd0.svg b/static.files/wheel-7b819b6101059cd0.svg new file mode 100644 index 0000000..83c07f6 --- /dev/null +++ b/static.files/wheel-7b819b6101059cd0.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/trait.impl/bitflags/traits/trait.Flags.js b/trait.impl/bitflags/traits/trait.Flags.js new file mode 100644 index 0000000..0c943c3 --- /dev/null +++ b/trait.impl/bitflags/traits/trait.Flags.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Flags for MappingFlags"],["impl Flags for PTEFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/bitflags/traits/trait.PublicFlags.js b/trait.impl/bitflags/traits/trait.PublicFlags.js new file mode 100644 index 0000000..b98edde --- /dev/null +++ b/trait.impl/bitflags/traits/trait.PublicFlags.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl PublicFlags for PTEFlags"],["impl PublicFlags for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/clone/trait.Clone.js b/trait.impl/core/clone/trait.Clone.js new file mode 100644 index 0000000..3bfb174 --- /dev/null +++ b/trait.impl/core/clone/trait.Clone.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Clone for TrapType"],["impl Clone for EscapeReason"],["impl Clone for PhysPage"],["impl Clone for Time"],["impl Clone for VirtAddr"],["impl Clone for TrapFrame"],["impl Clone for PTEFlags"],["impl Clone for PhysAddr"],["impl Clone for MappingFlags"],["impl Clone for VirtPage"],["impl Clone for IRQVector"],["impl Clone for PageTable"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/cmp/trait.Eq.js b/trait.impl/core/cmp/trait.Eq.js new file mode 100644 index 0000000..ec92efb --- /dev/null +++ b/trait.impl/core/cmp/trait.Eq.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Eq for PTEFlags"],["impl Eq for PhysPage"],["impl Eq for EscapeReason"],["impl Eq for VirtPage"],["impl Eq for VirtAddr"],["impl Eq for MappingFlags"],["impl Eq for PhysAddr"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/cmp/trait.Ord.js b/trait.impl/core/cmp/trait.Ord.js new file mode 100644 index 0000000..b0d3db2 --- /dev/null +++ b/trait.impl/core/cmp/trait.Ord.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Ord for PhysAddr"],["impl Ord for VirtPage"],["impl Ord for VirtAddr"],["impl Ord for PhysPage"],["impl Ord for MappingFlags"],["impl Ord for PTEFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/cmp/trait.PartialEq.js b/trait.impl/core/cmp/trait.PartialEq.js new file mode 100644 index 0000000..c663cf6 --- /dev/null +++ b/trait.impl/core/cmp/trait.PartialEq.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl PartialEq for VirtAddr"],["impl PartialEq for PhysAddr"],["impl PartialEq for VirtPage"],["impl PartialEq for PhysPage"],["impl PartialEq for MappingFlags"],["impl PartialEq for EscapeReason"],["impl PartialEq for PTEFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/cmp/trait.PartialOrd.js b/trait.impl/core/cmp/trait.PartialOrd.js new file mode 100644 index 0000000..c882668 --- /dev/null +++ b/trait.impl/core/cmp/trait.PartialOrd.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl PartialOrd for PTEFlags"],["impl PartialOrd for PhysAddr"],["impl PartialOrd for VirtAddr"],["impl PartialOrd for VirtPage"],["impl PartialOrd for MappingFlags"],["impl PartialOrd for PhysPage"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/convert/trait.From.js b/trait.impl/core/convert/trait.From.js new file mode 100644 index 0000000..43b9632 --- /dev/null +++ b/trait.impl/core/convert/trait.From.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl From<PhysPage> for PhysAddr"],["impl From<VirtAddr> for VirtPage"],["impl From<usize> for VirtPage"],["impl From<usize> for VirtAddr"],["impl From<VirtPage> for VirtAddr"],["impl From<VirtAddr> for usize"],["impl From<usize> for PhysPage"],["impl From<PTEFlags> for MappingFlags"],["impl From<MappingFlags> for PTEFlags"],["impl From<PhysAddr> for PhysPage"],["impl From<PhysPage> for usize"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/convert/trait.Into.js b/trait.impl/core/convert/trait.Into.js new file mode 100644 index 0000000..33ebef0 --- /dev/null +++ b/trait.impl/core/convert/trait.Into.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Into<EscapeReason> for TrapType"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.Binary.js b/trait.impl/core/fmt/trait.Binary.js new file mode 100644 index 0000000..d6753dd --- /dev/null +++ b/trait.impl/core/fmt/trait.Binary.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Binary for MappingFlags"],["impl Binary for PTEFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.Debug.js b/trait.impl/core/fmt/trait.Debug.js new file mode 100644 index 0000000..609a7a7 --- /dev/null +++ b/trait.impl/core/fmt/trait.Debug.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Debug for KContext"],["impl Debug for PTEFlags"],["impl Debug for PhysAddr"],["impl Debug for MappingFlags"],["impl Debug for VirtAddr"],["impl Debug for IRQVector"],["impl Debug for KContextArgs"],["impl Debug for PageTable"],["impl Debug for EscapeReason"],["impl Debug for PageTableWrapper"],["impl Debug for MappingSize"],["impl Debug for PhysPage"],["impl Debug for TrapType"],["impl Debug for VirtPage"],["impl Debug for Time"],["impl<T: Debug> Debug for LazyInit<T>"],["impl Debug for TrapFrameArgs"],["impl Debug for TrapFrame"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.Display.js b/trait.impl/core/fmt/trait.Display.js new file mode 100644 index 0000000..41e68ef --- /dev/null +++ b/trait.impl/core/fmt/trait.Display.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Display for PhysPage"],["impl Display for VirtAddr"],["impl Display for PhysAddr"],["impl Display for VirtPage"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.LowerHex.js b/trait.impl/core/fmt/trait.LowerHex.js new file mode 100644 index 0000000..02cefc2 --- /dev/null +++ b/trait.impl/core/fmt/trait.LowerHex.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl LowerHex for PTEFlags"],["impl LowerHex for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.Octal.js b/trait.impl/core/fmt/trait.Octal.js new file mode 100644 index 0000000..089747e --- /dev/null +++ b/trait.impl/core/fmt/trait.Octal.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Octal for PTEFlags"],["impl Octal for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.UpperHex.js b/trait.impl/core/fmt/trait.UpperHex.js new file mode 100644 index 0000000..cbb38d3 --- /dev/null +++ b/trait.impl/core/fmt/trait.UpperHex.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl UpperHex for PTEFlags"],["impl UpperHex for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.Write.js b/trait.impl/core/fmt/trait.Write.js new file mode 100644 index 0000000..f2f5047 --- /dev/null +++ b/trait.impl/core/fmt/trait.Write.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Write for DebugConsole"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/hash/trait.Hash.js b/trait.impl/core/hash/trait.Hash.js new file mode 100644 index 0000000..3d9ddd7 --- /dev/null +++ b/trait.impl/core/hash/trait.Hash.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Hash for PTEFlags"],["impl Hash for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/iter/traits/collect/trait.Extend.js b/trait.impl/core/iter/traits/collect/trait.Extend.js new file mode 100644 index 0000000..b496cb5 --- /dev/null +++ b/trait.impl/core/iter/traits/collect/trait.Extend.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Extend<MappingFlags> for MappingFlags"],["impl Extend<PTEFlags> for PTEFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/iter/traits/collect/trait.FromIterator.js b/trait.impl/core/iter/traits/collect/trait.FromIterator.js new file mode 100644 index 0000000..2cdc97b --- /dev/null +++ b/trait.impl/core/iter/traits/collect/trait.FromIterator.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl FromIterator<PTEFlags> for PTEFlags"],["impl FromIterator<MappingFlags> for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/iter/traits/collect/trait.IntoIterator.js b/trait.impl/core/iter/traits/collect/trait.IntoIterator.js new file mode 100644 index 0000000..acbd5b0 --- /dev/null +++ b/trait.impl/core/iter/traits/collect/trait.IntoIterator.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl IntoIterator for PTEFlags"],["impl IntoIterator for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Copy.js b/trait.impl/core/marker/trait.Copy.js new file mode 100644 index 0000000..1aa7880 --- /dev/null +++ b/trait.impl/core/marker/trait.Copy.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Copy for PhysPage"],["impl Copy for PhysAddr"],["impl Copy for EscapeReason"],["impl Copy for VirtPage"],["impl Copy for PTEFlags"],["impl Copy for MappingFlags"],["impl Copy for VirtAddr"],["impl Copy for PageTable"],["impl Copy for TrapType"],["impl Copy for Time"],["impl Copy for IRQVector"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Freeze.js b/trait.impl/core/marker/trait.Freeze.js new file mode 100644 index 0000000..26ddda1 --- /dev/null +++ b/trait.impl/core/marker/trait.Freeze.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Freeze for PhysAddr",1,["polyhal::addr::PhysAddr"]],["impl Freeze for VirtAddr",1,["polyhal::addr::VirtAddr"]],["impl Freeze for PhysPage",1,["polyhal::addr::PhysPage"]],["impl Freeze for VirtPage",1,["polyhal::addr::VirtPage"]],["impl Freeze for DebugConsole",1,["polyhal::components::debug_console::DebugConsole"]],["impl Freeze for Instruction",1,["polyhal::components::instruction::Instruction"]],["impl Freeze for IRQ",1,["polyhal::components::irq::IRQ"]],["impl Freeze for IRQVector",1,["polyhal::components::irq::IRQVector"]],["impl Freeze for KContext",1,["polyhal::components::kcontext::riscv64::KContext"]],["impl Freeze for KContextArgs",1,["polyhal::components::kcontext::KContextArgs"]],["impl Freeze for Barrier",1,["polyhal::components::mem::Barrier"]],["impl Freeze for MultiCore",1,["polyhal::components::multicore::MultiCore"]],["impl Freeze for CpuCore",1,["polyhal::components::multicore::CpuCore"]],["impl Freeze for PTEFlags",1,["polyhal::components::pagetable::riscv64::PTEFlags"]],["impl Freeze for PageTable",1,["polyhal::components::pagetable::PageTable"]],["impl Freeze for MappingFlags",1,["polyhal::components::pagetable::MappingFlags"]],["impl Freeze for MappingSize",1,["polyhal::components::pagetable::MappingSize"]],["impl Freeze for TLB",1,["polyhal::components::pagetable::TLB"]],["impl Freeze for PageTableWrapper",1,["polyhal::components::pagetable::PageTableWrapper"]],["impl Freeze for TrapType",1,["polyhal::components::trap::TrapType"]],["impl Freeze for EscapeReason",1,["polyhal::components::trap::EscapeReason"]],["impl Freeze for TrapFrame",1,["polyhal::components::trapframe::riscv64::TrapFrame"]],["impl Freeze for KernelToken",1,["polyhal::components::trapframe::riscv64::KernelToken"]],["impl Freeze for TrapFrameArgs",1,["polyhal::components::trapframe::TrapFrameArgs"]],["impl Freeze for Time",1,["polyhal::time::Time"]],["impl<T> !Freeze for LazyInit<T>",1,["polyhal::utils::lazy_init::LazyInit"]],["impl<T> !Freeze for MutexNoIrq<T>",1,["polyhal::utils::mutex_no_irq::MutexNoIrq"]],["impl<'a, T: ?Sized> Freeze for MutexNoIrqGuard<'a, T>",1,["polyhal::utils::mutex_no_irq::MutexNoIrqGuard"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Send.js b/trait.impl/core/marker/trait.Send.js new file mode 100644 index 0000000..99c3f4b --- /dev/null +++ b/trait.impl/core/marker/trait.Send.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Send for PhysAddr",1,["polyhal::addr::PhysAddr"]],["impl Send for VirtAddr",1,["polyhal::addr::VirtAddr"]],["impl Send for PhysPage",1,["polyhal::addr::PhysPage"]],["impl Send for VirtPage",1,["polyhal::addr::VirtPage"]],["impl Send for DebugConsole",1,["polyhal::components::debug_console::DebugConsole"]],["impl Send for Instruction",1,["polyhal::components::instruction::Instruction"]],["impl Send for IRQ",1,["polyhal::components::irq::IRQ"]],["impl Send for IRQVector",1,["polyhal::components::irq::IRQVector"]],["impl Send for KContext",1,["polyhal::components::kcontext::riscv64::KContext"]],["impl Send for KContextArgs",1,["polyhal::components::kcontext::KContextArgs"]],["impl Send for Barrier",1,["polyhal::components::mem::Barrier"]],["impl Send for MultiCore",1,["polyhal::components::multicore::MultiCore"]],["impl Send for CpuCore",1,["polyhal::components::multicore::CpuCore"]],["impl Send for PTEFlags",1,["polyhal::components::pagetable::riscv64::PTEFlags"]],["impl Send for PageTable",1,["polyhal::components::pagetable::PageTable"]],["impl Send for MappingFlags",1,["polyhal::components::pagetable::MappingFlags"]],["impl Send for MappingSize",1,["polyhal::components::pagetable::MappingSize"]],["impl Send for TLB",1,["polyhal::components::pagetable::TLB"]],["impl Send for PageTableWrapper",1,["polyhal::components::pagetable::PageTableWrapper"]],["impl Send for TrapType",1,["polyhal::components::trap::TrapType"]],["impl Send for EscapeReason",1,["polyhal::components::trap::EscapeReason"]],["impl Send for TrapFrame",1,["polyhal::components::trapframe::riscv64::TrapFrame"]],["impl Send for KernelToken",1,["polyhal::components::trapframe::riscv64::KernelToken"]],["impl Send for TrapFrameArgs",1,["polyhal::components::trapframe::TrapFrameArgs"]],["impl Send for Time",1,["polyhal::time::Time"]],["impl<'a, T: ?Sized> Send for MutexNoIrqGuard<'a, T>where\n T: Send,",1,["polyhal::utils::mutex_no_irq::MutexNoIrqGuard"]],["impl<T: Send> Send for LazyInit<T>"],["impl<T: ?Sized + Send> Send for MutexNoIrq<T>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.StructuralEq.js b/trait.impl/core/marker/trait.StructuralEq.js new file mode 100644 index 0000000..d6a9ce5 --- /dev/null +++ b/trait.impl/core/marker/trait.StructuralEq.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl StructuralEq for EscapeReason"],["impl StructuralEq for PTEFlags"],["impl StructuralEq for PhysPage"],["impl StructuralEq for VirtAddr"],["impl StructuralEq for MappingFlags"],["impl StructuralEq for VirtPage"],["impl StructuralEq for PhysAddr"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.StructuralPartialEq.js b/trait.impl/core/marker/trait.StructuralPartialEq.js new file mode 100644 index 0000000..802924a --- /dev/null +++ b/trait.impl/core/marker/trait.StructuralPartialEq.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl StructuralPartialEq for PhysPage"],["impl StructuralPartialEq for PTEFlags"],["impl StructuralPartialEq for PhysAddr"],["impl StructuralPartialEq for EscapeReason"],["impl StructuralPartialEq for VirtAddr"],["impl StructuralPartialEq for MappingFlags"],["impl StructuralPartialEq for VirtPage"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Sync.js b/trait.impl/core/marker/trait.Sync.js new file mode 100644 index 0000000..dc040a9 --- /dev/null +++ b/trait.impl/core/marker/trait.Sync.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Sync for PhysAddr",1,["polyhal::addr::PhysAddr"]],["impl Sync for VirtAddr",1,["polyhal::addr::VirtAddr"]],["impl Sync for PhysPage",1,["polyhal::addr::PhysPage"]],["impl Sync for VirtPage",1,["polyhal::addr::VirtPage"]],["impl Sync for DebugConsole",1,["polyhal::components::debug_console::DebugConsole"]],["impl Sync for Instruction",1,["polyhal::components::instruction::Instruction"]],["impl Sync for IRQ",1,["polyhal::components::irq::IRQ"]],["impl Sync for IRQVector",1,["polyhal::components::irq::IRQVector"]],["impl Sync for KContext",1,["polyhal::components::kcontext::riscv64::KContext"]],["impl Sync for KContextArgs",1,["polyhal::components::kcontext::KContextArgs"]],["impl Sync for Barrier",1,["polyhal::components::mem::Barrier"]],["impl Sync for MultiCore",1,["polyhal::components::multicore::MultiCore"]],["impl Sync for CpuCore",1,["polyhal::components::multicore::CpuCore"]],["impl Sync for PTEFlags",1,["polyhal::components::pagetable::riscv64::PTEFlags"]],["impl Sync for PageTable",1,["polyhal::components::pagetable::PageTable"]],["impl Sync for MappingFlags",1,["polyhal::components::pagetable::MappingFlags"]],["impl Sync for MappingSize",1,["polyhal::components::pagetable::MappingSize"]],["impl Sync for TLB",1,["polyhal::components::pagetable::TLB"]],["impl Sync for PageTableWrapper",1,["polyhal::components::pagetable::PageTableWrapper"]],["impl Sync for TrapType",1,["polyhal::components::trap::TrapType"]],["impl Sync for EscapeReason",1,["polyhal::components::trap::EscapeReason"]],["impl Sync for TrapFrame",1,["polyhal::components::trapframe::riscv64::TrapFrame"]],["impl Sync for KernelToken",1,["polyhal::components::trapframe::riscv64::KernelToken"]],["impl Sync for TrapFrameArgs",1,["polyhal::components::trapframe::TrapFrameArgs"]],["impl Sync for Time",1,["polyhal::time::Time"]],["impl<'a, T: ?Sized> Sync for MutexNoIrqGuard<'a, T>where\n T: Sync,",1,["polyhal::utils::mutex_no_irq::MutexNoIrqGuard"]],["impl<T: Send + Sync> Sync for LazyInit<T>"],["impl<T: ?Sized + Send> Sync for MutexNoIrq<T>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Unpin.js b/trait.impl/core/marker/trait.Unpin.js new file mode 100644 index 0000000..57cae5c --- /dev/null +++ b/trait.impl/core/marker/trait.Unpin.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Unpin for PhysAddr",1,["polyhal::addr::PhysAddr"]],["impl Unpin for VirtAddr",1,["polyhal::addr::VirtAddr"]],["impl Unpin for PhysPage",1,["polyhal::addr::PhysPage"]],["impl Unpin for VirtPage",1,["polyhal::addr::VirtPage"]],["impl Unpin for DebugConsole",1,["polyhal::components::debug_console::DebugConsole"]],["impl Unpin for Instruction",1,["polyhal::components::instruction::Instruction"]],["impl Unpin for IRQ",1,["polyhal::components::irq::IRQ"]],["impl Unpin for IRQVector",1,["polyhal::components::irq::IRQVector"]],["impl Unpin for KContext",1,["polyhal::components::kcontext::riscv64::KContext"]],["impl Unpin for KContextArgs",1,["polyhal::components::kcontext::KContextArgs"]],["impl Unpin for Barrier",1,["polyhal::components::mem::Barrier"]],["impl Unpin for MultiCore",1,["polyhal::components::multicore::MultiCore"]],["impl Unpin for CpuCore",1,["polyhal::components::multicore::CpuCore"]],["impl Unpin for PTEFlags",1,["polyhal::components::pagetable::riscv64::PTEFlags"]],["impl Unpin for PageTable",1,["polyhal::components::pagetable::PageTable"]],["impl Unpin for MappingFlags",1,["polyhal::components::pagetable::MappingFlags"]],["impl Unpin for MappingSize",1,["polyhal::components::pagetable::MappingSize"]],["impl Unpin for TLB",1,["polyhal::components::pagetable::TLB"]],["impl Unpin for PageTableWrapper",1,["polyhal::components::pagetable::PageTableWrapper"]],["impl Unpin for TrapType",1,["polyhal::components::trap::TrapType"]],["impl Unpin for EscapeReason",1,["polyhal::components::trap::EscapeReason"]],["impl Unpin for TrapFrame",1,["polyhal::components::trapframe::riscv64::TrapFrame"]],["impl Unpin for KernelToken",1,["polyhal::components::trapframe::riscv64::KernelToken"]],["impl Unpin for TrapFrameArgs",1,["polyhal::components::trapframe::TrapFrameArgs"]],["impl Unpin for Time",1,["polyhal::time::Time"]],["impl<T> Unpin for LazyInit<T>where\n T: Unpin,",1,["polyhal::utils::lazy_init::LazyInit"]],["impl<T: ?Sized> Unpin for MutexNoIrq<T>where\n T: Unpin,",1,["polyhal::utils::mutex_no_irq::MutexNoIrq"]],["impl<'a, T: ?Sized> Unpin for MutexNoIrqGuard<'a, T>",1,["polyhal::utils::mutex_no_irq::MutexNoIrqGuard"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/arith/trait.Add.js b/trait.impl/core/ops/arith/trait.Add.js new file mode 100644 index 0000000..d5c72b5 --- /dev/null +++ b/trait.impl/core/ops/arith/trait.Add.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Add for PhysPage"],["impl Add<usize> for VirtPage"],["impl Add<usize> for PhysPage"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/arith/trait.Sub.js b/trait.impl/core/ops/arith/trait.Sub.js new file mode 100644 index 0000000..274e8cf --- /dev/null +++ b/trait.impl/core/ops/arith/trait.Sub.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Sub for PTEFlags"],["impl Sub for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/arith/trait.SubAssign.js b/trait.impl/core/ops/arith/trait.SubAssign.js new file mode 100644 index 0000000..f06aaa8 --- /dev/null +++ b/trait.impl/core/ops/arith/trait.SubAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl SubAssign for MappingFlags"],["impl SubAssign for PTEFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/bit/trait.BitAnd.js b/trait.impl/core/ops/bit/trait.BitAnd.js new file mode 100644 index 0000000..c9a8e0b --- /dev/null +++ b/trait.impl/core/ops/bit/trait.BitAnd.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl BitAnd for MappingFlags"],["impl BitAnd for PTEFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/bit/trait.BitAndAssign.js b/trait.impl/core/ops/bit/trait.BitAndAssign.js new file mode 100644 index 0000000..4dfa9cc --- /dev/null +++ b/trait.impl/core/ops/bit/trait.BitAndAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl BitAndAssign for PTEFlags"],["impl BitAndAssign for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/bit/trait.BitOr.js b/trait.impl/core/ops/bit/trait.BitOr.js new file mode 100644 index 0000000..60df5f4 --- /dev/null +++ b/trait.impl/core/ops/bit/trait.BitOr.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl BitOr for PTEFlags"],["impl BitOr for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/bit/trait.BitOrAssign.js b/trait.impl/core/ops/bit/trait.BitOrAssign.js new file mode 100644 index 0000000..159659e --- /dev/null +++ b/trait.impl/core/ops/bit/trait.BitOrAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl BitOrAssign for PTEFlags"],["impl BitOrAssign for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/bit/trait.BitXor.js b/trait.impl/core/ops/bit/trait.BitXor.js new file mode 100644 index 0000000..2e3d729 --- /dev/null +++ b/trait.impl/core/ops/bit/trait.BitXor.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl BitXor for PTEFlags"],["impl BitXor for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/bit/trait.BitXorAssign.js b/trait.impl/core/ops/bit/trait.BitXorAssign.js new file mode 100644 index 0000000..757d442 --- /dev/null +++ b/trait.impl/core/ops/bit/trait.BitXorAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl BitXorAssign for MappingFlags"],["impl BitXorAssign for PTEFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/bit/trait.Not.js b/trait.impl/core/ops/bit/trait.Not.js new file mode 100644 index 0000000..6850590 --- /dev/null +++ b/trait.impl/core/ops/bit/trait.Not.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Not for PTEFlags"],["impl Not for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/deref/trait.Deref.js b/trait.impl/core/ops/deref/trait.Deref.js new file mode 100644 index 0000000..a25f12e --- /dev/null +++ b/trait.impl/core/ops/deref/trait.Deref.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl<'a, T: ?Sized> Deref for MutexNoIrqGuard<'a, T>"],["impl<T> Deref for LazyInit<T>"],["impl Deref for PageTableWrapper"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/deref/trait.DerefMut.js b/trait.impl/core/ops/deref/trait.DerefMut.js new file mode 100644 index 0000000..2c0788f --- /dev/null +++ b/trait.impl/core/ops/deref/trait.DerefMut.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl<T> DerefMut for LazyInit<T>"],["impl<'a, T: ?Sized> DerefMut for MutexNoIrqGuard<'a, T>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/drop/trait.Drop.js b/trait.impl/core/ops/drop/trait.Drop.js new file mode 100644 index 0000000..23946fa --- /dev/null +++ b/trait.impl/core/ops/drop/trait.Drop.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl<T> Drop for LazyInit<T>"],["impl Drop for PageTableWrapper"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/index/trait.Index.js b/trait.impl/core/ops/index/trait.Index.js new file mode 100644 index 0000000..be0b7c9 --- /dev/null +++ b/trait.impl/core/ops/index/trait.Index.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Index<TrapFrameArgs> for TrapFrame"],["impl Index<KContextArgs> for KContext"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/index/trait.IndexMut.js b/trait.impl/core/ops/index/trait.IndexMut.js new file mode 100644 index 0000000..861f748 --- /dev/null +++ b/trait.impl/core/ops/index/trait.IndexMut.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl IndexMut<KContextArgs> for KContext"],["impl IndexMut<TrapFrameArgs> for TrapFrame"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js b/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js new file mode 100644 index 0000000..cfcc9f1 --- /dev/null +++ b/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl RefUnwindSafe for PhysAddr",1,["polyhal::addr::PhysAddr"]],["impl RefUnwindSafe for VirtAddr",1,["polyhal::addr::VirtAddr"]],["impl RefUnwindSafe for PhysPage",1,["polyhal::addr::PhysPage"]],["impl RefUnwindSafe for VirtPage",1,["polyhal::addr::VirtPage"]],["impl RefUnwindSafe for DebugConsole",1,["polyhal::components::debug_console::DebugConsole"]],["impl RefUnwindSafe for Instruction",1,["polyhal::components::instruction::Instruction"]],["impl RefUnwindSafe for IRQ",1,["polyhal::components::irq::IRQ"]],["impl RefUnwindSafe for IRQVector",1,["polyhal::components::irq::IRQVector"]],["impl RefUnwindSafe for KContext",1,["polyhal::components::kcontext::riscv64::KContext"]],["impl RefUnwindSafe for KContextArgs",1,["polyhal::components::kcontext::KContextArgs"]],["impl RefUnwindSafe for Barrier",1,["polyhal::components::mem::Barrier"]],["impl RefUnwindSafe for MultiCore",1,["polyhal::components::multicore::MultiCore"]],["impl RefUnwindSafe for CpuCore",1,["polyhal::components::multicore::CpuCore"]],["impl RefUnwindSafe for PTEFlags",1,["polyhal::components::pagetable::riscv64::PTEFlags"]],["impl RefUnwindSafe for PageTable",1,["polyhal::components::pagetable::PageTable"]],["impl RefUnwindSafe for MappingFlags",1,["polyhal::components::pagetable::MappingFlags"]],["impl RefUnwindSafe for MappingSize",1,["polyhal::components::pagetable::MappingSize"]],["impl RefUnwindSafe for TLB",1,["polyhal::components::pagetable::TLB"]],["impl RefUnwindSafe for PageTableWrapper",1,["polyhal::components::pagetable::PageTableWrapper"]],["impl RefUnwindSafe for TrapType",1,["polyhal::components::trap::TrapType"]],["impl RefUnwindSafe for EscapeReason",1,["polyhal::components::trap::EscapeReason"]],["impl RefUnwindSafe for TrapFrame",1,["polyhal::components::trapframe::riscv64::TrapFrame"]],["impl RefUnwindSafe for KernelToken",1,["polyhal::components::trapframe::riscv64::KernelToken"]],["impl RefUnwindSafe for TrapFrameArgs",1,["polyhal::components::trapframe::TrapFrameArgs"]],["impl RefUnwindSafe for Time",1,["polyhal::time::Time"]],["impl<T> !RefUnwindSafe for LazyInit<T>",1,["polyhal::utils::lazy_init::LazyInit"]],["impl<T> !RefUnwindSafe for MutexNoIrq<T>",1,["polyhal::utils::mutex_no_irq::MutexNoIrq"]],["impl<'a, T: ?Sized> RefUnwindSafe for MutexNoIrqGuard<'a, T>where\n T: RefUnwindSafe,",1,["polyhal::utils::mutex_no_irq::MutexNoIrqGuard"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js b/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js new file mode 100644 index 0000000..dbe07a0 --- /dev/null +++ b/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl UnwindSafe for PhysAddr",1,["polyhal::addr::PhysAddr"]],["impl UnwindSafe for VirtAddr",1,["polyhal::addr::VirtAddr"]],["impl UnwindSafe for PhysPage",1,["polyhal::addr::PhysPage"]],["impl UnwindSafe for VirtPage",1,["polyhal::addr::VirtPage"]],["impl UnwindSafe for DebugConsole",1,["polyhal::components::debug_console::DebugConsole"]],["impl UnwindSafe for Instruction",1,["polyhal::components::instruction::Instruction"]],["impl UnwindSafe for IRQ",1,["polyhal::components::irq::IRQ"]],["impl UnwindSafe for IRQVector",1,["polyhal::components::irq::IRQVector"]],["impl UnwindSafe for KContext",1,["polyhal::components::kcontext::riscv64::KContext"]],["impl UnwindSafe for KContextArgs",1,["polyhal::components::kcontext::KContextArgs"]],["impl UnwindSafe for Barrier",1,["polyhal::components::mem::Barrier"]],["impl UnwindSafe for MultiCore",1,["polyhal::components::multicore::MultiCore"]],["impl UnwindSafe for CpuCore",1,["polyhal::components::multicore::CpuCore"]],["impl UnwindSafe for PTEFlags",1,["polyhal::components::pagetable::riscv64::PTEFlags"]],["impl UnwindSafe for PageTable",1,["polyhal::components::pagetable::PageTable"]],["impl UnwindSafe for MappingFlags",1,["polyhal::components::pagetable::MappingFlags"]],["impl UnwindSafe for MappingSize",1,["polyhal::components::pagetable::MappingSize"]],["impl UnwindSafe for TLB",1,["polyhal::components::pagetable::TLB"]],["impl UnwindSafe for PageTableWrapper",1,["polyhal::components::pagetable::PageTableWrapper"]],["impl UnwindSafe for TrapType",1,["polyhal::components::trap::TrapType"]],["impl UnwindSafe for EscapeReason",1,["polyhal::components::trap::EscapeReason"]],["impl UnwindSafe for TrapFrame",1,["polyhal::components::trapframe::riscv64::TrapFrame"]],["impl UnwindSafe for KernelToken",1,["polyhal::components::trapframe::riscv64::KernelToken"]],["impl UnwindSafe for TrapFrameArgs",1,["polyhal::components::trapframe::TrapFrameArgs"]],["impl UnwindSafe for Time",1,["polyhal::time::Time"]],["impl<T> UnwindSafe for LazyInit<T>where\n T: UnwindSafe,",1,["polyhal::utils::lazy_init::LazyInit"]],["impl<T: ?Sized> UnwindSafe for MutexNoIrq<T>where\n T: UnwindSafe,",1,["polyhal::utils::mutex_no_irq::MutexNoIrq"]],["impl<'a, T: ?Sized> UnwindSafe for MutexNoIrqGuard<'a, T>where\n T: RefUnwindSafe,",1,["polyhal::utils::mutex_no_irq::MutexNoIrqGuard"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/log/trait.Log.js b/trait.impl/log/trait.Log.js new file mode 100644 index 0000000..11c9234 --- /dev/null +++ b/trait.impl/log/trait.Log.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"polyhal":[["impl Log for DebugConsole"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file