Print this page
XXXX introduce drv_sectohz

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/sun4u/excalibur/io/xcalwd.c
          +++ new/usr/src/uts/sun4u/excalibur/io/xcalwd.c
↓ open down ↓ 448 lines elided ↑ open up ↑
 449  449                          return (EFAULT);
 450  450  
 451  451                  mutex_enter(&tsp->lock);
 452  452                  if (tsp->started == B_TRUE) {
 453  453                          mutex_exit(&tsp->lock);
 454  454                          return (EINVAL);
 455  455                  }
 456  456                  tsp->intvl = intvl;
 457  457                  tsp->tid = realtime_timeout(xcalwd_timeout,
 458  458                      (void *)(uintptr_t)instance,
 459      -                    drv_usectohz(1000000) * tsp->intvl);
      459 +                    drv_sectohz(tsp->intvl));
 460  460                  tsp->started = B_TRUE;
 461  461                  mutex_exit(&tsp->lock);
 462  462                  return (0);
 463  463          case XCALWD_KEEPALIVE:
 464  464                  tid = 0;
 465  465                  mutex_enter(&tsp->lock);
 466  466                  tid = tsp->tid;
 467  467                  tsp->tid = 0;
 468  468                  mutex_exit(&tsp->lock);
 469  469                  if (tid != 0)
 470  470                          (void) untimeout(tid);  /* cancel */
 471  471  
 472  472                  mutex_enter(&tsp->lock);
 473  473                  if (tsp->started == B_TRUE)     /* reinstate */
 474  474                          tsp->tid = realtime_timeout(xcalwd_timeout,
 475  475                              (void *)(uintptr_t)instance,
 476      -                            drv_usectohz(1000000) * tsp->intvl);
      476 +                            drv_sectohz(tsp->intvl));
 477  477                  mutex_exit(&tsp->lock);
 478  478                  return (0);
 479  479          case XCALWD_GETSTATE:
 480  480                  mutex_enter(&tsp->lock);
 481  481                  curstate = tsp->started;
 482  482                  mutex_exit(&tsp->lock);
 483  483                  if (ddi_copyout((const void *)&curstate, (void *)arg,
 484  484                      sizeof (curstate), flag))
 485  485                          return (EFAULT);
 486  486                  return (0);
 487  487          default:
 488  488                  return (EINVAL);
 489  489          }
 490  490          /*NOTREACHED*/
 491  491  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX