16#ifndef ZEPHYR_INCLUDE_ARCH_XTENSA_SYSCALL_H_
17#define ZEPHYR_INCLUDE_ARCH_XTENSA_SYSCALL_H_
19#ifdef CONFIG_USERSPACE
27#include <xtensa/config/core-isa.h>
33#ifdef CONFIG_XTENSA_SYSCALL_USE_HELPER
47#define SYSINL ALWAYS_INLINE
67#ifdef CONFIG_XTENSA_SYSCALL_USE_HELPER
68 return xtensa_syscall_helper_args_6(arg1, arg2, arg3, arg4, arg5, arg6, call_id);
70 register uintptr_t a2 __asm__(
"%a2") = call_id;
71 register uintptr_t a6 __asm__(
"%a6") = arg1;
72 register uintptr_t a3 __asm__(
"%a3") = arg2;
73 register uintptr_t a4 __asm__(
"%a4") = arg3;
74 register uintptr_t a5 __asm__(
"%a5") = arg4;
75 register uintptr_t a8 __asm__(
"%a8") = arg5;
76 register uintptr_t a9 __asm__(
"%a9") = arg6;
78 __asm__
volatile(
"syscall\n\t"
80 :
"r" (a2),
"r" (a6),
"r" (a3),
"r" (a4),
81 "r" (a5),
"r" (a8),
"r" (a9)
92#ifdef CONFIG_XTENSA_SYSCALL_USE_HELPER
93 return xtensa_syscall_helper_args_5(arg1, arg2, arg3, arg4, arg5, call_id);
95 register uintptr_t a2 __asm__(
"%a2") = call_id;
96 register uintptr_t a6 __asm__(
"%a6") = arg1;
97 register uintptr_t a3 __asm__(
"%a3") = arg2;
98 register uintptr_t a4 __asm__(
"%a4") = arg3;
99 register uintptr_t a5 __asm__(
"%a5") = arg4;
100 register uintptr_t a8 __asm__(
"%a8") = arg5;
102 __asm__
volatile(
"syscall\n\t"
104 :
"r" (a2),
"r" (a6),
"r" (a3),
"r" (a4),
116#ifdef CONFIG_XTENSA_SYSCALL_USE_HELPER
117 return xtensa_syscall_helper_args_4(arg1, arg2, arg3, arg4, call_id);
119 register uintptr_t a2 __asm__(
"%a2") = call_id;
120 register uintptr_t a6 __asm__(
"%a6") = arg1;
121 register uintptr_t a3 __asm__(
"%a3") = arg2;
122 register uintptr_t a4 __asm__(
"%a4") = arg3;
123 register uintptr_t a5 __asm__(
"%a5") = arg4;
125 __asm__
volatile(
"syscall\n\t"
127 :
"r" (a2),
"r" (a6),
"r" (a3),
"r" (a4),
138 register uintptr_t a2 __asm__(
"%a2") = call_id;
139 register uintptr_t a6 __asm__(
"%a6") = arg1;
140 register uintptr_t a3 __asm__(
"%a3") = arg2;
141 register uintptr_t a4 __asm__(
"%a4") = arg3;
143 __asm__
volatile(
"syscall\n\t"
145 :
"r" (a2),
"r" (a6),
"r" (a3),
"r" (a4)
154 register uintptr_t a2 __asm__(
"%a2") = call_id;
155 register uintptr_t a6 __asm__(
"%a6") = arg1;
156 register uintptr_t a3 __asm__(
"%a3") = arg2;
158 __asm__
volatile(
"syscall\n\t"
160 :
"r" (a2),
"r" (a6),
"r" (a3)
168 register uintptr_t a2 __asm__(
"%a2") = call_id;
169 register uintptr_t a6 __asm__(
"%a6") = arg1;
171 __asm__
volatile(
"syscall\n\t"
181 register uintptr_t a2 __asm__(
"%a2") = call_id;
183 __asm__
volatile(
"syscall\n\t"
198#if XCHAL_HAVE_THREADPTR
202 "rur.THREADPTR %0\n\t"
205#ifdef CONFIG_THREAD_LOCAL_STORAGE
206 extern Z_THREAD_LOCAL
uint32_t is_user_mode;
212 return is_user_mode != 0;
218 extern bool xtensa_is_user_context(
void);
220 return xtensa_is_user_context();
static uintptr_t arch_syscall_invoke4(uintptr_t arg1, uintptr_t arg2, uintptr_t arg3, uintptr_t arg4, uintptr_t call_id)
Definition syscall.h:89
static uintptr_t arch_syscall_invoke2(uintptr_t arg1, uintptr_t arg2, uintptr_t call_id)
Definition syscall.h:131
static uintptr_t arch_syscall_invoke1(uintptr_t arg1, uintptr_t call_id)
Definition syscall.h:149
static uintptr_t arch_syscall_invoke0(uintptr_t call_id)
Definition syscall.h:165
static bool arch_is_user_context(void)
Definition syscall.h:181
static uintptr_t arch_syscall_invoke5(uintptr_t arg1, uintptr_t arg2, uintptr_t arg3, uintptr_t arg4, uintptr_t arg5, uintptr_t call_id)
Definition syscall.h:65
static uintptr_t arch_syscall_invoke3(uintptr_t arg1, uintptr_t arg2, uintptr_t arg3, uintptr_t call_id)
Definition syscall.h:111
static uintptr_t arch_syscall_invoke6(uintptr_t arg1, uintptr_t arg2, uintptr_t arg3, uintptr_t arg4, uintptr_t arg5, uintptr_t arg6, uintptr_t call_id)
Definition syscall.h:40
#define SYSINL
Definition syscall.h:49
Definitions of various linker Sections.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINTPTR_TYPE__ uintptr_t
Definition stdint.h:105