Update reserved function names starting with one underscore, replacing them as follows: '_k_' with 'z_' '_K_' with 'Z_' '_handler_' with 'z_handl_' '_Cstart' with 'z_cstart' '_Swap' with 'z_swap' This renaming is done on both global and those static function names in kernel/include and include/. Other static function names in kernel/ are renamed by removing the leading underscore. Other function names not starting with any prefix listed above are renamed starting with a 'z_' or 'Z_' prefix. Function names starting with two or three leading underscores are not automatcally renamed since these names will collide with the variants with two or three leading underscores. Various generator scripts have also been updated as well as perf, linker and usb files. These are drivers/serial/uart_handlers.c include/linker/kobject-text.ld kernel/include/syscall_handler.h scripts/gen_kobject_list.py scripts/gen_syscall_header.py Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
66 lines
1.7 KiB
C
66 lines
1.7 KiB
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
|
|
|
|
#ifndef _ASMLANGUAGE
|
|
#include <toolchain/gcc.h>
|
|
extern void z_NanoFatalErrorHandler(unsigned int, const NANO_ESF*);
|
|
extern void z_SysFatalErrorHandler(unsigned int cause, const NANO_ESF *esf);
|
|
#endif
|
|
|
|
#define _NANO_ERR_HW_EXCEPTION (0) /* MPU/Bus/Usage fault */
|
|
#define _NANO_ERR_STACK_CHK_FAIL (2) /* Stack corruption detected */
|
|
#define _NANO_ERR_ALLOCATION_FAIL (3) /* Kernel Allocation Failure */
|
|
#define _NANO_ERR_KERNEL_OOPS (4) /* Kernel oops (fatal to thread) */
|
|
#define _NANO_ERR_KERNEL_PANIC (5) /* Kernel panic (fatal to system) */
|
|
|
|
|
|
/*
|
|
* the exception caused by kernel will be handled in interrupt context
|
|
* when the processor is already in interrupt context, no need to raise
|
|
* a new exception; when the processor is in thread context, the exception
|
|
* will be raised
|
|
*/
|
|
#define Z_ARCH_EXCEPT(reason_p) do { \
|
|
if (z_arc_v2_irq_unit_is_in_isr()) { \
|
|
printk("@ %s:%d:\n", __FILE__, __LINE__); \
|
|
z_NanoFatalErrorHandler(reason_p, 0); \
|
|
} else {\
|
|
__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_ */
|