We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ece87b commit 03583d3Copy full SHA for 03583d3
src/sys/gdt.rs
@@ -1,7 +1,9 @@
1
use lazy_static::lazy_static;
2
+use x86_64::VirtAddr;
3
+use x86_64::instructions::segmentation::{CS, Segment};
4
+use x86_64::instructions::tables::load_tss;
5
use x86_64::structures::gdt::{Descriptor, GlobalDescriptorTable, SegmentSelector};
6
use x86_64::structures::tss::TaskStateSegment;
-use x86_64::VirtAddr;
7
8
pub const DOUBLE_FAULT_IST_INDEX: u16 = 0;
9
@@ -38,12 +40,9 @@ struct Selectors {
38
40
}
39
41
42
pub fn init() {
- use x86_64::instructions::segmentation::set_cs;
- use x86_64::instructions::tables::load_tss;
43
-
44
GDT.0.load();
45
unsafe {
46
- set_cs(GDT.1.code_selector);
+ CS::set_reg(GDT.1.code_selector);
47
load_tss(GDT.1.tss_selector);
48
49
0 commit comments