aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Tobba <tobias.haegermarck@gmail.com> 2015-09-07 16:02:01 +0200
committerGravatar Tobba <tobias.haegermarck@gmail.com> 2015-09-07 16:02:01 +0200
commit709d4bfe3ad6ecf20ed79f5db7ad7aac25b189e6 (patch)
treefaeb5a2664a99b032b75d89a38776a6a978ca291 /src
parent9f0715be0fb13373e26e563a2449a718fc79ed72 (diff)
parent9a04dd6b444659a4039e857bd790add6db33dded (diff)
downloadrust-x86-709d4bfe3ad6ecf20ed79f5db7ad7aac25b189e6.tar.gz
rust-x86-709d4bfe3ad6ecf20ed79f5db7ad7aac25b189e6.tar.zst
rust-x86-709d4bfe3ad6ecf20ed79f5db7ad7aac25b189e6.zip
Merge branch 'master' of github.com:Tobba/libcpu
Diffstat (limited to 'src')
-rw-r--r--src/x86.rs28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/x86.rs b/src/x86.rs
index 1675790..40e181a 100644
--- a/src/x86.rs
+++ b/src/x86.rs
@@ -38,16 +38,14 @@ pub struct IdtEntry {
}
impl GdtEntry {
- pub fn null() -> GdtEntry {
- GdtEntry {
- base1: 0,
- base2: 0,
- base3: 0,
- access: 0,
- limit: 0,
- flags: 0
- }
- }
+ pub const NULL: GdtEntry = GdtEntry {
+ base1: 0,
+ base2: 0,
+ base3: 0,
+ access: 0,
+ limit: 0,
+ flags: 0
+ };
pub fn new(base: *const (), limit: usize, access: GdtAccess, dpl: PrivilegeLevel) -> GdtEntry {
let (limit, flags) = if limit < 0x100000 {
@@ -69,9 +67,15 @@ impl GdtEntry {
}
}
-pub const NULL_IDT_ENTRY: IdtEntry = IdtEntry { offset1: 0, selector: 0, reserved: 0, flags: 0, offset2: 0 };
-
impl IdtEntry {
+ pub const NULL: IdtEntry = IdtEntry {
+ offset1: 0,
+ selector: 0,
+ reserved: 0,
+ flags: 0,
+ offset2: 0
+ };
+
pub fn new(f: unsafe extern "C" fn(), dpl: PrivilegeLevel, block: bool) -> IdtEntry {
IdtEntry {
offset1: f as u16,