123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- #ifndef ZEPHYR_INCLUDE_SYSCALL_H_
- #define ZEPHYR_INCLUDE_SYSCALL_H_
- #include <syscall_list.h>
- #include <arch/syscall.h>
- #include <stdbool.h>
- #ifndef _ASMLANGUAGE
- #include <zephyr/types.h>
- #include <linker/sections.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- typedef uintptr_t (*_k_syscall_handler_t)(uintptr_t arg1, uintptr_t arg2,
- uintptr_t arg3, uintptr_t arg4,
- uintptr_t arg5, uintptr_t arg6,
- void *ssf);
- static ALWAYS_INLINE bool z_syscall_trap(void)
- {
- bool ret = false;
- #ifdef CONFIG_USERSPACE
- #if defined(__ZEPHYR_SUPERVISOR__)
- ret = false;
- #elif defined(__ZEPHYR_USER__)
- ret = true;
- #else
- ret = arch_is_user_context();
- #endif
- #endif
- return ret;
- }
- __pinned_func
- static inline bool k_is_user_context(void)
- {
- #ifdef CONFIG_USERSPACE
- return arch_is_user_context();
- #else
- return false;
- #endif
- }
- #ifdef __cplusplus
- }
- #endif
- #endif
- #endif
|