📄 generalize-small.template
字号:
/* XSIZE_load */#if defined(AO_HAVE_XSIZE_load_acquire) && !defined(AO_HAVE_XSIZE_load)# define AO_XSIZE_load(addr) AO_XSIZE_load_acquire(addr)# define AO_HAVE_XSIZE_load#endif#if defined(AO_HAVE_XSIZE_load_full) && !defined(AO_HAVE_XSIZE_load_acquire)# define AO_XSIZE_load_acquire(addr) AO_XSIZE_load_full(addr)# define AO_HAVE_XSIZE_load_acquire#endif#if defined(AO_HAVE_XSIZE_load_full) && !defined(AO_HAVE_XSIZE_load_read)# define AO_XSIZE_load_read(addr) AO_XSIZE_load_full(addr)# define AO_HAVE_XSIZE_load_read#endif#if !defined(AO_HAVE_XSIZE_load_acquire_read) && defined(AO_HAVE_XSIZE_load_acquire)# define AO_XSIZE_load_acquire_read(addr) AO_XSIZE_load_acquire(addr)# define AO_HAVE_XSIZE_load_acquire_read#endif#if defined(AO_HAVE_XSIZE_load) && defined(AO_HAVE_nop_full) && \ !defined(AO_HAVE_XSIZE_load_acquire) AO_INLINE unsigned XCTYPE AO_XSIZE_load_acquire(volatile unsigned XCTYPE *addr) { unsigned XCTYPE result = AO_XSIZE_load(addr); /* Acquire barrier would be useless, since the load could be delayed */ /* beyond it. */ AO_nop_full(); return result; }# define AO_HAVE_XSIZE_load_acquire#endif#if defined(AO_HAVE_XSIZE_load) && defined(AO_HAVE_nop_read) && \ !defined(AO_HAVE_XSIZE_load_read) AO_INLINE unsigned XCTYPE AO_XSIZE_load_read(volatile unsigned XCTYPE *addr) { unsigned XCTYPE result = AO_XSIZE_load(addr); /* Acquire barrier would be useless, since the load could be delayed */ /* beyond it. */ AO_nop_read(); return result; }# define AO_HAVE_XSIZE_load_read#endif#if defined(AO_HAVE_XSIZE_load_acquire) && defined(AO_HAVE_nop_full) && \ !defined(AO_HAVE_XSIZE_load_full)# define AO_XSIZE_load_full(addr) (AO_nop_full(), AO_XSIZE_load_acquire(addr))# define AO_HAVE_XSIZE_load_full#endif #if !defined(AO_HAVE_XSIZE_load_acquire_read) && defined(AO_HAVE_XSIZE_load_read)# define AO_XSIZE_load_acquire_read(addr) AO_XSIZE_load_read(addr)# define AO_HAVE_XSIZE_load_acquire_read#endif#if defined(AO_HAVE_XSIZE_load_acquire_read) && !defined(AO_HAVE_XSIZE_load)# define AO_XSIZE_load(addr) AO_XSIZE_load_acquire_read(addr)# define AO_HAVE_XSIZE_load#endif#ifdef AO_NO_DD_ORDERING# if defined(AO_HAVE_XSIZE_load_acquire_read)# define AO_XSIZE_load_dd_acquire_read(addr) \ AO_XSIZE_load_acquire_read(addr)# define AO_HAVE_XSIZE_load_dd_acquire_read# endif#else# if defined(AO_HAVE_XSIZE_load)# define AO_XSIZE_load_dd_acquire_read(addr) \ AO_XSIZE_load(addr)# define AO_HAVE_XSIZE_load_dd_acquire_read# endif#endif/* XSIZE_store */#if defined(AO_HAVE_XSIZE_store_release) && !defined(AO_HAVE_XSIZE_store)# define AO_XSIZE_store(addr, val) AO_XSIZE_store_release(addr,val)# define AO_HAVE_XSIZE_store#endif#if defined(AO_HAVE_XSIZE_store_full) && !defined(AO_HAVE_XSIZE_store_release)# define AO_XSIZE_store_release(addr,val) AO_XSIZE_store_full(addr,val)# define AO_HAVE_XSIZE_store_release#endif#if defined(AO_HAVE_XSIZE_store_full) && !defined(AO_HAVE_XSIZE_store_write)# define AO_XSIZE_store_write(addr,val) AO_XSIZE_store_full(addr,val)# define AO_HAVE_XSIZE_store_write#endif#if defined(AO_HAVE_XSIZE_store_release) && \ !defined(AO_HAVE_XSIZE_store_release_write)# define AO_XSIZE_store_release_write(addr, val) \ AO_XSIZE_store_release(addr,val)# define AO_HAVE_XSIZE_store_release_write#endif#if defined(AO_HAVE_XSIZE_store_write) && !defined(AO_HAVE_XSIZE_store)# define AO_XSIZE_store(addr, val) AO_XSIZE_store_write(addr,val)# define AO_HAVE_XSIZE_store#endif#if defined(AO_HAVE_XSIZE_store) && defined(AO_HAVE_nop_full) && \ !defined(AO_HAVE_XSIZE_store_release)# define AO_XSIZE_store_release(addr,val) \ (AO_nop_full(), AO_XSIZE_store(addr,val))# define AO_HAVE_XSIZE_store_release#endif#if defined(AO_HAVE_nop_write) && defined(AO_HAVE_XSIZE_store) && \ !defined(AO_HAVE_XSIZE_store_write)# define AO_XSIZE_store_write(addr, val) \ (AO_nop_write(), AO_XSIZE_store(addr,val))# define AO_HAVE_XSIZE_store_write#endif#if defined(AO_HAVE_XSIZE_store_write) && \ !defined(AO_HAVE_XSIZE_store_release_write)# define AO_XSIZE_store_release_write(addr, val) AO_XSIZE_store_write(addr,val)# define AO_HAVE_XSIZE_store_release_write#endif#if defined(AO_HAVE_XSIZE_store_release) && defined(AO_HAVE_nop_full) && \ !defined(AO_HAVE_XSIZE_store_full)# define AO_XSIZE_store_full(addr, val) \ (AO_XSIZE_store_release(addr, val), AO_nop_full())# define AO_HAVE_XSIZE_store_full#endif/* XSIZE_fetch_and_add */#if defined(AO_HAVE_XSIZE_compare_and_swap_full) && \ !defined(AO_HAVE_XSIZE_fetch_and_add_full) AO_INLINE AO_t AO_XSIZE_fetch_and_add_full(volatile unsigned XCTYPE *addr, unsigned XCTYPE incr) { unsigned XCTYPE old; do { old = *addr; } while (!AO_XSIZE_compare_and_swap_full(addr, old, old+incr)); return old; }# define AO_HAVE_XSIZE_fetch_and_add_full#endif#if defined(AO_HAVE_XSIZE_compare_and_swap_acquire) && \ !defined(AO_HAVE_XSIZE_fetch_and_add_acquire) AO_INLINE AO_t AO_XSIZE_fetch_and_add_acquire(volatile unsigned XCTYPE *addr, unsigned XCTYPE incr) { unsigned XCTYPE old; do { old = *addr; } while (!AO_XSIZE_compare_and_swap_acquire(addr, old, old+incr)); return old; }# define AO_HAVE_XSIZE_fetch_and_add_acquire#endif#if defined(AO_HAVE_XSIZE_compare_and_swap_release) && \ !defined(AO_HAVE_XSIZE_fetch_and_add_release) AO_INLINE AO_t AO_XSIZE_fetch_and_add_release(volatile unsigned XCTYPE *addr, unsigned XCTYPE incr) { unsigned XCTYPE old; do { old = *addr; } while (!AO_XSIZE_compare_and_swap_release(addr, old, old+incr)); return old; }# define AO_HAVE_XSIZE_fetch_and_add_release#endif#if defined(AO_HAVE_XSIZE_fetch_and_add_full)# if !defined(AO_HAVE_XSIZE_fetch_and_add_release)# define AO_XSIZE_fetch_and_add_release(addr, val) \ AO_XSIZE_fetch_and_add_full(addr, val)# define AO_HAVE_XSIZE_fetch_and_add_release# endif# if !defined(AO_HAVE_XSIZE_fetch_and_add_acquire)# define AO_XSIZE_fetch_and_add_acquire(addr, val) \ AO_XSIZE_fetch_and_add_full(addr, val)# define AO_HAVE_XSIZE_fetch_and_add_acquire# endif# if !defined(AO_HAVE_XSIZE_fetch_and_add_write)# define AO_XSIZE_fetch_and_add_write(addr, val) \ AO_XSIZE_fetch_and_add_full(addr, val)# define AO_HAVE_XSIZE_fetch_and_add_write# endif# if !defined(AO_HAVE_XSIZE_fetch_and_add_read)# define AO_XSIZE_fetch_and_add_read(addr, val) \ AO_XSIZE_fetch_and_add_full(addr, val)# define AO_HAVE_XSIZE_fetch_and_add_read# endif#endif /* AO_HAVE_XSIZE_fetch_and_add_full */#if !defined(AO_HAVE_XSIZE_fetch_and_add) && \ defined(AO_HAVE_XSIZE_fetch_and_add_release)# define AO_XSIZE_fetch_and_add(addr, val) \ AO_XSIZE_fetch_and_add_release(addr, val)# define AO_HAVE_XSIZE_fetch_and_add#endif#if !defined(AO_HAVE_XSIZE_fetch_and_add) && \ defined(AO_HAVE_XSIZE_fetch_and_add_acquire)# define AO_XSIZE_fetch_and_add(addr, val) \ AO_XSIZE_fetch_and_add_acquire(addr, val)# define AO_HAVE_XSIZE_fetch_and_add#endif#if !defined(AO_HAVE_XSIZE_fetch_and_add) && \ defined(AO_HAVE_XSIZE_fetch_and_add_write)# define AO_XSIZE_fetch_and_add(addr, val) \ AO_XSIZE_fetch_and_add_write(addr, val)# define AO_HAVE_XSIZE_fetch_and_add#endif#if !defined(AO_HAVE_XSIZE_fetch_and_add) && \ defined(AO_HAVE_XSIZE_fetch_and_add_read)# define AO_XSIZE_fetch_and_add(addr, val) \ AO_XSIZE_fetch_and_add_read(addr, val)# define AO_HAVE_XSIZE_fetch_and_add#endif#if defined(AO_HAVE_XSIZE_fetch_and_add_acquire) &&\ defined(AO_HAVE_nop_full) && \ !defined(AO_HAVE_XSIZE_fetch_and_add_full)# define AO_XSIZE_fetch_and_add_full(addr, val) \ (AO_nop_full(), AO_XSIZE_fetch_and_add_acquire(addr, val))#endif#if !defined(AO_HAVE_XSIZE_fetch_and_add_release_write) && \ defined(AO_HAVE_XSIZE_fetch_and_add_write)# define AO_XSIZE_fetch_and_add_release_write(addr, val) \ AO_XSIZE_fetch_and_add_write(addr, val)# define AO_HAVE_XSIZE_fetch_and_add_release_write#endif#if !defined(AO_HAVE_XSIZE_fetch_and_add_release_write) && \ defined(AO_HAVE_XSIZE_fetch_and_add_release)# define AO_XSIZE_fetch_and_add_release_write(addr, val) \ AO_XSIZE_fetch_and_add_release(addr, val)# define AO_HAVE_XSIZE_fetch_and_add_release_write#endif#if !defined(AO_HAVE_XSIZE_fetch_and_add_acquire_read) && \ defined(AO_HAVE_XSIZE_fetch_and_add_read)# define AO_XSIZE_fetch_and_add_acquire_read(addr, val) \ AO_XSIZE_fetch_and_add_read(addr, val)# define AO_HAVE_XSIZE_fetch_and_add_acquire_read#endif#if !defined(AO_HAVE_XSIZE_fetch_and_add_acquire_read) && \ defined(AO_HAVE_XSIZE_fetch_and_add_acquire)# define AO_XSIZE_fetch_and_add_acquire_read(addr, val) \ AO_XSIZE_fetch_and_add_acquire(addr, val)# define AO_HAVE_XSIZE_fetch_and_add_acquire_read#endif#ifdef AO_NO_DD_ORDERING# if defined(AO_HAVE_XSIZE_fetch_and_add_acquire_read)# define AO_XSIZE_fetch_and_add_dd_acquire_read(addr, val) \ AO_XSIZE_fetch_and_add_acquire_read(addr, val)# define AO_HAVE_XSIZE_fetch_and_add_dd_acquire_read# endif#else# if defined(AO_HAVE_XSIZE_fetch_and_add)# define AO_XSIZE_fetch_and_add_dd_acquire_read(addr, val) \ AO_XSIZE_fetch_and_add(addr, val)# define AO_HAVE_XSIZE_fetch_and_add_dd_acquire_read# endif#endif /* XSIZE_fetch_and_add1 */#if defined(AO_HAVE_XSIZE_fetch_and_add_full) &&\ !defined(AO_HAVE_XSIZE_fetch_and_add1_full)# define AO_XSIZE_fetch_and_add1_full(addr) \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -