MFi386: correctly calculate the top-of-stack when a kthread is created
with a larger kernel stack. Remove inclusion of opt_kstack_pages.h now that it's unused.
This commit is contained in:
parent
879d6c2306
commit
60f66d9174
@ -67,8 +67,6 @@
|
||||
* rights to redistribute these changes.
|
||||
*/
|
||||
|
||||
#include "opt_kstack_pages.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/proc.h>
|
||||
@ -129,7 +127,7 @@ cpu_thread_setup(struct thread *td)
|
||||
{
|
||||
intptr_t sp;
|
||||
|
||||
sp = td->td_kstack + KSTACK_PAGES * PAGE_SIZE;
|
||||
sp = td->td_kstack + td->td_kstack_pages * PAGE_SIZE;
|
||||
sp -= sizeof(struct pcb);
|
||||
td->td_pcb = (struct pcb *)sp;
|
||||
sp -= sizeof(struct trapframe);
|
||||
@ -257,7 +255,7 @@ cpu_fork(struct thread *td1, struct proc *p2 __unused, struct thread *td2,
|
||||
* create an image of the parent's stack and backing store and
|
||||
* adjust where necessary.
|
||||
*/
|
||||
stackp = (char *)(td2->td_kstack + KSTACK_PAGES * PAGE_SIZE);
|
||||
stackp = (char *)(td2->td_kstack + td2->td_kstack_pages * PAGE_SIZE);
|
||||
|
||||
stackp -= sizeof(struct pcb);
|
||||
td2->td_pcb = (struct pcb *)stackp;
|
||||
|
Loading…
Reference in New Issue
Block a user