Skip to content

Commit 7cd67ad

Browse files
committed
the operation is ineffective
1 parent 5b56e3c commit 7cd67ad

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/registers/control.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ bitflags! {
1212
/// Configuration flags of the Cr0 register.
1313
pub struct Cr0Flags: u64 {
1414
/// Enables protected mode.
15-
const PROTECTED_MODE_ENABLE = 1 << 0;
15+
const PROTECTED_MODE_ENABLE = 1;
1616
/// Enables monitoring of the coprocessor, typical for x87 instructions.
1717
///
1818
/// Controls together with the `TASK_SWITCHED` flag whether a `wait` or `fwait`
@@ -73,7 +73,7 @@ bitflags! {
7373
pub struct Cr4Flags: u64 {
7474
/// Enables hardware-supported performance enhancements for software running in
7575
/// virtual-8086 mode.
76-
const VIRTUAL_8086_MODE_EXTENSIONS = 1 << 0;
76+
const VIRTUAL_8086_MODE_EXTENSIONS = 1;
7777
/// Enables support for protected-mode virtual interrupts.
7878
const PROTECTED_MODE_VIRTUAL_INTERRUPTS = 1 << 1;
7979
/// When set, only privilege-level 0 can execute the RDTSC or RDTSCP instructions.

src/registers/model_specific.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ bitflags! {
8585
/// Flags of the Extended Feature Enable Register.
8686
pub struct EferFlags: u64 {
8787
/// Enables the `syscall` and `sysret` instructions.
88-
const SYSTEM_CALL_EXTENSIONS = 1 << 0;
88+
const SYSTEM_CALL_EXTENSIONS = 1;
8989
/// Activates long mode, requires activating paging.
9090
const LONG_MODE_ENABLE = 1 << 8;
9191
/// Indicates that long mode is active.

src/registers/rflags.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ bitflags! {
5858
const PARITY_FLAG = 1 << 2;
5959
/// Set by hardware if last arithmetic operation generated a carry out of the
6060
/// most-significant bit of the result.
61-
const CARRY_FLAG = 1 << 0;
61+
const CARRY_FLAG = 1;
6262
}
6363
}
6464

src/structures/idt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ bitflags! {
824824
pub struct PageFaultErrorCode: u64 {
825825
/// If this flag is set, the page fault was caused by a page-protection violation,
826826
/// else the page fault was caused by a not-present page.
827-
const PROTECTION_VIOLATION = 1 << 0;
827+
const PROTECTION_VIOLATION = 1;
828828

829829
/// If this flag is set, the memory access that caused the page fault was a write.
830830
/// Else the access that caused the page fault is a memory read. This bit does not

src/structures/paging/page_table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ bitflags! {
114114
/// Possible flags for a page table entry.
115115
pub struct PageTableFlags: u64 {
116116
/// Specifies whether the mapped frame or page table is loaded in memory.
117-
const PRESENT = 1 << 0;
117+
const PRESENT = 1;
118118
/// Controls whether writes to the mapped frames are allowed.
119119
///
120120
/// If this bit is unset in a level 1 page table entry, the mapped frame is read-only.

0 commit comments

Comments
 (0)