Subversion Repositories HelenOS-historic

Rev

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

Rev 897 Rev 1074
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/debugger.h>
34
 
35
 
35
void before_thread_runs_arch(void)
36
void before_thread_runs_arch(void)
36
{
37
{
37
    CPU->arch.tss->esp0 = (__address) &THREAD->kstack[THREAD_STACK_SIZE-SP_DELTA];
38
    CPU->arch.tss->esp0 = (__address) &THREAD->kstack[THREAD_STACK_SIZE-SP_DELTA];
38
    CPU->arch.tss->ss0 = selector(KDATA_DES);
39
    CPU->arch.tss->ss0 = selector(KDATA_DES);
-
 
40
 
-
 
41
#ifdef CONFIG_DEBUG_AS_WATCHPOINT
-
 
42
    /* Set watchpoint on AS to ensure that nobody sets it to zero */
-
 
43
    static int old_slot = -1;
-
 
44
    if (old_slot >=0)
-
 
45
        breakpoint_del(old_slot);
-
 
46
    old_slot = breakpoint_add(&((the_t *) THREAD->kstack)->as,
-
 
47
                  BKPOINT_WRITE | BKPOINT_CHECK_ZERO);
-
 
48
#endif
-
 
49
 
39
}
50
}
40
 
51
 
41
void after_thread_ran_arch(void)
52
void after_thread_ran_arch(void)
42
{
53
{
43
}
54
}