Skip to content

Commit 5fc96ff

Browse files
dcpleungnashif
authored andcommitted
sys: atomic_c: skip syscall tracing
This skips syscall tracing on atomic_c.h, as the compiler does not like "({ ... tracing code ... })" and complains: error: expected identifier or '(' before '{' token Even though there is already a '(' before '{'. Signed-off-by: Daniel Leung <[email protected]>
1 parent 7fedc81 commit 5fc96ff

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

include/zephyr/sys/atomic_c.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,26 @@ __syscall atomic_val_t atomic_nand(atomic_t *target, atomic_val_t value);
7272
#endif
7373

7474
#ifdef CONFIG_ATOMIC_OPERATIONS_C
75+
76+
#ifndef DISABLE_SYSCALL_TRACING
77+
/* Skip defining macros of atomic_*() for syscall tracing.
78+
* Compiler does not like "({ ... tracing code ... })" and complains
79+
*
80+
* error: expected identifier or '(' before '{' token
81+
*
82+
* ... even though there is a '(' before '{'.
83+
*/
84+
#define DISABLE_SYSCALL_TRACING
85+
#define _REMOVE_DISABLE_SYSCALL_TRACING
86+
#endif
87+
7588
#include <syscalls/atomic_c.h>
89+
90+
#ifdef _REMOVE_DISABLE_SYSCALL_TRACING
91+
#undef DISABLE_SYSCALL_TRACING
92+
#undef _REMOVE_DISABLE_SYSCALL_TRACING
93+
#endif
94+
7695
#endif
7796

7897
#endif /* ZEPHYR_INCLUDE_SYS_ATOMIC_C_H_ */

0 commit comments

Comments
 (0)