arm64, riscv: Use KSTACK_PAGES for the thread0 kstack size designator

(cherry picked from commit ac63f7534d0102352bf993ebe2c748ce2ffd432e)
This commit is contained in:
Konstantin Belousov 2023-10-10 02:56:37 +03:00
parent e857fe2227
commit 3f5b4dd6cd
2 changed files with 4 additions and 2 deletions

View file

@ -26,6 +26,7 @@
*/
#include "opt_acpi.h"
#include "opt_kstack_pages.h"
#include "opt_platform.h"
#include "opt_ddb.h"
@ -380,7 +381,7 @@ init_proc0(vm_offset_t kstack)
proc_linkup0(&proc0, &thread0);
thread0.td_kstack = kstack;
thread0.td_kstack_pages = kstack_pages;
thread0.td_kstack_pages = KSTACK_PAGES;
#if defined(PERTHREAD_SSP)
thread0.td_md.md_canary = boot_canary;
#endif

View file

@ -33,6 +33,7 @@
* SUCH DAMAGE.
*/
#include "opt_kstack_pages.h"
#include "opt_platform.h"
#include <sys/cdefs.h>
@ -286,7 +287,7 @@ init_proc0(vm_offset_t kstack)
proc_linkup0(&proc0, &thread0);
thread0.td_kstack = kstack;
thread0.td_kstack_pages = kstack_pages;
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_fpflags = 0;