Print this page
5255 uts shouldn't open-code ISP2

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/sun4/io/px/px_debug.c
          +++ new/usr/src/uts/sun4/io/px/px_debug.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  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 2007 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
  26      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  27      -
  28   26  /*
  29   27   * PCI nexus driver general debug support
  30   28   */
       29 +#include <sys/sysmacros.h>
  31   30  #include <sys/async.h>
  32   31  #include <sys/sunddi.h>         /* dev_info_t */
  33   32  #include <sys/ddi_impldefs.h>
  34   33  #include <sys/disp.h>
  35   34  #include <sys/archsystm.h>      /* getpil() */
  36   35  #include "px_obj.h"
  37   36  
  38   37  /*LINTLIBRARY*/
  39   38  
  40   39  #ifdef  DEBUG
↓ open down ↓ 208 lines elided ↑ open up ↑
 249  248  #endif  /* DEBUG */
 250  249  
 251  250  void
 252  251  px_dbg_attach(dev_info_t *dip, ddi_softint_handle_t *dbg_hdl)
 253  252  {
 254  253  #ifdef  DEBUG
 255  254          if (px_dbg_reference++ == 0) {
 256  255                  int size = px_dbg_msg_size;
 257  256  
 258  257                  /* Check if px_dbg_msg_size is ^2 */
 259      -                size = (size & (size - 1)) ? ((size | ~size) + 1) : size;
      258 +                size = !ISP2(size) ? ((size | ~size) + 1) : size;
 260  259                  px_dbg_msg_size = size;
 261  260                  px_dbg_qmask = size - 1;
 262  261                  px_dbg_msgq = kmem_zalloc(sizeof (px_dbg_msg_t) * size,
 263  262                      KM_SLEEP);
 264  263  
 265  264                  mutex_init(&px_dbg_mutex, NULL, MUTEX_DRIVER, NULL);
 266  265          }
 267  266  
 268  267          if (ddi_intr_add_softint(dip, dbg_hdl,
 269  268                  DDI_INTR_SOFTPRI_MAX, px_dbg_drain, NULL) != DDI_SUCCESS) {
↓ open down ↓ 23 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX