16#ifndef ZEPHYR_INCLUDE_ARCH_RISCV_SYSCALL_H_
17#define ZEPHYR_INCLUDE_ARCH_RISCV_SYSCALL_H_
22#define RV_ECALL_RUNTIME_EXCEPT 0
23#define RV_ECALL_IRQ_OFFLOAD 1
24#define RV_ECALL_SCHEDULE 2
44 register unsigned long a0 __asm__ (
"a0") = arg1;
45 register unsigned long a1 __asm__ (
"a1") = arg2;
46 register unsigned long a2 __asm__ (
"a2") = arg3;
47 register unsigned long a3 __asm__ (
"a3") = arg4;
48 register unsigned long a4 __asm__ (
"a4") = arg5;
49 register unsigned long a5 __asm__ (
"a5") = arg6;
50 register unsigned long t0 __asm__ (
"t0") = call_id;
52 __asm__
volatile (
"ecall"
54 :
"r" (a1),
"r" (a2),
"r" (a3),
"r" (a4),
"r" (a5),
65 register unsigned long a0 __asm__ (
"a0") = arg1;
66 register unsigned long a1 __asm__ (
"a1") = arg2;
67 register unsigned long a2 __asm__ (
"a2") = arg3;
68 register unsigned long a3 __asm__ (
"a3") = arg4;
69 register unsigned long a4 __asm__ (
"a4") = arg5;
70 register unsigned long t0 __asm__ (
"t0") = call_id;
72 __asm__
volatile (
"ecall"
74 :
"r" (a1),
"r" (a2),
"r" (a3),
"r" (a4),
"r" (t0)
83 register unsigned long a0 __asm__ (
"a0") = arg1;
84 register unsigned long a1 __asm__ (
"a1") = arg2;
85 register unsigned long a2 __asm__ (
"a2") = arg3;
86 register unsigned long a3 __asm__ (
"a3") = arg4;
87 register unsigned long t0 __asm__ (
"t0") = call_id;
89 __asm__
volatile (
"ecall"
91 :
"r" (a1),
"r" (a2),
"r" (a3),
"r" (t0)
100 register unsigned long a0 __asm__ (
"a0") = arg1;
101 register unsigned long a1 __asm__ (
"a1") = arg2;
102 register unsigned long a2 __asm__ (
"a2") = arg3;
103 register unsigned long t0 __asm__ (
"t0") = call_id;
105 __asm__
volatile (
"ecall"
107 :
"r" (a1),
"r" (a2),
"r" (t0)
115 register unsigned long a0 __asm__ (
"a0") = arg1;
116 register unsigned long a1 __asm__ (
"a1") = arg2;
117 register unsigned long t0 __asm__ (
"t0") = call_id;
119 __asm__
volatile (
"ecall"
128 register unsigned long a0 __asm__ (
"a0") = arg1;
129 register unsigned long t0 __asm__ (
"t0") = call_id;
131 __asm__
volatile (
"ecall"
140 register unsigned long a0 __asm__ (
"a0");
141 register unsigned long t0 __asm__ (
"t0") = call_id;
143 __asm__
volatile (
"ecall"
150#ifdef CONFIG_USERSPACE
151register unsigned long riscv_tp_reg __asm__ (
"tp");
156 if (riscv_tp_reg == 0) {
161 extern __thread
uint8_t is_user_mode;
163 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
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINTPTR_TYPE__ uintptr_t
Definition stdint.h:105