lib.c: Add __sync_lock_test_and_set as a builtin function
PATCH 5/5 lib.c: Add __sync_lock_test_and_set as a builtin function
--- lib.c | 1 + 1 file changed, 1 insertion(+)
lib.c +1 -0
@@ -779,6 +779,7 @@ void declare_builtin_functions(void)add_pre_buffer ("extern double __builtin_fabs(double);\n" );add_pre_buffer ("extern void __sync_synchronize();\n" );add_pre_buffer ("extern int __sync_bool_compare_and_swap(void *, ...);\n" ); +add_pre_buffer ("extern int __sync_lock_test_and_set(volatile long *const, const long);\n" );/* Add Blackfin-specific stuff */ add_pre_buffer(
Signature · 1 line
1.8.2
Christopher Li
maintainerQuoted 1 line · Ramsay Jones
+
add_pre_buffer("extern int __sync_lock_test_and_set(volatile long *const, const long);\n");
Looking at the gcc documents about atomic builtins. quote:
"and further that they are overloaded such that they work on multiple types"
Sparse does not do type overload. Which means sparse can't properly support this function right now. If some one try to use this function on an int type, sparse will
complain about type mismatch.
Chris
Quoted 7 lines · Christopher Li
Quoted 1 line · Ramsay Jones
+
add_pre_buffer("extern int __sync_lock_test_and_set(volatile long *const, const long);\n");Looking at the gcc documents about atomic builtins. quote:
"and further that they are overloaded such that they work on multiple types"
Ah, yes, I obviously didn't investigate this carefully enough! :( OK, so we can forget about this patch.
Thanks!
ATB,
Ramsay Jones