Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/proc/scheduler.c

    rb8230b9 r864e272  
    3838#include <proc/thread.h>
    3939#include <arch.h>
    40 #include <arch/context.h>  /* SP_DELTA */
     40#include <arch/interrupt.h>
    4141#include <arch/pm.h>
    4242#include <arch/asm.h>
     
    5858void before_thread_runs_arch(void)
    5959{
    60         uintptr_t kstk = (uintptr_t) &THREAD->kstack[THREAD_STACK_SIZE -
    61             SP_DELTA];
     60        uintptr_t kstk = (uintptr_t) &THREAD->kstack[THREAD_STACK_SIZE];
    6261       
    6362        if (CPU->arch.fi.bits.sep) {
    6463                /* Set kernel stack for CP3 -> CPL0 switch via SYSENTER */
    65                 write_msr(IA32_MSR_SYSENTER_ESP, kstk);
     64                write_msr(IA32_MSR_SYSENTER_ESP, kstk - sizeof(istate_t));
    6665        }
    6766       
Note: See TracChangeset for help on using the changeset viewer.