Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2605 → Rev 2606

/trunk/kernel/arch/amd64/src/proc/scheduler.c
56,12 → 56,14
/** Perform amd64 specific tasks needed before the new thread is scheduled. */
void before_thread_runs_arch(void)
{
CPU->arch.tss->rsp0 = (uintptr_t) &THREAD->kstack[THREAD_STACK_SIZE-SP_DELTA];
CPU->arch.tss->rsp0 =
(uintptr_t) &THREAD->kstack[THREAD_STACK_SIZE - SP_DELTA];
 
/* Syscall support - write address of thread stack pointer to
* hidden part of gs */
/*
* Syscall support.
*/
swapgs();
write_msr(AMD_MSR_GS, (uint64_t)&THREAD->kstack);
write_msr(AMD_MSR_GS, (uintptr_t)THREAD->arch.syscall_rsp);
swapgs();
 
/* TLS support - set FS to thread local storage */
71,8 → 73,7
/* Set watchpoint on AS to ensure that nobody sets it to zero */
if (CPU->id < BKPOINTS_MAX)
breakpoint_add(&((the_t *) THREAD->kstack)->as,
BKPOINT_WRITE | BKPOINT_CHECK_ZERO,
CPU->id);
BKPOINT_WRITE | BKPOINT_CHECK_ZERO, CPU->id);
#endif
}