16#ifndef ZEPHYR_INCLUDE_ARCH_XTENSA_SYSCALL_H_
17#define ZEPHYR_INCLUDE_ARCH_XTENSA_SYSCALL_H_
19#ifdef CONFIG_USERSPACE
31#ifdef CONFIG_XTENSA_SYSCALL_USE_HELPER
37#define SYSINL ALWAYS_INLINE
56#ifdef CONFIG_XTENSA_SYSCALL_USE_HELPER
57 return xtensa_syscall_helper(arg1, arg2, arg3, arg4, arg5, arg6, call_id);
59 register uintptr_t a2 __asm__(
"%a2") = call_id;
60 register uintptr_t a6 __asm__(
"%a6") = arg1;
61 register uintptr_t a3 __asm__(
"%a3") = arg2;
62 register uintptr_t a4 __asm__(
"%a4") = arg3;
63 register uintptr_t a5 __asm__(
"%a5") = arg4;
64 register uintptr_t a8 __asm__(
"%a8") = arg5;
65 register uintptr_t a9 __asm__(
"%a9") = arg6;
67 __asm__
volatile(
"syscall\n\t"
69 :
"r" (a2),
"r" (a6),
"r" (a3),
"r" (a4),
70 "r" (a5),
"r" (a8),
"r" (a9)
81#ifdef CONFIG_XTENSA_SYSCALL_USE_HELPER
82 return xtensa_syscall_helper(arg1, arg2, arg3, arg4, arg5, 0, call_id);
84 register uintptr_t a2 __asm__(
"%a2") = call_id;
85 register uintptr_t a6 __asm__(
"%a6") = arg1;
86 register uintptr_t a3 __asm__(
"%a3") = arg2;
87 register uintptr_t a4 __asm__(
"%a4") = arg3;
88 register uintptr_t a5 __asm__(
"%a5") = arg4;
89 register uintptr_t a8 __asm__(
"%a8") = arg5;
91 __asm__
volatile(
"syscall\n\t"
93 :
"r" (a2),
"r" (a6),
"r" (a3),
"r" (a4),
105#ifdef CONFIG_XTENSA_SYSCALL_USE_HELPER
106 return xtensa_syscall_helper(arg1, arg2, arg3, arg4, 0, 0, call_id);
108 register uintptr_t a2 __asm__(
"%a2") = call_id;
109 register uintptr_t a6 __asm__(
"%a6") = arg1;
110 register uintptr_t a3 __asm__(
"%a3") = arg2;
111 register uintptr_t a4 __asm__(
"%a4") = arg3;
112 register uintptr_t a5 __asm__(
"%a5") = arg4;
114 __asm__
volatile(
"syscall\n\t"
116 :
"r" (a2),
"r" (a6),
"r" (a3),
"r" (a4),
127#ifdef CONFIG_XTENSA_SYSCALL_USE_HELPER
128 return xtensa_syscall_helper(arg1, arg2, arg3, 0, 0, 0, call_id);
130 register uintptr_t a2 __asm__(
"%a2") = call_id;
131 register uintptr_t a6 __asm__(
"%a6") = arg1;
132 register uintptr_t a3 __asm__(
"%a3") = arg2;
133 register uintptr_t a4 __asm__(
"%a4") = arg3;
135 __asm__
volatile(
"syscall\n\t"
137 :
"r" (a2),
"r" (a6),
"r" (a3),
"r" (a4)
147#ifdef CONFIG_XTENSA_SYSCALL_USE_HELPER
148 return xtensa_syscall_helper(arg1, arg2, 0, 0, 0, 0, call_id);
150 register uintptr_t a2 __asm__(
"%a2") = call_id;
151 register uintptr_t a6 __asm__(
"%a6") = arg1;
152 register uintptr_t a3 __asm__(
"%a3") = arg2;
154 __asm__
volatile(
"syscall\n\t"
156 :
"r" (a2),
"r" (a6),
"r" (a3)
166#ifdef CONFIG_XTENSA_SYSCALL_USE_HELPER
167 return xtensa_syscall_helper(arg1, 0, 0, 0, 0, 0, call_id);
169 register uintptr_t a2 __asm__(
"%a2") = call_id;
170 register uintptr_t a6 __asm__(
"%a6") = arg1;
172 __asm__
volatile(
"syscall\n\t"
183#ifdef CONFIG_XTENSA_SYSCALL_USE_HELPER
184 return xtensa_syscall_helper(0, 0, 0, 0, 0, 0, call_id);
186 register uintptr_t a2 __asm__(
"%a2") = call_id;
188 __asm__
volatile(
"syscall\n\t"
207 "rur.THREADPTR %0\n\t"
210#ifdef CONFIG_THREAD_LOCAL_STORAGE
211 extern __thread
uint32_t is_user_mode;
217 return is_user_mode != 0;
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:39
Definitions of various linker Sections.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
__UINTPTR_TYPE__ uintptr_t
Definition: stdint.h:105