Index: include/pcpu.h =================================================================== RCS file: /repoman/r/ncvs/src/sys/sparc64/include/pcpu.h,v retrieving revision 1.26 diff -u -r1.26 pcpu.h --- include/pcpu.h 3 Sep 2008 17:39:19 -0000 1.26 +++ include/pcpu.h 21 Jun 2009 13:47:08 -0000 @@ -62,6 +62,8 @@ #ifdef _KERNEL +extern void *dpcpu0; + struct pcb; struct pcpu; Index: sparc64/machdep.c =================================================================== RCS file: /repoman/r/ncvs/src/sys/sparc64/sparc64/machdep.c,v retrieving revision 1.153 diff -u -r1.153 machdep.c --- sparc64/machdep.c 18 May 2009 18:37:18 -0000 1.153 +++ sparc64/machdep.c 21 Jun 2009 13:46:55 -0000 @@ -124,6 +124,7 @@ long Maxmem; long realmem; +void *dpcpu0; char pcpu0[PCPU_PAGES * PAGE_SIZE]; struct trapframe frame0; @@ -480,8 +481,10 @@ delay_func = delay_tick; /* - * Initialize the message buffer (after setting trap table). + * Initialize the dynamic per-CPU area for the BSP and the message + * buffer (after setting the trap table). */ + dpcpu_init(dpcpu0, 0); msgbufinit(msgbufp, MSGBUF_SIZE); mutex_init(); Index: sparc64/mp_machdep.c =================================================================== RCS file: /repoman/r/ncvs/src/sys/sparc64/sparc64/mp_machdep.c,v retrieving revision 1.51 diff -u -r1.51 mp_machdep.c --- sparc64/mp_machdep.c 19 Mar 2009 20:43:01 -0000 1.51 +++ sparc64/mp_machdep.c 18 Jun 2009 18:03:22 -0000 @@ -290,6 +290,8 @@ va = kmem_alloc(kernel_map, PCPU_PAGES * PAGE_SIZE); pc = (struct pcpu *)(va + (PCPU_PAGES * PAGE_SIZE)) - 1; pcpu_init(pc, cpuid, sizeof(*pc)); + dpcpu_init((void *)kmem_alloc(kernel_map, DPCPU_SIZE), + cpuid); pc->pc_addr = va; pc->pc_clock = clock; pc->pc_mid = mid; Index: sparc64/pmap.c =================================================================== RCS file: /repoman/r/ncvs/src/sys/sparc64/sparc64/pmap.c,v retrieving revision 1.178 diff -u -r1.178 pmap.c --- sparc64/pmap.c 1 Jan 2009 14:01:21 -0000 1.178 +++ sparc64/pmap.c 21 Jun 2009 13:47:21 -0000 @@ -75,6 +75,7 @@ #include #include #include +#include #include #include #include @@ -363,6 +364,11 @@ bzero(tsb_kernel, tsb_kernel_size); /* + * Allocate and map the dynamic per-CPU area for the BSP. + */ + dpcpu0 = (void *)TLB_PHYS_TO_DIRECT(pmap_bootstrap_alloc(DPCPU_SIZE)); + + /* * Allocate and map the message buffer. */ msgbuf_phys = pmap_bootstrap_alloc(MSGBUF_SIZE);