Print this page
XXXX pass in cpu_pause_func via pause_cpus


 569         return (ENOTSUP);
 570 }
 571 
 572 /*ARGSUSED*/
 573 int
 574 mp_cpu_poweroff(struct cpu *cp)
 575 {
 576         return (ENOTSUP);
 577 }
 578 
 579 void
 580 mp_enter_barrier(void)
 581 {
 582         hrtime_t last_poke_time = 0;
 583         int poke_allowed = 0;
 584         int done = 0;
 585         int i;
 586 
 587         ASSERT(MUTEX_HELD(&cpu_lock));
 588 
 589         pause_cpus(NULL);
 590 
 591         while (!done) {
 592                 done = 1;
 593                 poke_allowed = 0;
 594 
 595                 if (xpv_gethrtime() - last_poke_time > POKE_TIMEOUT) {
 596                         last_poke_time = xpv_gethrtime();
 597                         poke_allowed = 1;
 598                 }
 599 
 600                 for (i = 0; i < NCPU; i++) {
 601                         cpu_t *cp = cpu_get(i);
 602 
 603                         if (cp == NULL || cp == CPU)
 604                                 continue;
 605 
 606                         switch (cpu_phase[i]) {
 607                         case CPU_PHASE_NONE:
 608                                 cpu_phase[i] = CPU_PHASE_WAIT_SAFE;
 609                                 poke_cpu(i);




 569         return (ENOTSUP);
 570 }
 571 
 572 /*ARGSUSED*/
 573 int
 574 mp_cpu_poweroff(struct cpu *cp)
 575 {
 576         return (ENOTSUP);
 577 }
 578 
 579 void
 580 mp_enter_barrier(void)
 581 {
 582         hrtime_t last_poke_time = 0;
 583         int poke_allowed = 0;
 584         int done = 0;
 585         int i;
 586 
 587         ASSERT(MUTEX_HELD(&cpu_lock));
 588 
 589         pause_cpus(NULL, NULL);
 590 
 591         while (!done) {
 592                 done = 1;
 593                 poke_allowed = 0;
 594 
 595                 if (xpv_gethrtime() - last_poke_time > POKE_TIMEOUT) {
 596                         last_poke_time = xpv_gethrtime();
 597                         poke_allowed = 1;
 598                 }
 599 
 600                 for (i = 0; i < NCPU; i++) {
 601                         cpu_t *cp = cpu_get(i);
 602 
 603                         if (cp == NULL || cp == CPU)
 604                                 continue;
 605 
 606                         switch (cpu_phase[i]) {
 607                         case CPU_PHASE_NONE:
 608                                 cpu_phase[i] = CPU_PHASE_WAIT_SAFE;
 609                                 poke_cpu(i);