Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
error.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2014 Wind River Systems, Inc.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
14#ifndef ZEPHYR_INCLUDE_ARCH_ARC_V2_ERROR_H_
15#define ZEPHYR_INCLUDE_ARCH_ARC_V2_ERROR_H_
16
19#include <stdbool.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25/*
26 * use trap_s to raise a SW exception
27 */
28#define ARCH_EXCEPT(reason_p) do { \
29 __asm__ volatile ( \
30 "mov %%r0, %[reason]\n\t" \
31 "trap_s %[id]\n\t" \
32 : \
33 : [reason] "i" (reason_p), \
34 [id] "i" (_TRAP_S_CALL_RUNTIME_EXCEPT) \
35 : "memory"); \
36 CODE_UNREACHABLE; /* LCOV_EXCL_LINE */ \
37 } while (false)
38
39#ifdef __cplusplus
40}
41#endif
42
43
44#endif /* ZEPHYR_INCLUDE_ARCH_ARC_V2_ERROR_H_ */
ARCv2 public exception handling.
ARC specific syscall header.