aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2026-03-26 17:39:52 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2026-05-27 13:43:43 +0000
commit187b46e1c4d761efe2e92f662d68c0f49cd04b44 (patch)
treeb33c27095572312597e86bd6200ec34f3673a6bc /sys/powerpc
parent860aaecf1bb659d8cc6023aaa2d27273823faa75 (diff)
Diffstat (limited to 'sys/powerpc')
-rw-r--r--sys/powerpc/powerpc/vm_machdep.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/powerpc/powerpc/vm_machdep.c b/sys/powerpc/powerpc/vm_machdep.c
index 00fdc301a7e7..1dc28739ad7c 100644
--- a/sys/powerpc/powerpc/vm_machdep.c
+++ b/sys/powerpc/powerpc/vm_machdep.c
@@ -123,9 +123,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags)
if (td1 == curthread)
cpu_update_pcb(td1);
- pcb = (struct pcb *)__align_down(td2->td_kstack +
- td2->td_kstack_pages * PAGE_SIZE - sizeof(struct pcb), 0x40);
- td2->td_pcb = pcb;
+ pcb = td2->td_pcb;
/* Copy the pcb */
bcopy(td1->td_pcb, pcb, sizeof(struct pcb));
@@ -135,7 +133,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags)
* Copy the trap frame for the return to user mode as if from a
* syscall. This copies most of the user mode register values.
*/
- tf = (struct trapframe *)pcb - 1;
+ tf = td2->td_frame;
bcopy(td1->td_frame, tf, sizeof(*tf));
/* Set up trap frame. */
@@ -143,8 +141,6 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags)
tf->fixreg[FIRSTARG + 1] = 0;
tf->cr &= ~0x10000000;
- td2->td_frame = tf;
-
cf = (struct callframe *)tf - 1;
memset(cf, 0, sizeof(struct callframe));
#if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1)