Print this page
Reworking of L2ARC persistency to simplify design.

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/debug.h
          +++ new/usr/src/uts/common/sys/debug.h
↓ open down ↓ 17 lines elided ↑ open up ↑
  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   26  /*
  27   27   * Copyright (c) 2012 by Delphix. All rights reserved.
       28 + * Copyright 2013 Saso Kiselkov. All rights reserved.
  28   29   */
  29   30  
  30   31  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  31   32  /*        All Rights Reserved   */
  32   33  
  33   34  #ifndef _SYS_DEBUG_H
  34   35  #define _SYS_DEBUG_H
  35   36  
  36   37  #include <sys/isa_defs.h>
  37   38  #include <sys/types.h>
↓ open down ↓ 87 lines elided ↑ open up ↑
 125  126  #define ASSERT3U(x, y, z)       VERIFY3_IMPL(x, y, z, uint64_t)
 126  127  #define ASSERT3P(x, y, z)       VERIFY3_IMPL(x, y, z, uintptr_t)
 127  128  #define ASSERT0(x)              VERIFY3_IMPL(x, ==, 0, uintmax_t)
 128  129  #else
 129  130  #define ASSERT3S(x, y, z)       ((void)0)
 130  131  #define ASSERT3U(x, y, z)       ((void)0)
 131  132  #define ASSERT3P(x, y, z)       ((void)0)
 132  133  #define ASSERT0(x)              ((void)0)
 133  134  #endif
 134  135  
      136 +/*
      137 + * Compile-time assertion. The condition 'x' must be constant.
      138 + */
      139 +#define CTASSERT(x)             _CTASSERT(x, __LINE__)
      140 +#define _CTASSERT(x, y)         __CTASSERT(x, y)
      141 +#define __CTASSERT(x, y) \
      142 +        typedef char __compile_time_assertion__ ## y [(x) ? 1 : -1]
      143 +
 135  144  #ifdef  _KERNEL
 136  145  
 137  146  extern void abort_sequence_enter(char *);
 138  147  extern void debug_enter(char *);
 139  148  
 140  149  #endif  /* _KERNEL */
 141  150  
 142  151  #if defined(DEBUG) && !defined(__sun)
 143  152  /* CSTYLED */
 144  153  #define STATIC
 145  154  #else
 146  155  /* CSTYLED */
 147  156  #define STATIC static
 148  157  #endif
 149  158  
 150  159  #ifdef  __cplusplus
 151  160  }
 152  161  #endif
 153  162  
 154  163  #endif  /* _SYS_DEBUG_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX