16#ifndef ZEPHYR_INCLUDE_ARCH_ARC_SYSCALL_H_
17#define ZEPHYR_INCLUDE_ARCH_ARC_SYSCALL_H_
19#define _TRAP_S_CALL_RUNTIME_EXCEPT 2
20#define _TRAP_S_CALL_SYSTEM_CALL 3
22#ifdef CONFIG_USERSPACE
28#ifdef CONFIG_ISA_ARCV2
45 register uint32_t ret __asm__(
"r0") = arg1;
46 register uint32_t r1 __asm__(
"r1") = arg2;
47 register uint32_t r2 __asm__(
"r2") = arg3;
48 register uint32_t r3 __asm__(
"r3") = arg4;
49 register uint32_t r4 __asm__(
"r4") = arg5;
50 register uint32_t r5 __asm__(
"r5") = arg6;
51 register uint32_t r6 __asm__(
"r6") = call_id;
56 "trap_s %[trap_s_id]\n"
58 : [trap_s_id]
"i" (_TRAP_S_CALL_SYSTEM_CALL),
59 "r" (ret),
"r" (r1),
"r" (r2),
"r" (r3),
60 "r" (r4),
"r" (r5),
"r" (r6));
70 register uint32_t ret __asm__(
"r0") = arg1;
71 register uint32_t r1 __asm__(
"r1") = arg2;
72 register uint32_t r2 __asm__(
"r2") = arg3;
73 register uint32_t r3 __asm__(
"r3") = arg4;
74 register uint32_t r4 __asm__(
"r4") = arg5;
75 register uint32_t r6 __asm__(
"r6") = call_id;
80 "trap_s %[trap_s_id]\n"
82 : [trap_s_id]
"i" (_TRAP_S_CALL_SYSTEM_CALL),
83 "r" (ret),
"r" (r1),
"r" (r2),
"r" (r3),
93 register uint32_t ret __asm__(
"r0") = arg1;
94 register uint32_t r1 __asm__(
"r1") = arg2;
95 register uint32_t r2 __asm__(
"r2") = arg3;
96 register uint32_t r3 __asm__(
"r3") = arg4;
97 register uint32_t r6 __asm__(
"r6") = call_id;
102 "trap_s %[trap_s_id]\n"
104 : [trap_s_id]
"i" (_TRAP_S_CALL_SYSTEM_CALL),
105 "r" (ret),
"r" (r1),
"r" (r2),
"r" (r3),
115 register uint32_t ret __asm__(
"r0") = arg1;
116 register uint32_t r1 __asm__(
"r1") = arg2;
117 register uint32_t r2 __asm__(
"r2") = arg3;
118 register uint32_t r6 __asm__(
"r6") = call_id;
123 "trap_s %[trap_s_id]\n"
125 : [trap_s_id]
"i" (_TRAP_S_CALL_SYSTEM_CALL),
126 "r" (ret),
"r" (r1),
"r" (r2),
"r" (r6));
134 register uint32_t ret __asm__(
"r0") = arg1;
135 register uint32_t r1 __asm__(
"r1") = arg2;
136 register uint32_t r6 __asm__(
"r6") = call_id;
141 "trap_s %[trap_s_id]\n"
143 : [trap_s_id]
"i" (_TRAP_S_CALL_SYSTEM_CALL),
144 "r" (ret),
"r" (r1),
"r" (r6));
151 register uint32_t ret __asm__(
"r0") = arg1;
152 register uint32_t r6 __asm__(
"r6") = call_id;
157 "trap_s %[trap_s_id]\n"
159 : [trap_s_id]
"i" (_TRAP_S_CALL_SYSTEM_CALL),
160 "r" (ret),
"r" (r6));
167 register uint32_t ret __asm__(
"r0");
168 register uint32_t r6 __asm__(
"r6") = call_id;
173 "trap_s %[trap_s_id]\n"
175 : [trap_s_id]
"i" (_TRAP_S_CALL_SYSTEM_CALL),
176 "r" (ret),
"r" (r6));
187 __asm__
volatile(
"lr %0, [%[status32]]\n"
189 : [status32]
"i" (_ARC_V2_STATUS32));
191 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: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
ARCv2 auxiliary registers definitions.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
__UINTPTR_TYPE__ uintptr_t
Definition: stdint.h:105