diff options
author | 2015-09-07 16:02:01 +0200 | |
---|---|---|
committer | 2015-09-07 16:02:01 +0200 | |
commit | 709d4bfe3ad6ecf20ed79f5db7ad7aac25b189e6 (patch) | |
tree | faeb5a2664a99b032b75d89a38776a6a978ca291 /src | |
parent | 9f0715be0fb13373e26e563a2449a718fc79ed72 (diff) | |
parent | 9a04dd6b444659a4039e857bd790add6db33dded (diff) | |
download | rust-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.rs | 28 |
1 files changed, 16 insertions, 12 deletions
@@ -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, |