Use new x86::segmentation::cs function and merge set_handler and options

We avoid inline assembly and increase safety (it is no longer possible to set the non-present initilization entries to present).
This commit is contained in:
Philipp Oppermann
2016-05-27 21:21:08 +02:00
parent 968ae00de7
commit 8540d3844b
3 changed files with 6 additions and 14 deletions

View File

@@ -9,12 +9,10 @@ lazy_static! {
let mut idt = idt::Idt::new();
idt.set_handler(0, divide_by_zero_handler);
idt.set_handler(8, double_fault_handler);
idt.set_handler(8, double_fault_handler).set_stack_index(1);
idt.set_handler(13, general_protection_fault_handler);
idt.set_handler(14, page_fault_handler);
idt.options(8).set_stack_index(1);
idt
};