#include "assert.h"
#include "mm.h"
#include "init.h"
+#include "msr.h"
task_union root_task __attribute__((__aligned__(PAGE_SIZE)));
root_task.cr3 = (unsigned long)init_pgd;
tss.esp0 = root_task.esp0;
+ wrmsr(MSR_SYSENTER_ESP, root_task.esp0, 0);
printk("init_root_task tss.esp0 %08x\n", tss.esp0);
}
{
LOAD_CR3(current->cr3);
tss.esp0 = current->esp0;
+ wrmsr(MSR_SYSENTER_ESP, current->esp0, 0);
}
void context_switch(task_union *prev, task_union *next)
{
wrmsr(MSR_SYSENTER_CS, SELECTOR_KRNL_CS, 0);
wrmsr(MSR_SYSENTER_EIP, syscall_entry, 0);
- wrmsr(MSR_SYSENTER_ESP, &(tss.esp0), 0);
+ //wrmsr(MSR_SYSENTER_ESP, &(tss.esp0), 0);
init_sysc_handler_table();
}