diff --git a/sys/sparc64/include/param.h b/sys/sparc64/include/param.h index 72cf69c28039..a4404cfe2991 100644 --- a/sys/sparc64/include/param.h +++ b/sys/sparc64/include/param.h @@ -126,6 +126,7 @@ #define KSTACK_PAGES 4 /* pages of kernel stack (with pcb) */ #define UAREA_PAGES 1 /* pages of user area */ +#define PCPU_PAGES 1 #define KSTACK_GUARD /* compile in kstack guard page */ #define KSTACK_GUARD_PAGES 1 diff --git a/sys/sparc64/sparc64/genassym.c b/sys/sparc64/sparc64/genassym.c index 22fa7f769819..725baae2100a 100644 --- a/sys/sparc64/sparc64/genassym.c +++ b/sys/sparc64/sparc64/genassym.c @@ -72,6 +72,7 @@ ASSYM(ENAMETOOLONG, ENAMETOOLONG); ASSYM(KSTACK_PAGES, KSTACK_PAGES); ASSYM(KSTACK_GUARD_PAGES, KSTACK_GUARD_PAGES); +ASSYM(PCPU_PAGES, PCPU_PAGES); ASSYM(UAREA_PAGES, UAREA_PAGES); ASSYM(PAGE_SIZE, PAGE_SIZE); diff --git a/sys/sparc64/sparc64/locore.S b/sys/sparc64/sparc64/locore.S index 5d7e5d352627..886b1b209587 100644 --- a/sys/sparc64/sparc64/locore.S +++ b/sys/sparc64/sparc64/locore.S @@ -77,7 +77,7 @@ ENTRY(_start) * Get onto our per-cpu panic stack, which precedes the struct pcpu in * the per-cpu page. */ - SET(pcpu0 + PAGE_SIZE - PC_SIZEOF, %l1, %l0) + SET(pcpu0 + (PCPU_PAGES * PAGE_SIZE) - PC_SIZEOF, %l1, %l0) sub %l0, SPOFF + CCFSZ, %sp /* diff --git a/sys/sparc64/sparc64/locore.s b/sys/sparc64/sparc64/locore.s index 5d7e5d352627..886b1b209587 100644 --- a/sys/sparc64/sparc64/locore.s +++ b/sys/sparc64/sparc64/locore.s @@ -77,7 +77,7 @@ ENTRY(_start) * Get onto our per-cpu panic stack, which precedes the struct pcpu in * the per-cpu page. */ - SET(pcpu0 + PAGE_SIZE - PC_SIZEOF, %l1, %l0) + SET(pcpu0 + (PCPU_PAGES * PAGE_SIZE) - PC_SIZEOF, %l1, %l0) sub %l0, SPOFF + CCFSZ, %sp /* diff --git a/sys/sparc64/sparc64/machdep.c b/sys/sparc64/sparc64/machdep.c index 58ff07a35702..0517ede7ca89 100644 --- a/sys/sparc64/sparc64/machdep.c +++ b/sys/sparc64/sparc64/machdep.c @@ -115,7 +115,7 @@ int Maxmem; struct mtx Giant; struct mtx sched_lock; -char pcpu0[PAGE_SIZE]; +char pcpu0[PCPU_PAGES * PAGE_SIZE]; char uarea0[UAREA_PAGES * PAGE_SIZE]; struct trapframe frame0; @@ -140,7 +140,7 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); CTASSERT((1 << INT_SHIFT) == sizeof(int)); CTASSERT((1 << PTR_SHIFT) == sizeof(char *)); -CTASSERT(sizeof(struct pcpu) <= (PAGE_SIZE / 2)); +CTASSERT(sizeof(struct pcpu) <= ((PCPU_PAGES * PAGE_SIZE) / 2)); static void cpu_startup(void *arg) @@ -291,7 +291,7 @@ sparc64_init(caddr_t mdp, u_int *state, u_int mid, u_int bootmid, * stack, so don't pass the real size (PAGE_SIZE) to pcpu_init or * it'll zero it out from under us. */ - pc = (struct pcpu *)(pcpu0 + PAGE_SIZE) - 1; + pc = (struct pcpu *)(pcpu0 + (PCPU_PAGES * PAGE_SIZE)) - 1; pcpu_init(pc, 0, sizeof(struct pcpu)); pc->pc_curthread = &thread0; pc->pc_curpcb = thread0.td_pcb;