Print this page
3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first argument is zero

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/debug.h
          +++ new/usr/src/uts/common/sys/debug.h
↓ 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 2010 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
       26 +/*
       27 + * Copyright (c) 2012 by Delphix. All rights reserved.
       28 + */
       29 +
  26   30  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  27   31  /*        All Rights Reserved   */
  28   32  
  29   33  #ifndef _SYS_DEBUG_H
  30   34  #define _SYS_DEBUG_H
  31   35  
  32   36  #include <sys/isa_defs.h>
  33   37  #include <sys/types.h>
  34   38  #include <sys/note.h>
  35   39  
↓ open down ↓ 71 lines elided ↑ open up ↑
 107  111          const TYPE __right = (TYPE)(RIGHT); \
 108  112          if (!(__left OP __right)) \
 109  113                  assfail3(#LEFT " " #OP " " #RIGHT, \
 110  114                          (uintmax_t)__left, #OP, (uintmax_t)__right, \
 111  115                          __FILE__, __LINE__); \
 112  116  _NOTE(CONSTCOND) } while (0)
 113  117  
 114  118  #define VERIFY3S(x, y, z)       VERIFY3_IMPL(x, y, z, int64_t)
 115  119  #define VERIFY3U(x, y, z)       VERIFY3_IMPL(x, y, z, uint64_t)
 116  120  #define VERIFY3P(x, y, z)       VERIFY3_IMPL(x, y, z, uintptr_t)
      121 +#define VERIFY0(x)              VERIFY3_IMPL(x, ==, 0, uintmax_t)
      122 +
 117  123  #if DEBUG
 118  124  #define ASSERT3S(x, y, z)       VERIFY3_IMPL(x, y, z, int64_t)
 119  125  #define ASSERT3U(x, y, z)       VERIFY3_IMPL(x, y, z, uint64_t)
 120  126  #define ASSERT3P(x, y, z)       VERIFY3_IMPL(x, y, z, uintptr_t)
      127 +#define ASSERT0(x)              VERIFY3_IMPL(x, ==, 0, uintmax_t)
 121  128  #else
 122  129  #define ASSERT3S(x, y, z)       ((void)0)
 123  130  #define ASSERT3U(x, y, z)       ((void)0)
 124  131  #define ASSERT3P(x, y, z)       ((void)0)
      132 +#define ASSERT0(x)              ((void)0)
 125  133  #endif
 126  134  
 127  135  #ifdef  _KERNEL
 128  136  
 129  137  extern void abort_sequence_enter(char *);
 130  138  extern void debug_enter(char *);
 131  139  
 132  140  #endif  /* _KERNEL */
 133  141  
 134  142  #if defined(DEBUG) && !defined(__sun)
↓ open down ↓ 12 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX