16#ifndef ZEPHYR_INCLUDE_ARCH_ARC_SYSCALL_H_
17#define ZEPHYR_INCLUDE_ARCH_ARC_SYSCALL_H_
19#define _TRAP_S_SCALL_IRQ_OFFLOAD 1
20#define _TRAP_S_CALL_RUNTIME_EXCEPT 2
21#define _TRAP_S_CALL_SYSTEM_CALL 3
23#ifdef CONFIG_USERSPACE
29#ifdef CONFIG_ISA_ARCV2
47 register uint32_t r1 __asm__(
"r1") = arg2;
48 register uint32_t r2 __asm__(
"r2") = arg3;
49 register uint32_t r3 __asm__(
"r3") = arg4;
50 register uint32_t r4 __asm__(
"r4") = arg5;
51 register uint32_t r5 __asm__(
"r5") = arg6;
52 register uint32_t r6 __asm__(
"r6") = call_id;
57 "trap_s %[trap_s_id]\n"
59 : [trap_s_id]
"i" (_TRAP_S_CALL_SYSTEM_CALL),
60 "r" (
ret),
"r" (r1),
"r" (r2),
"r" (r3),
61 "r" (r4),
"r" (r5),
"r" (r6));
72 register uint32_t r1 __asm__(
"r1") = arg2;
73 register uint32_t r2 __asm__(
"r2") = arg3;
74 register uint32_t r3 __asm__(
"r3") = arg4;
75 register uint32_t r4 __asm__(
"r4") = arg5;
76 register uint32_t r6 __asm__(
"r6") = call_id;
81 "trap_s %[trap_s_id]\n"
83 : [trap_s_id]
"i" (_TRAP_S_CALL_SYSTEM_CALL),
84 "r" (
ret),
"r" (r1),
"r" (r2),
"r" (r3),
95 register uint32_t r1 __asm__(
"r1") = arg2;
96 register uint32_t r2 __asm__(
"r2") = arg3;
97 register uint32_t r3 __asm__(
"r3") = arg4;
98 register uint32_t r6 __asm__(
"r6") = call_id;
103 "trap_s %[trap_s_id]\n"
105 : [trap_s_id]
"i" (_TRAP_S_CALL_SYSTEM_CALL),
106 "r" (
ret),
"r" (r1),
"r" (r2),
"r" (r3),
117 register uint32_t r1 __asm__(
"r1") = arg2;
118 register uint32_t r2 __asm__(
"r2") = arg3;
119 register uint32_t r6 __asm__(
"r6") = call_id;
124 "trap_s %[trap_s_id]\n"
126 : [trap_s_id]
"i" (_TRAP_S_CALL_SYSTEM_CALL),
127 "r" (
ret),
"r" (r1),
"r" (r2),
"r" (r6));
136 register uint32_t r1 __asm__(
"r1") = arg2;
137 register uint32_t r6 __asm__(
"r6") = call_id;
142 "trap_s %[trap_s_id]\n"
144 : [trap_s_id]
"i" (_TRAP_S_CALL_SYSTEM_CALL),
145 "r" (
ret),
"r" (r1),
"r" (r6));
153 register uint32_t r6 __asm__(
"r6") = call_id;
158 "trap_s %[trap_s_id]\n"
160 : [trap_s_id]
"i" (_TRAP_S_CALL_SYSTEM_CALL),
161 "r" (
ret),
"r" (r6));
169 register uint32_t r6 __asm__(
"r6") = call_id;
174 "trap_s %[trap_s_id]\n"
176 : [trap_s_id]
"i" (_TRAP_S_CALL_SYSTEM_CALL),
177 "r" (
ret),
"r" (r6));
188 __asm__
volatile(
"lr %0, [%[status32]]\n"
190 : [status32]
"i" (_ARC_V2_STATUS32));
192 return !(status & _ARC_V2_STATUS32_US) ?
true :
false;
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:90
static uintptr_t arch_syscall_invoke2(uintptr_t arg1, uintptr_t arg2, uintptr_t call_id)
Definition: syscall.h:132
static uintptr_t arch_syscall_invoke1(uintptr_t arg1, uintptr_t call_id)
Definition: syscall.h:150
static uintptr_t arch_syscall_invoke0(uintptr_t call_id)
Definition: syscall.h:166
static bool arch_is_user_context(void)
Definition: syscall.h:182
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:66
static uintptr_t arch_syscall_invoke3(uintptr_t arg1, uintptr_t arg2, uintptr_t arg3, uintptr_t call_id)
Definition: syscall.h:112
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:41
ARCv2 auxiliary registers definitions.
static ZTEST_BMEM volatile int ret
Definition: k_float_disable.c:28
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINTPTR_TYPE__ uintptr_t
Definition: stdint.h:75