summaryrefslogtreecommitdiffstats
path: root/sys/pc98
diff options
context:
space:
mode:
Diffstat (limited to 'sys/pc98')
-rw-r--r--sys/pc98/pc98/machdep.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c
index 826bcc8..4ccfa5d 100644
--- a/sys/pc98/pc98/machdep.c
+++ b/sys/pc98/pc98/machdep.c
@@ -2088,11 +2088,13 @@ init386(first)
{
struct gate_descriptor *gdp;
int gsel_tss, metadata_missing, x, pa;
+ size_t kstack0_sz;
struct pcpu *pc;
thread0.td_kstack = proc0kstack;
- thread0.td_pcb = (struct pcb *)
- (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1;
+ thread0.td_kstack_pages = KSTACK_PAGES;
+ kstack0_sz = thread0.td_kstack_pages * PAGE_SIZE;
+ thread0.td_pcb = (struct pcb *)(thread0.td_kstack + kstack0_sz) - 1;
/*
* This may be done better later if it gets more high level
@@ -2262,7 +2264,7 @@ init386(first)
/* make an initial tss so cpu can get interrupt stack on syscall! */
/* Note: -16 is so we can grow the trapframe if we came from vm86 */
PCPU_SET(common_tss.tss_esp0, thread0.td_kstack +
- KSTACK_PAGES * PAGE_SIZE - sizeof(struct pcb) - 16);
+ kstack0_sz - sizeof(struct pcb) - 16);
PCPU_SET(common_tss.tss_ss0, GSEL(GDATA_SEL, SEL_KPL));
gsel_tss = GSEL(GPROC0_SEL, SEL_KPL);
PCPU_SET(tss_gdt, &gdt[GPROC0_SEL].sd);
OpenPOWER on IntegriCloud