73 |
void |
void |
74 |
stack_handoff (struct thread *old_thread, struct thread *new_thread) |
stack_handoff (struct thread *old_thread, struct thread *new_thread) |
75 |
{ |
{ |
76 |
|
struct task *old_task, *new_task; |
77 |
vm_offset_t stack; |
vm_offset_t stack; |
78 |
|
|
79 |
/* Switch address maps if switching tasks. */ |
/* Switch address maps if switching tasks. */ |
80 |
#if 0 |
|
81 |
{ |
if ((old_task = old_thread->task) != (new_task = new_thread->task)) |
82 |
struct task *old_task, *new_task; |
PMAP_ACTIVATE (new_task->map->pmap); |
|
|
|
|
if ((old_task = old_thread->task) != (new_task = new_thread->task)) |
|
|
pmap_activate (new_task->map->pmap); |
|
|
} |
|
|
#endif |
|
83 |
|
|
84 |
/* Load the rest of the user state for the new thread */ |
/* Load the rest of the user state for the new thread */ |
85 |
switch_ktss (&new_thread->pcb); |
switch_ktss (&new_thread->pcb); |
123 |
switch_context (struct thread *old_thread, void (*continuation)(), |
switch_context (struct thread *old_thread, void (*continuation)(), |
124 |
struct thread *new_thread) |
struct thread *new_thread) |
125 |
{ |
{ |
126 |
#if 0 |
struct task *old_task, *new_task; |
127 |
|
|
128 |
/* Switch address maps if switching tasks. */ |
/* Switch address maps if switching tasks. */ |
129 |
{ |
|
130 |
task_t old_task, new_task; |
if ((old_task = old_thread->task) != (new_task = new_thread->task)) |
131 |
int mycpu = cpu_number (); |
PMAP_ACTIVATE (new_task->map->pmap); |
|
|
|
|
if ((old_task = old->task) != (new_task = new->task)) |
|
|
{ |
|
|
pmap_activate (new_task->map->pmap); |
|
|
} |
|
|
} |
|
|
#endif |
|
132 |
|
|
133 |
active_threads [CPU_CURRENT ()] = new_thread; |
active_threads [CPU_CURRENT ()] = new_thread; |
134 |
|
|