2 ** Copyright 2001, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
5 #include <kernel/kernel.h>
6 #include <kernel/thread.h>
8 int arch_proc_init_proc_struct(struct proc
*p
, bool kernel
)
13 int arch_thread_init_thread_struct(Thread
*t
)
18 int arch_thread_initialize_kthread_stack(Thread
*t
, int (*start_func
)(void), void (*entry_func
)(void))
23 void arch_thread_context_switch(Thread
*t_from
, Thread
*t_to
)
27 dprintf("arch_thread_context_switch: 0x%x->0x%x to sp 0x%x\n",
28 t_from
->id
, t_to
->id
, t_to
->arch_info
.sp
);
32 dprintf("sp[%d] = 0x%x\n", i
, t_to
->arch_info
.sp
[i
]);
36 sh4_set_kstack(t_to
->kernel_stack_area
->base
+ KSTACK_SIZE
);
38 if(t_from
->proc
->arch_info
.pgdir
!= t_to
->proc
->arch_info
.pgdir
)
39 sh4_set_user_pgdir((addr
)t_to
->proc
->arch_info
.pgdir
);
40 sh4_context_switch(&t_from
->arch_info
.sp
, t_to
->arch_info
.sp
);
44 void arch_thread_dump_info(void *info
)
48 void arch_thread_enter_uspace(addr entry
, addr ustack_top
)