Ignore:
Timestamp:
2011-03-21T22:00:17Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
143932e3
Parents:
b50b5af2 (diff), 7308e84 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes (needs fixes).

File:
1 edited

Legend:

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

    rb50b5af2 r04803bf  
    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       
    63         /* Set kernel stack for CP3 -> CPL0 switch via SYSENTER */
    64         write_msr(IA32_MSR_SYSENTER_ESP, kstk);
     62        if (CPU->arch.fi.bits.sep) {
     63                /* Set kernel stack for CP3 -> CPL0 switch via SYSENTER */
     64                write_msr(IA32_MSR_SYSENTER_ESP, kstk - sizeof(istate_t));
     65        }
    6566       
    6667        /* Set kernel stack for CPL3 -> CPL0 switch via interrupt */
    6768        CPU->arch.tss->esp0 = kstk;
    68         CPU->arch.tss->ss0 = gdtselector(KDATA_DES);
     69        CPU->arch.tss->ss0 = GDT_SELECTOR(KDATA_DES);
    6970       
    7071        /* Set up TLS in GS register */
Note: See TracChangeset for help on using the changeset viewer.