Subversion Repositories HelenOS-historic

Rev

Rev 1077 | Rev 1187 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1077 Rev 1112
Line 30... Line 30...
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/debugger.h>
34
#include <arch/debugger.h>
-
 
35
#include <arch/pm.h>
35
 
36
 
36
void before_thread_runs_arch(void)
37
void before_thread_runs_arch(void)
37
{
38
{
38
    CPU->arch.tss->esp0 = (__address) &THREAD->kstack[THREAD_STACK_SIZE-SP_DELTA];
39
    CPU->arch.tss->esp0 = (__address) &THREAD->kstack[THREAD_STACK_SIZE-SP_DELTA];
39
    CPU->arch.tss->ss0 = selector(KDATA_DES);
40
    CPU->arch.tss->ss0 = selector(KDATA_DES);
40
 
41
 
-
 
42
    /* Set up TLS in GS register */
-
 
43
    set_tls_desc(THREAD->tls);
-
 
44
 
41
#ifdef CONFIG_DEBUG_AS_WATCHPOINT
45
#ifdef CONFIG_DEBUG_AS_WATCHPOINT
42
    /* Set watchpoint on AS to ensure that nobody sets it to zero */
46
    /* Set watchpoint on AS to ensure that nobody sets it to zero */
43
    if (CPU->id < BKPOINTS_MAX)
47
    if (CPU->id < BKPOINTS_MAX)
44
        breakpoint_add(&((the_t *) THREAD->kstack)->as,
48
        breakpoint_add(&((the_t *) THREAD->kstack)->as,
45
                   BKPOINT_WRITE | BKPOINT_CHECK_ZERO,
49
                   BKPOINT_WRITE | BKPOINT_CHECK_ZERO,