Skip to content

Commit add9e20

Browse files
committed
Bump bitflags to 2.3.2
1 parent 486c2a4 commit add9e20

File tree

10 files changed

+15
-2
lines changed

10 files changed

+15
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ rust-version = "1.57" # Needed to support panic! in const fns
2121

2222
[dependencies]
2323
bit_field = "0.10.1"
24-
bitflags = "1.3.2"
24+
bitflags = "2.3.2"
2525
volatile = "0.4.4"
2626
rustversion = "1.0.5"
2727

src/registers/control.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pub struct Cr0;
1010
bitflags! {
1111
/// Configuration flags of the [`Cr0`] register.
1212
#[repr(transparent)]
13+
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
1314
pub struct Cr0Flags: u64 {
1415
/// Enables protected mode.
1516
const PROTECTED_MODE_ENABLE = 1;
@@ -64,6 +65,7 @@ bitflags! {
6465
/// Controls cache settings for the highest-level page table.
6566
///
6667
/// Unused if paging is disabled or if [`PCID`](Cr4Flags::PCID) is enabled.
68+
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
6769
pub struct Cr3Flags: u64 {
6870
/// Use a writethrough cache policy for the table (otherwise a writeback policy is used).
6971
const PAGE_LEVEL_WRITETHROUGH = 1 << 3;
@@ -80,6 +82,7 @@ pub struct Cr4;
8082
bitflags! {
8183
/// Configuration flags of the [`Cr4`] register.
8284
#[repr(transparent)]
85+
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
8386
pub struct Cr4Flags: u64 {
8487
/// Enables hardware-supported performance enhancements for software running in
8588
/// virtual-8086 mode.

src/registers/debug.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ pub struct Dr6;
110110
bitflags! {
111111
/// Debug condition flags of the [`Dr6`] register.
112112
#[repr(transparent)]
113+
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
113114
pub struct Dr6Flags: u64 {
114115
/// Breakpoint condition 0 was detected.
115116
const TRAP0 = 1;
@@ -124,7 +125,7 @@ bitflags! {
124125
const TRAP3 = 1 << 3;
125126

126127
/// Breakpoint condition was detected.
127-
const TRAP = Self::TRAP0.bits | Self::TRAP1.bits | Self::TRAP2.bits | Self::TRAP3.bits;
128+
const TRAP = Self::TRAP0.bits() | Self::TRAP1.bits() | Self::TRAP2.bits() | Self::TRAP3.bits();
128129

129130
/// Next instruction accesses one of the debug registers.
130131
///
@@ -164,6 +165,7 @@ impl Dr6Flags {
164165
bitflags! {
165166
/// Debug control flags of the [`Dr7`] register.
166167
#[repr(transparent)]
168+
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
167169
pub struct Dr7Flags: u64 {
168170
/// Breakpoint 0 is enabled for the current task.
169171
const LOCAL_BREAKPOINT_0_ENABLE = 1;

src/registers/model_specific.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ impl SCet {
111111
bitflags! {
112112
/// Flags of the Extended Feature Enable Register.
113113
#[repr(transparent)]
114+
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
114115
pub struct EferFlags: u64 {
115116
/// Enables the `syscall` and `sysret` instructions.
116117
const SYSTEM_CALL_EXTENSIONS = 1;
@@ -135,6 +136,7 @@ bitflags! {
135136
/// Flags stored in IA32_U_CET and IA32_S_CET (Table-2-2 in Intel SDM Volume
136137
/// 4). The Intel SDM-equivalent names are described in parentheses.
137138
#[repr(transparent)]
139+
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
138140
pub struct CetFlags: u64 {
139141
/// Enable shadow stack (SH_STK_EN)
140142
const SS_ENABLE = 1 << 0;

src/registers/mxcsr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use bitflags::bitflags;
88
bitflags! {
99
/// MXCSR register.
1010
#[repr(transparent)]
11+
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
1112
pub struct MxCsr: u32 {
1213
/// Invalid operation
1314
const INVALID_OPERATION = 1 << 0;

src/registers/rflags.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use bitflags::bitflags;
88
bitflags! {
99
/// The RFLAGS register.
1010
#[repr(transparent)]
11+
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
1112
pub struct RFlags: u64 {
1213
/// Processor feature identification flag.
1314
///

src/registers/xcontrol.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ bitflags! {
1111
/// For MPX, [`BNDREG`](XCr0Flags::BNDREG) and [`BNDCSR`](XCr0Flags::BNDCSR) must be set/unset simultaneously.
1212
/// For AVX-512, [`OPMASK`](XCr0Flags::OPMASK), [`ZMM_HI256`](XCr0Flags::ZMM_HI256), and [`HI16_ZMM`](XCr0Flags::HI16_ZMM) must be set/unset simultaneously.
1313
#[repr(transparent)]
14+
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
1415
pub struct XCr0Flags: u64 {
1516
/// Enables using the x87 FPU state
1617
/// with `XSAVE`/`XRSTOR`.

src/structures/gdt.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ pub enum Descriptor {
187187

188188
bitflags! {
189189
/// Flags for a GDT descriptor. Not all flags are valid for all descriptor types.
190+
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
190191
pub struct DescriptorFlags: u64 {
191192
/// Set by the processor if this segment has been accessed. Only cleared by software.
192193
/// _Setting_ this bit in software prevents GDT writes on first use.

src/structures/idt.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,7 @@ bitflags! {
968968
/// * AMD Volume 2: 8.4.2
969969
/// * Intel Volume 3A: 4.7
970970
#[repr(transparent)]
971+
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
971972
pub struct PageFaultErrorCode: u64 {
972973
/// If this flag is set, the page fault was caused by a page-protection violation,
973974
/// else the page fault was caused by a not-present page.

src/structures/paging/page_table.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ impl fmt::Debug for PageTableEntry {
106106

107107
bitflags! {
108108
/// Possible flags for a page table entry.
109+
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
109110
pub struct PageTableFlags: u64 {
110111
/// Specifies whether the mapped frame or page table is loaded in memory.
111112
const PRESENT = 1;

0 commit comments

Comments
 (0)