Skip to content
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

remove deprecated from_bits_unchecked functions #449

Merged
merged 1 commit into from
Jan 14, 2024
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
24 changes: 0 additions & 24 deletions src/registers/control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@ bitflags! {
}
}

impl Cr0Flags {
#[deprecated = "use the safe `from_bits_retain` method instead"]
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
Self::from_bits_retain(bits)
}
}

/// Contains the Page Fault Linear Address (PFLA).
///
/// When a page fault occurs, the CPU sets this register to the faulting virtual address.
Expand All @@ -82,14 +74,6 @@ bitflags! {
}
}

impl Cr3Flags {
#[deprecated = "use the safe `from_bits_retain` method instead"]
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
Self::from_bits_retain(bits)
}
}

/// Contains various control flags that enable architectural extensions, and
/// indicate support for specific processor capabilities.
#[derive(Debug)]
Expand Down Expand Up @@ -175,14 +159,6 @@ bitflags! {
}
}

impl Cr4Flags {
#[deprecated = "use the safe `from_bits_retain` method instead"]
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
Self::from_bits_retain(bits)
}
}

#[cfg(feature = "instructions")]
mod x86_64 {
use super::*;
Expand Down
12 changes: 0 additions & 12 deletions src/registers/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,6 @@ impl Dr6Flags {
DebugAddressRegisterNumber::Dr3 => Self::TRAP3,
}
}

#[deprecated = "use the safe `from_bits_retain` method instead"]
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
Self::from_bits_retain(bits)
}
}

bitflags! {
Expand Down Expand Up @@ -239,12 +233,6 @@ impl Dr7Flags {
DebugAddressRegisterNumber::Dr3 => Self::GLOBAL_BREAKPOINT_3_ENABLE,
}
}

#[deprecated = "use the safe `from_bits_retain` method instead"]
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
Self::from_bits_retain(bits)
}
}

/// The condition for a hardware breakpoint.
Expand Down
16 changes: 0 additions & 16 deletions src/registers/model_specific.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,6 @@ bitflags! {
}
}

impl EferFlags {
#[deprecated = "use the safe `from_bits_retain` method instead"]
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
Self::from_bits_retain(bits)
}
}

bitflags! {
/// Flags stored in IA32_U_CET and IA32_S_CET (Table-2-2 in Intel SDM Volume
/// 4). The Intel SDM-equivalent names are described in parentheses.
Expand All @@ -165,14 +157,6 @@ bitflags! {
}
}

impl CetFlags {
#[deprecated = "use the safe `from_bits_retain` method instead"]
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
Self::from_bits_retain(bits)
}
}

#[cfg(feature = "instructions")]
mod x86_64 {
use super::*;
Expand Down
8 changes: 0 additions & 8 deletions src/registers/mxcsr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,6 @@ impl Default for MxCsr {
}
}

impl MxCsr {
#[deprecated = "use the safe `from_bits_retain` method instead"]
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
pub const unsafe fn from_bits_unchecked(bits: u32) -> Self {
Self::from_bits_retain(bits)
}
}

#[cfg(feature = "instructions")]
mod x86_64 {
use super::*;
Expand Down
8 changes: 0 additions & 8 deletions src/registers/rflags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@ bitflags! {
}
}

impl RFlags {
#[deprecated = "use the safe `from_bits_retain` method instead"]
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
Self::from_bits_retain(bits)
}
}

#[cfg(feature = "instructions")]
mod x86_64 {
use super::*;
Expand Down
8 changes: 0 additions & 8 deletions src/registers/xcontrol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@ bitflags! {
}
}

impl XCr0Flags {
#[deprecated = "use the safe `from_bits_retain` method instead"]
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
Self::from_bits_retain(bits)
}
}

#[cfg(feature = "instructions")]
mod x86_64 {
use super::*;
Expand Down
6 changes: 0 additions & 6 deletions src/structures/gdt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,6 @@ impl DescriptorFlags {
/// A 64-bit user code segment
pub const USER_CODE64: Self =
Self::from_bits_truncate(Self::KERNEL_CODE64.bits() | Self::DPL_RING_3.bits());

#[deprecated = "use the safe `from_bits_retain` method instead"]
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
Self::from_bits_retain(bits)
}
}

impl Descriptor {
Expand Down
8 changes: 0 additions & 8 deletions src/structures/idt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1115,14 +1115,6 @@ bitflags! {
}
}

impl PageFaultErrorCode {
#[deprecated = "use the safe `from_bits_retain` method instead"]
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
Self::from_bits_retain(bits)
}
}

/// Describes an error code referencing a segment selector.
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
#[repr(transparent)]
Expand Down
8 changes: 0 additions & 8 deletions src/structures/paging/page_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,6 @@ bitflags! {
}
}

impl PageTableFlags {
#[deprecated = "use the safe `from_bits_retain` method instead"]
/// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
pub const unsafe fn from_bits_unchecked(bits: u64) -> Self {
Self::from_bits_retain(bits)
}
}

/// The number of entries in a page table.
const ENTRY_COUNT: usize = 512;

Expand Down