Print this page
XXXX pass in cpu_pause_func via pause_cpus


 855         srh->sr_suspend_state = DR_SRSTATE_DRIVER;
 856         srh->sr_err_idx = 0;
 857         /* No parent to hold busy */
 858         if ((rc = dr_suspend_devices(ddi_root_node(), srh)) != DDI_SUCCESS) {
 859                 if (srh->sr_err_idx && srh->sr_dr_handlep) {
 860                         (srh->sr_dr_handlep)->h_err = drerr_int(ESBD_SUSPEND,
 861                             srh->sr_err_ints, srh->sr_err_idx, 1);
 862                 }
 863                 dr_resume(srh);
 864                 return (rc);
 865         }
 866 
 867         drmach_suspend_last();
 868 
 869         /*
 870          * finally, grab all cpus
 871          */
 872         srh->sr_suspend_state = DR_SRSTATE_FULL;
 873 
 874         mutex_enter(&cpu_lock);
 875         pause_cpus(NULL);
 876         dr_stop_intr();
 877 
 878         return (rc);
 879 }
 880 
 881 int
 882 dr_pt_test_suspend(dr_handle_t *hp)
 883 {
 884         dr_sr_handle_t *srh;
 885         int             err;
 886         uint_t          psmerr;
 887         static fn_t     f = "dr_pt_test_suspend";
 888 
 889         PR_QR("%s...\n", f);
 890 
 891         srh = dr_get_sr_handle(hp);
 892         if ((err = dr_suspend(srh)) == DDI_SUCCESS) {
 893                 dr_resume(srh);
 894                 if ((hp->h_err) && ((psmerr = hp->h_err->e_code) != 0)) {
 895                         PR_QR("%s: error on dr_resume()", f);




 855         srh->sr_suspend_state = DR_SRSTATE_DRIVER;
 856         srh->sr_err_idx = 0;
 857         /* No parent to hold busy */
 858         if ((rc = dr_suspend_devices(ddi_root_node(), srh)) != DDI_SUCCESS) {
 859                 if (srh->sr_err_idx && srh->sr_dr_handlep) {
 860                         (srh->sr_dr_handlep)->h_err = drerr_int(ESBD_SUSPEND,
 861                             srh->sr_err_ints, srh->sr_err_idx, 1);
 862                 }
 863                 dr_resume(srh);
 864                 return (rc);
 865         }
 866 
 867         drmach_suspend_last();
 868 
 869         /*
 870          * finally, grab all cpus
 871          */
 872         srh->sr_suspend_state = DR_SRSTATE_FULL;
 873 
 874         mutex_enter(&cpu_lock);
 875         pause_cpus(NULL, NULL);
 876         dr_stop_intr();
 877 
 878         return (rc);
 879 }
 880 
 881 int
 882 dr_pt_test_suspend(dr_handle_t *hp)
 883 {
 884         dr_sr_handle_t *srh;
 885         int             err;
 886         uint_t          psmerr;
 887         static fn_t     f = "dr_pt_test_suspend";
 888 
 889         PR_QR("%s...\n", f);
 890 
 891         srh = dr_get_sr_handle(hp);
 892         if ((err = dr_suspend(srh)) == DDI_SUCCESS) {
 893                 dr_resume(srh);
 894                 if ((hp->h_err) && ((psmerr = hp->h_err->e_code) != 0)) {
 895                         PR_QR("%s: error on dr_resume()", f);