Update post-06 to set CS register with non-deprecated function (#1099)

Set CS register with non-deprecated function
This commit is contained in:
ruhuang
2022-04-08 16:05:21 +08:00
committed by GitHub
parent 4a684a06b1
commit b72c457481

View File

@@ -41,12 +41,12 @@ struct Selectors {
} }
pub fn init() { pub fn init() {
use x86_64::instructions::segmentation::set_cs; use x86_64::instructions::segmentation::{Segment, CS};
use x86_64::instructions::tables::load_tss; use x86_64::instructions::tables::load_tss;
GDT.0.load(); GDT.0.load();
unsafe { unsafe {
set_cs(GDT.1.code_selector); CS::set_reg(GDT.1.code_selector);
load_tss(GDT.1.tss_selector); load_tss(GDT.1.tss_selector);
} }
} }