aboutsummaryrefslogtreecommitdiff
path: root/src/segmentation.rs
diff options
context:
space:
mode:
authorGravatar John Ericson <Ericson2314@Yahoo.com> 2016-06-26 18:49:50 -0700
committerGravatar John Ericson <Ericson2314@Yahoo.com> 2016-06-26 18:49:50 -0700
commitb071258ae864f869cf578fd2a47c80af3edce15a (patch)
tree2a326321a1ac902b9ba2b6e75896d4b6a509ce23 /src/segmentation.rs
parent32257991aaa3700620f1d6c180cfec3e2d65a360 (diff)
downloadrust-x86-b071258ae864f869cf578fd2a47c80af3edce15a.tar.gz
rust-x86-b071258ae864f869cf578fd2a47c80af3edce15a.tar.zst
rust-x86-b071258ae864f869cf578fd2a47c80af3edce15a.zip
Use upstream bitflags now that no_std issues were resolved
Diffstat (limited to 'src/segmentation.rs')
-rw-r--r--src/segmentation.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/segmentation.rs b/src/segmentation.rs
index e3c259e..e46b333 100644
--- a/src/segmentation.rs
+++ b/src/segmentation.rs
@@ -6,7 +6,7 @@ use core::fmt;
/// descriptor tables (i.e., is a index to LDT or GDT table
/// with some additional flags).
bitflags! {
- flags SegmentSelector: u16 {
+ pub flags SegmentSelector: u16 {
/// Requestor Privilege Level
const RPL_0 = 0b00,
const RPL_1 = 0b01,
@@ -35,7 +35,7 @@ impl SegmentSelector {
}
}
-impl fmt::Debug for SegmentSelector {
+impl fmt::Display for SegmentSelector {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let r0 = match self.contains(RPL_0) {
false => "",
@@ -73,7 +73,7 @@ impl fmt::Debug for SegmentSelector {
/// Entry for GDT or LDT. Provides size and location of a segment.
bitflags! {
- flags SegmentDescriptor: u64 {
+ pub flags SegmentDescriptor: u64 {
/// Descriptor type (0 = system; 1 = code or data).
const DESC_S = 1 << (32+12),
/// Descriptor privilege level 0.
@@ -162,12 +162,6 @@ impl SegmentDescriptor {
}
}
-impl fmt::Debug for SegmentDescriptor {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "SD: 0x{:x}", self.bits)
- }
-}
-
/// Reload stack segment register.
pub unsafe fn load_ss(sel: SegmentSelector) {
asm!("movw $0, %ss " :: "r" (sel) : "memory");