mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Update to latest bit_field version
(cherry picked from commit 46100ba24b)
This commit is contained in:
@@ -4,7 +4,7 @@ name = "blog_os"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bit_field = "0.5.0"
|
bit_field = "0.7.0"
|
||||||
bitflags = "0.7.0"
|
bitflags = "0.7.0"
|
||||||
multiboot2 = "0.1.0"
|
multiboot2 = "0.1.0"
|
||||||
once = "0.3.2"
|
once = "0.3.2"
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ pub struct EntryOptions(u16);
|
|||||||
impl EntryOptions {
|
impl EntryOptions {
|
||||||
fn minimal() -> Self {
|
fn minimal() -> Self {
|
||||||
let mut options = 0;
|
let mut options = 0;
|
||||||
options.set_range(9..12, 0b111); // 'must-be-one' bits
|
options.set_bits(9..12, 0b111); // 'must-be-one' bits
|
||||||
EntryOptions(options)
|
EntryOptions(options)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,13 +103,13 @@ impl EntryOptions {
|
|||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub fn set_privilege_level(&mut self, dpl: u16) -> &mut Self {
|
pub fn set_privilege_level(&mut self, dpl: u16) -> &mut Self {
|
||||||
self.0.set_range(13..15, dpl);
|
self.0.set_bits(13..15, dpl);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub fn set_stack_index(&mut self, index: u16) -> &mut Self {
|
pub fn set_stack_index(&mut self, index: u16) -> &mut Self {
|
||||||
self.0.set_range(0..3, index);
|
self.0.set_bits(0..3, index);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user