Zephyr API Documentation  3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
error.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 BayLibre, SAS
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
14#ifndef ZEPHYR_INCLUDE_ARCH_RISCV_ERROR_H_
15#define ZEPHYR_INCLUDE_ARCH_RISCV_ERROR_H_
16
19#include <stdbool.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25#ifdef CONFIG_USERSPACE
26
27#define ARCH_EXCEPT(reason_p) do { \
28 if (k_is_user_context()) { \
29 arch_syscall_invoke1(reason_p, \
30 K_SYSCALL_USER_FAULT); \
31 } else { \
32 compiler_barrier(); \
33 arch_syscall_invoke1(reason_p, \
34 RV_ECALL_RUNTIME_EXCEPT);\
35 } \
36 CODE_UNREACHABLE; /* LCOV_EXCL_LINE */ \
37 } while (false)
38#else
39#define ARCH_EXCEPT(reason_p) \
40 arch_syscall_invoke1(reason_p, RV_ECALL_RUNTIME_EXCEPT)
41#endif
42
43__syscall void user_fault(unsigned int reason);
44
45#include <zephyr/syscalls/error.h>
46
47#ifdef __cplusplus
48}
49#endif
50
51#endif /* ZEPHYR_INCLUDE_ARCH_RISCV_ERROR_H_ */
RISCV specific syscall header.
void user_fault(unsigned int reason)
RISCV public exception handling.