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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/sun4/os/intr.c
          +++ new/usr/src/uts/sun4/os/intr.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
       25 +/*
       26 + * Copyright (c) 2013, Joyent, Inc.  All rights reserved.
       27 + */
  25   28  
  26   29  #include <sys/sysmacros.h>
  27   30  #include <sys/stack.h>
  28   31  #include <sys/cpuvar.h>
  29   32  #include <sys/ivintr.h>
  30   33  #include <sys/intreg.h>
  31   34  #include <sys/membar.h>
  32   35  #include <sys/kmem.h>
  33   36  #include <sys/intr.h>
  34   37  #include <sys/sunddi.h>
↓ open down ↓ 1 lines elided ↑ open up ↑
  36   39  #include <sys/cmn_err.h>
  37   40  #include <sys/privregs.h>
  38   41  #include <sys/systm.h>
  39   42  #include <sys/archsystm.h>
  40   43  #include <sys/machsystm.h>
  41   44  #include <sys/x_call.h>
  42   45  #include <vm/seg_kp.h>
  43   46  #include <sys/debug.h>
  44   47  #include <sys/cyclic.h>
  45   48  #include <sys/kdi_impl.h>
  46      -#include <sys/ddi_timer.h>
       49 +#include <sys/ddi_periodic.h>
  47   50  
  48   51  #include <sys/cpu_sgnblk_defs.h>
  49   52  
  50   53  /* Global locks which protect the interrupt distribution lists */
  51   54  static kmutex_t intr_dist_lock;
  52   55  static kmutex_t intr_dist_cpu_lock;
  53   56  
  54   57  /* Head of the interrupt distribution lists */
  55   58  static struct intr_dist *intr_dist_head = NULL;
  56   59  static struct intr_dist *intr_dist_whead = NULL;
↓ open down ↓ 55 lines elided ↑ open up ↑
 112  115          extern uint_t softlevel1();
 113  116  
 114  117          init_ivintr();
 115  118          REGISTER_BBUS_INTR();
 116  119  
 117  120          /*
 118  121           * Register these software interrupts for ddi timer.
 119  122           * Software interrupts up to the level 10 are supported.
 120  123           */
 121  124          for (i = DDI_IPL_1; i <= DDI_IPL_10; i++) {
 122      -                siron_inum[i-1] = add_softintr(i, (softintrfunc)timer_softintr,
      125 +                siron_inum[i - 1] = add_softintr(i,
      126 +                    (softintrfunc)ddi_periodic_softintr,
 123  127                      (caddr_t)(uintptr_t)(i), SOFTINT_ST);
 124  128          }
 125  129  
 126  130          siron1_inum = add_softintr(PIL_1, softlevel1, 0, SOFTINT_ST);
 127  131          poke_cpu_inum = add_softintr(PIL_13, poke_cpu_intr, 0, SOFTINT_MT);
 128  132          siron_poke_cpu_inum = add_softintr(PIL_13,
 129  133              siron_poke_cpu_intr, 0, SOFTINT_MT);
 130  134          cp->cpu_m.poke_cpu_outstanding = B_FALSE;
 131  135  
 132  136          mutex_init(&intr_dist_lock, NULL, MUTEX_DEFAULT, NULL);
↓ open down ↓ 737 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX