summaryrefslogtreecommitdiffstats
path: root/sys/sparc64
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2002-02-27 06:08:13 +0000
committerjake <jake@FreeBSD.org>2002-02-27 06:08:13 +0000
commite4a45ab17b61a30b3898fda8c971539f18323478 (patch)
treeffbfbb7ac10718ddeda6d879ce82a6c8f6bbe91c /sys/sparc64
parentc584d5961c05615a8b4e160f1354b2b3a2448db4 (diff)
downloadFreeBSD-src-e4a45ab17b61a30b3898fda8c971539f18323478.zip
FreeBSD-src-e4a45ab17b61a30b3898fda8c971539f18323478.tar.gz
Parameterize the number of pages to allocate for the per-cpu area on
PCPU_PAGES.
Diffstat (limited to 'sys/sparc64')
-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 72cf69c..a4404cf 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 22fa7f7..725baae 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 5d7e5d3..886b1b2 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 5d7e5d3..886b1b2 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 58ff07a..0517ede 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;
OpenPOWER on IntegriCloud