/*
* --------------- DO NOT EDIT THIS FILE! ---------------
* This file was automatically generated by the
* $ERL_TOP/erts/lib_src/utils/make_atomics_api script.
* If you need to make changes, edit the script and
* regenerate this file.
* --------------- DO NOT EDIT THIS FILE! ---------------
*/
/*
* %CopyrightBegin%
*
* Copyright Ericsson AB 2011-2016. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* %CopyrightEnd%
*/
/*
* Description: The ethread atomics API
* Author: Rickard Green
*/
/*
* This file maps native atomic implementations to ethread
* API atomics. If no native atomic implementation
* is available, a less efficient fallback is used instead.
* The API consists of 32-bit size, word size (pointer size),
* and double word size atomics.
*
* The following atomic operations are implemented for
* 32-bit size, and word size atomics:
* - cmpxchg
* - xchg
* - set
* - init
* - add_read
* - read
* - inc_read
* - dec_read
* - add
* - inc
* - dec
* - read_band
* - read_bor
*
* The following atomic operations are implemented for
* double word size atomics:
* - cmpxchg
* - set
* - read
* - init
*
* Appart from a function implementing the atomic operation
* with unspecified memory barrier semantics, there are
* functions implementing each operation with the following
* implied memory barrier semantics:
* - mb - Full memory barrier. Orders both loads, and
* stores before, and after the atomic operation.
* No load or store is allowed to be reordered
* over the atomic operation.
* - relb - Release barrier. Orders both loads, and
* stores appearing *before* the atomic
* operation. These are not allowed to be
* reordered over the atomic operation.
* - acqb - Acquire barrier. Orders both loads, and stores
* appearing *after* the atomic operation. These
* are not allowed to be reordered over the
* atomic operation.
* - wb - Write barrier. Orders *only* stores. These are
* not allowed to be reordered over the barrier.
* Store in atomic operation is ordered *after*
* the barrier.
* - rb - Read barrier. Orders *only* loads. These are
* not allowed to be reordered over the barrier.
* Load in atomic operation is ordered *before*
* the barrier.
* - ddrb - Data dependency read barrier. Orders *only*
* loads according to data dependency across the
* barrier. Load in atomic operation is ordered
* before the barrier.
*
* We implement all of these operation/barrier
* combinations, regardless of whether they are useful
* or not (some of them are useless).
*
* Double word size atomic functions are on the followning
* form:
* ethr_dw_atomic_<OP>[_<BARRIER>]
*
* Word size atomic functions are on the followning
* form:
* ethr_atomic_<OP>[_<BARRIER>]
*
* 32-bit size atomic functions are on the followning
* form:
* ethr_atomic32_<OP>[_<BARRIER>]
*
* Apart from the operation/barrier functions
* described above also 'addr' functions are implemented
* which return the actual memory address used of the
* atomic variable. The 'addr' functions have no barrier
* versions.
*
* The native atomic implementation does not need to
* implement all operation/barrier combinations.
* Functions that have no native implementation will be
* constructed from existing native functionality. These
* functions will perform the wanted operation and will
* produce sufficient memory barriers, but may
* in some cases be less efficient than pure native
* versions.
*
* When we create ethread API operation/barrier functions by
* adding barriers before and after native operations it is
* assumed that:
* - A native read operation begins, and ends with a load.
* - A native set operation begins, and ends with a store.
* - An init operation begins with either a load, or a store,
* and ends with either a load, or a store.
* - All other operations begins with a load, and ends with
* either a load, or a store.
*
* This is the minimum functionality that a native
* implementation needs to provide:
*
* - Functions that need to be implemented:
*
* - ethr_native_[dw_|su_dw_]atomic[BITS]_addr
* - ethr_native_[dw_|su_dw_]atomic[BITS]_cmpxchg[_<BARRIER>]
* (at least one cmpxchg of optional barrier)
*
* - Macros that needs to be defined:
*
* A macro informing about the presence of the native
* implementation:
*
* - ETHR_HAVE_NATIVE_[DW_|SU_DW_]ATOMIC[BITS]
*
* A macro naming (a string constant) the implementation:
*
* - ETHR_NATIVE_[DW_]ATOMIC[BITS]_IMPL
*
* Each implemented native atomic function has to
* be accompanied by a defined macro on the following
* form informing about its presence:
*
* - ETHR_HAVE_ETHR_NATIVE_[DW_|SU_DW_]ATOMIC[BITS]_<OP>[_<BARRIER>]
*
* A (sparc-v9 style) membar macro:
*
* - ETHR_MEMBAR(B)
*
* Which takes a combination of the following macros
* or:ed (using |) together:
*
* - ETHR_LoadLoad
* - ETHR_LoadStore
* - ETHR_StoreLoad
* - ETHR_StoreStore
*
*/
#ifndef ETHR_ATOMICS_H__
#define ETHR_ATOMICS_H__
#undef ETHR_AMC_FALLBACK__
#undef ETHR_AMC_NO_ATMCS__
#undef ETHR_AMC_ATMC_T__
#undef ETHR_AMC_ATMC_FUNC__
/* -- 32-bit atomics -- */
#undef ETHR_NAINT32_T__
#undef ETHR_NATMC32_FUNC__
#undef ETHR_NATMC32_ADDR_FUNC__
#undef ETHR_NATMC32_BITS__
#if defined(ETHR_HAVE_NATIVE_ATOMIC32)
# define ETHR_NEED_NATMC32_ADDR
# define ETHR_NATMC32_ADDR_FUNC__ ethr_native_atomic32_addr
typedef ethr_native_atomic32_t ethr_atomic32_t;
# define ETHR_NAINT32_T__ ethr_sint32_t
# define ETHR_NATMC32_FUNC__(X) ethr_native_atomic32_ ## X
# define ETHR_NATMC32_BITS__ 32
#elif defined(ETHR_HAVE_NATIVE_ATOMIC64)
# define ETHR_NEED_NATMC64_ADDR
#ifdef ETHR_BIGENDIAN
# define ETHR_NATMC32_ADDR_FUNC__(VAR) \
(((ethr_sint32_t *) ethr_native_atomic64_addr((VAR))) + 1)
#else
# define ETHR_NATMC32_ADDR_FUNC__(VAR) \
((ethr_sint32_t *) ethr_native_atomic64_addr((VAR)))
#endif
typedef ethr_native_atomic64_t ethr_atomic32_t;
# define ETHR_NAINT32_T__ ethr_sint64_t
# define ETHR_NATMC32_FUNC__(X) ethr_native_atomic64_ ## X
# define ETHR_NATMC32_BITS__ 64
#else
/*
* No native atomics usable for 32-bits atomics :(
* Use fallback...
*/
typedef ethr_sint32_t ethr_atomic32_t;
#endif
#undef ETHR_ATMC32_INLINE__
#ifdef ETHR_NATMC32_BITS__
# ifdef ETHR_TRY_INLINE_FUNCS
# define ETHR_ATMC32_INLINE__
# endif
# define ETHR_HAVE_32BIT_NATIVE_ATOMIC_OPS
#endif
#if !defined(ETHR_ATMC32_INLINE__) || defined(ETHR_ATOMIC_IMPL__)
# define ETHR_NEED_ATMC32_PROTOTYPES__
#endif
#ifndef ETHR_INLINE_ATMC32_FUNC_NAME_
# define ETHR_INLINE_ATMC32_FUNC_NAME_(X) X
#endif
#undef ETHR_ATMC32_FUNC__
#define ETHR_ATMC32_FUNC__(X) ETHR_INLINE_ATMC32_FUNC_NAME_(ethr_atomic32_ ## X)
/* -- Word size atomics -- */
#undef ETHR_NEED_NATMC32_ADDR
#undef ETHR_NEED_NATMC64_ADDR
#undef ETHR_NAINT_T__
#undef ETHR_NATMC_FUNC__
#undef ETHR_NATMC_ADDR_FUNC__
#undef ETHR_NATMC_BITS__
#if ETHR_SIZEOF_PTR == 8 && defined(ETHR_HAVE_NATIVE_ATOMIC64)
# ifndef ETHR_NEED_NATMC64_ADDR
# define ETHR_NEED_NATMC64_ADDR
# endif
# define ETHR_NATMC_ADDR_FUNC__ ethr_native_atomic64_addr
typedef ethr_native_atomic64_t ethr_atomic_t;
# define ETHR_NAINT_T__ ethr_sint64_t
# define ETHR_NATMC_FUNC__(X) ethr_native_atomic64_ ## X
# define ETHR_NATM
没有合适的资源?快使用搜索试试~ 我知道了~
EMQ_mqtt服务器
共1593个文件
beam:1130个
hrl:74个
app:66个
需积分: 50 29 下载量 44 浏览量
2018-11-12
16:01:35
上传
评论
收藏 25.9MB ZIP 举报
温馨提示
EMQ是基于高并发的Erlang/OTP语言平台设计,支持百万级连接和分布式集群,发布订阅模式的开源MQTT消息服务器 完整支持MQTT V3.1/V3.1.1协议规范,扩展支持WebSocket、Stomp、CoAP、MQTT-SN或私有TCP协议
资源推荐
资源详情
资源评论
收起资源包目录
EMQ_mqtt服务器 (1593个子文件)
kernel.app 3KB
inets.app 3KB
stdlib.app 2KB
gen_rpc.app 2KB
observer.app 2KB
compiler.app 2KB
emqx.app 2KB
prometheus.app 2KB
ssl.app 2KB
sasl.app 1KB
os_mon.app 1KB
runtime_tools.app 1KB
epgsql.app 1KB
mnesia.app 1KB
luerl.app 1KB
crypto.app 974B
esockd.app 922B
cuttlefish.app 908B
ekka.app 903B
lwm2m_coap.app 878B
emqx_management.app 791B
xmerl.app 781B
cowboy.app 744B
gen_coap.app 674B
jwerl.app 642B
mongodb.app 604B
clique.app 604B
gproc.app 585B
emqx_sn.app 584B
recon.app 568B
emqx_lwm2m.app 556B
jsx.app 502B
ranch.app 497B
syntax_tools.app 484B
poolboy.app 478B
public_key.app 470B
cowlib.app 451B
emqx_coap.app 435B
emqx_auth_pgsql.app 414B
emqx_auth_redis.app 409B
emqx_auth_mysql.app 408B
emqx_auth_ldap.app 398B
emqx_dashboard.app 396B
eredis.app 394B
emqx_auth_mongo.app 390B
ecpool.app 386B
emqx_plugin_template.app 380B
emqx_stomp.app 379B
emqx_auth_http.app 356B
emqx_reloader.app 332B
emqx_delayed_publish.app 331B
emqx_lua_hook.app 327B
mysql.app 326B
emqx_retainer.app 322B
emqx_web_hook.app 319B
emqx_auth_username.app 316B
emqx_auth_clientid.app 316B
emqx_auth_jwt.app 310B
asn1.app 308B
bson.app 304B
emqx_statsd.app 283B
eldap.app 268B
pbkdf2.app 259B
emqx_recon.app 246B
emqx_passwd.app 228B
minirest.app 226B
sasl.appup 1KB
kernel.appup 1KB
stdlib.appup 1KB
inets.appup 895B
runtime_tools.appup 799B
syntax_tools.appup 795B
eldap.appup 791B
os_mon.appup 789B
public_key.appup 789B
observer.appup 788B
compiler.appup 787B
crypto.appup 787B
xmerl.appup 782B
asn1.appup 779B
mnesia.appup 645B
ssl.appup 617B
cdv.bat 86B
etop.bat 79B
unicode_util.beam 535KB
OTP-PUB-KEY.beam 504KB
cow_http_hd.beam 381KB
erl_parse.beam 341KB
asn1ct_check.beam 225KB
core_parse.beam 217KB
xmerl_xsd.beam 208KB
xmerl_scan.beam 199KB
erl_lint.beam 182KB
qlc.beam 150KB
mnesia_schema.beam 147KB
qlc_pt.beam 140KB
v3_codegen.beam 132KB
xmerl_sax_parser_utf8.beam 132KB
xmerl_sax_parser_utf16le.beam 132KB
xmerl_sax_parser_utf16be.beam 132KB
共 1593 条
- 1
- 2
- 3
- 4
- 5
- 6
- 16
资源评论
weixin_43671727
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功