aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2012-02-29 20:13:29 +0100
committerRickard Green <[email protected]>2012-02-29 20:13:29 +0100
commitf76bc89ede20e943a03f7ac41f48c00fe049e77e (patch)
tree34ca276dcf397f95fbdf3f420860a759966a8cf5 /erts
parentca390f6bb00d14998faa8081a488a6d4889f1aea (diff)
parent3750ac230e0af600417fff900b3d5ef242fb18c7 (diff)
downloadotp-f76bc89ede20e943a03f7ac41f48c00fe049e77e.tar.gz
otp-f76bc89ede20e943a03f7ac41f48c00fe049e77e.tar.bz2
otp-f76bc89ede20e943a03f7ac41f48c00fe049e77e.zip
Merge branch 'maint'
* maint: Fix implementation with ddrb barriers
Diffstat (limited to 'erts')
-rw-r--r--erts/lib_src/common/ethr_atomics.c24
-rwxr-xr-xerts/lib_src/utils/make_atomics_api20
2 files changed, 21 insertions, 23 deletions
diff --git a/erts/lib_src/common/ethr_atomics.c b/erts/lib_src/common/ethr_atomics.c
index e4213e1eef..d093873841 100644
--- a/erts/lib_src/common/ethr_atomics.c
+++ b/erts/lib_src/common/ethr_atomics.c
@@ -561,12 +561,12 @@ int ethr_dw_atomic_cmpxchg(ethr_dw_atomic_t *var, ethr_dw_sint_t *val, ethr_dw_s
}
#endif
-int ETHR_DW_ATOMIC_FUNC__(cmpxchg_ddrb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val, ethr_dw_sint_t *old_val)
+int ethr_dw_atomic_cmpxchg_ddrb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val, ethr_dw_sint_t *old_val)
{
#ifdef ETHR_ORDERED_READ_DEPEND
- return ETHR_DW_ATOMIC_FUNC__(cmpxchg)(var, val, old_val);
+ return ethr_dw_atomic_cmpxchg(var, val, old_val);
#else
- return ETHR_DW_ATOMIC_FUNC__(cmpxchg_rb)(var, val, old_val);
+ return ethr_dw_atomic_cmpxchg_rb(var, val, old_val);
#endif
}
@@ -784,12 +784,12 @@ void ethr_dw_atomic_set(ethr_dw_atomic_t *var, ethr_dw_sint_t *val)
}
#endif
-void ETHR_DW_ATOMIC_FUNC__(set_ddrb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val)
+void ethr_dw_atomic_set_ddrb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val)
{
#ifdef ETHR_ORDERED_READ_DEPEND
- ETHR_DW_ATOMIC_FUNC__(set)(var, val);
+ ethr_dw_atomic_set(var, val);
#else
- ETHR_DW_ATOMIC_FUNC__(set_rb)(var, val);
+ ethr_dw_atomic_set_rb(var, val);
#endif
}
@@ -947,12 +947,12 @@ void ethr_dw_atomic_read(ethr_dw_atomic_t *var, ethr_dw_sint_t *val)
}
#endif
-void ETHR_DW_ATOMIC_FUNC__(read_ddrb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val)
+void ethr_dw_atomic_read_ddrb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val)
{
#ifdef ETHR_ORDERED_READ_DEPEND
- ETHR_DW_ATOMIC_FUNC__(read)(var, val);
+ ethr_dw_atomic_read(var, val);
#else
- ETHR_DW_ATOMIC_FUNC__(read_rb)(var, val);
+ ethr_dw_atomic_read_rb(var, val);
#endif
}
@@ -1107,12 +1107,12 @@ void ethr_dw_atomic_init(ethr_dw_atomic_t *var, ethr_dw_sint_t *val)
}
#endif
-void ETHR_DW_ATOMIC_FUNC__(init_ddrb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val)
+void ethr_dw_atomic_init_ddrb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val)
{
#ifdef ETHR_ORDERED_READ_DEPEND
- ETHR_DW_ATOMIC_FUNC__(init)(var, val);
+ ethr_dw_atomic_init(var, val);
#else
- ETHR_DW_ATOMIC_FUNC__(init_rb)(var, val);
+ ethr_dw_atomic_init_rb(var, val);
#endif
}
diff --git a/erts/lib_src/utils/make_atomics_api b/erts/lib_src/utils/make_atomics_api
index d8b1a56100..75e88f8a7e 100755
--- a/erts/lib_src/utils/make_atomics_api
+++ b/erts/lib_src/utils/make_atomics_api
@@ -805,17 +805,17 @@ rtchk_fallback_call(Return, #atomic_context{dw = DW,
non_native_barrier(B) ->
lists:member(B, ?NON_NATIVE_BARRIERS).
-non_native_barrier_impl(AC, Type, Macro, Op, B) ->
+non_native_barrier_impl(AC, Type, Op, B) ->
["
-", func_header(AC, Type, Macro, Op, B), "
+", func_header(AC, Type, false, Op, B), "
{",
case B of
ddrb ->
["
#ifdef ETHR_ORDERED_READ_DEPEND
- ", func_call(AC, Type, Macro, Op, none, true), "
+ ", func_call(AC, Type, Op, none, true), "
#else
- ", func_call(AC, Type, Macro, Op, rb, true), "
+ ", func_call(AC, Type, Op, rb, true), "
#endif
"
]
@@ -824,12 +824,10 @@ non_native_barrier_impl(AC, Type, Macro, Op, B) ->
"
].
-func_call(#atomic_context{'ATMC' = ATMC} = AC, inline_implementation, _Macro, Op, B, RetStatement) ->
+func_call(#atomic_context{'ATMC' = ATMC} = AC, inline_implementation, Op, B, RetStatement) ->
func_call(AC, Op, ["ETHR_", ATMC, "_FUNC__(", opstr(Op), op_barrier_ext(B), ")"], RetStatement);
-func_call(#atomic_context{atomic = Atomic} = AC, implementation, false, Op, B, RetStatement) ->
- func_call(AC, Op, [Atomic, "_", opstr(Op), op_barrier_ext(B)], RetStatement);
-func_call(AC, implementation, Macro, Op, B, RetStatement) ->
- func_call(AC, Op, [Macro, "(", opstr(Op), op_barrier_ext(B), ")"], RetStatement).
+func_call(#atomic_context{atomic = Atomic} = AC, implementation, Op, B, RetStatement) ->
+ func_call(AC, Op, [Atomic, "_", opstr(Op), op_barrier_ext(B)], RetStatement).
func_call(#atomic_context{dw = DW, arg1 = Arg1, arg2 = Arg2, arg3 = Arg3} = AC, Op, Func, true) ->
op_call(Op, DW, case is_return_op(AC, Op) of
@@ -901,7 +899,7 @@ make_implementations(#atomic_context{dw = DW,
lists:map(fun (B) ->
case non_native_barrier(B) of
true ->
- non_native_barrier_impl(AC, inline_implementation, false, Op, B);
+ non_native_barrier_impl(AC, inline_implementation, Op, B);
false ->
TryBarriers = try_barrier_order(B),
["
@@ -1211,7 +1209,7 @@ int ethr_have_native_dw_atomic(void)
end,
case non_native_barrier(B) of
true ->
- non_native_barrier_impl(AC, implementation, Macro, Op, B);
+ non_native_barrier_impl(AC, implementation, Op, B);
false ->
["\n",
func_header(AC, implementation, Macro, Op, B),