Skip to content

const_fn: Remove stabilized features #352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

#![cfg_attr(not(test), no_std)]
#![cfg_attr(feature = "const_fn", feature(const_mut_refs))] // GDT add_entry()
#![cfg_attr(feature = "const_fn", feature(const_fn_fn_ptr_basics))] // IDT new()
#![cfg_attr(feature = "const_fn", feature(const_fn_trait_bound))] // PageSize marker trait
#![cfg_attr(feature = "abi_x86_interrupt", feature(abi_x86_interrupt))]
#![cfg_attr(feature = "step_trait", feature(step_trait))]
#![cfg_attr(feature = "doc_cfg", feature(doc_cfg))]
Expand Down
1 change: 1 addition & 0 deletions src/structures/idt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ pub struct InterruptDescriptorTable {
}

impl InterruptDescriptorTable {
// TODO: Remove const_fn! when our minimum supported stable Rust version is 1.61
const_fn! {
/// Creates a new IDT filled with non-present entries.
#[inline]
Expand Down
8 changes: 7 additions & 1 deletion src/structures/paging/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ use core::ops::{Add, AddAssign, Sub, SubAssign};
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(C)]
pub struct PhysFrame<S: PageSize = Size4KiB> {
pub(crate) start_address: PhysAddr, // TODO: remove when start_address() is const
// TODO: Make private when our minimum supported stable Rust version is 1.61
pub(crate) start_address: PhysAddr,
size: PhantomData<S>,
}

Expand All @@ -29,6 +30,7 @@ impl<S: PageSize> PhysFrame<S> {
Ok(unsafe { PhysFrame::from_start_address_unchecked(address) })
}

// TODO: Remove const_fn! when our minimum supported stable Rust version is 1.61
const_fn! {
/// Returns the frame that starts at the given virtual address.
///
Expand All @@ -53,6 +55,7 @@ impl<S: PageSize> PhysFrame<S> {
}
}

// TODO: Remove const_fn! when our minimum supported stable Rust version is 1.61
const_fn! {
/// Returns the start address of the frame.
#[inline]
Expand All @@ -61,6 +64,7 @@ impl<S: PageSize> PhysFrame<S> {
}
}

// TODO: Remove const_fn! when our minimum supported stable Rust version is 1.61
const_fn! {
/// Returns the size the frame (4KB, 2MB or 1GB).
#[inline]
Expand All @@ -69,6 +73,7 @@ impl<S: PageSize> PhysFrame<S> {
}
}

// TODO: Remove const_fn! when our minimum supported stable Rust version is 1.61
const_fn! {
/// Returns a range of frames, exclusive `end`.
#[inline]
Expand All @@ -77,6 +82,7 @@ impl<S: PageSize> PhysFrame<S> {
}
}

// TODO: Remove const_fn! when our minimum supported stable Rust version is 1.61
const_fn! {
/// Returns a range of frames, inclusive `end`.
#[inline]
Expand Down
9 changes: 9 additions & 0 deletions src/structures/paging/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ impl<S: PageSize> Page<S> {
Ok(Page::containing_address(address))
}

// TODO: Remove const_fn! when our minimum supported stable Rust version is 1.61
const_fn! {
/// Returns the page that starts at the given virtual address.
///
Expand All @@ -101,6 +102,7 @@ impl<S: PageSize> Page<S> {
}
}

// TODO: Remove const_fn! when our minimum supported stable Rust version is 1.61
const_fn! {
/// Returns the start address of the page.
#[inline]
Expand All @@ -109,6 +111,7 @@ impl<S: PageSize> Page<S> {
}
}

// TODO: Remove const_fn! when our minimum supported stable Rust version is 1.61
const_fn! {
/// Returns the size the page (4KB, 2MB or 1GB).
#[inline]
Expand All @@ -117,6 +120,7 @@ impl<S: PageSize> Page<S> {
}
}

// TODO: Remove const_fn! when our minimum supported stable Rust version is 1.61
const_fn! {
/// Returns the level 4 page table index of this page.
#[inline]
Expand All @@ -125,6 +129,7 @@ impl<S: PageSize> Page<S> {
}
}

// TODO: Remove const_fn! when our minimum supported stable Rust version is 1.61
const_fn! {
/// Returns the level 3 page table index of this page.
#[inline]
Expand All @@ -133,6 +138,7 @@ impl<S: PageSize> Page<S> {
}
}

// TODO: Remove const_fn! when our minimum supported stable Rust version is 1.61
const_fn! {
/// Returns the table index of this page at the specified level.
#[inline]
Expand All @@ -141,6 +147,7 @@ impl<S: PageSize> Page<S> {
}
}

// TODO: Remove const_fn! when our minimum supported stable Rust version is 1.61
const_fn! {
/// Returns a range of pages, exclusive `end`.
#[inline]
Expand All @@ -149,6 +156,7 @@ impl<S: PageSize> Page<S> {
}
}

// TODO: Remove const_fn! when our minimum supported stable Rust version is 1.61
const_fn! {
/// Returns a range of pages, inclusive `end`.
#[inline]
Expand All @@ -159,6 +167,7 @@ impl<S: PageSize> Page<S> {
}

impl<S: NotGiantPageSize> Page<S> {
// TODO: Remove const_fn! when our minimum supported stable Rust version is 1.61
const_fn! {
/// Returns the level 2 page table index of this page.
#[inline]
Expand Down