--- old/usr/src/uts/common/cpr/cpr_main.c	2014-05-01 19:50:17.423494659 -0400
+++ new/usr/src/uts/common/cpr/cpr_main.c	2014-05-01 19:50:17.429298220 -0400
@@ -90,7 +90,6 @@
 int curthreadremapped;
 
 extern cpuset_t cpu_ready_set;
-extern void *(*cpu_pause_func)(void *);
 
 extern processorid_t i_cpr_bootcpuid(void);
 extern cpu_t *i_cpr_bootcpu(void);
@@ -416,8 +415,7 @@
 	/*
 	 * pause all other running CPUs and save the CPU state at the sametime
 	 */
-	cpu_pause_func = i_cpr_save_context;
-	pause_cpus(NULL);
+	pause_cpus(NULL, i_cpr_save_context);
 
 	mutex_exit(&cpu_lock);
 
@@ -792,12 +790,6 @@
 
 	mutex_enter(&cpu_lock);
 	/*
-	 * Restore this cpu to use the regular cpu_pause(), so that
-	 * online and offline will work correctly
-	 */
-	cpu_pause_func = NULL;
-
-	/*
 	 * clear the affinity set in cpr_suspend_cpus()
 	 */
 	affinity_clear();
@@ -820,13 +812,6 @@
 	PMD(PMD_SX, ("cpr_unpause_cpus: restoring system\n"))
 
 	mutex_enter(&cpu_lock);
-
-	/*
-	 * Restore this cpu to use the regular cpu_pause(), so that
-	 * online and offline will work correctly
-	 */
-	cpu_pause_func = NULL;
-
 	/*
 	 * Restart the paused cpus
 	 */
@@ -1094,7 +1079,7 @@
 	 */
 	if (cpr_resume_uniproc) {
 		mutex_enter(&cpu_lock);
-		pause_cpus(NULL);
+		pause_cpus(NULL, NULL);
 		mutex_exit(&cpu_lock);
 	}
 #endif
--- old/usr/src/uts/common/disp/cmt.c	2014-05-01 19:50:17.629620046 -0400
+++ new/usr/src/uts/common/disp/cmt.c	2014-05-01 19:50:17.635413030 -0400
@@ -355,7 +355,7 @@
 	 * We're changing around the hierarchy, which is actively traversed
 	 * by the dispatcher. Pause CPUS to ensure exclusivity.
 	 */
-	pause_cpus(NULL);
+	pause_cpus(NULL, NULL);
 
 	/*
 	 * If necessary, update the parent's sibling set, replacing parent
@@ -1555,7 +1555,7 @@
 	 * We're operating on the PG hierarchy. Pause CPUs to ensure
 	 * exclusivity with respect to the dispatcher.
 	 */
-	pause_cpus(NULL);
+	pause_cpus(NULL, NULL);
 
 	/*
 	 * Prune all PG instances of the hardware sharing relationship
@@ -1675,7 +1675,7 @@
 
 	ASSERT(MUTEX_HELD(&cpu_lock));
 
-	pause_cpus(NULL);
+	pause_cpus(NULL, NULL);
 	cpu = cpu_list;
 
 	do {
--- old/usr/src/uts/common/disp/cpupart.c	2014-05-01 19:50:17.858534495 -0400
+++ new/usr/src/uts/common/disp/cpupart.c	2014-05-01 19:50:17.864285641 -0400
@@ -441,7 +441,7 @@
 		return (EBUSY);
 	}
 
-	pause_cpus(cp);
+	pause_cpus(cp, NULL);
 
 	if (move_threads) {
 		/*
@@ -865,7 +865,7 @@
 	 * the clock thread (which traverses the list without holding
 	 * cpu_lock) isn't running.
 	 */
-	pause_cpus(NULL);
+	pause_cpus(NULL, NULL);
 	pp->cp_next = cp_list_head;
 	pp->cp_prev = cp_list_head->cp_prev;
 	cp_list_head->cp_prev->cp_next = pp;
