mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-17 15:27:36 +00:00
MFi386: correctly calculate the top-of-stack when a kthread is created
with a larger kernel stack.
This commit is contained in:
parent
946a5e675d
commit
fc900bcdd2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=127392
@ -124,7 +124,8 @@ cpu_fork(td1, p2, td2, flags)
|
||||
fpuexit(td1);
|
||||
|
||||
/* Point the pcb to the top of the stack */
|
||||
pcb2 = (struct pcb *)(td2->td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1;
|
||||
pcb2 = (struct pcb *)(td2->td_kstack +
|
||||
td2->td_kstack_pages * PAGE_SIZE) - 1;
|
||||
td2->td_pcb = pcb2;
|
||||
|
||||
/* Copy p1's pcb */
|
||||
@ -247,8 +248,8 @@ void
|
||||
cpu_thread_setup(struct thread *td)
|
||||
{
|
||||
|
||||
td->td_pcb =
|
||||
(struct pcb *)(td->td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1;
|
||||
td->td_pcb = (struct pcb *)(td->td_kstack +
|
||||
td->td_kstack_pages * PAGE_SIZE) - 1;
|
||||
td->td_frame = (struct trapframe *)td->td_pcb - 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user