zephyr/include/arch/arc/v2/error.h
Andrew Boie 4f77c2ad53 kernel: rename z_arch_ to arch_
Promote the private z_arch_* namespace, which specifies
the interface between the core kernel and the
architecture code, to a new top-level namespace named
arch_*.

This allows our documentation generation to create
online documentation for this set of interfaces,
and this set of interfaces is worth treating in a
more formal way anyway.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-11-07 15:21:46 -08:00

45 lines
811 B
C

/*
* Copyright (c) 2014 Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief ARCv2 public error handling
*
* ARC-specific kernel error handling interface. Included by arc/arch.h.
*/
#ifndef ZEPHYR_INCLUDE_ARCH_ARC_V2_ERROR_H_
#define ZEPHYR_INCLUDE_ARCH_ARC_V2_ERROR_H_
#include <arch/arc/syscall.h>
#include <arch/arc/v2/exc.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* use trap_s to raise a SW exception
*/
#define ARCH_EXCEPT(reason_p) do { \
__asm__ volatile ( \
"mov r0, %[reason]\n\t" \
"trap_s %[id]\n\t" \
: \
: [reason] "i" (reason_p), \
[id] "i" (_TRAP_S_CALL_RUNTIME_EXCEPT) \
: "memory"); \
CODE_UNREACHABLE; \
} while (false)
#ifdef __cplusplus
}
#endif
#endif /* ZEPHYR_INCLUDE_ARCH_ARC_V2_ERROR_H_ */