aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/x86.rs2
-rw-r--r--src/x86_64.rs2
-rw-r--r--src/x86_shared.rs8
3 files changed, 6 insertions, 6 deletions
diff --git a/src/x86.rs b/src/x86.rs
index 40e181a..3c5cd99 100644
--- a/src/x86.rs
+++ b/src/x86.rs
@@ -179,7 +179,7 @@ impl Tss {
#[inline(always)]
pub fn get_flags() -> Flags {
unsafe {
- let mut r: usize;
+ let r: usize;
asm!("pushfd; pop $0" : "=r"(r) ::: "intel");
Flags::from_bits_truncate(r)
}
diff --git a/src/x86_64.rs b/src/x86_64.rs
index 67b7e64..64c0efd 100644
--- a/src/x86_64.rs
+++ b/src/x86_64.rs
@@ -7,7 +7,7 @@ mod x86_shared;
#[inline(always)]
pub fn get_flags() -> Flags {
unsafe {
- let mut r: usize;
+ let r: usize;
asm!("pushfq; pop $0" : "=r"(r) ::: "intel");
Flags::from_bits_truncate(r)
}
diff --git a/src/x86_shared.rs b/src/x86_shared.rs
index 4189594..7d63a66 100644
--- a/src/x86_shared.rs
+++ b/src/x86_shared.rs
@@ -278,7 +278,7 @@ pub unsafe fn set_cs(selector: SegmentSelector) {
#[inline(always)]
pub fn get_cr0() -> Cr0 {
unsafe {
- let mut r: usize;
+ let r: usize;
asm!("mov $0, cr0" : "=r"(r) ::: "intel");
Cr0::from_bits_truncate(r)
}
@@ -287,7 +287,7 @@ pub fn get_cr0() -> Cr0 {
#[inline(always)]
pub fn get_cr2() -> usize {
unsafe {
- let mut r: usize;
+ let r: usize;
asm!("mov $0, cr2" : "=r"(r) ::: "intel");
r
}
@@ -296,7 +296,7 @@ pub fn get_cr2() -> usize {
#[inline(always)]
pub fn get_cr3() -> usize {
unsafe {
- let mut r: usize;
+ let r: usize;
asm!("mov $0, cr3" : "=r"(r) ::: "intel");
r
}
@@ -305,7 +305,7 @@ pub fn get_cr3() -> usize {
#[inline(always)]
pub fn get_cr4() -> Cr4 {
unsafe {
- let mut r: usize;
+ let r: usize;
asm!("mov $0, cr4" : "=r"(r) ::: "intel");
Cr4::from_bits_truncate(r)
}