Rev 534 | Rev 897 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 534 | Rev 806 | ||
---|---|---|---|
Line 29... | Line 29... | ||
29 | #include <proc/scheduler.h> |
29 | #include <proc/scheduler.h> |
30 | #include <cpu.h> |
30 | #include <cpu.h> |
31 | #include <proc/thread.h> |
31 | #include <proc/thread.h> |
32 | #include <arch.h> |
32 | #include <arch.h> |
33 | #include <arch/context.h> /* SP_DELTA */ |
33 | #include <arch/context.h> /* SP_DELTA */ |
- | 34 | #include <arch/asm.h> |
|
34 | 35 | ||
35 | void before_thread_runs_arch(void) |
36 | void before_thread_runs_arch(void) |
36 | { |
37 | { |
37 | CPU->arch.tss->rsp0 = (__address) &THREAD->kstack[THREAD_STACK_SIZE-SP_DELTA]; |
38 | CPU->arch.tss->rsp0 = (__address) &THREAD->kstack[THREAD_STACK_SIZE-SP_DELTA]; |
- | 39 | ||
- | 40 | /* Syscall support - write thread address to hidden part of gs */ |
|
- | 41 | swapgs(); |
|
- | 42 | write_msr(AMD_MSR_GS, |
|
- | 43 | (__u64)&THREAD->kstack); |
|
- | 44 | swapgs(); |
|
38 | } |
45 | } |