Subversion Repositories HelenOS

Rev

Rev 2927 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2927 Rev 4343
Line 37... Line 37...
37
#include <proc/task.h>
37
#include <proc/task.h>
38
#include <proc/thread.h>
38
#include <proc/thread.h>
39
#include <arch.h>
39
#include <arch.h>
40
#include <arch/context.h>   /* SP_DELTA */
40
#include <arch/context.h>   /* SP_DELTA */
41
#include <arch/asm.h>
41
#include <arch/asm.h>
42
#include <arch/debugger.h>
-
 
43
#include <print.h>
42
#include <print.h>
44
#include <arch/pm.h>
43
#include <arch/pm.h>
45
#include <arch/ddi/ddi.h>
44
#include <arch/ddi/ddi.h>
46
 
45
 
47
/** Perform amd64 specific tasks needed before the new task is run.
46
/** Perform amd64 specific tasks needed before the new task is run.
Line 66... Line 65...
66
    write_msr(AMD_MSR_GS, (uintptr_t)THREAD->arch.syscall_rsp);
65
    write_msr(AMD_MSR_GS, (uintptr_t)THREAD->arch.syscall_rsp);
67
    swapgs();
66
    swapgs();
68
 
67
 
69
    /* TLS support - set FS to thread local storage */
68
    /* TLS support - set FS to thread local storage */
70
    write_msr(AMD_MSR_FS, THREAD->arch.tls);
69
    write_msr(AMD_MSR_FS, THREAD->arch.tls);
71
 
-
 
72
#ifdef CONFIG_DEBUG_AS_WATCHPOINT
-
 
73
    /* Set watchpoint on AS to ensure that nobody sets it to zero */
-
 
74
    if (CPU->id < BKPOINTS_MAX)
-
 
75
        breakpoint_add(&((the_t *) THREAD->kstack)->as,
-
 
76
            BKPOINT_WRITE | BKPOINT_CHECK_ZERO, CPU->id);
-
 
77
#endif
-
 
78
}
70
}
79
 
71
 
80
void after_thread_ran_arch(void)
72
void after_thread_ran_arch(void)
81
{
73
{
82
}
74
}