summaryrefslogtreecommitdiffstats
path: root/sys/arm
diff options
context:
space:
mode:
authorcognet <cognet@FreeBSD.org>2005-05-24 23:05:26 +0000
committercognet <cognet@FreeBSD.org>2005-05-24 23:05:26 +0000
commitd1e353d08b6e4b176afe013fd46ba02ddb251532 (patch)
tree8cc4e840a690346579fa1e93b571748fa8d00bf5 /sys/arm
parent9bcd47137c7156356e0688f42e92aaaa24e1f9e4 (diff)
downloadFreeBSD-src-d1e353d08b6e4b176afe013fd46ba02ddb251532.zip
FreeBSD-src-d1e353d08b6e4b176afe013fd46ba02ddb251532.tar.gz
Correctly setup the UND stack in cpu_set_upcall(), and the trapframe in
cpu_thread_setup(), as done in cpu_fork().
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/arm/vm_machdep.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/arm/arm/vm_machdep.c b/sys/arm/arm/vm_machdep.c
index a4c6937..10d7798 100644
--- a/sys/arm/arm/vm_machdep.c
+++ b/sys/arm/arm/vm_machdep.c
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
#include <sys/proc.h>
#include <sys/socketvar.h>
#include <sys/sf_buf.h>
+#include <sys/unistd.h>
#include <machine/cpu.h>
#include <machine/pcb.h>
#include <machine/sysarch.h>
@@ -106,6 +107,8 @@ cpu_fork(register struct thread *td1, register struct proc *p2,
struct switchframe *sf;
struct mdproc *mdp2;
+ if ((flags & RFPROC) == 0)
+ return;
pcb1 = td1->td_pcb;
pcb2 = (struct pcb *)(td2->td_kstack + td2->td_kstack_pages * PAGE_SIZE) - 1;
#ifdef __XSCALE__
@@ -267,8 +270,7 @@ cpu_set_upcall(struct thread *td, struct thread *td0)
tf->tf_spsr &= ~PSR_C_bit;
tf->tf_r0 = 0;
td->td_pcb->un_32.pcb32_sp = (u_int)sf;
- td->td_pcb->un_32.pcb32_und_sp = td->td_kstack + td->td_kstack_pages
- * PAGE_SIZE + USPACE_UNDEF_STACK_TOP;
+ td->td_pcb->un_32.pcb32_und_sp = td->td_kstack + USPACE_UNDEF_STACK_TOP;
/* Setup to release sched_lock in fork_exit(). */
td->td_md.md_spinlock_count = 1;
@@ -317,8 +319,7 @@ cpu_thread_setup(struct thread *td)
td->td_pcb = (struct pcb *)(td->td_kstack + td->td_kstack_pages *
PAGE_SIZE) - 1;
td->td_frame = (struct trapframe *)
- ((u_int)td->td_kstack + td->td_kstack_pages * PAGE_SIZE +
- USPACE_SVC_STACK_TOP - sizeof(struct pcb)) - 1;
+ ((u_int)td->td_kstack + USPACE_SVC_STACK_TOP - sizeof(struct pcb)) - 1;
#ifdef __XSCALE__
pmap_use_minicache(td->td_kstack, td->td_kstack_pages * PAGE_SIZE);
#endif
OpenPOWER on IntegriCloud