Print this page
XXXX pass in cpu_pause_func via pause_cpus


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




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