Print this page
9936 atomic ops in syscall_mstate() induce significant overhead
9942 zone secflags are not initialized correctly

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/sysmacros.h
          +++ new/usr/src/uts/common/sys/sysmacros.h
↓ open down ↓ 365 lines elided ↑ open up ↑
 366  366  #define DECL_BITFIELD8(_a, _b, _c, _d, _e, _f, _g, _h)  \
 367  367          uint8_t _h, _g, _f, _e, _d, _c, _b, _a
 368  368  #else
 369  369  #error  One of _BIT_FIELDS_LTOH or _BIT_FIELDS_HTOL must be defined
 370  370  #endif  /* _BIT_FIELDS_LTOH */
 371  371  
 372  372  #if !defined(ARRAY_SIZE)
 373  373  #define ARRAY_SIZE(x)   (sizeof (x) / sizeof (x[0]))
 374  374  #endif
 375  375  
      376 +/*
      377 + * Add a value to a uint64_t that saturates at UINT64_MAX instead of wrapping
      378 + * around.
      379 + */
      380 +#define UINT64_OVERFLOW_ADD(val, add) \
      381 +        ((val) > ((val) + (add)) ? (UINT64_MAX) : ((val) + (add)))
      382 +
      383 +/*
      384 + * Convert to an int64, saturating at INT64_MAX.
      385 + */
      386 +#define UINT64_OVERFLOW_TO_INT64(uval) \
      387 +        (((uval) > INT64_MAX) ? INT64_MAX : (int64_t)(uval))
      388 +
 376  389  #ifdef  __cplusplus
 377  390  }
 378  391  #endif
 379  392  
 380  393  #endif  /* _SYS_SYSMACROS_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX