Print this page
XXXX pass in cpu_pause_func via pause_cpus

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/sun4v/os/suspend.c
          +++ new/usr/src/uts/sun4v/os/suspend.c
↓ open down ↓ 381 lines elided ↑ open up ↑
 382  382           * call pg_cpu_inactive and pg_cpu_active with CPUs paused and
 383  383           * we want to minimize the number of times pause_cpus is called.
 384  384           * Inactivating all CPUs would leave PGs without any active CPUs,
 385  385           * so while CPUs are paused, call pg_cpu_inactive and swap in the
 386  386           * bootstrap PG structure saving the original PG structure to be
 387  387           * fini'd afterwards. This prevents the dispatcher from encountering
 388  388           * PGs in which all CPUs are inactive. Offline CPUs are already
 389  389           * inactive in their PGs and shouldn't be reactivated, so we must
 390  390           * not call pg_cpu_inactive or pg_cpu_active for those CPUs.
 391  391           */
 392      -        pause_cpus(NULL);
      392 +        pause_cpus(NULL, NULL);
 393  393          for (id = 0; id < NCPU; id++) {
 394  394                  if ((cp = cpu_get(id)) == NULL)
 395  395                          continue;
 396  396                  if ((cp->cpu_flags & CPU_OFFLINE) == 0)
 397  397                          pg_cpu_inactive(cp);
 398  398                  pgps[id] = cp->cpu_pg;
 399  399                  pg_cpu_bootstrap(cp);
 400  400          }
 401  401          start_cpus();
 402  402  
↓ open down ↓ 20 lines elided ↑ open up ↑
 423  423                          continue;
 424  424                  mpo_cpu_add(mdp, id);
 425  425                  pgps[id] = pg_cpu_init(cp, B_TRUE);
 426  426          }
 427  427  
 428  428          /*
 429  429           * Now that PG data has been initialized for all CPUs in the
 430  430           * system, replace the bootstrapped PG structure with the
 431  431           * initialized PG structure and call pg_cpu_active for each CPU.
 432  432           */
 433      -        pause_cpus(NULL);
      433 +        pause_cpus(NULL, NULL);
 434  434          for (id = 0; id < NCPU; id++) {
 435  435                  if ((cp = cpu_get(id)) == NULL)
 436  436                          continue;
 437  437                  cp->cpu_pg = pgps[id];
 438  438                  if ((cp->cpu_flags & CPU_OFFLINE) == 0)
 439  439                          pg_cpu_active(cp);
 440  440          }
 441  441          start_cpus();
 442  442  
 443  443          mutex_exit(&cpu_lock);
↓ open down ↓ 164 lines elided ↑ open up ↑
 608  608  
 609  609          /* Suspend the watchdog */
 610  610          watchdog_suspend();
 611  611  
 612  612          /* Record the TOD */
 613  613          mutex_enter(&tod_lock);
 614  614          source_tod = tod_get();
 615  615          mutex_exit(&tod_lock);
 616  616  
 617  617          /* Pause all other CPUs */
 618      -        pause_cpus(NULL);
      618 +        pause_cpus(NULL, NULL);
 619  619          DBG_PROM("suspend: CPUs paused\n");
 620  620  
 621  621          /* Suspend cyclics */
 622  622          cyclic_suspend();
 623  623          DBG_PROM("suspend: cyclics suspended\n");
 624  624  
 625  625          /* Disable interrupts */
 626  626          spl = spl8();
 627  627          DBG_PROM("suspend: spl8()\n");
 628  628  
↓ open down ↓ 90 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX