Correctly setup the UND stack in cpu_set_upcall(), and the trapframe in
cpu_thread_setup(), as done in cpu_fork().
This commit is contained in:
parent
77f30ffff8
commit
47b3d09bb0
@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/proc.h>
|
#include <sys/proc.h>
|
||||||
#include <sys/socketvar.h>
|
#include <sys/socketvar.h>
|
||||||
#include <sys/sf_buf.h>
|
#include <sys/sf_buf.h>
|
||||||
|
#include <sys/unistd.h>
|
||||||
#include <machine/cpu.h>
|
#include <machine/cpu.h>
|
||||||
#include <machine/pcb.h>
|
#include <machine/pcb.h>
|
||||||
#include <machine/sysarch.h>
|
#include <machine/sysarch.h>
|
||||||
@ -106,6 +107,8 @@ cpu_fork(register struct thread *td1, register struct proc *p2,
|
|||||||
struct switchframe *sf;
|
struct switchframe *sf;
|
||||||
struct mdproc *mdp2;
|
struct mdproc *mdp2;
|
||||||
|
|
||||||
|
if ((flags & RFPROC) == 0)
|
||||||
|
return;
|
||||||
pcb1 = td1->td_pcb;
|
pcb1 = td1->td_pcb;
|
||||||
pcb2 = (struct pcb *)(td2->td_kstack + td2->td_kstack_pages * PAGE_SIZE) - 1;
|
pcb2 = (struct pcb *)(td2->td_kstack + td2->td_kstack_pages * PAGE_SIZE) - 1;
|
||||||
#ifdef __XSCALE__
|
#ifdef __XSCALE__
|
||||||
@ -267,8 +270,7 @@ cpu_set_upcall(struct thread *td, struct thread *td0)
|
|||||||
tf->tf_spsr &= ~PSR_C_bit;
|
tf->tf_spsr &= ~PSR_C_bit;
|
||||||
tf->tf_r0 = 0;
|
tf->tf_r0 = 0;
|
||||||
td->td_pcb->un_32.pcb32_sp = (u_int)sf;
|
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
|
td->td_pcb->un_32.pcb32_und_sp = td->td_kstack + USPACE_UNDEF_STACK_TOP;
|
||||||
* PAGE_SIZE + USPACE_UNDEF_STACK_TOP;
|
|
||||||
|
|
||||||
/* Setup to release sched_lock in fork_exit(). */
|
/* Setup to release sched_lock in fork_exit(). */
|
||||||
td->td_md.md_spinlock_count = 1;
|
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 *
|
td->td_pcb = (struct pcb *)(td->td_kstack + td->td_kstack_pages *
|
||||||
PAGE_SIZE) - 1;
|
PAGE_SIZE) - 1;
|
||||||
td->td_frame = (struct trapframe *)
|
td->td_frame = (struct trapframe *)
|
||||||
((u_int)td->td_kstack + td->td_kstack_pages * PAGE_SIZE +
|
((u_int)td->td_kstack + USPACE_SVC_STACK_TOP - sizeof(struct pcb)) - 1;
|
||||||
USPACE_SVC_STACK_TOP - sizeof(struct pcb)) - 1;
|
|
||||||
#ifdef __XSCALE__
|
#ifdef __XSCALE__
|
||||||
pmap_use_minicache(td->td_kstack, td->td_kstack_pages * PAGE_SIZE);
|
pmap_use_minicache(td->td_kstack, td->td_kstack_pages * PAGE_SIZE);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user