Print this page
6639 uhci_qh walker contains whacky boolean logic

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/mdb/common/modules/uhci/uhci.c
          +++ new/usr/src/cmd/mdb/common/modules/uhci/uhci.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * fields enclosed by brackets "[]" replaced with your own identifying
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*
  23   23   * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  28      -
  29   27  #include <gelf.h>
  30   28  
  31   29  #include <sys/mdb_modapi.h>
  32   30  #include <mdb/mdb_ks.h>
  33   31  
  34   32  #include <sys/usb/usba.h>
  35   33  #include <sys/usb/usba/usba_types.h>
  36   34  
  37   35  #include <sys/usb/hcd/uhci/uhci.h>
  38   36  #include <sys/usb/hcd/uhci/uhcid.h>
↓ open down ↓ 439 lines elided ↑ open up ↑
 478  476   * link_ptr is NULL.
 479  477   */
 480  478  int
 481  479  uhci_td_walk_step(mdb_walk_state_t *wsp)
 482  480  {
 483  481          int status;
 484  482          uhci_state_t    *uhcip = (uhci_state_t *)wsp->walk_arg;
 485  483  
 486  484  
 487  485          if (mdb_vread(wsp->walk_data, sizeof (uhci_td_t), wsp->walk_addr)
 488      -                == -1) {
      486 +            == -1) {
 489  487                  mdb_warn("failed to read td at %p", wsp->walk_addr);
 490  488                  return (WALK_DONE);
 491  489          }
 492  490  
 493  491          status = wsp->walk_callback(wsp->walk_addr, wsp->walk_data,
 494  492              wsp->walk_cbdata);
 495  493  
 496  494          /* Next td. */
 497  495          wsp->walk_addr = ((uhci_td_t *)wsp->walk_data)->link_ptr;
 498  496  
↓ open down ↓ 78 lines elided ↑ open up ↑
 577  575          /* Next QH. */
 578  576          wsp->walk_addr = ((queue_head_t *)wsp->walk_data)->link_ptr;
 579  577  
 580  578  
 581  579          /* Check if we're at the last element */
 582  580          if (wsp->walk_addr == NULL || wsp->walk_addr & HC_END_OF_LIST)  {
 583  581                  return (WALK_DONE);
 584  582          }
 585  583  
 586  584          /* Make sure next element is a QH.  If a TD, stop.  */
 587      -        if (!  ((((queue_head_t *)wsp->walk_data)->link_ptr) & HC_QUEUE_HEAD)
 588      -            == HC_QUEUE_HEAD)  {
      585 +        if (((((queue_head_t *)wsp->walk_data)->link_ptr) & HC_QUEUE_HEAD)
      586 +            != HC_QUEUE_HEAD)  {
 589  587                  return (WALK_DONE);
 590  588          }
 591  589  
 592  590          /* Strip terminate etc. bits.  */
 593  591          wsp->walk_addr &= QH_LINK_PTR_MASK;
 594  592  
 595  593          if (wsp->walk_addr == NULL)
 596  594                  return (WALK_DONE);
 597  595  
 598  596          /*
↓ open down ↓ 42 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX