Get the kernel stack right now that the u-area is gone.

This commit is contained in:
Olivier Houchard 2004-11-20 16:51:32 +00:00
parent e6f9d4b6de
commit 579d53f4cf
4 changed files with 7 additions and 6 deletions

View File

@ -145,7 +145,6 @@ cpu_fork(register struct thread *td1, register struct proc *p2,
struct trapframe *tf;
struct switchframe *sf;
struct mdproc *mdp2;
vm_offset_t uarea = td2->td_kstack + td2->td_kstack_pages * PAGE_SIZE;
pcb1 = td1->td_pcb;
pcb2 = (struct pcb *)(td2->td_kstack + td2->td_kstack_pages * PAGE_SIZE) - 1;
@ -156,8 +155,8 @@ cpu_fork(register struct thread *td1, register struct proc *p2,
bcopy(td1->td_pcb, pcb2, sizeof(*pcb2));
mdp2 = &p2->p_md;
bcopy(&td1->td_proc->p_md, mdp2, sizeof(*mdp2));
pcb2->un_32.pcb32_und_sp = uarea + USPACE_UNDEF_STACK_TOP;
pcb2->un_32.pcb32_sp = uarea +
pcb2->un_32.pcb32_und_sp = td2->td_kstack + USPACE_UNDEF_STACK_TOP;
pcb2->un_32.pcb32_sp = td2->td_kstack +
USPACE_SVC_STACK_TOP - sizeof(*pcb2);
pmap_activate(td2);
td2->td_frame = tf =

View File

@ -106,7 +106,7 @@
#define KSTACK_GUARD_PAGES 1
#endif /* !KSTACK_GUARD_PAGES */
#define USPACE_SVC_STACK_TOP 0
#define USPACE_SVC_STACK_TOP KSTACK_PAGES * PAGE_SIZE
#define USPACE_SVC_STACK_BOTTOM (USPACE_SVC_STACK_TOP - 0x1000)
#define USPACE_UNDEF_STACK_TOP (USPACE_SVC_STACK_BOTTOM - 0x10)
#define USPACE_UNDEF_STACK_BOTTOM (FPCONTEXTSIZE + 10)

View File

@ -417,5 +417,6 @@ initarm(void *arg, void *arg2)
init_param2(physmem);
kdb_init();
avail_end = 0xc0000000 + 0x02000000 - 1;
return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP));
return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP -
sizeof(struct pcb)));
}

View File

@ -432,5 +432,6 @@ initarm(void *arg, void *arg2)
init_param2(physmem);
avail_end = 0xa0000000 + memsize - 1;
kdb_init();
return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP));
return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP -
sizeof(struct pcb)));
}