Print this page
remove support for non-ANSI compilation

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/atomic.h
          +++ new/usr/src/uts/common/sys/atomic.h
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  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  /*
       23 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
       24 + *
  23   25   * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  24   26   * Use is subject to license terms.
  25   27   */
  26   28  
  27   29  #ifndef _SYS_ATOMIC_H
  28   30  #define _SYS_ATOMIC_H
  29   31  
  30      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  31      -
  32   32  #include <sys/types.h>
  33   33  #include <sys/inttypes.h>
  34   34  
  35   35  #ifdef  __cplusplus
  36   36  extern "C" {
  37   37  #endif
  38   38  
  39   39  #if defined(_KERNEL) && defined(__GNUC__) && defined(_ASM_INLINES) && \
  40   40          (defined(__i386) || defined(__amd64))
  41   41  #include <asm/atomic.h>
  42   42  #endif
  43   43  
  44      -#if defined(_KERNEL) || defined(__STDC__)
  45   44  /*
  46   45   * Increment target.
  47   46   */
  48   47  extern void atomic_inc_8(volatile uint8_t *);
  49   48  extern void atomic_inc_uchar(volatile uchar_t *);
  50   49  extern void atomic_inc_16(volatile uint16_t *);
  51   50  extern void atomic_inc_ushort(volatile ushort_t *);
  52   51  extern void atomic_inc_32(volatile uint32_t *);
  53   52  extern void atomic_inc_uint(volatile uint_t *);
  54   53  extern void atomic_inc_ulong(volatile ulong_t *);
  55   54  #if defined(_KERNEL) || defined(_INT64_TYPE)
  56   55  extern void atomic_inc_64(volatile uint64_t *);
  57      -#endif
  58   56  
  59   57  /*
  60   58   * Decrement target
  61   59   */
  62   60  extern void atomic_dec_8(volatile uint8_t *);
  63   61  extern void atomic_dec_uchar(volatile uchar_t *);
  64   62  extern void atomic_dec_16(volatile uint16_t *);
  65   63  extern void atomic_dec_ushort(volatile ushort_t *);
  66   64  extern void atomic_dec_32(volatile uint32_t *);
  67   65  extern void atomic_dec_uint(volatile uint_t *);
↓ open down ↓ 191 lines elided ↑ open up ↑
 259  257  /*
 260  258   * Arrange that all loads issued before this point in the code are
 261  259   * completed before any subsequent loads; useful in consumer modules
 262  260   * that check to see if data is available and read the data.
 263  261   * The memory barrier guarantees that the data is not sampled until
 264  262   * after the available flag has been seen, i.e. it imposes load ordering.
 265  263   */
 266  264  extern void membar_consumer(void);
 267  265  #endif
 268  266  
 269      -#if !defined(_KERNEL) && !defined(__STDC__)
 270      -extern void atomic_inc_8();
 271      -extern void atomic_inc_uchar();
 272      -extern void atomic_inc_16();
 273      -extern void atomic_inc_ushort();
 274      -extern void atomic_inc_32();
 275      -extern void atomic_inc_uint();
 276      -extern void atomic_inc_ulong();
 277      -#if defined(_INT64_TYPE)
 278      -extern void atomic_inc_64();
 279      -#endif /* defined(_INT64_TYPE) */
 280      -extern void atomic_dec_8();
 281      -extern void atomic_dec_uchar();
 282      -extern void atomic_dec_16();
 283      -extern void atomic_dec_ushort();
 284      -extern void atomic_dec_32();
 285      -extern void atomic_dec_uint();
 286      -extern void atomic_dec_ulong();
 287      -#if defined(_INT64_TYPE)
 288      -extern void atomic_dec_64();
 289      -#endif /* defined(_INT64_TYPE) */
 290      -extern void atomic_add_8();
 291      -extern void atomic_add_char();
 292      -extern void atomic_add_16();
 293      -extern void atomic_add_short();
 294      -extern void atomic_add_32();
 295      -extern void atomic_add_int();
 296      -extern void atomic_add_ptr();
 297      -extern void atomic_add_long();
 298      -#if defined(_INT64_TYPE)
 299      -extern void atomic_add_64();
 300      -#endif /* defined(_INT64_TYPE) */
 301      -extern void atomic_or_8();
 302      -extern void atomic_or_uchar();
 303      -extern void atomic_or_16();
 304      -extern void atomic_or_ushort();
 305      -extern void atomic_or_32();
 306      -extern void atomic_or_uint();
 307      -extern void atomic_or_ulong();
 308      -#if defined(_INT64_TYPE)
 309      -extern void atomic_or_64();
 310      -#endif /* defined(_INT64_TYPE) */
 311      -extern void atomic_and_8();
 312      -extern void atomic_and_uchar();
 313      -extern void atomic_and_16();
 314      -extern void atomic_and_ushort();
 315      -extern void atomic_and_32();
 316      -extern void atomic_and_uint();
 317      -extern void atomic_and_ulong();
 318      -#if defined(_INT64_TYPE)
 319      -extern void atomic_and_64();
 320      -#endif /* defined(_INT64_TYPE) */
 321      -extern uint8_t atomic_inc_8_nv();
 322      -extern uchar_t atomic_inc_uchar_nv();
 323      -extern uint16_t atomic_inc_16_nv();
 324      -extern ushort_t atomic_inc_ushort_nv();
 325      -extern uint32_t atomic_inc_32_nv();
 326      -extern uint_t atomic_inc_uint_nv();
 327      -extern ulong_t atomic_inc_ulong_nv();
 328      -#if defined(_INT64_TYPE)
 329      -extern uint64_t atomic_inc_64_nv();
 330      -#endif /* defined(_INT64_TYPE) */
 331      -extern uint8_t atomic_dec_8_nv();
 332      -extern uchar_t atomic_dec_uchar_nv();
 333      -extern uint16_t atomic_dec_16_nv();
 334      -extern ushort_t atomic_dec_ushort_nv();
 335      -extern uint32_t atomic_dec_32_nv();
 336      -extern uint_t atomic_dec_uint_nv();
 337      -extern ulong_t atomic_dec_ulong_nv();
 338      -#if defined(_INT64_TYPE)
 339      -extern uint64_t atomic_dec_64_nv();
 340      -#endif /* defined(_INT64_TYPE) */
 341      -extern uint8_t atomic_add_8_nv();
 342      -extern uchar_t atomic_add_char_nv();
 343      -extern uint16_t atomic_add_16_nv();
 344      -extern ushort_t atomic_add_short_nv();
 345      -extern uint32_t atomic_add_32_nv();
 346      -extern uint_t atomic_add_int_nv();
 347      -extern void *atomic_add_ptr_nv();
 348      -extern ulong_t atomic_add_long_nv();
 349      -#if defined(_INT64_TYPE)
 350      -extern uint64_t atomic_add_64_nv();
 351      -#endif /* defined(_INT64_TYPE) */
 352      -extern uint8_t atomic_or_8_nv();
 353      -extern uchar_t atomic_or_uchar_nv();
 354      -extern uint16_t atomic_or_16_nv();
 355      -extern ushort_t atomic_or_ushort_nv();
 356      -extern uint32_t atomic_or_32_nv();
 357      -extern uint_t atomic_or_uint_nv();
 358      -extern ulong_t atomic_or_ulong_nv();
 359      -#if defined(_INT64_TYPE)
 360      -extern uint64_t atomic_or_64_nv();
 361      -#endif /* defined(_INT64_TYPE) */
 362      -extern uint8_t atomic_and_8_nv();
 363      -extern uchar_t atomic_and_uchar_nv();
 364      -extern uint16_t atomic_and_16_nv();
 365      -extern ushort_t atomic_and_ushort_nv();
 366      -extern uint32_t atomic_and_32_nv();
 367      -extern uint_t atomic_and_uint_nv();
 368      -extern ulong_t atomic_and_ulong_nv();
 369      -#if defined(_INT64_TYPE)
 370      -extern uint64_t atomic_and_64_nv();
 371      -#endif /* defined(_INT64_TYPE) */
 372      -extern uint8_t atomic_cas_8();
 373      -extern uchar_t atomic_cas_uchar();
 374      -extern uint16_t atomic_cas_16();
 375      -extern ushort_t atomic_cas_ushort();
 376      -extern uint32_t atomic_cas_32();
 377      -extern uint_t atomic_cas_uint();
 378      -extern void *atomic_cas_ptr();
 379      -extern ulong_t atomic_cas_ulong();
 380      -#if defined(_INT64_TYPE)
 381      -extern uint64_t atomic_cas_64();
 382      -#endif /* defined(_INT64_TYPE) */
 383      -extern uint8_t atomic_swap_8();
 384      -extern uchar_t atomic_swap_uchar();
 385      -extern uint16_t atomic_swap_16();
 386      -extern ushort_t atomic_swap_ushort();
 387      -extern uint32_t atomic_swap_32();
 388      -extern uint_t atomic_swap_uint();
 389      -extern void *atomic_swap_ptr();
 390      -extern ulong_t atomic_swap_ulong();
 391      -#if defined(_INT64_TYPE)
 392      -extern uint64_t atomic_swap_64();
 393      -#endif /* defined(_INT64_TYPE) */
 394      -
 395      -
 396      -extern int atomic_set_long_excl();
 397      -extern int atomic_clear_long_excl();
 398      -
 399      -extern void membar_enter();
 400      -extern void membar_exit();
 401      -extern void membar_producer();
 402      -extern void membar_consumer();
 403      -
 404      -#endif
 405      -
 406  267  #if defined(_KERNEL)
 407  268  
 408  269  #if defined(_LP64) || defined(_ILP32)
 409  270  #define atomic_add_ip           atomic_add_long
 410  271  #define atomic_add_ip_nv        atomic_add_long_nv
 411  272  #define casip                   atomic_cas_ulong
 412  273  #endif
 413  274  
 414  275  #if defined(__sparc)
 415  276  extern uint8_t ldstub(uint8_t *);
↓ open down ↓ 23 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX