diff --git a/.clang-format b/.clang-format index e5f69355cbe..fdcd735fe28 100644 --- a/.clang-format +++ b/.clang-format @@ -24,6 +24,7 @@ AttributeMacros: - __packed - __printf_like - __syscall + - __syscall_always_inline - __subsystem BitFieldColonSpacing: After BreakBeforeBraces: Linux diff --git a/doc/conf.py b/doc/conf.py index aeccbd204b0..497373060aa 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -232,6 +232,7 @@ breathe_default_members = ("members", ) cpp_id_attributes = [ "__syscall", + "__syscall_always_inline", "__deprecated", "__may_alias", "__used", diff --git a/doc/zephyr.doxyfile.in b/doc/zephyr.doxyfile.in index 0a066ace08e..50fc3e75304 100644 --- a/doc/zephyr.doxyfile.in +++ b/doc/zephyr.doxyfile.in @@ -2397,6 +2397,7 @@ PREDEFINED = __DOXYGEN__ \ "__printf_like(x, y)=" \ __attribute__(x)= \ __syscall= \ + __syscall_always_inline= \ __must_check= \ "ATOMIC_DEFINE(x, y)=atomic_t x[ATOMIC_BITMAP_SIZE(y)]" diff --git a/include/zephyr/toolchain/common.h b/include/zephyr/toolchain/common.h index 9259dc438ad..4f8708c427c 100644 --- a/include/zephyr/toolchain/common.h +++ b/include/zephyr/toolchain/common.h @@ -143,8 +143,10 @@ */ #ifndef ZTEST_UNITTEST #define __syscall static inline +#define __syscall_always_inline static inline __attribute__((always_inline)) #else #define __syscall +#define __syscall_always_inline #endif /* ZTEST_UNITTEST */ /* Definitions for struct declaration tags. These are sentinel values used by diff --git a/scripts/build/parse_syscalls.py b/scripts/build/parse_syscalls.py index 4385f5a8a9a..3536d52a9c4 100644 --- a/scripts/build/parse_syscalls.py +++ b/scripts/build/parse_syscalls.py @@ -33,11 +33,11 @@ import json regex_flags = re.MULTILINE | re.VERBOSE syscall_regex = re.compile(r''' -__syscall\s+ # __syscall attribute, must be first -([^(]+) # type and name of system call (split later) -[(] # Function opening parenthesis -([^)]*) # Arg list (split later) -[)] # Closing parenthesis +(?:__syscall|__syscall_always_inline)\s+ # __syscall attribute, must be first +([^(]+) # type and name of system call (split later) +[(] # Function opening parenthesis +([^)]*) # Arg list (split later) +[)] # Closing parenthesis ''', regex_flags) struct_tags = ["__subsystem", "__net_socket"]