Print this page
patch cpu-pause-func-deglobalize

@@ -88,11 +88,10 @@
 int cpr_suspend_succeeded;
 pfn_t curthreadpfn;
 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);
 extern void tsc_adjust_delta(hrtime_t tdelta);
 extern void tsc_resume(void);

@@ -414,12 +413,11 @@
         PMD(PMD_SX, ("curthread running on bootcpu\n"))
 
         /*
          * 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);
 
         return (0);
 }

@@ -790,16 +788,10 @@
 
         i_cpr_post_resume_cpus();
 
         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();
 
         /*

@@ -818,17 +810,10 @@
          */
 
         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
          */
         start_cpus();
 

@@ -1092,11 +1077,11 @@
          * apart from the current cpu, so that broken drivers that think
          * that they are on a uniprocessor machine will resume
          */
         if (cpr_resume_uniproc) {
                 mutex_enter(&cpu_lock);
-                pause_cpus(NULL);
+                pause_cpus(NULL, NULL);
                 mutex_exit(&cpu_lock);
         }
 #endif
 
         /*