@@ -1011,7 +1011,7 @@
 	 * the clock thread (which traverses the list without holding
 	 * cpu_lock) isn't running.
 	 */
-	pause_cpus(NULL);
+	pause_cpus(NULL, NULL);
 	pp->cp_prev->cp_next = pp->cp_next;
 	pp->cp_next->cp_prev = pp->cp_prev;
 	if (cp_list_head == pp)
--- old/usr/src/uts/common/disp/disp.c	2014-05-01 19:50:18.061424553 -0400
+++ new/usr/src/uts/common/disp/disp.c	2014-05-01 19:50:18.067158192 -0400
@@ -340,7 +340,7 @@
 	} while (cpup != cpu_list);
 	num = i;
 
-	pause_cpus(NULL);
+	pause_cpus(NULL, NULL);
 	for (i = 0; i < num; i++)
 		disp_dq_assign(&disp_mem[i], numpris);
 	start_cpus();
--- old/usr/src/uts/common/os/cpu.c	2014-05-01 19:50:18.318619783 -0400
+++ new/usr/src/uts/common/os/cpu.c	2014-05-01 19:50:18.324419885 -0400
@@ -167,13 +167,12 @@
 	int		cp_count;	/* # of CPUs to pause */
 	ksema_t		cp_sem;		/* synch pause_cpus & cpu_pause */
 	kthread_id_t	cp_paused;
+	void		*(*cp_func)(void *);
 } cpu_pause_info;
 
 static kmutex_t pause_free_mutex;
 static kcondvar_t pause_free_cv;
 
-void *(*cpu_pause_func)(void *) = NULL;
-
 
 static struct cpu_sys_stats_ks_data {
 	kstat_named_t cpu_ticks_idle;
@@ -792,15 +791,15 @@
 		 */
 		s = splhigh();
 		/*
-		 * if cpu_pause_func() has been set then call it using
-		 * index as the argument, currently only used by
-		 * cpr_suspend_cpus().  This function is used as the
-		 * code to execute on the "paused" cpu's when a machine
-		 * comes out of a sleep state and CPU's were powered off.
-		 * (could also be used for hotplugging CPU's).
+		 * if cp_func has been set then call it using index as the
+		 * argument, currently only used by cpr_suspend_cpus().
+		 * This function is used as the code to execute on the
+		 * "paused" cpu's when a machine comes out of a sleep state
+		 * and CPU's were powered off.  (could also be used for
+		 * hotplugging CPU's).
 		 */
-		if (cpu_pause_func != NULL)
-			(*cpu_pause_func)((void *)lindex);
+		if (cpi->cp_func != NULL)
+			(*cpi->cp_func)((void *)lindex);
 
 		mach_cpu_pause(safe);
 
@@ -988,7 +987,7 @@
  * context.
  */
 void
-pause_cpus(cpu_t *off_cp)
+pause_cpus(cpu_t *off_cp, void *(*func)(void *))
 {
 	processorid_t	cpu_id;
 	int		i;
@@ -1002,6 +1001,8 @@
 		safe_list[i] = PAUSE_IDLE;
 	kpreempt_disable();
 
+	cpi->cp_func = func;
+
 	/*
 	 * If running on the cpu that is going offline, get off it.
 	 * This is so that it won't be necessary to rechoose a CPU
@@ -1206,7 +1207,7 @@
 	error = mp_cpu_start(cp);	/* arch-dep hook */
 	if (error == 0) {
 		pg_cpupart_in(cp, cp->cpu_part);
-		pause_cpus(NULL);
+		pause_cpus(NULL, NULL);
 		cpu_add_active_internal(cp);
 		if (cp->cpu_flags & CPU_FAULTED) {
 			cp->cpu_flags &= ~CPU_FAULTED;
@@ -1405,7 +1406,7 @@
 		 * Put all the cpus into a known safe place.
 		 * No mutexes can be entered while CPUs are paused.
 		 */
-		pause_cpus(cp);
+		pause_cpus(cp, NULL);
 		/*
 		 * Repeat the operation, if necessary, to make sure that
 		 * all outstanding low-level interrupts run to completion
@@ -1758,7 +1759,7 @@
 	 * adding the cpu to the list.
 	 */
 	cp->cpu_part = &cp_default;
-	(void) pause_cpus(NULL);
+	(void) pause_cpus(NULL, NULL);
 	cp->cpu_next = cpu_list;
 	cp->cpu_prev = cpu_list->cpu_prev;
 	cpu_list->cpu_prev->cpu_next = cp;
@@ -1853,7 +1854,7 @@
 	 * has been updated so that we don't waste time
 	 * trying to pause the cpu we're trying to delete.
 	 */
-	(void) pause_cpus(NULL);
+	(void) pause_cpus(NULL, NULL);
 
 	cpnext = cp->cpu_next;
 	cp->cpu_prev->cpu_next = cp->cpu_next;
@@ -1925,7 +1926,7 @@
 {
 	pg_cpupart_in(cp, cp->cpu_part);
 
-	pause_cpus(NULL);
+	pause_cpus(NULL, NULL);
 	cpu_add_active_internal(cp);
 	start_cpus();
 
--- old/usr/src/uts/common/os/cpu_event.c	2014-05-01 19:50:18.633886043 -0400
+++ new/usr/src/uts/common/os/cpu_event.c	2014-05-01 19:50:18.639584813 -0400
@@ -396,7 +396,7 @@
 	 * after pause_cpus().
 	 */
 	if (!cpus_paused()) {
-		pause_cpus(NULL);
+		pause_cpus(NULL, NULL);
 		unpause = 1;
 	}
 
@@ -462,7 +462,7 @@
 	 * after pause_cpus().
 	 */
 	if (!cpus_paused()) {
-		pause_cpus(NULL);
+		pause_cpus(NULL, NULL);
 		unpause = 1;
 	}
 
--- old/usr/src/uts/common/os/cpu_pm.c	2014-05-01 19:50:18.838553618 -0400
+++ new/usr/src/uts/common/os/cpu_pm.c	2014-05-01 19:50:18.844203586 -0400
@@ -188,7 +188,7 @@
 	 */
 	switch (new_policy) {
 	case CPUPM_POLICY_DISABLED:
-		pause_cpus(NULL);
+		pause_cpus(NULL, NULL);
 		cpupm_policy = CPUPM_POLICY_DISABLED;
 		start_cpus();
 
@@ -228,7 +228,7 @@
 			gov_init = 1;
 		}
 
-		pause_cpus(NULL);
+		pause_cpus(NULL, NULL);
 		cpupm_policy = CPUPM_POLICY_ELASTIC;
 		start_cpus();
 
--- old/usr/src/uts/common/os/lgrp.c	2014-05-01 19:50:19.025943593 -0400
+++ new/usr/src/uts/common/os/lgrp.c	2014-05-01 19:50:19.031825717 -0400
@@ -1297,7 +1297,7 @@
 		klgrpset_add(my_lgrp->lgrp_set[LGRP_RSRC_MEM], lgrpid);
 
 		if (need_synch)
-			pause_cpus(NULL);
+			pause_cpus(NULL, NULL);
 		count = lgrp_leaf_add(my_lgrp, lgrp_table, lgrp_alloc_max + 1,
 		    &changed);
 		if (need_synch)
@@ -1316,7 +1316,7 @@
 		    lgrpid))
 			klgrpset_add(my_lgrp->lgrp_set[LGRP_RSRC_MEM], lgrpid);
 		if (need_synch)
-			pause_cpus(NULL);
+			pause_cpus(NULL, NULL);
 		count = lgrp_leaf_add(my_lgrp, lgrp_table, lgrp_alloc_max + 1,
 		    &changed);
 		if (need_synch)
@@ -1477,7 +1477,7 @@
 		 * Delete lgroup when no more resources
 		 */
 		if (need_synch)
-			pause_cpus(NULL);
+			pause_cpus(NULL, NULL);
 		count = lgrp_leaf_delete(my_lgrp, lgrp_table,
 		    lgrp_alloc_max + 1, &changed);
 		ASSERT(count > 0);
--- old/usr/src/uts/common/os/lgrp_topo.c	2014-05-01 19:50:19.336764011 -0400
+++ new/usr/src/uts/common/os/lgrp_topo.c	2014-05-01 19:50:19.342561778 -0400
@@ -1480,7 +1480,7 @@
 	}
 
 	mutex_enter(&cpu_lock);
-	pause_cpus(NULL);
+	pause_cpus(NULL, NULL);
 
 	/*
 	 * Look for any leaf lgroup without its latency set, finish adding it
--- old/usr/src/uts/common/os/mem_config.c	2014-05-01 19:50:19.549127299 -0400
+++ new/usr/src/uts/common/os/mem_config.c	2014-05-01 19:50:19.554871324 -0400
@@ -3302,7 +3302,7 @@
 	vm_cpu_data_t *vc;
 
 	mutex_enter(&cpu_lock);
-	pause_cpus(NULL);
+	pause_cpus(NULL, NULL);
 
 	cp = cpu_list;
 	do {
--- old/usr/src/uts/common/sys/cpuvar.h	2014-05-01 19:50:19.818361703 -0400
+++ new/usr/src/uts/common/sys/cpuvar.h	2014-05-01 19:50:19.824093404 -0400
@@ -659,7 +659,7 @@
 
 void	mach_cpu_pause(volatile char *);
 
-void	pause_cpus(cpu_t *off_cp);
+void	pause_cpus(cpu_t *off_cp, void *(*func)(void *));
 void	start_cpus(void);
 int	cpus_paused(void);
 
--- old/usr/src/uts/i86pc/i86hvm/io/xpv/xpv_support.c	2014-05-01 19:50:20.008671352 -0400
+++ new/usr/src/uts/i86pc/i86hvm/io/xpv/xpv_support.c	2014-05-01 19:50:20.014448650 -0400
@@ -472,7 +472,7 @@
 	kpreempt_disable();
 
 	if (ncpus > 1)
-		pause_cpus(NULL);
+		pause_cpus(NULL, NULL);
 	/*
 	 * We can grab the ec_lock as it's a spinlock with a high SPL. Hence
 	 * any holder would have dropped it to get through pause_cpus().
--- old/usr/src/uts/i86pc/io/dr/dr_quiesce.c	2014-05-01 19:50:20.193878089 -0400
+++ new/usr/src/uts/i86pc/io/dr/dr_quiesce.c	2014-05-01 19:50:20.200084096 -0400
@@ -872,7 +872,7 @@
 	srh->sr_suspend_state = DR_SRSTATE_FULL;
 
 	mutex_enter(&cpu_lock);
-	pause_cpus(NULL);
+	pause_cpus(NULL, NULL);
 	dr_stop_intr();
 
 	return (rc);
--- old/usr/src/uts/i86pc/io/ppm/acpisleep.c	2014-05-01 19:50:20.386750178 -0400
+++ new/usr/src/uts/i86pc/io/ppm/acpisleep.c	2014-05-01 19:50:20.392552493 -0400
@@ -70,8 +70,6 @@
 extern int tsc_gethrtime_enable;
 
 extern cpuset_t cpu_ready_set;
-extern void *(*cpu_pause_func)(void *);
-
 
 
 /*
--- old/usr/src/uts/i86pc/os/cpr_impl.c	2014-05-01 19:50:20.556012248 -0400
+++ new/usr/src/uts/i86pc/os/cpr_impl.c	2014-05-01 19:50:20.561847241 -0400
@@ -737,7 +737,7 @@
 		mutex_exit(&cpu_lock);
 		return;
 	}
-	pause_cpus(NULL);
+	pause_cpus(NULL, NULL);
 	cpu_are_paused = 1;
 
 	mutex_exit(&cpu_lock);
--- old/usr/src/uts/i86pc/os/machdep.c	2014-05-01 19:50:20.753894334 -0400
+++ new/usr/src/uts/i86pc/os/machdep.c	2014-05-01 19:50:20.759472796 -0400
@@ -283,7 +283,7 @@
 	(void) spl6();
 	if (!panicstr) {
 		mutex_enter(&cpu_lock);
-		pause_cpus(NULL);
+		pause_cpus(NULL, NULL);
 		mutex_exit(&cpu_lock);
 	}
 
--- old/usr/src/uts/i86pc/os/mp_pc.c	2014-05-01 19:50:20.960114716 -0400
+++ new/usr/src/uts/i86pc/os/mp_pc.c	2014-05-01 19:50:20.965896812 -0400
@@ -63,7 +63,6 @@
 extern void real_mode_stop_cpu_stage1_end(void);
 extern void real_mode_stop_cpu_stage2(void);
 extern void real_mode_stop_cpu_stage2_end(void);
-extern void *(*cpu_pause_func)(void *);
 
 void rmp_gdt_init(rm_platter_t *);
 
--- old/usr/src/uts/i86pc/os/x_call.c	2014-05-01 19:50:21.143567535 -0400
+++ new/usr/src/uts/i86pc/os/x_call.c	2014-05-01 19:50:21.149310391 -0400
@@ -279,7 +279,7 @@
 	 * This is used to work around a race condition window in xc_common()
 	 * between checking CPU_READY flag and increasing working item count.
 	 */
-	pause_cpus(cpup);
+	pause_cpus(cpup, NULL);
 	start_cpus();
 
 	for (i = 0; i < XC_FLUSH_MAX_WAITS; i++) {
--- old/usr/src/uts/i86xpv/os/mp_xen.c	2014-05-01 19:50:21.327597807 -0400
+++ new/usr/src/uts/i86xpv/os/mp_xen.c	2014-05-01 19:50:21.333342806 -0400
@@ -586,7 +586,7 @@
 
 	ASSERT(MUTEX_HELD(&cpu_lock));
 
-	pause_cpus(NULL);
+	pause_cpus(NULL, NULL);
 
 	while (!done) {
 		done = 1;
--- old/usr/src/uts/sun4/os/mp_states.c	2014-05-01 19:50:21.522253805 -0400
+++ new/usr/src/uts/sun4/os/mp_states.c	2014-05-01 19:50:21.527871705 -0400
@@ -200,7 +200,7 @@
 	if (ncpus > 1)
 		intr_redist_all_cpus_shutdown();
 
-	pause_cpus(NULL);
+	pause_cpus(NULL, NULL);
 	cpu_are_paused = 1;
 
 	mutex_exit(&cpu_lock);
--- old/usr/src/uts/sun4/os/prom_subr.c	2014-05-01 19:50:21.694615591 -0400
+++ new/usr/src/uts/sun4/os/prom_subr.c	2014-05-01 19:50:21.700303562 -0400
@@ -410,7 +410,7 @@
 void
 promsafe_pause_cpus(void)
 {
-	pause_cpus(NULL);
+	pause_cpus(NULL, NULL);
 
 	/* If some other cpu is entering or is in the prom, spin */
 	while (prom_cpu || mutex_owner(&prom_mutex)) {
@@ -423,7 +423,7 @@
 			cv_wait(&prom_cv, &prom_mutex);
 
 		mutex_exit(&prom_mutex);
-		pause_cpus(NULL);
+		pause_cpus(NULL, NULL);
 	}
 
 	/* At this point all cpus are paused and none are in the prom */
--- old/usr/src/uts/sun4u/io/mem_cache.c	2014-05-01 19:50:21.876179116 -0400
+++ new/usr/src/uts/sun4u/io/mem_cache.c	2014-05-01 19:50:21.882322846 -0400
@@ -815,7 +815,7 @@
 			    << PN_CACHE_LINE_SHIFT);
 			mutex_enter(&cpu_lock);
 			affinity_set(cache_info->cpu_id);
-			(void) pause_cpus(NULL);
+			(void) pause_cpus(NULL, NULL);
 			mutex_exit(&cpu_lock);
 			/*
 			 * We bind ourself to a CPU and send cross trap to
--- old/usr/src/uts/sun4u/ngdr/io/dr_quiesce.c	2014-05-01 19:50:22.070046773 -0400
+++ new/usr/src/uts/sun4u/ngdr/io/dr_quiesce.c	2014-05-01 19:50:22.075821279 -0400
@@ -935,7 +935,7 @@
 	CPU_SIGNATURE(OS_SIG, SIGST_QUIESCED, SIGSUBST_NULL, CPU->cpu_id);
 
 	mutex_enter(&cpu_lock);
-	pause_cpus(NULL);
+	pause_cpus(NULL, NULL);
 	dr_stop_intr();
 
 	return (rc);
--- old/usr/src/uts/sun4u/os/cpr_impl.c	2014-05-01 19:50:22.264481682 -0400
+++ new/usr/src/uts/sun4u/os/cpr_impl.c	2014-05-01 19:50:22.270125678 -0400
@@ -269,7 +269,7 @@
 		for (cp = CPU->cpu_next; cp != CPU; cp = cp->cpu_next)
 			restart_other_cpu(cp->cpu_id);
 
-		pause_cpus(NULL);
+		pause_cpus(NULL, NULL);
 		mutex_exit(&cpu_lock);
 
 		i_cpr_xcall(i_cpr_clear_entries);
--- old/usr/src/uts/sun4u/serengeti/io/sbdp_quiesce.c	2014-05-01 19:50:22.490761997 -0400
+++ new/usr/src/uts/sun4u/serengeti/io/sbdp_quiesce.c	2014-05-01 19:50:22.496418956 -0400
@@ -844,7 +844,7 @@
 	}
 
 	mutex_enter(&cpu_lock);
-	pause_cpus(NULL);
+	pause_cpus(NULL, NULL);
 	sbdp_stop_intr();
 
 	/*
--- old/usr/src/uts/sun4v/os/mpo.c	2014-05-01 19:50:22.679166236 -0400
+++ new/usr/src/uts/sun4v/os/mpo.c	2014-05-01 19:50:22.684912215 -0400
@@ -220,7 +220,7 @@
 mpo_wr_lock()
 {
 	mutex_enter(&cpu_lock);
-	pause_cpus(NULL);
+	pause_cpus(NULL, NULL);
 	mutex_exit(&cpu_lock);
 }
 
--- old/usr/src/uts/sun4v/os/suspend.c	2014-05-01 19:50:22.911380233 -0400
+++ new/usr/src/uts/sun4v/os/suspend.c	2014-05-01 19:50:22.917028937 -0400
@@ -389,7 +389,7 @@
 	 * inactive in their PGs and shouldn't be reactivated, so we must
 	 * not call pg_cpu_inactive or pg_cpu_active for those CPUs.
 	 */
-	pause_cpus(NULL);
+	pause_cpus(NULL, NULL);
 	for (id = 0; id < NCPU; id++) {
 		if ((cp = cpu_get(id)) == NULL)
 			continue;
@@ -430,7 +430,7 @@
 	 * system, replace the bootstrapped PG structure with the
 	 * initialized PG structure and call pg_cpu_active for each CPU.
 	 */
-	pause_cpus(NULL);
+	pause_cpus(NULL, NULL);
 	for (id = 0; id < NCPU; id++) {
 		if ((cp = cpu_get(id)) == NULL)
 			continue;
@@ -615,7 +615,7 @@
 	mutex_exit(&tod_lock);
 
 	/* Pause all other CPUs */
-	pause_cpus(NULL);
+	pause_cpus(NULL, NULL);
 	DBG_PROM("suspend: CPUs paused\n");
 
 	/* Suspend cyclics */
