syscall: Introduce __syscall_always_inline

Sometimes we want to force the inlining of a __syscall. Introduce a new
__syscall_always_inline symbol to do that.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
This commit is contained in:
Carlo Caione 2023-04-20 17:04:55 +02:00 committed by Anas Nashif
commit de90dfccbc
5 changed files with 10 additions and 5 deletions

View file

@ -24,6 +24,7 @@ AttributeMacros:
- __packed - __packed
- __printf_like - __printf_like
- __syscall - __syscall
- __syscall_always_inline
- __subsystem - __subsystem
BitFieldColonSpacing: After BitFieldColonSpacing: After
BreakBeforeBraces: Linux BreakBeforeBraces: Linux

View file

@ -232,6 +232,7 @@ breathe_default_members = ("members", )
cpp_id_attributes = [ cpp_id_attributes = [
"__syscall", "__syscall",
"__syscall_always_inline",
"__deprecated", "__deprecated",
"__may_alias", "__may_alias",
"__used", "__used",

View file

@ -2397,6 +2397,7 @@ PREDEFINED = __DOXYGEN__ \
"__printf_like(x, y)=" \ "__printf_like(x, y)=" \
__attribute__(x)= \ __attribute__(x)= \
__syscall= \ __syscall= \
__syscall_always_inline= \
__must_check= \ __must_check= \
"ATOMIC_DEFINE(x, y)=atomic_t x[ATOMIC_BITMAP_SIZE(y)]" "ATOMIC_DEFINE(x, y)=atomic_t x[ATOMIC_BITMAP_SIZE(y)]"

View file

@ -143,8 +143,10 @@
*/ */
#ifndef ZTEST_UNITTEST #ifndef ZTEST_UNITTEST
#define __syscall static inline #define __syscall static inline
#define __syscall_always_inline static inline __attribute__((always_inline))
#else #else
#define __syscall #define __syscall
#define __syscall_always_inline
#endif /* ZTEST_UNITTEST */ #endif /* ZTEST_UNITTEST */
/* Definitions for struct declaration tags. These are sentinel values used by /* Definitions for struct declaration tags. These are sentinel values used by

View file

@ -33,11 +33,11 @@ import json
regex_flags = re.MULTILINE | re.VERBOSE regex_flags = re.MULTILINE | re.VERBOSE
syscall_regex = re.compile(r''' syscall_regex = re.compile(r'''
__syscall\s+ # __syscall attribute, must be first (?:__syscall|__syscall_always_inline)\s+ # __syscall attribute, must be first
([^(]+) # type and name of system call (split later) ([^(]+) # type and name of system call (split later)
[(] # Function opening parenthesis [(] # Function opening parenthesis
([^)]*) # Arg list (split later) ([^)]*) # Arg list (split later)
[)] # Closing parenthesis [)] # Closing parenthesis
''', regex_flags) ''', regex_flags)
struct_tags = ["__subsystem", "__net_socket"] struct_tags = ["__subsystem", "__net_socket"]