Index: sys/compat/linuxkpi/common/src/linux_idr.c =================================================================== --- sys/compat/linuxkpi/common/src/linux_idr.c +++ sys/compat/linuxkpi/common/src/linux_idr.c @@ -55,7 +55,7 @@ unsigned count; }; -static DPCPU_DEFINE(struct linux_idr_cache, linux_idr_cache); +DPCPU_STATIC_DEFINE(struct linux_idr_cache, linux_idr_cache); /* * IDR Implementation. Index: sys/compat/linuxkpi/common/src/linux_rcu.c =================================================================== --- sys/compat/linuxkpi/common/src/linux_rcu.c +++ sys/compat/linuxkpi/common/src/linux_rcu.c @@ -92,7 +92,7 @@ static ck_epoch_t linux_epoch; static struct linux_epoch_head linux_epoch_head; -static DPCPU_DEFINE(struct linux_epoch_record, linux_epoch_record); +DPCPU_STATIC_DEFINE(struct linux_epoch_record, linux_epoch_record); static void linux_rcu_cleaner_func(void *, int); Index: sys/compat/linuxkpi/common/src/linux_tasklet.c =================================================================== --- sys/compat/linuxkpi/common/src/linux_tasklet.c +++ sys/compat/linuxkpi/common/src/linux_tasklet.c @@ -61,7 +61,7 @@ #define TASKLET_WORKER_LOCK(tw) mtx_lock(&(tw)->mtx) #define TASKLET_WORKER_UNLOCK(tw) mtx_unlock(&(tw)->mtx) -static DPCPU_DEFINE(struct tasklet_worker, tasklet_worker); +DPCPU_STATIC_DEFINE(struct tasklet_worker, tasklet_worker); static void tasklet_handler(void *arg) Index: sys/dev/xen/debug/debug.c =================================================================== --- sys/dev/xen/debug/debug.c +++ sys/dev/xen/debug/debug.c @@ -51,7 +51,7 @@ * vCPU on the Xen console. */ -DPCPU_DEFINE(xen_intr_handle_t, xendebug_handler); +DPCPU_GLOBAL_DEFINE(xen_intr_handle_t, xendebug_handler); static struct mtx lock; static struct sbuf *buf; Index: sys/dev/xen/timer/timer.c =================================================================== --- sys/dev/xen/timer/timer.c +++ sys/dev/xen/timer/timer.c @@ -92,7 +92,7 @@ void *irq_handle; }; -DPCPU_DEFINE(struct xentimer_pcpu_data, xentimer_pcpu); +DPCPU_GLOBAL_DEFINE(struct xentimer_pcpu_data, xentimer_pcpu); DPCPU_DECLARE(struct vcpu_info *, vcpu_info); Index: sys/kern/kern_clock.c =================================================================== --- sys/kern/kern_clock.c +++ sys/kern/kern_clock.c @@ -388,7 +388,7 @@ volatile int ticks; int psratio; -static DPCPU_DEFINE(int, pcputicks); /* Per-CPU version of ticks. */ +DPCPU_STATIC_DEFINE(int, pcputicks); /* Per-CPU version of ticks. */ #ifdef DEVICE_POLLING static int devpoll_run = 0; #endif Index: sys/kern/kern_clocksource.c =================================================================== --- sys/kern/kern_clocksource.c +++ sys/kern/kern_clocksource.c @@ -126,8 +126,8 @@ int idle; /* This CPU is in idle mode. */ }; -static DPCPU_DEFINE(struct pcpu_state, timerstate); -DPCPU_DEFINE(sbintime_t, hardclocktime); +DPCPU_STATIC_DEFINE(struct pcpu_state, timerstate); +DPCPU_GLOBAL_DEFINE(sbintime_t, hardclocktime); /* * Timer broadcast IPI handler. Index: sys/kern/kern_exec.c =================================================================== --- sys/kern/kern_exec.c +++ sys/kern/kern_exec.c @@ -1331,7 +1331,7 @@ SLIST_ENTRY(exec_args_kva) next; }; -static DPCPU_DEFINE(struct exec_args_kva *, exec_args_kva); +DPCPU_STATIC_DEFINE(struct exec_args_kva *, exec_args_kva); static SLIST_HEAD(, exec_args_kva) exec_args_kva_freelist; static struct mtx exec_args_kva_mtx; Index: sys/kern/kern_pmc.c =================================================================== --- sys/kern/kern_pmc.c +++ sys/kern/kern_pmc.c @@ -73,7 +73,7 @@ /* Interrupt handler */ int __read_mostly (*pmc_intr)(struct trapframe *tf) = NULL; -DPCPU_DEFINE(uint8_t, pmc_sampled); +DPCPU_GLOBAL_DEFINE(uint8_t, pmc_sampled); /* * A global count of SS mode PMCs. When non-zero, this means that Index: sys/kern/kern_switch.c =================================================================== --- sys/kern/kern_switch.c +++ sys/kern/kern_switch.c @@ -84,7 +84,7 @@ SYSCTL_NODE(_kern_sched, OID_AUTO, stats, CTLFLAG_RW, 0, "switch stats"); /* Switch reasons from mi_switch(). */ -DPCPU_DEFINE(long, sched_switch_stats[SWT_COUNT]); +DPCPU_GLOBAL_DEFINE(long, sched_switch_stats[SWT_COUNT]); SCHED_STAT_DEFINE_VAR(uncategorized, &DPCPU_NAME(sched_switch_stats[SWT_NONE]), ""); SCHED_STAT_DEFINE_VAR(preempt, Index: sys/kern/kern_tc.c =================================================================== --- sys/kern/kern_tc.c +++ sys/kern/kern_tc.c @@ -2001,8 +2001,8 @@ static int cpu_tick_variable; static uint64_t cpu_tick_frequency; -static DPCPU_DEFINE(uint64_t, tc_cpu_ticks_base); -static DPCPU_DEFINE(unsigned, tc_cpu_ticks_last); +DPCPU_STATIC_DEFINE(uint64_t, tc_cpu_ticks_base); +DPCPU_STATIC_DEFINE(unsigned, tc_cpu_ticks_last); static uint64_t tc_cpu_ticks(void) Index: sys/kern/sched_4bsd.c =================================================================== --- sys/kern/sched_4bsd.c +++ sys/kern/sched_4bsd.c @@ -176,7 +176,7 @@ u_int idlecalls; u_int oldidlecalls; }; -static DPCPU_DEFINE(struct pcpuidlestat, idlestat); +DPCPU_STATIC_DEFINE(struct pcpuidlestat, idlestat); static void setup_runqs(void) Index: sys/kern/sched_ule.c =================================================================== --- sys/kern/sched_ule.c +++ sys/kern/sched_ule.c @@ -283,7 +283,7 @@ static struct tdq tdq_cpu[MAXCPU]; static struct tdq *balance_tdq; static int balance_ticks; -static DPCPU_DEFINE(uint32_t, randomval); +DPCPU_STATIC_DEFINE(uint32_t, randomval); #define TDQ_SELF() (&tdq_cpu[PCPU_GET(cpuid)]) #define TDQ_CPU(x) (&tdq_cpu[(x)]) Index: sys/kern/subr_epoch.c =================================================================== --- sys/kern/subr_epoch.c +++ sys/kern/subr_epoch.c @@ -121,8 +121,8 @@ epoch_t allepochs[MAX_EPOCHS]; -DPCPU_DEFINE(struct grouptask, epoch_cb_task); -DPCPU_DEFINE(int, epoch_cb_count); +DPCPU_GLOBAL_DEFINE(struct grouptask, epoch_cb_task); +DPCPU_GLOBAL_DEFINE(int, epoch_cb_count); static __read_mostly int domcount[MAXMEMDOM]; static __read_mostly int domoffsets[MAXMEMDOM]; Index: sys/kern/subr_pcpu.c =================================================================== --- sys/kern/subr_pcpu.c +++ sys/kern/subr_pcpu.c @@ -72,7 +72,7 @@ TAILQ_ENTRY(dpcpu_free) df_link; }; -static DPCPU_DEFINE(char, modspace[DPCPU_MODMIN]); +DPCPU_STATIC_DEFINE(char, modspace[DPCPU_MODMIN]); static TAILQ_HEAD(, dpcpu_free) dpcpu_head = TAILQ_HEAD_INITIALIZER(dpcpu_head); static struct sx dpcpu_lock; uintptr_t dpcpu_off[MAXCPU]; Index: sys/mips/mips/tick.c =================================================================== --- sys/mips/mips/tick.c +++ sys/mips/mips/tick.c @@ -61,13 +61,13 @@ struct timecounter *platform_timecounter; -static DPCPU_DEFINE(uint32_t, cycles_per_tick); +DPCPU_STATIC_DEFINE(uint32_t, cycles_per_tick); static uint32_t cycles_per_usec; -static DPCPU_DEFINE(volatile uint32_t, counter_upper); -static DPCPU_DEFINE(volatile uint32_t, counter_lower_last); -static DPCPU_DEFINE(uint32_t, compare_ticks); -static DPCPU_DEFINE(uint32_t, lost_ticks); +DPCPU_STATIC_DEFINE(volatile uint32_t, counter_upper); +DPCPU_STATIC_DEFINE(volatile uint32_t, counter_lower_last); +DPCPU_STATIC_DEFINE(uint32_t, compare_ticks); +DPCPU_STATIC_DEFINE(uint32_t, lost_ticks); struct clock_softc { int intr_rid; Index: sys/mips/nlm/tick.c =================================================================== --- sys/mips/nlm/tick.c +++ sys/mips/nlm/tick.c @@ -62,13 +62,13 @@ struct timecounter *platform_timecounter; -static DPCPU_DEFINE(uint32_t, cycles_per_tick); +DPCPU_STATIC_DEFINE(uint32_t, cycles_per_tick); static uint32_t cycles_per_usec; -static DPCPU_DEFINE(volatile uint32_t, counter_upper); -static DPCPU_DEFINE(volatile uint32_t, counter_lower_last); -static DPCPU_DEFINE(uint32_t, compare_ticks); -static DPCPU_DEFINE(uint32_t, lost_ticks); +DPCPU_STATIC_DEFINE(volatile uint32_t, counter_upper); +DPCPU_STATIC_DEFINE(volatile uint32_t, counter_lower_last); +DPCPU_STATIC_DEFINE(uint32_t, compare_ticks); +DPCPU_STATIC_DEFINE(uint32_t, lost_ticks); struct clock_softc { int intr_rid; Index: sys/net/if_epair.c =================================================================== --- sys/net/if_epair.c +++ sys/net/if_epair.c @@ -191,7 +191,7 @@ struct eid_list epair_ifp_drain_list; /* Per-CPU list of ifps with * data in the ifq. */ }; -DPCPU_DEFINE(struct epair_dpcpu, epair_dpcpu); +DPCPU_GLOBAL_DEFINE(struct epair_dpcpu, epair_dpcpu); static void epair_dpcpu_init(void) Index: sys/net/netisr.c =================================================================== --- sys/net/netisr.c +++ sys/net/netisr.c @@ -232,7 +232,7 @@ /* * Per-CPU workstream data. See netisr_internal.h for more details. */ -DPCPU_DEFINE(struct netisr_workstream, nws); +DPCPU_GLOBAL_DEFINE(struct netisr_workstream, nws); /* * Map contiguous values between 0 and nws_count into CPU IDs appropriate for Index: sys/netinet/siftr.c =================================================================== --- sys/netinet/siftr.c +++ sys/netinet/siftr.c @@ -268,7 +268,7 @@ uint32_t nskip_out_dejavu; }; -static DPCPU_DEFINE(struct siftr_stats, ss); +DPCPU_STATIC_DEFINE(struct siftr_stats, ss); static volatile unsigned int siftr_exit_pkt_manager_thread = 0; static unsigned int siftr_enabled = 0; Index: sys/netpfil/ipfw/ip_fw_dynamic.c =================================================================== --- sys/netpfil/ipfw/ip_fw_dynamic.c +++ sys/netpfil/ipfw/ip_fw_dynamic.c @@ -219,7 +219,7 @@ * and must not be reclaimed by expiration callout. */ static void **dyn_hp_cache; -static DPCPU_DEFINE(void *, dyn_hp); +DPCPU_STATIC_DEFINE(void *, dyn_hp); #define DYNSTATE_GET(cpu) ck_pr_load_ptr(DPCPU_ID_PTR((cpu), dyn_hp)) #define DYNSTATE_PROTECT(v) ck_pr_store_ptr(DPCPU_PTR(dyn_hp), (v)) #define DYNSTATE_RELEASE() DYNSTATE_PROTECT(NULL) Index: sys/powerpc/powerpc/clock.c =================================================================== --- sys/powerpc/powerpc/clock.c +++ sys/powerpc/powerpc/clock.c @@ -95,7 +95,7 @@ int mode; /* 0 - off, 1 - periodic, 2 - one-shot. */ int32_t div; /* Periodic divisor. */ }; -static DPCPU_DEFINE(struct decr_state, decr_state); +DPCPU_STATIC_DEFINE(struct decr_state, decr_state); static struct eventtimer decr_et; static struct timecounter decr_tc = { Index: sys/sys/pcpu.h =================================================================== --- sys/sys/pcpu.h +++ sys/sys/pcpu.h @@ -81,7 +81,10 @@ */ #define DPCPU_NAME(n) pcpu_entry_##n #define DPCPU_DECLARE(t, n) extern t DPCPU_NAME(n) -#define DPCPU_DEFINE(t, n) t DPCPU_NAME(n) __section(DPCPU_SETNAME) __used +#define DPCPU_GLOBAL_DEFINE(t, n) \ + t DPCPU_NAME(n) __section(DPCPU_SETNAME) __used +#define DPCPU_STATIC_DEFINE(t, n) \ + static t DPCPU_NAME(n) __section(DPCPU_SETNAME) __used /* * Accessors with a given base. Index: sys/sys/sched.h =================================================================== --- sys/sys/sched.h +++ sys/sys/sched.h @@ -206,7 +206,7 @@ SYSINIT(name, SI_SUB_LAST, SI_ORDER_MIDDLE, name ## _add_proc, NULL); #define SCHED_STAT_DEFINE(name, descr) \ - DPCPU_DEFINE(unsigned long, name); \ + DPCPU_GLOBAL_DEFINE(unsigned long, name); \ SCHED_STAT_DEFINE_VAR(name, &DPCPU_NAME(name), descr) /* * Sched stats are always incremented in critical sections so no atomic Index: sys/vm/vm_page.c =================================================================== --- sys/vm/vm_page.c +++ sys/vm/vm_page.c @@ -134,7 +134,7 @@ struct vm_domain vm_dom[MAXMEMDOM]; -static DPCPU_DEFINE(struct vm_batchqueue, pqbatch[MAXMEMDOM][PQ_COUNT]); +DPCPU_STATIC_DEFINE(struct vm_batchqueue, pqbatch[MAXMEMDOM][PQ_COUNT]); struct mtx_padalign __exclusive_cache_line pa_lock[PA_LOCK_COUNT]; Index: sys/x86/xen/hvm.c =================================================================== --- sys/x86/xen/hvm.c +++ sys/x86/xen/hvm.c @@ -89,8 +89,8 @@ int xen_vector_callback_enabled; /*------------------------------- Per-CPU Data -------------------------------*/ -DPCPU_DEFINE(struct vcpu_info, vcpu_local_info); -DPCPU_DEFINE(struct vcpu_info *, vcpu_info); +DPCPU_GLOBAL_DEFINE(struct vcpu_info, vcpu_local_info); +DPCPU_GLOBAL_DEFINE(struct vcpu_info *, vcpu_info); /*------------------ Hypervisor Access Shared Memory Regions -----------------*/ shared_info_t *HYPERVISOR_shared_info; Index: sys/x86/xen/xen_apic.c =================================================================== --- sys/x86/xen/xen_apic.c +++ sys/x86/xen/xen_apic.c @@ -102,7 +102,7 @@ /*------------------------------- Per-CPU Data -------------------------------*/ #ifdef SMP -DPCPU_DEFINE(xen_intr_handle_t, ipi_handle[nitems(xen_ipis)]); +DPCPU_GLOBAL_DEFINE(xen_intr_handle_t, ipi_handle[nitems(xen_ipis)]); #endif /*------------------------------- Xen PV APIC --------------------------------*/ Index: sys/x86/xen/xen_intr.c =================================================================== --- sys/x86/xen/xen_intr.c +++ sys/x86/xen/xen_intr.c @@ -103,7 +103,7 @@ * Start the scan at port 0 by initializing the last scanned * location as the highest numbered event channel port. */ -static DPCPU_DEFINE(struct xen_intr_pcpu_data, xen_intr_pcpu) = { +DPCPU_STATIC_DEFINE(struct xen_intr_pcpu_data, xen_intr_pcpu) = { .last_processed_l1i = LONG_BIT - 1, .last_processed_l2i = LONG_BIT - 1 };