Print this page
5285 pass in cpu_pause_func via pause_cpus


 391         return (s);
 392 }
 393 
 394 void
 395 console_exit(int busy, int spl)
 396 {
 397         if (busy && panicstr == NULL) {
 398                 resume_other_cpus();
 399                 splx(spl);
 400                 kern_postprom();
 401         }
 402 }
 403 
 404 /*
 405  * This routine is a special form of pause_cpus().  It ensures that
 406  * prom functions are callable while the cpus are paused.
 407  */
 408 void
 409 promsafe_pause_cpus(void)
 410 {
 411         pause_cpus(NULL);
 412 
 413         /* If some other cpu is entering or is in the prom, spin */
 414         while (prom_cpu || mutex_owner(&prom_mutex)) {
 415 
 416                 start_cpus();
 417                 mutex_enter(&prom_mutex);
 418 
 419                 /* Wait for other cpu to exit prom */
 420                 while (prom_cpu)
 421                         cv_wait(&prom_cv, &prom_mutex);
 422 
 423                 mutex_exit(&prom_mutex);
 424                 pause_cpus(NULL);
 425         }
 426 
 427         /* At this point all cpus are paused and none are in the prom */
 428 }
 429 
 430 /*
 431  * This routine is a special form of xc_attention().  It ensures that
 432  * prom functions are callable while the cpus are at attention.
 433  */
 434 void
 435 promsafe_xc_attention(cpuset_t cpuset)
 436 {
 437         xc_attention(cpuset);
 438 
 439         /* If some other cpu is entering or is in the prom, spin */
 440         while (prom_cpu || mutex_owner(&prom_mutex)) {
 441 
 442                 xc_dismissed(cpuset);
 443                 mutex_enter(&prom_mutex);
 444 




 391         return (s);
 392 }
 393 
 394 void
 395 console_exit(int busy, int spl)
 396 {
 397         if (busy && panicstr == NULL) {
 398                 resume_other_cpus();
 399                 splx(spl);
 400                 kern_postprom();
 401         }
 402 }
 403 
 404 /*
 405  * This routine is a special form of pause_cpus().  It ensures that
 406  * prom functions are callable while the cpus are paused.
 407  */
 408 void
 409 promsafe_pause_cpus(void)
 410 {
 411         pause_cpus(NULL, NULL);
 412 
 413         /* If some other cpu is entering or is in the prom, spin */
 414         while (prom_cpu || mutex_owner(&prom_mutex)) {
 415 
 416                 start_cpus();
 417                 mutex_enter(&prom_mutex);
 418 
 419                 /* Wait for other cpu to exit prom */
 420                 while (prom_cpu)
 421                         cv_wait(&prom_cv, &prom_mutex);
 422 
 423                 mutex_exit(&prom_mutex);
 424                 pause_cpus(NULL, NULL);
 425         }
 426 
 427         /* At this point all cpus are paused and none are in the prom */
 428 }
 429 
 430 /*
 431  * This routine is a special form of xc_attention().  It ensures that
 432  * prom functions are callable while the cpus are at attention.
 433  */
 434 void
 435 promsafe_xc_attention(cpuset_t cpuset)
 436 {
 437         xc_attention(cpuset);
 438 
 439         /* If some other cpu is entering or is in the prom, spin */
 440         while (prom_cpu || mutex_owner(&prom_mutex)) {
 441 
 442                 xc_dismissed(cpuset);
 443                 mutex_enter(&prom_mutex);
 444