Expand description
This crate provides an abstraction over multiboot2 and UEFI boot +
Expand description
This crate provides an abstraction over multiboot2 and UEFI boot information.
It allows the kernel’s initialisation to be the same, regardless of whether it was booted using BIOS or UEFI.
diff --git a/doc/boot_info/multiboot2/index.html b/doc/boot_info/multiboot2/index.html index 5419ca1862..02dd851f65 100644 --- a/doc/boot_info/multiboot2/index.html +++ b/doc/boot_info/multiboot2/index.html @@ -1 +1 @@ -Module boot_info::multiboot2
source · Structs
Module boot_info::multiboot2
source · Structs
Struct boot_info::ElfSectionFlags
source · pub struct ElfSectionFlags { /* private fields */ }
Expand description
ELF section flags.
-Implementations§
source§impl ElfSectionFlags
impl ElfSectionFlags
sourcepub const WRITABLE: Self = _
pub const WRITABLE: Self = _
The section contains data that should be writable during program execution.
-sourcepub const EXECUTABLE: Self = _
pub const EXECUTABLE: Self = _
The section contains executable machine instructions.
-sourcepub const fn from_bits(bits: u64) -> Option<Self>
pub const fn from_bits(bits: u64) -> Option<Self>
Convert from underlying bit representation, unless that +
Struct boot_info::ElfSectionFlags
source · pub struct ElfSectionFlags { /* private fields */ }
Expand description
ELF section flags.
+Implementations§
source§impl ElfSectionFlags
impl ElfSectionFlags
sourcepub const WRITABLE: Self = _
pub const WRITABLE: Self = _
The section contains data that should be writable during program execution.
+sourcepub const EXECUTABLE: Self = _
pub const EXECUTABLE: Self = _
The section contains executable machine instructions.
+sourcepub const fn from_bits(bits: u64) -> Option<Self>
pub const fn from_bits(bits: u64) -> Option<Self>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
-sourcepub const fn from_bits_truncate(bits: u64) -> Self
pub const fn from_bits_truncate(bits: u64) -> Self
Convert from underlying bit representation, dropping any bits +
sourcepub const fn from_bits_truncate(bits: u64) -> Self
pub const fn from_bits_truncate(bits: u64) -> Self
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
-sourcepub const unsafe fn from_bits_unchecked(bits: u64) -> Self
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self
Convert from underlying bit representation, preserving all +
sourcepub const unsafe fn from_bits_unchecked(bits: u64) -> Self
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
Safety
The caller of the bitflags!
macro can chose to allow or
@@ -17,35 +17,35 @@
Safety
The caller of from_bits_unchecked()
has to ensure that
all bits correspond to a defined flag or that extra bits
are valid for this bitflags type.
sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Returns true
if there are flags common to both self
and other
.
sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Returns true
if all of the flags in other
are contained within self
.
sourcepub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Inserts or removes the specified flags depending on the passed value.
-sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
Returns the intersection between the flags in self
and
+
sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Returns true
if there are flags common to both self
and other
.
sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Returns true
if all of the flags in other
are contained within self
.
sourcepub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Inserts or removes the specified flags depending on the passed value.
+sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
Returns the intersection between the flags in self
and
other
.
Specifically, the returned set contains only the flags which are
present in both self
and other
.
This is equivalent to using the &
operator (e.g.
ops::BitAnd
), as in flags & other
.
sourcepub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
Returns the union of between the flags in self
and other
.
sourcepub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
Returns the union of between the flags in self
and other
.
Specifically, the returned set contains all flags which are
present in either self
or other
, including any which are
present in both (see Self::symmetric_difference
if that
is undesirable).
This is equivalent to using the |
operator (e.g.
ops::BitOr
), as in flags | other
.
sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
Returns the difference between the flags in self
and other
.
sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
Returns the difference between the flags in self
and other
.
Specifically, the returned set contains all flags present in
self
, except for the ones present in other
.
It is also conceptually equivalent to the “bit-clear” operation:
flags & !other
(and this syntax is also supported).
This is equivalent to using the -
operator (e.g.
ops::Sub
), as in flags - other
.
sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
Returns the symmetric difference between the flags +
sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
Returns the symmetric difference between the flags
in self
and other
.
Specifically, the returned set contains the flags present which
are present in self
or other
, but that are not present in
@@ -53,27 +53,27 @@
Safety
one of the setsself
and other
.
This is equivalent to using the ^
operator (e.g.
ops::BitXor
), as in flags ^ other
.
sourcepub const fn complement(self) -> Self
pub const fn complement(self) -> Self
Returns the complement of this set of flags.
+sourcepub const fn complement(self) -> Self
pub const fn complement(self) -> Self
Returns the complement of this set of flags.
Specifically, the returned set contains all the flags which are
not set in self
, but which are allowed for this type.
Alternatively, it can be thought of as the set difference
between Self::all()
and self
(e.g. Self::all() - self
)
This is equivalent to using the !
operator (e.g.
ops::Not
), as in !flags
.
Trait Implementations§
source§impl Binary for ElfSectionFlags
impl Binary for ElfSectionFlags
source§impl BitAnd<ElfSectionFlags> for ElfSectionFlags
impl BitAnd<ElfSectionFlags> for ElfSectionFlags
source§impl BitAndAssign<ElfSectionFlags> for ElfSectionFlags
impl BitAndAssign<ElfSectionFlags> for ElfSectionFlags
source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
Disables all flags disabled in the set.
-source§impl BitOr<ElfSectionFlags> for ElfSectionFlags
impl BitOr<ElfSectionFlags> for ElfSectionFlags
source§fn bitor(self, other: ElfSectionFlags) -> Self
fn bitor(self, other: ElfSectionFlags) -> Self
Returns the union of the two sets of flags.
-§type Output = ElfSectionFlags
type Output = ElfSectionFlags
|
operator.source§impl BitOrAssign<ElfSectionFlags> for ElfSectionFlags
impl BitOrAssign<ElfSectionFlags> for ElfSectionFlags
source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Adds the set of flags.
-source§impl BitXor<ElfSectionFlags> for ElfSectionFlags
impl BitXor<ElfSectionFlags> for ElfSectionFlags
source§impl BitXorAssign<ElfSectionFlags> for ElfSectionFlags
impl BitXorAssign<ElfSectionFlags> for ElfSectionFlags
source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
Toggles the set of flags.
-source§impl Clone for ElfSectionFlags
impl Clone for ElfSectionFlags
source§fn clone(&self) -> ElfSectionFlags
fn clone(&self) -> ElfSectionFlags
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ElfSectionFlags
impl Debug for ElfSectionFlags
source§impl Extend<ElfSectionFlags> for ElfSectionFlags
impl Extend<ElfSectionFlags> for ElfSectionFlags
source§fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)source§impl FromIterator<ElfSectionFlags> for ElfSectionFlags
impl FromIterator<ElfSectionFlags> for ElfSectionFlags
source§fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
source§impl Hash for ElfSectionFlags
impl Hash for ElfSectionFlags
source§impl LowerHex for ElfSectionFlags
impl LowerHex for ElfSectionFlags
source§impl Not for ElfSectionFlags
impl Not for ElfSectionFlags
source§impl Octal for ElfSectionFlags
impl Octal for ElfSectionFlags
source§impl Ord for ElfSectionFlags
impl Ord for ElfSectionFlags
source§fn cmp(&self, other: &ElfSectionFlags) -> Ordering
fn cmp(&self, other: &ElfSectionFlags) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq<ElfSectionFlags> for ElfSectionFlags
impl PartialEq<ElfSectionFlags> for ElfSectionFlags
source§fn eq(&self, other: &ElfSectionFlags) -> bool
fn eq(&self, other: &ElfSectionFlags) -> bool
self
and other
values to be equal, and is used
+Trait Implementations§
source§impl Binary for ElfSectionFlags
impl Binary for ElfSectionFlags
source§impl BitAnd<ElfSectionFlags> for ElfSectionFlags
impl BitAnd<ElfSectionFlags> for ElfSectionFlags
source§impl BitAndAssign<ElfSectionFlags> for ElfSectionFlags
impl BitAndAssign<ElfSectionFlags> for ElfSectionFlags
source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
Disables all flags disabled in the set.
+source§impl BitOr<ElfSectionFlags> for ElfSectionFlags
impl BitOr<ElfSectionFlags> for ElfSectionFlags
source§fn bitor(self, other: ElfSectionFlags) -> Self
fn bitor(self, other: ElfSectionFlags) -> Self
Returns the union of the two sets of flags.
+§type Output = ElfSectionFlags
type Output = ElfSectionFlags
|
operator.source§impl BitOrAssign<ElfSectionFlags> for ElfSectionFlags
impl BitOrAssign<ElfSectionFlags> for ElfSectionFlags
source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Adds the set of flags.
+source§impl BitXor<ElfSectionFlags> for ElfSectionFlags
impl BitXor<ElfSectionFlags> for ElfSectionFlags
source§impl BitXorAssign<ElfSectionFlags> for ElfSectionFlags
impl BitXorAssign<ElfSectionFlags> for ElfSectionFlags
source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
Toggles the set of flags.
+source§impl Clone for ElfSectionFlags
impl Clone for ElfSectionFlags
source§fn clone(&self) -> ElfSectionFlags
fn clone(&self) -> ElfSectionFlags
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ElfSectionFlags
impl Debug for ElfSectionFlags
source§impl Extend<ElfSectionFlags> for ElfSectionFlags
impl Extend<ElfSectionFlags> for ElfSectionFlags
source§fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)source§impl FromIterator<ElfSectionFlags> for ElfSectionFlags
impl FromIterator<ElfSectionFlags> for ElfSectionFlags
source§fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
source§impl Hash for ElfSectionFlags
impl Hash for ElfSectionFlags
source§impl LowerHex for ElfSectionFlags
impl LowerHex for ElfSectionFlags
source§impl Not for ElfSectionFlags
impl Not for ElfSectionFlags
source§impl Octal for ElfSectionFlags
impl Octal for ElfSectionFlags
source§impl Ord for ElfSectionFlags
impl Ord for ElfSectionFlags
source§fn cmp(&self, other: &ElfSectionFlags) -> Ordering
fn cmp(&self, other: &ElfSectionFlags) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq<ElfSectionFlags> for ElfSectionFlags
impl PartialEq<ElfSectionFlags> for ElfSectionFlags
source§fn eq(&self, other: &ElfSectionFlags) -> bool
fn eq(&self, other: &ElfSectionFlags) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<ElfSectionFlags> for ElfSectionFlags
impl PartialOrd<ElfSectionFlags> for ElfSectionFlags
source§impl PartialOrd<ElfSectionFlags> for ElfSectionFlags
impl PartialOrd<ElfSectionFlags> for ElfSectionFlags
source§fn partial_cmp(&self, other: &ElfSectionFlags) -> Option<Ordering>
fn partial_cmp(&self, other: &ElfSectionFlags) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Sub<ElfSectionFlags> for ElfSectionFlags
impl Sub<ElfSectionFlags> for ElfSectionFlags
source§impl SubAssign<ElfSectionFlags> for ElfSectionFlags
impl SubAssign<ElfSectionFlags> for ElfSectionFlags
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Disables all flags enabled in the set.
-source§impl UpperHex for ElfSectionFlags
impl UpperHex for ElfSectionFlags
impl Copy for ElfSectionFlags
impl Eq for ElfSectionFlags
impl StructuralEq for ElfSectionFlags
impl StructuralPartialEq for ElfSectionFlags
Auto Trait Implementations§
impl RefUnwindSafe for ElfSectionFlags
impl Send for ElfSectionFlags
impl Sync for ElfSectionFlags
impl Unpin for ElfSectionFlags
impl UnwindSafe for ElfSectionFlags
Blanket Implementations§
source§impl Sub<ElfSectionFlags> for ElfSectionFlags
impl Sub<ElfSectionFlags> for ElfSectionFlags
source§impl SubAssign<ElfSectionFlags> for ElfSectionFlags
impl SubAssign<ElfSectionFlags> for ElfSectionFlags
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Disables all flags enabled in the set.
+source§impl UpperHex for ElfSectionFlags
impl UpperHex for ElfSectionFlags
impl Copy for ElfSectionFlags
impl Eq for ElfSectionFlags
impl StructuralEq for ElfSectionFlags
impl StructuralPartialEq for ElfSectionFlags
Auto Trait Implementations§
impl RefUnwindSafe for ElfSectionFlags
impl Send for ElfSectionFlags
impl Sync for ElfSectionFlags
impl Unpin for ElfSectionFlags
impl UnwindSafe for ElfSectionFlags
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · source§fn into(self) -> U
fn into(self) -> U
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
Struct boot_info::ReservedMemoryRegion
source · pub struct ReservedMemoryRegion {
+ReservedMemoryRegion in boot_info - Rust Struct boot_info::ReservedMemoryRegion
source · pub struct ReservedMemoryRegion {
pub start: PhysicalAddress,
pub len: usize,
-}
Fields§
§start: PhysicalAddress
§len: usize
Trait Implementations§
Auto Trait Implementations§
§impl RefUnwindSafe for ReservedMemoryRegion
§impl Send for ReservedMemoryRegion
§impl Sync for ReservedMemoryRegion
§impl Unpin for ReservedMemoryRegion
§impl UnwindSafe for ReservedMemoryRegion
Blanket Implementations§
source§impl<T> From<T> for T
const: unstable · source§fn from(t: T) -> T
Returns the argument unchanged.
+}Fields§
§start: PhysicalAddress
§len: usize
Trait Implementations§
Auto Trait Implementations§
§impl RefUnwindSafe for ReservedMemoryRegion
§impl Send for ReservedMemoryRegion
§impl Sync for ReservedMemoryRegion
§impl Unpin for ReservedMemoryRegion
§impl UnwindSafe for ReservedMemoryRegion
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · 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.
diff --git a/doc/boot_info/trait.BootInformation.html b/doc/boot_info/trait.BootInformation.html
index 767d5f264a..87853b1110 100644
--- a/doc/boot_info/trait.BootInformation.html
+++ b/doc/boot_info/trait.BootInformation.html
@@ -1,4 +1,4 @@
-BootInformation in boot_info - Rust Trait boot_info::BootInformation
source · pub trait BootInformation: 'static {
+BootInformation in boot_info - Rust Trait boot_info::BootInformation
source · pub trait BootInformation: 'static {
type MemoryRegion<'a>: MemoryRegion;
type MemoryRegions<'a>: Iterator<Item = Self::MemoryRegion<'a>>;
type ElfSection<'a>: ElfSection;
@@ -13,20 +13,20 @@
fn elf_sections(&self) -> Result<Self::ElfSections<'_>, &'static str>;
fn modules(&self) -> Self::Modules<'_>;
fn additional_reserved_memory_regions(
&self
) -> Result<Self::AdditionalReservedMemoryRegions, &'static str>;
- fn kernel_end(&self) -> Result<PhysicalAddress, &'static str>;
+ fn kernel_end(&self) -> Result<VirtualAddress, &'static str>;
fn rsdp(&self) -> Option<PhysicalAddress>;
fn stack_size(&self) -> Result<usize, &'static str>;
fn is_empty(&self) -> bool { ... }
-}
Required Associated Types§
sourcetype MemoryRegion<'a>: MemoryRegion
sourcetype MemoryRegions<'a>: Iterator<Item = Self::MemoryRegion<'a>>
sourcetype ElfSection<'a>: ElfSection
sourcetype ElfSections<'a>: Iterator<Item = Self::ElfSection<'a>>
sourcetype Module<'a>: Module
sourcetype Modules<'a>: Iterator<Item = Self::Module<'a>>
sourcetype AdditionalReservedMemoryRegions: Iterator<Item = ReservedMemoryRegion>
Required Methods§
sourcefn start(&self) -> Option<VirtualAddress>
Returns the boot information’s starting virtual address.
-sourcefn memory_regions(&self) -> Result<Self::MemoryRegions<'_>, &'static str>
Returns memory regions describing the physical memory.
-sourcefn elf_sections(&self) -> Result<Self::ElfSections<'_>, &'static str>
Returns the kernel’s ELF sections.
-sourcefn additional_reserved_memory_regions(
&self
) -> Result<Self::AdditionalReservedMemoryRegions, &'static str>
Returns additional reserved memory regions that aren’t included in
+}
Required Associated Types§
sourcetype MemoryRegion<'a>: MemoryRegion
sourcetype MemoryRegions<'a>: Iterator<Item = Self::MemoryRegion<'a>>
sourcetype ElfSection<'a>: ElfSection
sourcetype ElfSections<'a>: Iterator<Item = Self::ElfSection<'a>>
sourcetype Module<'a>: Module
sourcetype Modules<'a>: Iterator<Item = Self::Module<'a>>
sourcetype AdditionalReservedMemoryRegions: Iterator<Item = ReservedMemoryRegion>
Required Methods§
sourcefn start(&self) -> Option<VirtualAddress>
Returns the boot information’s starting virtual address.
+sourcefn memory_regions(&self) -> Result<Self::MemoryRegions<'_>, &'static str>
Returns memory regions describing the physical memory.
+sourcefn elf_sections(&self) -> Result<Self::ElfSections<'_>, &'static str>
Returns the kernel’s ELF sections.
+sourcefn additional_reserved_memory_regions(
&self
) -> Result<Self::AdditionalReservedMemoryRegions, &'static str>
Returns additional reserved memory regions that aren’t included in
the list of regions returned by [memory_regions
].
-sourcefn kernel_end(&self) -> Result<PhysicalAddress, &'static str>
Returns the end of the kernel’s image in physical memory.
-sourcefn rsdp(&self) -> Option<PhysicalAddress>
Returns the RSDP if it was provided by the bootloader.
-sourcefn stack_size(&self) -> Result<usize, &'static str>
Returns the stack size in bytes.
-Provided Methods§
Implementations on Foreign Types§
source§impl BootInformation for BootInformation
§type MemoryRegion<'a> = &'a MemoryArea
§type MemoryRegions<'a> = MemoryRegions<'a>
§type ElfSection<'a> = ElfSection
§type ElfSections<'a> = ElfSectionIter
§type Module<'a> = &'a ModuleTag
§type Modules<'a> = ModuleIter<'a>
§type AdditionalReservedMemoryRegions = IntoIter<ReservedMemoryRegion, 3>
source§fn start(&self) -> Option<VirtualAddress>
source§fn len(&self) -> usize
source§fn memory_regions(&self) -> Result<Self::MemoryRegions<'_>, &'static str>
source§fn elf_sections(&self) -> Result<Self::ElfSections<'static>, &'static str>
source§fn modules(&self) -> Self::Modules<'_>
source§fn additional_reserved_memory_regions(
&self
) -> Result<Self::AdditionalReservedMemoryRegions, &'static str>
source§fn kernel_end(&self) -> Result<PhysicalAddress, &'static str>
source§fn rsdp(&self) -> Option<PhysicalAddress>
source§fn stack_size(&self) -> Result<usize, &'static str>
Implementors§
\ No newline at end of file
+sourcefn kernel_end(&self) -> Result<VirtualAddress, &'static str>
Returns the end of the kernel’s image in memory.
+sourcefn rsdp(&self) -> Option<PhysicalAddress>
Returns the RSDP if it was provided by the bootloader.
+sourcefn stack_size(&self) -> Result<usize, &'static str>
Returns the stack size in bytes.
+
Provided Methods§
Implementations on Foreign Types§
source§impl BootInformation for BootInformation
§type MemoryRegion<'a> = &'a MemoryArea
§type MemoryRegions<'a> = MemoryRegions<'a>
§type ElfSection<'a> = ElfSection
§type ElfSections<'a> = ElfSectionIter
§type Module<'a> = &'a ModuleTag
§type Modules<'a> = ModuleIter<'a>
§type AdditionalReservedMemoryRegions = IntoIter<ReservedMemoryRegion, 3>
source§fn start(&self) -> Option<VirtualAddress>
source§fn len(&self) -> usize
source§fn memory_regions(&self) -> Result<Self::MemoryRegions<'_>, &'static str>
source§fn elf_sections(&self) -> Result<Self::ElfSections<'static>, &'static str>
source§fn modules(&self) -> Self::Modules<'_>
source§fn additional_reserved_memory_regions(
&self
) -> Result<Self::AdditionalReservedMemoryRegions, &'static str>
source§fn kernel_end(&self) -> Result<VirtualAddress, &'static str>
source§fn rsdp(&self) -> Option<PhysicalAddress>
source§fn stack_size(&self) -> Result<usize, &'static str>
Implementors§
\ No newline at end of file
diff --git a/doc/boot_info/trait.ElfSection.html b/doc/boot_info/trait.ElfSection.html
index def996bc04..28071e6a29 100644
--- a/doc/boot_info/trait.ElfSection.html
+++ b/doc/boot_info/trait.ElfSection.html
@@ -1,4 +1,4 @@
-ElfSection in boot_info - Rust Trait boot_info::ElfSection
source · pub trait ElfSection {
+ElfSection in boot_info - Rust Trait boot_info::ElfSection
source · pub trait ElfSection {
fn name(&self) -> &str;
fn start(&self) -> VirtualAddress;
fn len(&self) -> usize;
@@ -7,7 +7,8 @@
fn is_empty(&self) -> bool { ... }
}
Required Methods§
sourcefn flags(&self) -> ElfSectionFlags
Returns the section’s flags.
-Provided Methods§
sourcefn len(&self) -> usize
Returns the section’s length in memory, as opposed to its length in the
+ELF file.
+sourcefn flags(&self) -> ElfSectionFlags
Returns the section’s flags.
+Provided Methods§
Implementations on Foreign Types§
source§impl ElfSection for ElfSection
Implementors§
\ No newline at end of file
diff --git a/doc/boot_info/trait.Module.html b/doc/boot_info/trait.Module.html
index 3aa19e3f57..fe97fa4070 100644
--- a/doc/boot_info/trait.Module.html
+++ b/doc/boot_info/trait.Module.html
@@ -1,11 +1,11 @@
-Module in boot_info - Rust pub trait Module {
+Module in boot_info - Rust pub trait Module {
fn name(&self) -> Result<&str, &'static str>;
fn start(&self) -> PhysicalAddress;
fn len(&self) -> usize;
fn is_empty(&self) -> bool { ... }
-}
Required Methods§
Provided Methods§
\ No newline at end of file
diff --git a/doc/captain/fn.init.html b/doc/captain/fn.init.html
index 2a1bc5002a..cc7fe8d9f2 100644
--- a/doc/captain/fn.init.html
+++ b/doc/captain/fn.init.html
@@ -1,4 +1,4 @@
-init in captain - Rust pub fn init(
kernel_mmi_ref: MmiRef,
identity_mapped_pages: NoDrop<EarlyIdentityMappedPages>,
bsp_initial_stack: NoDrop<Stack>,
ap_start_realmode_begin: VirtualAddress,
ap_start_realmode_end: VirtualAddress,
rsdp_address: Option<PhysicalAddress>
) -> Result<(), &'static str>
Expand description
Initialize the Captain, which is the main module that steers the ship of Theseus.
+init in captain - Rust pub fn init(
kernel_mmi_ref: MmiRef,
identity_mapped_pages: NoDrop<EarlyIdentityMappedPages>,
bsp_initial_stack: NoDrop<Stack>,
ap_start_realmode_begin: VirtualAddress,
ap_start_realmode_end: VirtualAddress,
ap_gdt: VirtualAddress,
rsdp_address: Option<PhysicalAddress>
) -> Result<(), &'static str>
Expand description
Initialize the Captain, which is the main module that steers the ship of Theseus.
This does the rest of the initialization procedures so that the OS
can continue running and do actual useful work.
Arguments
diff --git a/doc/captain/index.html b/doc/captain/index.html
index e3e2c35cb8..f728402b4e 100644
--- a/doc/captain/index.html
+++ b/doc/captain/index.html
@@ -1,4 +1,4 @@
-captain - Rust Expand description
The main initialization routine and setup logic of the OS.
+captain - Rust Expand description
The main initialization routine and setup logic of the OS.
The captain
steers the ship of Theseus, meaning that it contains basic logic
for initializing all of the other crates in the proper order and with the proper flow of data between them.
Currently, this is the default captain
in Theseus, which does the following:
diff --git a/doc/crate_metadata/constant.BSS_SECTION_NAME.html b/doc/crate_metadata/constant.BSS_SECTION_NAME.html
index 864d7a2b43..41432c206d 100644
--- a/doc/crate_metadata/constant.BSS_SECTION_NAME.html
+++ b/doc/crate_metadata/constant.BSS_SECTION_NAME.html
@@ -1 +1 @@
-BSS_SECTION_NAME in crate_metadata - Rust Constant crate_metadata::BSS_SECTION_NAME
pub const BSS_SECTION_NAME: &'static str;
\ No newline at end of file
+BSS_SECTION_NAME in crate_metadata - Rust Constant crate_metadata::BSS_SECTION_NAME
source · pub const BSS_SECTION_NAME: &'static str;
\ No newline at end of file
diff --git a/doc/crate_metadata/constant.DATA_SECTION_NAME.html b/doc/crate_metadata/constant.DATA_SECTION_NAME.html
index 071297d902..b022b67582 100644
--- a/doc/crate_metadata/constant.DATA_SECTION_NAME.html
+++ b/doc/crate_metadata/constant.DATA_SECTION_NAME.html
@@ -1 +1 @@
-DATA_SECTION_NAME in crate_metadata - Rust Constant crate_metadata::DATA_SECTION_NAME
pub const DATA_SECTION_NAME: &'static str;
\ No newline at end of file
+DATA_SECTION_NAME in crate_metadata - Rust Constant crate_metadata::DATA_SECTION_NAME
source · pub const DATA_SECTION_NAME: &'static str;
\ No newline at end of file
diff --git a/doc/crate_metadata/constant.EH_FRAME_SECTION_NAME.html b/doc/crate_metadata/constant.EH_FRAME_SECTION_NAME.html
index 8eec4a68cb..d4288352cb 100644
--- a/doc/crate_metadata/constant.EH_FRAME_SECTION_NAME.html
+++ b/doc/crate_metadata/constant.EH_FRAME_SECTION_NAME.html
@@ -1 +1 @@
-EH_FRAME_SECTION_NAME in crate_metadata - Rust Constant crate_metadata::EH_FRAME_SECTION_NAME
pub const EH_FRAME_SECTION_NAME: &'static str;
\ No newline at end of file
+EH_FRAME_SECTION_NAME in crate_metadata - Rust Constant crate_metadata::EH_FRAME_SECTION_NAME
source · pub const EH_FRAME_SECTION_NAME: &'static str;
\ No newline at end of file
diff --git a/doc/crate_metadata/constant.GCC_EXCEPT_TABLE_SECTION_NAME.html b/doc/crate_metadata/constant.GCC_EXCEPT_TABLE_SECTION_NAME.html
index 4fafbcbf65..51e6f14868 100644
--- a/doc/crate_metadata/constant.GCC_EXCEPT_TABLE_SECTION_NAME.html
+++ b/doc/crate_metadata/constant.GCC_EXCEPT_TABLE_SECTION_NAME.html
@@ -1 +1 @@
-GCC_EXCEPT_TABLE_SECTION_NAME in crate_metadata - Rust Constant crate_metadata::GCC_EXCEPT_TABLE_SECTION_NAME
pub const GCC_EXCEPT_TABLE_SECTION_NAME: &'static str;
\ No newline at end of file
+GCC_EXCEPT_TABLE_SECTION_NAME in crate_metadata - Rust Constant crate_metadata::GCC_EXCEPT_TABLE_SECTION_NAME
source · pub const GCC_EXCEPT_TABLE_SECTION_NAME: &'static str;
\ No newline at end of file
diff --git a/doc/crate_metadata/constant.RODATA_SECTION_NAME.html b/doc/crate_metadata/constant.RODATA_SECTION_NAME.html
index d93efc48ad..8442258d6d 100644
--- a/doc/crate_metadata/constant.RODATA_SECTION_NAME.html
+++ b/doc/crate_metadata/constant.RODATA_SECTION_NAME.html
@@ -1 +1 @@
-RODATA_SECTION_NAME in crate_metadata - Rust Constant crate_metadata::RODATA_SECTION_NAME
pub const RODATA_SECTION_NAME: &'static str;
\ No newline at end of file
+RODATA_SECTION_NAME in crate_metadata - Rust Constant crate_metadata::RODATA_SECTION_NAME
source · pub const RODATA_SECTION_NAME: &'static str;
\ No newline at end of file
diff --git a/doc/crate_metadata/constant.TEXT_SECTION_NAME.html b/doc/crate_metadata/constant.TEXT_SECTION_NAME.html
index 30515ff7a7..3d103c7cc0 100644
--- a/doc/crate_metadata/constant.TEXT_SECTION_NAME.html
+++ b/doc/crate_metadata/constant.TEXT_SECTION_NAME.html
@@ -1 +1 @@
-TEXT_SECTION_NAME in crate_metadata - Rust Constant crate_metadata::TEXT_SECTION_NAME
pub const TEXT_SECTION_NAME: &'static str;
\ No newline at end of file
+TEXT_SECTION_NAME in crate_metadata - Rust Constant crate_metadata::TEXT_SECTION_NAME
source · pub const TEXT_SECTION_NAME: &'static str;
\ No newline at end of file
diff --git a/doc/crate_metadata/constant.TLS_BSS_SECTION_NAME.html b/doc/crate_metadata/constant.TLS_BSS_SECTION_NAME.html
index 46cd7fd4fe..b9d8c81528 100644
--- a/doc/crate_metadata/constant.TLS_BSS_SECTION_NAME.html
+++ b/doc/crate_metadata/constant.TLS_BSS_SECTION_NAME.html
@@ -1 +1 @@
-TLS_BSS_SECTION_NAME in crate_metadata - Rust Constant crate_metadata::TLS_BSS_SECTION_NAME
pub const TLS_BSS_SECTION_NAME: &'static str;
\ No newline at end of file
+TLS_BSS_SECTION_NAME in crate_metadata - Rust Constant crate_metadata::TLS_BSS_SECTION_NAME
source · pub const TLS_BSS_SECTION_NAME: &'static str;
\ No newline at end of file
diff --git a/doc/crate_metadata/constant.TLS_DATA_SECTION_NAME.html b/doc/crate_metadata/constant.TLS_DATA_SECTION_NAME.html
index aae887fef0..411b3fd7b6 100644
--- a/doc/crate_metadata/constant.TLS_DATA_SECTION_NAME.html
+++ b/doc/crate_metadata/constant.TLS_DATA_SECTION_NAME.html
@@ -1 +1 @@
-TLS_DATA_SECTION_NAME in crate_metadata - Rust Constant crate_metadata::TLS_DATA_SECTION_NAME
pub const TLS_DATA_SECTION_NAME: &'static str;
\ No newline at end of file
+TLS_DATA_SECTION_NAME in crate_metadata - Rust Constant crate_metadata::TLS_DATA_SECTION_NAME
source · pub const TLS_DATA_SECTION_NAME: &'static str;
\ No newline at end of file
diff --git a/doc/crate_metadata/enum.SectionType.html b/doc/crate_metadata/enum.SectionType.html
index 01a4d29f8b..f01cd42813 100644
--- a/doc/crate_metadata/enum.SectionType.html
+++ b/doc/crate_metadata/enum.SectionType.html
@@ -1,4 +1,4 @@
-SectionType in crate_metadata - Rust Enum crate_metadata::SectionType
pub enum SectionType {
+SectionType in crate_metadata - Rust Enum crate_metadata::SectionType
source · pub enum SectionType {
Text,
Rodata,
Data,
@@ -27,11 +27,11 @@
that should be called when traversing up the stack for cleanup.
Blog post from author of gold linker: https://www.airs.com/blog/archives/460
Some documentation here: https://gcc.gnu.org/wiki/Dwarf2EHNewbiesHowto
-
Implementations§
§impl SectionType
pub fn is_data_or_bss(&self) -> bool
Returns true
if Data
or Bss
, otherwise false
.
-Trait Implementations§
§impl Clone for SectionType
§fn clone(&self) -> SectionType
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more§impl Debug for SectionType
§impl<'de> Deserialize<'de> for SectionType
§fn deserialize<__D>(
__deserializer: __D
) -> Result<SectionType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl PartialEq<SectionType> for SectionType
§fn eq(&self, other: &SectionType) -> bool
This method tests for self
and other
values to be equal, and is used
+Implementations§
source§impl SectionType
Trait Implementations§
source§impl Clone for SectionType
source§fn clone(&self) -> SectionType
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SectionType
source§impl<'de> Deserialize<'de> for SectionType
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<SectionType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read moresource§impl PartialEq<SectionType> for SectionType
source§fn eq(&self, other: &SectionType) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.§impl Serialize for SectionType
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Copy for SectionType
§impl StructuralPartialEq for SectionType
Auto Trait Implementations§
§impl RefUnwindSafe for SectionType
§impl Send for SectionType
§impl Sync for SectionType
§impl Unpin for SectionType
§impl UnwindSafe for SectionType
Blanket Implementations§
source§impl Serialize for SectionType
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read moresource§impl Copy for SectionType
source§impl StructuralPartialEq for SectionType
Auto Trait Implementations§
§impl RefUnwindSafe for SectionType
§impl Send for SectionType
§impl Sync for SectionType
§impl Unpin for SectionType
§impl UnwindSafe for SectionType
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · 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.
diff --git a/doc/crate_metadata/type.Shndx.html b/doc/crate_metadata/type.Shndx.html
index 31e99631d9..b2410fd1d4 100644
--- a/doc/crate_metadata/type.Shndx.html
+++ b/doc/crate_metadata/type.Shndx.html
@@ -1,4 +1,4 @@
-Shndx in crate_metadata - Rust Type Definition crate_metadata::Shndx
pub type Shndx = usize;
Expand description
A Section Header iNDeX (SHNDX), as specified by the ELF format.
+
Shndx in crate_metadata - Rust Type Definition crate_metadata::Shndx
source · pub type Shndx = usize;
Expand description
A Section Header iNDeX (SHNDX), as specified by the ELF format.
Even though this is typically encoded as a u16
,
its decoded form can exceed the max size of u16
.
\ No newline at end of file
diff --git a/doc/memory/all.html b/doc/memory/all.html
index a4e99cb4fa..37801c32b9 100644
--- a/doc/memory/all.html
+++ b/doc/memory/all.html
@@ -1 +1 @@
-List of all items in this crate List of all items
Structs
- AllocatedFrames
- AllocatedPages
- BorrowedMappedPages
- BorrowedSliceMappedPages
- EarlyIdentityMappedPages
- Frame
- FrameRange
- Immutable
- InitialMemoryMappings
- MappedPages
- Mapper
- MemoryManagementInfo
- Mutable
- Page
- PageRange
- PageTable
- PhysicalAddress
- PhysicalMemoryRegion
- PteFlags
- PteFlagsArch
- PteFlagsX86_64
- VirtualAddress
Enums
Traits
Functions
- allocate_frames
- allocate_frames_at
- allocate_frames_by_bytes
- allocate_frames_by_bytes_at
- allocate_pages
- allocate_pages_at
- allocate_pages_by_bytes
- allocate_pages_by_bytes_at
- create_contiguous_mapping
- create_mapping
- get_kernel_mmi_ref
- init
- init_post_heap
- set_broadcast_tlb_shootdown_cb
Type Definitions
Constants
\ No newline at end of file
+List of all items in this crate List of all items
Structs
- AllocatedFrames
- AllocatedPages
- BorrowedMappedPages
- BorrowedSliceMappedPages
- EarlyIdentityMappedPages
- Frame
- FrameRange
- Immutable
- InitialMemoryMappings
- MappedPages
- Mapper
- MemoryManagementInfo
- Mutable
- Page
- PageRange
- PageTable
- PhysicalAddress
- PhysicalMemoryRegion
- PteFlags
- PteFlagsArch
- PteFlagsX86_64
- VirtualAddress
Enums
Traits
Functions
- allocate_frames
- allocate_frames_at
- allocate_frames_by_bytes
- allocate_frames_by_bytes_at
- allocate_pages
- allocate_pages_at
- allocate_pages_by_bytes
- allocate_pages_by_bytes_at
- create_contiguous_mapping
- create_mapping
- get_kernel_mmi_ref
- init
- init_post_heap
- set_broadcast_tlb_shootdown_cb
- translate
Type Definitions
Constants
\ No newline at end of file
diff --git a/doc/memory/fn.create_contiguous_mapping.html b/doc/memory/fn.create_contiguous_mapping.html
index 355d13f1f0..efeb08d8c8 100644
--- a/doc/memory/fn.create_contiguous_mapping.html
+++ b/doc/memory/fn.create_contiguous_mapping.html
@@ -1,4 +1,4 @@
-create_contiguous_mapping in memory - Rust Function memory::create_contiguous_mapping
source · pub fn create_contiguous_mapping<F: Into<PteFlagsArch>>(
size_in_bytes: usize,
flags: F
) -> Result<(MappedPages, PhysicalAddress), &'static str>
Expand description
A convenience function that creates a new memory mapping by allocating frames that are contiguous in physical memory.
+
create_contiguous_mapping in memory - Rust Function memory::create_contiguous_mapping
source · pub fn create_contiguous_mapping<F: Into<PteFlagsArch>>(
size_in_bytes: usize,
flags: F
) -> Result<(MappedPages, PhysicalAddress), &'static str>
Expand description
A convenience function that creates a new memory mapping by allocating frames that are contiguous in physical memory.
If contiguous frames are not required, then see create_mapping()
.
Returns a tuple containing the new MappedPages
and the starting PhysicalAddress of the first frame,
which is a convenient way to get the physical address without walking the page tables.
diff --git a/doc/memory/fn.create_mapping.html b/doc/memory/fn.create_mapping.html
index 8e1b63c929..69ad0fbbc7 100644
--- a/doc/memory/fn.create_mapping.html
+++ b/doc/memory/fn.create_mapping.html
@@ -1,4 +1,4 @@
-create_mapping in memory - Rust Function memory::create_mapping
source · pub fn create_mapping<F: Into<PteFlagsArch>>(
size_in_bytes: usize,
flags: F
) -> Result<MappedPages, &'static str>
Expand description
A convenience function that creates a new memory mapping. The pages allocated are contiguous in memory but there’s
+
create_mapping in memory - Rust Function memory::create_mapping
source · pub fn create_mapping<F: Into<PteFlagsArch>>(
size_in_bytes: usize,
flags: F
) -> Result<MappedPages, &'static str>
Expand description
A convenience function that creates a new memory mapping. The pages allocated are contiguous in memory but there’s
no guarantee that the frames they are mapped to are also contiguous in memory. If contiguous frames are required
then see create_contiguous_mapping()
.
Returns the new MappedPages.
diff --git a/doc/memory/fn.get_kernel_mmi_ref.html b/doc/memory/fn.get_kernel_mmi_ref.html
index 854da96c6c..350de34827 100644
--- a/doc/memory/fn.get_kernel_mmi_ref.html
+++ b/doc/memory/fn.get_kernel_mmi_ref.html
@@ -1,3 +1,3 @@
-get_kernel_mmi_ref in memory - Rust Function memory::get_kernel_mmi_ref
source · Expand description
Returns a reference to the kernel’s MemoryManagementInfo
, if initialized.
+
get_kernel_mmi_ref in memory - Rust Function memory::get_kernel_mmi_ref
source · Expand description
Returns a reference to the kernel’s MemoryManagementInfo
, if initialized.
If not, it returns None
.
\ No newline at end of file
diff --git a/doc/memory/fn.init.html b/doc/memory/fn.init.html
index 18909114ab..9a23915b9c 100644
--- a/doc/memory/fn.init.html
+++ b/doc/memory/fn.init.html
@@ -1,4 +1,4 @@
-init in memory - Rust pub fn init(
boot_info: &impl BootInformation,
kernel_stack_start: VirtualAddress
) -> Result<InitialMemoryMappings, &'static str>
Expand description
Initializes the virtual memory management system.
+
init in memory - Rust pub fn init(
boot_info: &impl BootInformation,
kernel_stack_start: VirtualAddress
) -> Result<InitialMemoryMappings, &'static str>
Expand description
Initializes the virtual memory management system.
Consumes the given BootInformation, because after the memory system is initialized,
the original BootInformation will be unmapped and inaccessible.
\ No newline at end of file
diff --git a/doc/memory/fn.init_post_heap.html b/doc/memory/fn.init_post_heap.html
index 37b644bb5c..a7e9bde204 100644
--- a/doc/memory/fn.init_post_heap.html
+++ b/doc/memory/fn.init_post_heap.html
@@ -1,4 +1,4 @@
-init_post_heap in memory - Rust Function memory::init_post_heap
source · pub fn init_post_heap(
page_table: PageTable,
additional_mapped_pages: MappedPages,
heap_mapped_pages: MappedPages
) -> MmiRef
Expand description
Finishes initializing the memory management system after the heap is ready.
+init_post_heap in memory - Rust Function memory::init_post_heap
source · pub fn init_post_heap(
page_table: PageTable,
additional_mapped_pages: MappedPages,
heap_mapped_pages: MappedPages
) -> MmiRef
Expand description
Finishes initializing the memory management system after the heap is ready.
Returns the following tuple:
- The kernel’s new
MemoryManagementInfo
, representing the initial virtual address space,
diff --git a/doc/memory/fn.set_broadcast_tlb_shootdown_cb.html b/doc/memory/fn.set_broadcast_tlb_shootdown_cb.html
index ec805aef35..3791c4b418 100644
--- a/doc/memory/fn.set_broadcast_tlb_shootdown_cb.html
+++ b/doc/memory/fn.set_broadcast_tlb_shootdown_cb.html
@@ -1,3 +1,3 @@
-set_broadcast_tlb_shootdown_cb in memory - Rust Function memory::set_broadcast_tlb_shootdown_cb
source · Expand description
Set the function callback that will be invoked every time a TLB shootdown is necessary,
+
set_broadcast_tlb_shootdown_cb in memory - Rust Function memory::set_broadcast_tlb_shootdown_cb
source · Expand description
Set the function callback that will be invoked every time a TLB shootdown is necessary,
i.e., during page table remapping and unmapping operations.
\ No newline at end of file
diff --git a/doc/memory/fn.translate.html b/doc/memory/fn.translate.html
new file mode 100644
index 0000000000..9e99d8fa90
--- /dev/null
+++ b/doc/memory/fn.translate.html
@@ -0,0 +1,3 @@
+translate in memory - Rust pub fn translate(virtual_address: VirtualAddress) -> Option<PhysicalAddress>
Expand description
A convenience function to translate the given virtual address into a
+physical address using the currently-active page table.
+
\ No newline at end of file
diff --git a/doc/memory/index.html b/doc/memory/index.html
index cf120a6778..27a6f15940 100644
--- a/doc/memory/index.html
+++ b/doc/memory/index.html
@@ -1,4 +1,4 @@
-memory - Rust Expand description
This crate implements the main memory management subsystem for Theseus.
+memory - Rust Expand description
This crate implements the main memory management subsystem for Theseus.
The primary type of interest is MappedPages
, which offers a robust
interface that unifies the usage of arbitrary memory regions
with that of Rust’s safe type system and lifetimes.
@@ -24,4 +24,5 @@ Acknowledgments
If not, it returns None
. Initializes the virtual memory management system.
Consumes the given BootInformation, because after the memory system is initialized,
the original BootInformation will be unmapped and inaccessible.Finishes initializing the memory management system after the heap is ready.Set the function callback that will be invoked every time a TLB shootdown is necessary,
-i.e., during page table remapping and unmapping operations.Type Definitions
A shareable reference to a MemoryManagementInfo
struct wrapper in a lock.
\ No newline at end of file
+i.e., during page table remapping and unmapping operations. A convenience function to translate the given virtual address into a
+physical address using the currently-active page table.
Type Definitions
A shareable reference to a MemoryManagementInfo
struct wrapper in a lock.
\ No newline at end of file
diff --git a/doc/memory/paging/mapper/fn.translate.html b/doc/memory/paging/mapper/fn.translate.html
new file mode 100644
index 0000000000..b5fca4f8ab
--- /dev/null
+++ b/doc/memory/paging/mapper/fn.translate.html
@@ -0,0 +1,11 @@
+
+
+
+
+ Redirection
+
+
+ Redirecting to ../../../memory/fn.translate.html...
+
+
+
\ No newline at end of file
diff --git a/doc/memory/sidebar-items.js b/doc/memory/sidebar-items.js
index 8563161727..f569543a65 100644
--- a/doc/memory/sidebar-items.js
+++ b/doc/memory/sidebar-items.js
@@ -1 +1 @@
-window.SIDEBAR_ITEMS = {"constant":[["PAGE_SIZE","Page size is 4096 bytes, 4KiB pages."],["PTE_FRAME_MASK","A mask for the bits of a page table entry that contain the physical frame address."]],"enum":[["MemoryRegionType","Types of physical memory. See each variant’s documentation."]],"fn":[["allocate_frames","Allocates the given number of frames with no constraints on the starting physical address."],["allocate_frames_at","Allocates the given number of frames starting at (inclusive of) the frame containing the given `PhysicalAddress`."],["allocate_frames_by_bytes","Allocates frames with no constraints on the starting physical address, with a size given by the number of bytes. "],["allocate_frames_by_bytes_at","Allocates frames starting at the given `PhysicalAddress` with a size given in number of bytes. "],["allocate_pages","Allocates the given number of pages with no constraints on the starting virtual address."],["allocate_pages_at","Allocates the given number of pages starting at (inclusive of) the page containing the given `VirtualAddress`."],["allocate_pages_by_bytes","Allocates pages with no constraints on the starting virtual address, with a size given by the number of bytes. "],["allocate_pages_by_bytes_at","Allocates pages starting at the given `VirtualAddress` with a size given in number of bytes. "],["create_contiguous_mapping","A convenience function that creates a new memory mapping by allocating frames that are contiguous in physical memory. If contiguous frames are not required, then see `create_mapping()`. Returns a tuple containing the new `MappedPages` and the starting PhysicalAddress of the first frame, which is a convenient way to get the physical address without walking the page tables."],["create_mapping","A convenience function that creates a new memory mapping. The pages allocated are contiguous in memory but there’s no guarantee that the frames they are mapped to are also contiguous in memory. If contiguous frames are required then see `create_contiguous_mapping()`. Returns the new `MappedPages.` "],["get_kernel_mmi_ref","Returns a reference to the kernel’s `MemoryManagementInfo`, if initialized. If not, it returns `None`."],["init","Initializes the virtual memory management system. Consumes the given BootInformation, because after the memory system is initialized, the original BootInformation will be unmapped and inaccessible."],["init_post_heap","Finishes initializing the memory management system after the heap is ready."],["set_broadcast_tlb_shootdown_cb","Set the function callback that will be invoked every time a TLB shootdown is necessary, i.e., during page table remapping and unmapping operations."]],"struct":[["AllocatedFrames","Represents a range of allocated physical memory [`Frame`]s; derefs to [`FrameRange`]."],["AllocatedPages","Represents a range of allocated `VirtualAddress`es, specified in `Page`s. "],["BorrowedMappedPages","A borrowed [`MappedPages`] object that derefs to `&T` and optionally also `&mut T`."],["BorrowedSliceMappedPages","A borrowed [`MappedPages`] object that derefs to a slice `&[T]` and optionally also `&mut [T]`."],["EarlyIdentityMappedPages","The set of identity mappings that should be dropped before starting the first application."],["Frame","A `Frame` is a chunk of physical memory aligned to a [`PAGE_SIZE`] boundary."],["FrameRange","A range of [`Frame`]s that are contiguous in physical memory."],["Immutable","A marker type used to indicate that a [`BorrowedMappedPages`] or [`BorrowedSliceMappedPages`] is borrowed immutably."],["InitialMemoryMappings","Information returned after initialising the memory subsystem."],["MappedPages","Represents a contiguous range of virtual memory pages that are currently mapped. A `MappedPages` object can only have a single range of contiguous pages, not multiple disjoint ranges. This does not guarantee that its pages are mapped to frames that are contiguous in physical memory."],["Mapper",""],["MemoryManagementInfo","This holds all the information for a `Task`’s memory mappings and address space (this is basically the equivalent of Linux’s mm_struct)"],["Mutable","A marker type used to indicate that a [`BorrowedMappedPages`] or [`BorrowedSliceMappedPages`] is borrowed mutably."],["Page","A `Page` is a chunk of virtual memory aligned to a [`PAGE_SIZE`] boundary."],["PageRange","A range of [`Page`]s that are contiguous in virtual memory."],["PageTable","A top-level root (P4) page table."],["PhysicalAddress","A physical memory address, which is a `usize` under the hood."],["PhysicalMemoryRegion","A region of physical memory."],["PteFlags","Common, architecture-independent flags for a page table entry (PTE) that define how a page is mapped."],["PteFlagsArch","Page table entry (PTE) flags on x86_64."],["PteFlagsX86_64","Page table entry (PTE) flags on x86_64."],["VirtualAddress","A virtual memory address, which is a `usize` under the hood."]],"trait":[["Mutability","A trait for parameterizing a [`BorrowedMappedPages`] or [`BorrowedSliceMappedPages`] as mutably or immutably borrowed."]],"type":[["MmiRef","A shareable reference to a `MemoryManagementInfo` struct wrapper in a lock."]]};
\ No newline at end of file
+window.SIDEBAR_ITEMS = {"constant":[["PAGE_SIZE","Page size is 4096 bytes, 4KiB pages."],["PTE_FRAME_MASK","A mask for the bits of a page table entry that contain the physical frame address."]],"enum":[["MemoryRegionType","Types of physical memory. See each variant’s documentation."]],"fn":[["allocate_frames","Allocates the given number of frames with no constraints on the starting physical address."],["allocate_frames_at","Allocates the given number of frames starting at (inclusive of) the frame containing the given `PhysicalAddress`."],["allocate_frames_by_bytes","Allocates frames with no constraints on the starting physical address, with a size given by the number of bytes. "],["allocate_frames_by_bytes_at","Allocates frames starting at the given `PhysicalAddress` with a size given in number of bytes. "],["allocate_pages","Allocates the given number of pages with no constraints on the starting virtual address."],["allocate_pages_at","Allocates the given number of pages starting at (inclusive of) the page containing the given `VirtualAddress`."],["allocate_pages_by_bytes","Allocates pages with no constraints on the starting virtual address, with a size given by the number of bytes. "],["allocate_pages_by_bytes_at","Allocates pages starting at the given `VirtualAddress` with a size given in number of bytes. "],["create_contiguous_mapping","A convenience function that creates a new memory mapping by allocating frames that are contiguous in physical memory. If contiguous frames are not required, then see `create_mapping()`. Returns a tuple containing the new `MappedPages` and the starting PhysicalAddress of the first frame, which is a convenient way to get the physical address without walking the page tables."],["create_mapping","A convenience function that creates a new memory mapping. The pages allocated are contiguous in memory but there’s no guarantee that the frames they are mapped to are also contiguous in memory. If contiguous frames are required then see `create_contiguous_mapping()`. Returns the new `MappedPages.` "],["get_kernel_mmi_ref","Returns a reference to the kernel’s `MemoryManagementInfo`, if initialized. If not, it returns `None`."],["init","Initializes the virtual memory management system. Consumes the given BootInformation, because after the memory system is initialized, the original BootInformation will be unmapped and inaccessible."],["init_post_heap","Finishes initializing the memory management system after the heap is ready."],["set_broadcast_tlb_shootdown_cb","Set the function callback that will be invoked every time a TLB shootdown is necessary, i.e., during page table remapping and unmapping operations."],["translate","A convenience function to translate the given virtual address into a physical address using the currently-active page table."]],"struct":[["AllocatedFrames","Represents a range of allocated physical memory [`Frame`]s; derefs to [`FrameRange`]."],["AllocatedPages","Represents a range of allocated `VirtualAddress`es, specified in `Page`s. "],["BorrowedMappedPages","A borrowed [`MappedPages`] object that derefs to `&T` and optionally also `&mut T`."],["BorrowedSliceMappedPages","A borrowed [`MappedPages`] object that derefs to a slice `&[T]` and optionally also `&mut [T]`."],["EarlyIdentityMappedPages","The set of identity mappings that should be dropped before starting the first application."],["Frame","A `Frame` is a chunk of physical memory aligned to a [`PAGE_SIZE`] boundary."],["FrameRange","A range of [`Frame`]s that are contiguous in physical memory."],["Immutable","A marker type used to indicate that a [`BorrowedMappedPages`] or [`BorrowedSliceMappedPages`] is borrowed immutably."],["InitialMemoryMappings","Information returned after initialising the memory subsystem."],["MappedPages","Represents a contiguous range of virtual memory pages that are currently mapped. A `MappedPages` object can only have a single range of contiguous pages, not multiple disjoint ranges. This does not guarantee that its pages are mapped to frames that are contiguous in physical memory."],["Mapper",""],["MemoryManagementInfo","This holds all the information for a `Task`’s memory mappings and address space (this is basically the equivalent of Linux’s mm_struct)"],["Mutable","A marker type used to indicate that a [`BorrowedMappedPages`] or [`BorrowedSliceMappedPages`] is borrowed mutably."],["Page","A `Page` is a chunk of virtual memory aligned to a [`PAGE_SIZE`] boundary."],["PageRange","A range of [`Page`]s that are contiguous in virtual memory."],["PageTable","A top-level root (P4) page table."],["PhysicalAddress","A physical memory address, which is a `usize` under the hood."],["PhysicalMemoryRegion","A region of physical memory."],["PteFlags","Common, architecture-independent flags for a page table entry (PTE) that define how a page is mapped."],["PteFlagsArch","Page table entry (PTE) flags on x86_64."],["PteFlagsX86_64","Page table entry (PTE) flags on x86_64."],["VirtualAddress","A virtual memory address, which is a `usize` under the hood."]],"trait":[["Mutability","A trait for parameterizing a [`BorrowedMappedPages`] or [`BorrowedSliceMappedPages`] as mutably or immutably borrowed."]],"type":[["MmiRef","A shareable reference to a `MemoryManagementInfo` struct wrapper in a lock."]]};
\ No newline at end of file
diff --git a/doc/memory/struct.BorrowedMappedPages.html b/doc/memory/struct.BorrowedMappedPages.html
index 14754e7447..988a138ad7 100644
--- a/doc/memory/struct.BorrowedMappedPages.html
+++ b/doc/memory/struct.BorrowedMappedPages.html
@@ -1,29 +1,29 @@
-BorrowedMappedPages in memory - Rust Struct memory::BorrowedMappedPages
source · pub struct BorrowedMappedPages<T: FromBytes, M: Mutability = Immutable> { /* private fields */ }
Expand description
A borrowed MappedPages
object that derefs to &T
and optionally also &mut T
.
+BorrowedMappedPages in memory - Rust Struct memory::BorrowedMappedPages
source · pub struct BorrowedMappedPages<T: FromBytes, M: Mutability = Immutable> { /* private fields */ }
Expand description
A borrowed MappedPages
object that derefs to &T
and optionally also &mut T
.
By default, the Mutability
type parameter is Immutable
for ease of use.
When dropped, the borrow ends and the contained MappedPages
is dropped and unmapped.
You can manually end the borrow and reclaim the inner MappedPages
via Self::into_inner()
.
-Implementations§
source§impl<T: FromBytes> BorrowedMappedPages<T, Immutable>
sourcepub fn from(
mp: MappedPages,
byte_offset: usize
) -> Result<BorrowedMappedPages<T>, (MappedPages, &'static str)>
Immutably borrows the given MappedPages
as an instance of type &T
+
Implementations§
source§impl<T: FromBytes> BorrowedMappedPages<T, Immutable>
sourcepub fn from(
mp: MappedPages,
byte_offset: usize
) -> Result<BorrowedMappedPages<T>, (MappedPages, &'static str)>
Immutably borrows the given MappedPages
as an instance of type &T
located at the given byte_offset
into the MappedPages
.
See MappedPages::as_type()
for more info.
Upon failure, returns an error containing the unmodified MappedPages
and a string
describing the error.
-source§impl<T: FromBytes> BorrowedMappedPages<T, Mutable>
sourcepub fn from_mut(
mp: MappedPages,
byte_offset: usize
) -> Result<BorrowedMappedPages<T, Mutable>, (MappedPages, &'static str)>
Mutably borrows the given MappedPages
as an instance of type &mut T
+
source§impl<T: FromBytes> BorrowedMappedPages<T, Mutable>
sourcepub fn from_mut(
mp: MappedPages,
byte_offset: usize
) -> Result<BorrowedMappedPages<T, Mutable>, (MappedPages, &'static str)>
Mutably borrows the given MappedPages
as an instance of type &mut T
located at the given byte_offset
into the MappedPages
.
See MappedPages::as_type_mut()
for more info.
Upon failure, returns an error containing the unmodified MappedPages
and a string describing the error.
-source§impl<T: FromBytes, M: Mutability> BorrowedMappedPages<T, M>
sourcepub fn into_inner(self) -> MappedPages
Consumes this object and returns the inner MappedPages
.
-Trait Implementations§
source§impl<T: FromBytes> AsMut<T> for BorrowedMappedPages<T, Mutable>
Only Mutable
BorrowedMappedPages
implement AsMut<T>
.
-source§impl<T: FromBytes, M: Mutability> AsRef<T> for BorrowedMappedPages<T, M>
Both Mutable
and Immutable
BorrowedMappedPages
implement AsRef<T>
.
-source§impl<T: FromBytes, M: Mutability> Borrow<T> for BorrowedMappedPages<T, M>
Both Mutable
and Immutable
BorrowedMappedPages
implement Borrow<T>
.
-source§impl<T: FromBytes> BorrowMut<T> for BorrowedMappedPages<T, Mutable>
Only Mutable
BorrowedMappedPages
implement BorrowMut<T>
.
-source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moresource§impl<T: FromBytes, M: Mutability> Deref for BorrowedMappedPages<T, M>
Both Mutable
and Immutable
BorrowedMappedPages
can deref into &T
.
-source§impl<T: FromBytes> DerefMut for BorrowedMappedPages<T, Mutable>
Only Mutable
BorrowedMappedPages
can deref into &mut T
.
-source§impl<T: FromBytes + Hash, M: Mutability> Hash for BorrowedMappedPages<T, M>
source§impl<T: FromBytes + Ord, M: Mutability> Ord for BorrowedMappedPages<T, M>
source§impl<T: FromBytes + PartialEq, M: Mutability> PartialEq<BorrowedMappedPages<T, M>> for BorrowedMappedPages<T, M>
source§impl<T: FromBytes, M: Mutability> BorrowedMappedPages<T, M>
sourcepub fn into_inner(self) -> MappedPages
Consumes this object and returns the inner MappedPages
.
+Trait Implementations§
source§impl<T: FromBytes> AsMut<T> for BorrowedMappedPages<T, Mutable>
Only Mutable
BorrowedMappedPages
implement AsMut<T>
.
+source§impl<T: FromBytes, M: Mutability> AsRef<T> for BorrowedMappedPages<T, M>
Both Mutable
and Immutable
BorrowedMappedPages
implement AsRef<T>
.
+source§impl<T: FromBytes, M: Mutability> Borrow<T> for BorrowedMappedPages<T, M>
Both Mutable
and Immutable
BorrowedMappedPages
implement Borrow<T>
.
+source§impl<T: FromBytes> BorrowMut<T> for BorrowedMappedPages<T, Mutable>
Only Mutable
BorrowedMappedPages
implement BorrowMut<T>
.
+source§fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read moresource§impl<T: FromBytes, M: Mutability> Deref for BorrowedMappedPages<T, M>
Both Mutable
and Immutable
BorrowedMappedPages
can deref into &T
.
+source§impl<T: FromBytes> DerefMut for BorrowedMappedPages<T, Mutable>
Only Mutable
BorrowedMappedPages
can deref into &mut T
.
+source§impl<T: FromBytes + Hash, M: Mutability> Hash for BorrowedMappedPages<T, M>
source§impl<T: FromBytes + Ord, M: Mutability> Ord for BorrowedMappedPages<T, M>
source§impl<T: FromBytes + PartialEq, M: Mutability> PartialEq<BorrowedMappedPages<T, M>> for BorrowedMappedPages<T, M>
source§impl<T: FromBytes + PartialOrd, M: Mutability> PartialOrd<BorrowedMappedPages<T, M>> for BorrowedMappedPages<T, M>
source§impl<T: FromBytes + PartialOrd, M: Mutability> PartialOrd<BorrowedMappedPages<T, M>> for BorrowedMappedPages<T, M>
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 moresource§impl<T: FromBytes + Eq, M: Mutability> Eq for BorrowedMappedPages<T, M>
Auto Trait Implementations§
§impl<T, M> RefUnwindSafe for BorrowedMappedPages<T, M>where
M: RefUnwindSafe,
T: RefUnwindSafe,
§impl<T, M> Send for BorrowedMappedPages<T, M>where
M: Send,
T: Send,
§impl<T, M> Sync for BorrowedMappedPages<T, M>where
M: Sync,
T: Sync,
§impl<T, M> Unpin for BorrowedMappedPages<T, M>where
M: Unpin,
T: Unpin,
§impl<T, M> UnwindSafe for BorrowedMappedPages<T, M>where
M: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
source§impl<T: FromBytes + Eq, M: Mutability> Eq for BorrowedMappedPages<T, M>
Auto Trait Implementations§
§impl<T, M> RefUnwindSafe for BorrowedMappedPages<T, M>where
M: RefUnwindSafe,
T: RefUnwindSafe,
§impl<T, M> Send for BorrowedMappedPages<T, M>where
M: Send,
T: Send,
§impl<T, M> Sync for BorrowedMappedPages<T, M>where
M: Sync,
T: Sync,
§impl<T, M> Unpin for BorrowedMappedPages<T, M>where
M: Unpin,
T: Unpin,
§impl<T, M> UnwindSafe for BorrowedMappedPages<T, M>where
M: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · 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.
diff --git a/doc/memory/struct.BorrowedSliceMappedPages.html b/doc/memory/struct.BorrowedSliceMappedPages.html
index ca7a6af880..0d59f360b6 100644
--- a/doc/memory/struct.BorrowedSliceMappedPages.html
+++ b/doc/memory/struct.BorrowedSliceMappedPages.html
@@ -1,18 +1,18 @@
-BorrowedSliceMappedPages in memory - Rust Struct memory::BorrowedSliceMappedPages
source · pub struct BorrowedSliceMappedPages<T: FromBytes, M: Mutability = Immutable> { /* private fields */ }
Expand description
A borrowed MappedPages
object that derefs to a slice &[T]
and optionally also &mut [T]
.
+BorrowedSliceMappedPages in memory - Rust Struct memory::BorrowedSliceMappedPages
source · pub struct BorrowedSliceMappedPages<T: FromBytes, M: Mutability = Immutable> { /* private fields */ }
Expand description
A borrowed MappedPages
object that derefs to a slice &[T]
and optionally also &mut [T]
.
For ease of use, the default Mutability
type parameter is Immutable
.
When dropped, the borrow ends and the contained MappedPages
is dropped and unmapped.
You can manually end the borrow and reclaim the inner MappedPages
via Self::into_inner()
.
-Implementations§
source§impl<T: FromBytes> BorrowedSliceMappedPages<T, Immutable>
sourcepub fn from(
mp: MappedPages,
byte_offset: usize,
length: usize
) -> Result<BorrowedSliceMappedPages<T>, (MappedPages, &'static str)>
Immutably borrows the given MappedPages
as a slice &[T]
+
Implementations§
source§impl<T: FromBytes> BorrowedSliceMappedPages<T, Immutable>
sourcepub fn from(
mp: MappedPages,
byte_offset: usize,
length: usize
) -> Result<BorrowedSliceMappedPages<T>, (MappedPages, &'static str)>
Immutably borrows the given MappedPages
as a slice &[T]
of length
elements of type T
starting at the given byte_offset
into the MappedPages
.
See MappedPages::as_slice()
for more info.
Upon failure, returns an error containing the unmodified MappedPages
and a string
describing the error.
-source§impl<T: FromBytes> BorrowedSliceMappedPages<T, Mutable>
sourcepub fn from_mut(
mp: MappedPages,
byte_offset: usize,
length: usize
) -> Result<Self, (MappedPages, &'static str)>
Mutably borrows the given MappedPages
as an instance of type &mut T
+
source§impl<T: FromBytes> BorrowedSliceMappedPages<T, Mutable>
sourcepub fn from_mut(
mp: MappedPages,
byte_offset: usize,
length: usize
) -> Result<Self, (MappedPages, &'static str)>
Mutably borrows the given MappedPages
as an instance of type &mut T
starting at the given byte_offset
into the MappedPages
.
See MappedPages::as_type_mut()
for more info.
Upon failure, returns an error containing the unmodified MappedPages
and a string describing the error.
-source§impl<T: FromBytes, M: Mutability> BorrowedSliceMappedPages<T, M>
sourcepub fn into_inner(self) -> MappedPages
Consumes this object and returns the inner MappedPages
.
+source§impl<T: FromBytes, M: Mutability> BorrowedSliceMappedPages<T, M>
sourcepub fn into_inner(self) -> MappedPages
Consumes this object and returns the inner MappedPages
.
Methods from Deref<Target = [T]>§
Trait Implementations§
source§impl<T: FromBytes> AsMut<[T]> for BorrowedSliceMappedPages<T, Mutable>
Only Mutable
BorrowedSliceMappedPages
implement AsMut<T>
.
-source§impl<T: FromBytes, M: Mutability> AsRef<[T]> for BorrowedSliceMappedPages<T, M>
Both Mutable
and Immutable
BorrowedSliceMappedPages
implement AsRef<[T]>
.
-source§impl<T: FromBytes, M: Mutability> Borrow<[T]> for BorrowedSliceMappedPages<T, M>
Both Mutable
and Immutable
BorrowedSliceMappedPages
implement Borrow<T>
.
-source§impl<T: FromBytes> BorrowMut<[T]> for BorrowedSliceMappedPages<T, Mutable>
Only Mutable
BorrowedSliceMappedPages
implement BorrowMut<T>
.
-source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read moresource§impl<T: FromBytes, M: Mutability> Deref for BorrowedSliceMappedPages<T, M>
Both Mutable
and Immutable
BorrowedSliceMappedPages
can deref into &[T]
.
-source§impl<T: FromBytes> DerefMut for BorrowedSliceMappedPages<T, Mutable>
Only Mutable
BorrowedSliceMappedPages
can deref into &mut T
.
-source§impl<T: FromBytes + Hash, M: Mutability> Hash for BorrowedSliceMappedPages<T, M>
source§impl<T: FromBytes + Ord, M: Mutability> Ord for BorrowedSliceMappedPages<T, M>
source§impl<T: FromBytes + PartialEq, M: Mutability> PartialEq<BorrowedSliceMappedPages<T, M>> for BorrowedSliceMappedPages<T, M>
Trait Implementations§
source§impl<T: FromBytes> AsMut<[T]> for BorrowedSliceMappedPages<T, Mutable>
Only Mutable
BorrowedSliceMappedPages
implement AsMut<T>
.
+source§impl<T: FromBytes, M: Mutability> AsRef<[T]> for BorrowedSliceMappedPages<T, M>
Both Mutable
and Immutable
BorrowedSliceMappedPages
implement AsRef<[T]>
.
+source§impl<T: FromBytes, M: Mutability> Borrow<[T]> for BorrowedSliceMappedPages<T, M>
Both Mutable
and Immutable
BorrowedSliceMappedPages
implement Borrow<T>
.
+source§impl<T: FromBytes> BorrowMut<[T]> for BorrowedSliceMappedPages<T, Mutable>
Only Mutable
BorrowedSliceMappedPages
implement BorrowMut<T>
.
+source§fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read moresource§impl<T: FromBytes, M: Mutability> Deref for BorrowedSliceMappedPages<T, M>
Both Mutable
and Immutable
BorrowedSliceMappedPages
can deref into &[T]
.
+source§impl<T: FromBytes> DerefMut for BorrowedSliceMappedPages<T, Mutable>
Only Mutable
BorrowedSliceMappedPages
can deref into &mut T
.
+source§impl<T: FromBytes + Hash, M: Mutability> Hash for BorrowedSliceMappedPages<T, M>
source§impl<T: FromBytes + Ord, M: Mutability> Ord for BorrowedSliceMappedPages<T, M>
source§impl<T: FromBytes + PartialEq, M: Mutability> PartialEq<BorrowedSliceMappedPages<T, M>> for BorrowedSliceMappedPages<T, M>
source§impl<T: FromBytes + PartialOrd, M: Mutability> PartialOrd<BorrowedSliceMappedPages<T, M>> for BorrowedSliceMappedPages<T, M>
source§impl<T: FromBytes + PartialOrd, M: Mutability> PartialOrd<BorrowedSliceMappedPages<T, M>> for BorrowedSliceMappedPages<T, M>
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 moresource§impl<T: FromBytes + Eq, M: Mutability> Eq for BorrowedSliceMappedPages<T, M>
Auto Trait Implementations§
§impl<T, M> RefUnwindSafe for BorrowedSliceMappedPages<T, M>where
M: RefUnwindSafe,
T: RefUnwindSafe,
§impl<T, M> Send for BorrowedSliceMappedPages<T, M>where
M: Send,
T: Send,
§impl<T, M> Sync for BorrowedSliceMappedPages<T, M>where
M: Sync,
T: Sync,
§impl<T, M> Unpin for BorrowedSliceMappedPages<T, M>where
M: Unpin,
T: Unpin,
§impl<T, M> UnwindSafe for BorrowedSliceMappedPages<T, M>where
M: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
source§impl<T: FromBytes + Eq, M: Mutability> Eq for BorrowedSliceMappedPages<T, M>
Auto Trait Implementations§
§impl<T, M> RefUnwindSafe for BorrowedSliceMappedPages<T, M>where
M: RefUnwindSafe,
T: RefUnwindSafe,
§impl<T, M> Send for BorrowedSliceMappedPages<T, M>where
M: Send,
T: Send,
§impl<T, M> Sync for BorrowedSliceMappedPages<T, M>where
M: Sync,
T: Sync,
§impl<T, M> Unpin for BorrowedSliceMappedPages<T, M>where
M: Unpin,
T: Unpin,
§impl<T, M> UnwindSafe for BorrowedSliceMappedPages<T, M>where
M: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · 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.
diff --git a/doc/memory/struct.EarlyIdentityMappedPages.html b/doc/memory/struct.EarlyIdentityMappedPages.html
index 4cdc1ee2ff..d0b6537e55 100644
--- a/doc/memory/struct.EarlyIdentityMappedPages.html
+++ b/doc/memory/struct.EarlyIdentityMappedPages.html
@@ -1,4 +1,4 @@
-EarlyIdentityMappedPages in memory - Rust Struct memory::EarlyIdentityMappedPages
source · pub struct EarlyIdentityMappedPages { /* private fields */ }
Expand description
The set of identity mappings that should be dropped before starting the first application.
+EarlyIdentityMappedPages in memory - Rust Struct memory::EarlyIdentityMappedPages
source · pub struct EarlyIdentityMappedPages { /* private fields */ }
Expand description
The set of identity mappings that should be dropped before starting the first application.
Currently there are only 4 identity mappings, used for the base kernel image:
- the
.init
early text section,
@@ -6,7 +6,7 @@
- the
.rodata
section, which includes all read-only data,
- the
.data
section, which includes .bss
and all read-write data.
-Trait Implementations§
Auto Trait Implementations§
§impl RefUnwindSafe for EarlyIdentityMappedPages
§impl Send for EarlyIdentityMappedPages
§impl Sync for EarlyIdentityMappedPages
§impl Unpin for EarlyIdentityMappedPages
§impl UnwindSafe for EarlyIdentityMappedPages
Blanket Implementations§
source§impl<T> From<T> for T
Trait Implementations§
Auto Trait Implementations§
§impl RefUnwindSafe for EarlyIdentityMappedPages
§impl Send for EarlyIdentityMappedPages
§impl Sync for EarlyIdentityMappedPages
§impl Unpin for EarlyIdentityMappedPages
§impl UnwindSafe for EarlyIdentityMappedPages
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · 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.
diff --git a/doc/memory/struct.Immutable.html b/doc/memory/struct.Immutable.html
index 19d942defb..928b6e0201 100644
--- a/doc/memory/struct.Immutable.html
+++ b/doc/memory/struct.Immutable.html
@@ -1,7 +1,7 @@
-Immutable in memory - Rust #[non_exhaustive]pub struct Immutable {}
Expand description
A marker type used to indicate that a BorrowedMappedPages
+
Immutable in memory - Rust #[non_exhaustive]pub struct Immutable {}
Expand description
A marker type used to indicate that a BorrowedMappedPages
or BorrowedSliceMappedPages
is borrowed immutably.
Implements the Mutability
trait.
-Trait Implementations§
source§impl Mutability for Immutable
Auto Trait Implementations§
§impl RefUnwindSafe for Immutable
§impl Send for Immutable
§impl Sync for Immutable
§impl Unpin for Immutable
§impl UnwindSafe for Immutable
Blanket Implementations§
source§impl<T> From<T> for T
Trait Implementations§
source§impl Mutability for Immutable
Auto Trait Implementations§
§impl RefUnwindSafe for Immutable
§impl Send for Immutable
§impl Sync for Immutable
§impl Unpin for Immutable
§impl UnwindSafe for Immutable
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · 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.
diff --git a/doc/memory/struct.InitialMemoryMappings.html b/doc/memory/struct.InitialMemoryMappings.html
index 64d6e1992e..ac0918866b 100644
--- a/doc/memory/struct.InitialMemoryMappings.html
+++ b/doc/memory/struct.InitialMemoryMappings.html
@@ -1,4 +1,4 @@
-InitialMemoryMappings in memory - Rust Struct memory::InitialMemoryMappings
source · pub struct InitialMemoryMappings {
+InitialMemoryMappings in memory - Rust Struct memory::InitialMemoryMappings
source · pub struct InitialMemoryMappings {
pub page_table: PageTable,
pub text: NoDrop<MappedPages>,
pub rodata: NoDrop<MappedPages>,
@@ -26,7 +26,7 @@
§additional: NoDrop<MappedPages>
The list of additional mappings that must be kept forever.
Currently, this contains only one mapping: the early VGA buffer.
-Trait Implementations§
Auto Trait Implementations§
§impl RefUnwindSafe for InitialMemoryMappings
§impl Send for InitialMemoryMappings
§impl Sync for InitialMemoryMappings
§impl Unpin for InitialMemoryMappings
§impl UnwindSafe for InitialMemoryMappings
Blanket Implementations§
source§impl<T> From<T> for T
const: unstable · source§fn from(t: T) -> T
Returns the argument unchanged.
+Trait Implementations§
Auto Trait Implementations§
§impl RefUnwindSafe for InitialMemoryMappings
§impl Send for InitialMemoryMappings
§impl Sync for InitialMemoryMappings
§impl Unpin for InitialMemoryMappings
§impl UnwindSafe for InitialMemoryMappings
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · 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.
diff --git a/doc/memory/struct.MappedPages.html b/doc/memory/struct.MappedPages.html
index 7019b3ee42..c075eb7341 100644
--- a/doc/memory/struct.MappedPages.html
+++ b/doc/memory/struct.MappedPages.html
@@ -1,14 +1,14 @@
-MappedPages in memory - Rust Struct memory::MappedPages
source · pub struct MappedPages { /* private fields */ }
Expand description
Represents a contiguous range of virtual memory pages that are currently mapped.
+
MappedPages in memory - Rust Struct memory::MappedPages
source · pub struct MappedPages { /* private fields */ }
Expand description
Represents a contiguous range of virtual memory pages that are currently mapped.
A MappedPages
object can only have a single range of contiguous pages, not multiple disjoint ranges.
This does not guarantee that its pages are mapped to frames that are contiguous in physical memory.
This object also represents ownership of those pages; if this object falls out of scope,
it will be dropped, and the pages will be unmapped and then also de-allocated.
Thus, it ensures memory safety by guaranteeing that this object must be held
in order to access data stored in these mapped pages, much like a guard type.
-Implementations§
source§impl MappedPages
sourcepub const fn empty() -> MappedPages
Returns an empty MappedPages object that performs no allocation or mapping actions.
+
Implementations§
source§impl MappedPages
sourcepub const fn empty() -> MappedPages
Returns an empty MappedPages object that performs no allocation or mapping actions.
Can be used as a placeholder, but will not permit any real usage.
-sourcepub fn flags(&self) -> PteFlagsArch
Returns the flags that describe this MappedPages
page table permissions.
-sourcepub fn merge(
&mut self,
mp: MappedPages
) -> Result<(), (&'static str, MappedPages)>
Merges the given MappedPages
object mp
into this MappedPages
object (self
).
+sourcepub fn flags(&self) -> PteFlagsArch
Returns the flags that describe this MappedPages
page table permissions.
+sourcepub fn merge(
&mut self,
mp: MappedPages
) -> Result<(), (&'static str, MappedPages)>
Merges the given MappedPages
object mp
into this MappedPages
object (self
).
For example, if you have the following MappedPages
objects:
- this mapping, with a page range including one page at 0x2000
@@ -22,7 +22,7 @@
which prevents the mp
from being dropped.
Note
No remapping actions or page reallocations will occur on either a failure or a success.
-
sourcepub fn split(
self,
at_page: Page
) -> Result<(MappedPages, MappedPages), MappedPages>
Splits this MappedPages
into two separate MappedPages
objects:
+sourcepub fn split(
self,
at_page: Page
) -> Result<(MappedPages, MappedPages), MappedPages>
Splits this MappedPages
into two separate MappedPages
objects:
sourcepub fn deep_copy<F: Into<PteFlagsArch>>(
&self,
active_table_mapper: &mut Mapper,
new_flags: Option<F>
) -> Result<MappedPages, &'static str>
Creates a deep copy of this MappedPages
memory region,
+
sourcepub fn deep_copy<F: Into<PteFlagsArch>>(
&self,
active_table_mapper: &mut Mapper,
new_flags: Option<F>
) -> Result<MappedPages, &'static str>
Creates a deep copy of this MappedPages
memory region,
by duplicating not only the virtual memory mapping
but also the underlying physical memory frames.
The caller can optionally specify new flags for the duplicated mapping,
@@ -45,17 +45,17 @@
Note
since it avoids extra remap()
operations.
Returns a new MappedPages
object with the same in-memory contents
as this object, but at a completely new memory region.
-sourcepub fn remap<F: Into<PteFlagsArch>>(
&mut self,
active_table_mapper: &mut Mapper,
new_flags: F
) -> Result<(), &'static str>
Change the mapping flags of this MappedPages
’s page table entries.
+sourcepub fn remap<F: Into<PteFlagsArch>>(
&mut self,
active_table_mapper: &mut Mapper,
new_flags: F
) -> Result<(), &'static str>
Change the mapping flags of this MappedPages
’s page table entries.
Note that attempting to change certain “reserved” flags will have no effect.
For example, the EXCLUSIVE
flag cannot be changed beause arbitrarily setting it
would violate safety.
-sourcepub fn unmap_into_parts(
self,
active_table_mapper: &mut Mapper
) -> Result<(AllocatedPages, Option<AllocatedFrames>), Self>
Consumes and unmaps this MappedPages
object without auto-deallocating its AllocatedPages
and AllocatedFrames
,
+
sourcepub fn unmap_into_parts(
self,
active_table_mapper: &mut Mapper
) -> Result<(AllocatedPages, Option<AllocatedFrames>), Self>
Consumes and unmaps this MappedPages
object without auto-deallocating its AllocatedPages
and AllocatedFrames
,
allowing the caller to continue using them directly, e.g., reusing them for a future mapping.
This removes the need to attempt to to reallocate those same pages or frames on a separate code path.
Note that only the first contiguous range of AllocatedFrames
will be returned, if any were unmapped.
All other non-contiguous ranges will be auto-dropped and deallocated.
This is due to how frame deallocation works.
-sourcepub fn as_type<T: FromBytes>(
&self,
byte_offset: usize
) -> Result<&T, &'static str>
Reinterprets this MappedPages
’s underlying memory region as a struct of the given type T
,
+
sourcepub fn as_type<T: FromBytes>(
&self,
byte_offset: usize
) -> Result<&T, &'static str>
Reinterprets this MappedPages
’s underlying memory region as a struct of the given type T
,
i.e., overlays a struct on top of this mapped memory region.
Requirements
The type T
must implement the FromBytes
trait, which is similar to the requirements
@@ -79,9 +79,9 @@
Arguments
with a lifetime dependent upon the lifetime of this MappedPages
object.
This ensures safety by guaranteeing that the returned struct reference
cannot be used after this MappedPages
object is dropped and unmapped.
-sourcepub fn as_type_mut<T: FromBytes>(
&mut self,
byte_offset: usize
) -> Result<&mut T, &'static str>
Same as MappedPages::as_type()
, but returns a mutable reference to the type T
.
+sourcepub fn as_type_mut<T: FromBytes>(
&mut self,
byte_offset: usize
) -> Result<&mut T, &'static str>
Same as MappedPages::as_type()
, but returns a mutable reference to the type T
.
Thus, it also checks that the underlying mapping is writable.
-sourcepub fn as_slice<T: FromBytes>(
&self,
byte_offset: usize,
length: usize
) -> Result<&[T], &'static str>
Reinterprets this MappedPages
’s underlying memory region as &[T]
, a length
-element slice of type T
.
+sourcepub fn as_slice<T: FromBytes>(
&self,
byte_offset: usize,
length: usize
) -> Result<&[T], &'static str>
Reinterprets this MappedPages
’s underlying memory region as &[T]
, a length
-element slice of type T
.
It has similar requirements and behavior as MappedPages::as_type()
.
Arguments
@@ -97,12 +97,12 @@ Arguments
with a lifetime dependent upon the lifetime of this MappedPages
object.
This ensures safety by guaranteeing that the returned slice
cannot be used after this MappedPages
object is dropped and unmapped.
-
sourcepub fn as_slice_mut<T: FromBytes>(
&mut self,
byte_offset: usize,
length: usize
) -> Result<&mut [T], &'static str>
Same as MappedPages::as_slice()
, but returns a mutable slice.
+sourcepub fn as_slice_mut<T: FromBytes>(
&mut self,
byte_offset: usize,
length: usize
) -> Result<&mut [T], &'static str>
Same as MappedPages::as_slice()
, but returns a mutable slice.
Thus, it checks that the underlying mapping is writable.
-sourcepub fn into_borrowed<T: FromBytes>(
self,
byte_offset: usize
) -> Result<BorrowedMappedPages<T, Immutable>, (MappedPages, &'static str)>
A convenience function for BorrowedMappedPages::from()
.
-sourcepub fn into_borrowed_mut<T: FromBytes>(
self,
byte_offset: usize
) -> Result<BorrowedMappedPages<T, Mutable>, (MappedPages, &'static str)>
A convenience function for BorrowedMappedPages::from_mut()
.
-sourcepub fn into_borrowed_slice<T: FromBytes>(
self,
byte_offset: usize,
length: usize
) -> Result<BorrowedSliceMappedPages<T, Immutable>, (MappedPages, &'static str)>
A convenience function for BorrowedSliceMappedPages::from()
.
-sourcepub fn into_borrowed_slice_mut<T: FromBytes>(
self,
byte_offset: usize,
length: usize
) -> Result<BorrowedSliceMappedPages<T, Mutable>, (MappedPages, &'static str)>
A convenience function for BorrowedSliceMappedPages::from_mut()
.
+sourcepub fn into_borrowed<T: FromBytes>(
self,
byte_offset: usize
) -> Result<BorrowedMappedPages<T, Immutable>, (MappedPages, &'static str)>
A convenience function for BorrowedMappedPages::from()
.
+sourcepub fn into_borrowed_mut<T: FromBytes>(
self,
byte_offset: usize
) -> Result<BorrowedMappedPages<T, Mutable>, (MappedPages, &'static str)>
A convenience function for BorrowedMappedPages::from_mut()
.
+sourcepub fn into_borrowed_slice<T: FromBytes>(
self,
byte_offset: usize,
length: usize
) -> Result<BorrowedSliceMappedPages<T, Immutable>, (MappedPages, &'static str)>
A convenience function for BorrowedSliceMappedPages::from()
.
+sourcepub fn into_borrowed_slice_mut<T: FromBytes>(
self,
byte_offset: usize,
length: usize
) -> Result<BorrowedSliceMappedPages<T, Mutable>, (MappedPages, &'static str)>
A convenience function for BorrowedSliceMappedPages::from_mut()
.
Methods from Deref<Target = PageRange>§
pub fn start_address(&self) -> VirtualAddress
Returns the VirtualAddress
of the starting Page
in this PageRange
.
pub fn size_in_pages(&self) -> usize
Returns the number of Page
s covered by this iterator.
Use this instead of Iterator::count()
method. This is instant, because it doesn’t need to iterate over each entry, unlike normal iterators.
@@ -175,7 +175,7 @@ Examples
for _ in r.by_ref() {}
// Precise field values are unspecified here
assert!(r.is_empty());
-Trait Implementations§
source§impl Debug for MappedPages
source§impl Deref for MappedPages
Auto Trait Implementations§
§impl RefUnwindSafe for MappedPages
§impl Send for MappedPages
§impl Sync for MappedPages
§impl Unpin for MappedPages
§impl UnwindSafe for MappedPages
Blanket Implementations§
Trait Implementations§
source§impl Debug for MappedPages
source§impl Deref for MappedPages
Auto Trait Implementations§
§impl RefUnwindSafe for MappedPages
§impl Send for MappedPages
§impl Sync for MappedPages
§impl Unpin for MappedPages
§impl UnwindSafe for MappedPages
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · 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.
diff --git a/doc/memory/struct.Mapper.html b/doc/memory/struct.Mapper.html
index 35fd775e34..45d1cc34bb 100644
--- a/doc/memory/struct.Mapper.html
+++ b/doc/memory/struct.Mapper.html
@@ -1,11 +1,11 @@
-Mapper in memory - Rust pub struct Mapper { /* private fields */ }
Implementations§
source§impl Mapper
sourcepub fn dump_pte(&self, virtual_address: VirtualAddress)
Dumps all page table entries at all four page table levels for the given VirtualAddress
,
+
Mapper in memory - Rust pub struct Mapper { /* private fields */ }
Implementations§
source§impl Mapper
sourcepub fn dump_pte(&self, virtual_address: VirtualAddress)
Dumps all page table entries at all four page table levels for the given VirtualAddress
,
and also shows their PteFlags
.
The page table details are written to the log as an info
message.
-sourcepub fn translate(
&self,
virtual_address: VirtualAddress
) -> Option<PhysicalAddress>
Translates a VirtualAddress
to a PhysicalAddress
by walking the page tables.
-sourcepub fn translate_page(&self, page: Page) -> Option<Frame>
Translates a virtual memory Page
to a physical memory Frame
by walking the page tables.
-sourcepub fn map_allocated_pages_to<F: Into<PteFlagsArch>>(
&mut self,
pages: AllocatedPages,
frames: AllocatedFrames,
flags: F
) -> Result<MappedPages, &'static str>
Maps the given virtual AllocatedPages
to the given physical AllocatedFrames
.
+sourcepub fn translate(
&self,
virtual_address: VirtualAddress
) -> Option<PhysicalAddress>
Translates a VirtualAddress
to a PhysicalAddress
by walking the page tables.
+sourcepub fn translate_page(&self, page: Page) -> Option<Frame>
Translates a virtual memory Page
to a physical memory Frame
by walking the page tables.
+sourcepub fn map_allocated_pages_to<F: Into<PteFlagsArch>>(
&mut self,
pages: AllocatedPages,
frames: AllocatedFrames,
flags: F
) -> Result<MappedPages, &'static str>
Maps the given virtual AllocatedPages
to the given physical AllocatedFrames
.
Consumes the given AllocatedPages
and returns a MappedPages
object which contains those AllocatedPages
.
-sourcepub fn map_allocated_pages<F: Into<PteFlagsArch>>(
&mut self,
pages: AllocatedPages,
flags: F
) -> Result<MappedPages, &'static str>
Maps the given AllocatedPages
to randomly chosen (allocated) physical frames.
+sourcepub fn map_allocated_pages<F: Into<PteFlagsArch>>(
&mut self,
pages: AllocatedPages,
flags: F
) -> Result<MappedPages, &'static str>
Maps the given AllocatedPages
to randomly chosen (allocated) physical frames.
Consumes the given AllocatedPages
and returns a MappedPages
object which contains those AllocatedPages
.
Auto Trait Implementations§
§impl RefUnwindSafe for Mapper
§impl Send for Mapper
§impl Sync for Mapper
§impl Unpin for Mapper
§impl UnwindSafe for Mapper
Blanket Implementations§
source§impl<T, U> Into<U> for Twhere
U: From<T>,
const: unstable · source§fn into(self) -> U
Calls U::from(self)
.
diff --git a/doc/memory/struct.MemoryManagementInfo.html b/doc/memory/struct.MemoryManagementInfo.html
index c3c7e995a9..dd4a9058a9 100644
--- a/doc/memory/struct.MemoryManagementInfo.html
+++ b/doc/memory/struct.MemoryManagementInfo.html
@@ -1,4 +1,4 @@
-MemoryManagementInfo in memory - Rust Struct memory::MemoryManagementInfo
source · pub struct MemoryManagementInfo {
+MemoryManagementInfo in memory - Rust