Parameterize the number of pages to allocate for the per-cpu area on

PCPU_PAGES.
This commit is contained in:
Jake Burkholder 2002-02-27 06:08:13 +00:00
parent 62ad058292
commit 95a44511f3
5 changed files with 7 additions and 5 deletions

View File

@ -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

View File

@ -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);

View File

@ -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
/*

View File

@ -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
/*

View File

@ -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;