Sfoglia il codice sorgente

Kernel: Stop flushing GDT/IDT registers all the time

Andreas Kling 5 anni fa
parent
commit
c3e4387c57
2 ha cambiato i file con 0 aggiunte e 4 eliminazioni
  1. 0 2
      Kernel/Arch/i386/CPU.cpp
  2. 0 2
      Kernel/Scheduler.cpp

+ 0 - 2
Kernel/Arch/i386/CPU.cpp

@@ -447,14 +447,12 @@ void register_interrupt_handler(u8 index, void (*f)())
 {
 {
     s_idt[index].low = 0x00080000 | LSW((f));
     s_idt[index].low = 0x00080000 | LSW((f));
     s_idt[index].high = ((u32)(f)&0xffff0000) | 0x8e00;
     s_idt[index].high = ((u32)(f)&0xffff0000) | 0x8e00;
-    flush_idt();
 }
 }
 
 
 void register_user_callable_interrupt_handler(u8 index, void (*f)())
 void register_user_callable_interrupt_handler(u8 index, void (*f)())
 {
 {
     s_idt[index].low = 0x00080000 | LSW((f));
     s_idt[index].low = 0x00080000 | LSW((f));
     s_idt[index].high = ((u32)(f)&0xffff0000) | 0xef00;
     s_idt[index].high = ((u32)(f)&0xffff0000) | 0xef00;
-    flush_idt();
 }
 }
 
 
 void flush_idt()
 void flush_idt()

+ 0 - 2
Kernel/Scheduler.cpp

@@ -464,7 +464,6 @@ void Scheduler::switch_now()
 {
 {
     Descriptor& descriptor = get_gdt_entry(current->selector());
     Descriptor& descriptor = get_gdt_entry(current->selector());
     descriptor.type = 9;
     descriptor.type = 9;
-    flush_gdt();
     asm("sti\n"
     asm("sti\n"
         "ljmp *(%%eax)\n" ::"a"(&current->far_ptr()));
         "ljmp *(%%eax)\n" ::"a"(&current->far_ptr()));
 }
 }
@@ -521,7 +520,6 @@ bool Scheduler::context_switch(Thread& thread)
 
 
     auto& descriptor = get_gdt_entry(thread.selector());
     auto& descriptor = get_gdt_entry(thread.selector());
     descriptor.type = 11; // Busy TSS
     descriptor.type = 11; // Busy TSS
-    flush_gdt();
     return true;
     return true;
 }
 }