Print this page
XXXX pass in cpu_pause_func via pause_cpus

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/cpr/cpr_main.c
          +++ new/usr/src/uts/common/cpr/cpr_main.c
↓ open down ↓ 82 lines elided ↑ open up ↑
  83   83  #endif
  84   84  static int cpr_all_online(void);
  85   85  static void cpr_restore_offline(void);
  86   86  
  87   87  cpr_time_t wholecycle_tv;
  88   88  int cpr_suspend_succeeded;
  89   89  pfn_t curthreadpfn;
  90   90  int curthreadremapped;
  91   91  
  92   92  extern cpuset_t cpu_ready_set;
  93      -extern void *(*cpu_pause_func)(void *);
  94   93  
  95   94  extern processorid_t i_cpr_bootcpuid(void);
  96   95  extern cpu_t *i_cpr_bootcpu(void);
  97   96  extern void tsc_adjust_delta(hrtime_t tdelta);
  98   97  extern void tsc_resume(void);
  99   98  extern int tsc_resume_in_cyclic;
 100   99  
 101  100  /*
 102  101   * Set this variable to 1, to have device drivers resume in an
 103  102   * uniprocessor environment. This is to allow drivers that assume
↓ open down ↓ 305 lines elided ↑ open up ↑
 409  408           */
 410  409          affinity_set(i_cpr_bootcpuid());
 411  410  
 412  411          ASSERT(CPU->cpu_id == 0);
 413  412  
 414  413          PMD(PMD_SX, ("curthread running on bootcpu\n"))
 415  414  
 416  415          /*
 417  416           * pause all other running CPUs and save the CPU state at the sametime
 418  417           */
 419      -        cpu_pause_func = i_cpr_save_context;
 420      -        pause_cpus(NULL);
      418 +        pause_cpus(NULL, i_cpr_save_context);
 421  419  
 422  420          mutex_exit(&cpu_lock);
 423  421  
 424  422          return (0);
 425  423  }
 426  424  
 427  425  /*
 428  426   * Take the system down to a checkpointable state and write
 429  427   * the state file, the following are sequentially executed:
 430  428   *
↓ open down ↓ 354 lines elided ↑ open up ↑
 785  783           * Restart the paused cpus
 786  784           */
 787  785          mutex_enter(&cpu_lock);
 788  786          start_cpus();
 789  787          mutex_exit(&cpu_lock);
 790  788  
 791  789          i_cpr_post_resume_cpus();
 792  790  
 793  791          mutex_enter(&cpu_lock);
 794  792          /*
 795      -         * Restore this cpu to use the regular cpu_pause(), so that
 796      -         * online and offline will work correctly
 797      -         */
 798      -        cpu_pause_func = NULL;
 799      -
 800      -        /*
 801  793           * clear the affinity set in cpr_suspend_cpus()
 802  794           */
 803  795          affinity_clear();
 804  796  
 805  797          /*
 806  798           * offline all the cpus that were brought online during suspend
 807  799           */
 808  800          cpr_restore_offline();
 809  801  
 810  802          mutex_exit(&cpu_lock);
↓ open down ↓ 2 lines elided ↑ open up ↑
 813  805  void
 814  806  cpr_unpause_cpus(void)
 815  807  {
 816  808          /*
 817  809           * Now restore the system back to what it was before we suspended
 818  810           */
 819  811  
 820  812          PMD(PMD_SX, ("cpr_unpause_cpus: restoring system\n"))
 821  813  
 822  814          mutex_enter(&cpu_lock);
 823      -
 824      -        /*
 825      -         * Restore this cpu to use the regular cpu_pause(), so that
 826      -         * online and offline will work correctly
 827      -         */
 828      -        cpu_pause_func = NULL;
 829      -
 830  815          /*
 831  816           * Restart the paused cpus
 832  817           */
 833  818          start_cpus();
 834  819  
 835  820          /*
 836  821           * clear the affinity set in cpr_suspend_cpus()
 837  822           */
 838  823          affinity_clear();
 839  824  
↓ open down ↓ 247 lines elided ↑ open up ↑
1087 1072              cpr_resume_uniproc))
1088 1073  
1089 1074  #if defined(__x86)
1090 1075          /*
1091 1076           * If cpr_resume_uniproc is set, then pause all the other cpus
1092 1077           * apart from the current cpu, so that broken drivers that think
1093 1078           * that they are on a uniprocessor machine will resume
1094 1079           */
1095 1080          if (cpr_resume_uniproc) {
1096 1081                  mutex_enter(&cpu_lock);
1097      -                pause_cpus(NULL);
     1082 +                pause_cpus(NULL, NULL);
1098 1083                  mutex_exit(&cpu_lock);
1099 1084          }
1100 1085  #endif
1101 1086  
1102 1087          /*
1103 1088           * The policy here is to continue resume everything we can if we did
1104 1089           * not successfully finish suspend; and panic if we are coming back
1105 1090           * from a fully suspended system.
1106 1091           */
1107 1092          PMD(PMD_SX, ("cpr_resume: resume devices\n"))
↓ open down ↓ 287 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX