diff options
author | cognet <cognet@FreeBSD.org> | 2004-09-23 22:24:12 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2004-09-23 22:24:12 +0000 |
commit | 83a28a9eaacba559ad3216ce6c010e76a2cc85e4 (patch) | |
tree | 5466c97fadf4c876e450eda6a6f839747b3a1b57 /sys/arm | |
parent | 4ad93571b601a3a632ac1e535c15865f367394f2 (diff) | |
download | FreeBSD-src-83a28a9eaacba559ad3216ce6c010e76a2cc85e4.zip FreeBSD-src-83a28a9eaacba559ad3216ce6c010e76a2cc85e4.tar.gz |
On Xscale, use the minicache for the kernel stack.
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/arm/vm_machdep.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/arm/arm/vm_machdep.c b/sys/arm/arm/vm_machdep.c index 23cf5ba..89c16ed 100644 --- a/sys/arm/arm/vm_machdep.c +++ b/sys/arm/arm/vm_machdep.c @@ -145,16 +145,21 @@ 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 + - USPACE; pcb1 = td1->td_pcb; pcb2 = (struct pcb *)(td2->td_kstack + td2->td_kstack_pages * PAGE_SIZE) - 1; +#ifdef __XSCALE__ + pmap_use_minicache(td2->td_kstack, td2->td_kstack_pages * PAGE_SIZE); +#endif td2->td_pcb = pcb2; 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 = (u_int)td2->td_kstack + USPACE_UNDEF_STACK_TOP; - pcb2->un_32.pcb32_sp = (u_int)td2->td_kstack + - USPACE_SVC_STACK_TOP; + pcb2->un_32.pcb32_und_sp = uarea + USPACE_UNDEF_STACK_TOP; + pcb2->un_32.pcb32_sp = uarea + + USPACE_SVC_STACK_TOP - sizeof(*pcb2); pmap_activate(td2); td2->td_frame = tf = (struct trapframe *)pcb2->un_32.pcb32_sp - 1; @@ -165,6 +170,7 @@ cpu_fork(register struct thread *td1, register struct proc *p2, sf->sf_pc = (u_int)fork_trampoline; tf->tf_spsr &= ~PSR_C_bit; tf->tf_r0 = 0; + tf->tf_r1 = 0; pcb2->un_32.pcb32_sp = (u_int)sf; } @@ -327,7 +333,6 @@ cpu_set_fork_handler(struct thread *td, void (*func)(void *), void *arg) struct switchframe *sf; struct trapframe *tf; - tf = td->td_frame; sf = (struct switchframe *)tf - 1; sf->sf_r4 = (u_int)func; |