mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
Implement cpu_thread_setup. Fix cpu_set_upcall.
This commit is contained in:
parent
cef57e7624
commit
c2b117e7db
1 changed files with 9 additions and 3 deletions
|
|
@ -138,17 +138,23 @@ cpu_thread_clean(struct thread *td)
|
|||
void
|
||||
cpu_thread_setup(struct thread *td)
|
||||
{
|
||||
struct pcb *pcb;
|
||||
|
||||
pcb = (struct pcb *)((td->td_kstack + KSTACK_PAGES * PAGE_SIZE -
|
||||
sizeof(struct pcb)) & ~0x3fUL);
|
||||
td->td_frame = (struct trapframe *)pcb - 1;
|
||||
td->td_pcb = pcb;
|
||||
}
|
||||
|
||||
void
|
||||
cpu_set_upcall(struct thread *td, void *v)
|
||||
{
|
||||
struct pcb *pcb = v;
|
||||
struct trapframe *tf;
|
||||
struct frame *fr;
|
||||
struct pcb *pcb;
|
||||
|
||||
tf = (struct trapframe *)pcb - 1;
|
||||
td->td_frame = tf;
|
||||
pcb = td->td_pcb;
|
||||
tf = td->td_frame;
|
||||
fr = (struct frame *)tf - 1;
|
||||
fr->fr_local[0] = (u_long)fork_return;
|
||||
fr->fr_local[1] = (u_long)td;
|
||||
|
|
|
|||
Loading…
Reference in a new issue