Print this page
OS-2366 ddi_periodic_add(9F) is entirely rubbish (MORE)
OS-2366 ddi_periodic_add(9F) is entirely rubbish

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/main.c
          +++ new/usr/src/uts/common/os/main.c
↓ open down ↓ 18 lines elided ↑ open up ↑
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   */
  25   25  
  26   26  /*      Copyright (c) 1988 AT&T */
  27   27  /*        All Rights Reserved   */
  28   28  
       29 +/*
       30 + * Copyright (c) 2013, Joyent, Inc. All rights reserved.
       31 + */
       32 +
  29   33  #include <sys/types.h>
  30   34  #include <sys/param.h>
  31   35  #include <sys/sysmacros.h>
  32   36  #include <sys/pcb.h>
  33   37  #include <sys/systm.h>
  34   38  #include <sys/signal.h>
  35   39  #include <sys/cred.h>
  36   40  #include <sys/user.h>
  37   41  #include <sys/vfs.h>
  38   42  #include <sys/vnode.h>
↓ open down ↓ 7 lines elided ↑ open up ↑
  46   50  #include <sys/callb.h>
  47   51  #include <sys/debug.h>
  48   52  #include <sys/conf.h>
  49   53  #include <sys/bootconf.h>
  50   54  #include <sys/utsname.h>
  51   55  #include <sys/cmn_err.h>
  52   56  #include <sys/vmparam.h>
  53   57  #include <sys/modctl.h>
  54   58  #include <sys/vm.h>
  55   59  #include <sys/callb.h>
  56      -#include <sys/ddi_timer.h>
       60 +#include <sys/ddi_periodic.h>
  57   61  #include <sys/kmem.h>
  58   62  #include <sys/vmem.h>
  59   63  #include <sys/cpuvar.h>
  60   64  #include <sys/cladm.h>
  61   65  #include <sys/corectl.h>
  62   66  #include <sys/exec.h>
  63   67  #include <sys/syscall.h>
  64   68  #include <sys/reboot.h>
  65   69  #include <sys/task.h>
  66   70  #include <sys/exacct.h>
↓ open down ↓ 341 lines elided ↑ open up ↑
 408  412  
 409  413          /*
 410  414           * Once 'startup()' completes, the thread_reaper() daemon would be
 411  415           * created(in thread_init()). After that, it is safe to create threads
 412  416           * that could exit. These exited threads will get reaped.
 413  417           */
 414  418          startup();
 415  419          segkmem_gc();
 416  420          callb_init();
 417  421          cbe_init_pre(); /* x86 must initialize gethrtimef before timer_init */
 418      -        timer_init();   /* timer must be initialized before cyclic starts */
      422 +        ddi_periodic_init();
 419  423          cbe_init();
 420  424          callout_init(); /* callout table MUST be init'd after cyclics */
 421  425          clock_tick_init_pre();
 422  426          clock_init();
 423  427  
 424  428  #if defined(__x86)
 425  429          /*
 426  430           * The progressbar thread uses cv_reltimedwait() and hence needs to be
 427  431           * started after the callout mechanism has been initialized.
 428  432           */
↓ open down ↓ 222 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX