diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c index dc0a84404f0..fd6d13f38e9 100644 --- a/sys/arm/arm/machdep.c +++ b/sys/arm/arm/machdep.c @@ -771,8 +771,9 @@ init_proc0(vm_offset_t kstack) { proc_linkup0(&proc0, &thread0); thread0.td_kstack = kstack; - thread0.td_pcb = (struct pcb *) - (thread0.td_kstack + kstack_pages * PAGE_SIZE) - 1; + thread0.td_kstack_pages = kstack_pages; + thread0.td_pcb = (struct pcb *)(thread0.td_kstack + + thread0.td_kstack_pages * PAGE_SIZE) - 1; thread0.td_pcb->pcb_flags = 0; thread0.td_pcb->pcb_vfpcpu = -1; thread0.td_pcb->pcb_vfpstate.fpscr = VFPSCR_DN;