aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJake Burkholder <jake@FreeBSD.org>2002-02-27 06:08:13 +0000
committerJake Burkholder <jake@FreeBSD.org>2002-02-27 06:08:13 +0000
commit95a44511f33bbfffc6c9538e0526927f8192cfd9 (patch)
treeffbfbb7ac10718ddeda6d879ce82a6c8f6bbe91c /sys
parent62ad05829206d60a1e4f0ebd3e7b99d936d411df (diff)
Parameterize the number of pages to allocate for the per-cpu area on
PCPU_PAGES.
Notes
Notes: svn path=/head/; revision=91360
Diffstat (limited to 'sys')
-rw-r--r--sys/sparc64/include/param.h1
-rw-r--r--sys/sparc64/sparc64/genassym.c1
-rw-r--r--sys/sparc64/sparc64/locore.S2
-rw-r--r--sys/sparc64/sparc64/locore.s2
-rw-r--r--sys/sparc64/sparc64/machdep.c6
5 files changed, 7 insertions, 5 deletions
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;