16#ifndef ZEPHYR_INCLUDE_ARCH_RISCV_SYSCALL_H_
17#define ZEPHYR_INCLUDE_ARCH_RISCV_SYSCALL_H_
19#define _SVC_CALL_CONTEXT_SWITCH 0
20#define _SVC_CALL_IRQ_OFFLOAD 1
21#define _SVC_CALL_RUNTIME_EXCEPT 2
22#define _SVC_CALL_SYSTEM_CALL 3
24#define FORCE_SYSCALL_ID -1
26#ifdef CONFIG_USERSPACE
45 register uint32_t a0 __asm__ (
"a0") = arg1;
46 register uint32_t a1 __asm__ (
"a1") = arg2;
47 register uint32_t a2 __asm__ (
"a2") = arg3;
48 register uint32_t a3 __asm__ (
"a3") = arg4;
49 register uint32_t a4 __asm__ (
"a4") = arg5;
50 register uint32_t a5 __asm__ (
"a5") = arg6;
51 register uint32_t a7 __asm__ (
"a7") = call_id;
53 __asm__
volatile (
"ecall"
55 :
"r" (a1),
"r" (a2),
"r" (a3),
"r" (a4),
"r" (a5),
66 register uint32_t a0 __asm__ (
"a0") = arg1;
67 register uint32_t a1 __asm__ (
"a1") = arg2;
68 register uint32_t a2 __asm__ (
"a2") = arg3;
69 register uint32_t a3 __asm__ (
"a3") = arg4;
70 register uint32_t a4 __asm__ (
"a4") = arg5;
71 register uint32_t a7 __asm__ (
"a7") = call_id;
73 __asm__
volatile (
"ecall"
75 :
"r" (a1),
"r" (a2),
"r" (a3),
"r" (a4),
"r" (a7)
84 register uint32_t a0 __asm__ (
"a0") = arg1;
85 register uint32_t a1 __asm__ (
"a1") = arg2;
86 register uint32_t a2 __asm__ (
"a2") = arg3;
87 register uint32_t a3 __asm__ (
"a3") = arg4;
88 register uint32_t a7 __asm__ (
"a7") = call_id;
90 __asm__
volatile (
"ecall"
92 :
"r" (a1),
"r" (a2),
"r" (a3),
"r" (a7)
101 register uint32_t a0 __asm__ (
"a0") = arg1;
102 register uint32_t a1 __asm__ (
"a1") = arg2;
103 register uint32_t a2 __asm__ (
"a2") = arg3;
104 register uint32_t a7 __asm__ (
"a7") = call_id;
106 __asm__
volatile (
"ecall"
108 :
"r" (a1),
"r" (a2),
"r" (a7)
116 register uint32_t a0 __asm__ (
"a0") = arg1;
117 register uint32_t a1 __asm__ (
"a1") = arg2;
118 register uint32_t a7 __asm__ (
"a7") = call_id;
120 __asm__
volatile (
"ecall"
129 register uint32_t a0 __asm__ (
"a0") = arg1;
130 register uint32_t a7 __asm__ (
"a7") = call_id;
132 __asm__
volatile (
"ecall"
141 register uint32_t a0 __asm__ (
"a0");
142 register uint32_t a7 __asm__ (
"a7") = call_id;
144 __asm__
volatile (
"ecall"
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:80
static uintptr_t arch_syscall_invoke2(uintptr_t arg1, uintptr_t arg2, uintptr_t call_id)
Definition: syscall.h:113
static uintptr_t arch_syscall_invoke1(uintptr_t arg1, uintptr_t call_id)
Definition: syscall.h:127
static uintptr_t arch_syscall_invoke0(uintptr_t call_id)
Definition: syscall.h:139
static bool arch_is_user_context(void)
Definition: syscall.h:151
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:61
static uintptr_t arch_syscall_invoke3(uintptr_t arg1, uintptr_t arg2, uintptr_t arg3, uintptr_t call_id)
Definition: syscall.h:97
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
unsigned long ulong_t
Definition: types.h:18
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINTPTR_TYPE__ uintptr_t
Definition: stdint.h:75