Merge pull request #1096 from Programatic/patch-1

Set CS register with non-deprecated function
This commit is contained in:
Philipp Oppermann
2022-04-07 19:07:17 +02:00
committed by GitHub

View File

@@ -363,12 +363,12 @@ Now we can use the selectors to reload the `cs` segment register and load our `T
// in src/gdt.rs // in src/gdt.rs
pub fn init() { pub fn init() {
use x86_64::instructions::segmentation::set_cs;
use x86_64::instructions::tables::load_tss; use x86_64::instructions::tables::load_tss;
use x86_64::instructions::segmentation::{CS, Segment};
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);
} }
} }