From 7d2fc8ec222afe67fcfb07b0ec7a45850b3533b7 Mon Sep 17 00:00:00 2001 From: Peter Mitsis Date: Thu, 28 May 2015 13:01:42 -0400 Subject: [PATCH] Add _NANO_ERR_ALLOCATION_FAIL fatal error code This reason code will be used indicate that the kernel failed to allocate a critical resource (such as a command packet or a timer packet). Change-Id: I6d4c3d96fc70b2b8cab4027b1b8e4febf4d6c474 Signed-off-by: Peter Mitsis --- arch/arc/core/fatal.c | 4 ++++ arch/arm/core/nanofatal.c | 4 ++++ arch/x86/core/nanofatal.c | 4 ++++ include/arch/arc/v2/error.h | 1 + include/arch/arm/CortexM/error.h | 1 + include/arch/x86/arch.h | 1 + 6 files changed, 15 insertions(+) diff --git a/arch/arc/core/fatal.c b/arch/arc/core/fatal.c index 8195bc06e6d..5e675128be7 100644 --- a/arch/arc/core/fatal.c +++ b/arch/arc/core/fatal.c @@ -84,6 +84,10 @@ FUNC_NORETURN void _NanoFatalErrorHandler(unsigned int reason, break; #endif + case _NANO_ERR_ALLOCATION_FAIL: + PR_EXC("**** Kernel Allocation Failure! ****\n"); + break; + default: PR_EXC("**** Unknown Fatal Error %d! ****\n", reason); break; diff --git a/arch/arm/core/nanofatal.c b/arch/arm/core/nanofatal.c index 5b44b76ae6a..d254302078e 100644 --- a/arch/arm/core/nanofatal.c +++ b/arch/arm/core/nanofatal.c @@ -102,6 +102,10 @@ FUNC_NORETURN void _NanoFatalErrorHandler( break; #endif /* CONFIG_STACK_CANARIES */ + case _NANO_ERR_ALLOCATION_FAIL: + PR_EXC("**** Kernel Allocation Failure! ****\n"); + break; + default: PR_EXC("**** Unknown Fatal Error %d! ****\n", reason); break; diff --git a/arch/x86/core/nanofatal.c b/arch/x86/core/nanofatal.c index be870a9ebae..2ec372ccc48 100644 --- a/arch/x86/core/nanofatal.c +++ b/arch/x86/core/nanofatal.c @@ -114,6 +114,10 @@ FUNC_NORETURN void _NanoFatalErrorHandler( #endif /* CONFIG_STACK_CANARIES */ + case _NANO_ERR_ALLOCATION_FAIL: + printk("**** Kernel Allocation Failure! ****\n"); + break; + default: printk("**** Unknown Fatal Error %d! ****\n", reason); break; diff --git a/include/arch/arc/v2/error.h b/include/arch/arc/v2/error.h index 71ddcb88e0c..7ea8a2c0bf1 100644 --- a/include/arch/arc/v2/error.h +++ b/include/arch/arc/v2/error.h @@ -49,5 +49,6 @@ extern void _SysFatalErrorHandler(unsigned int cause, const NANO_ESF *esf); #define _NANO_ERR_HW_EXCEPTION (0) /* MPU/Bus/Usage fault */ #define _NANO_ERR_INVALID_TASK_EXIT (1) /* Invalid task exit */ #define _NANO_ERR_STACK_CHK_FAIL (2) /* Stack corruption detected */ +#define _NANO_ERR_ALLOCATION_FAIL (3) /* Kernel Allocation Failure */ #endif /* _ARCH_ARC_V2_ERROR_H_ */ diff --git a/include/arch/arm/CortexM/error.h b/include/arch/arm/CortexM/error.h index 84055458775..81684e112c9 100644 --- a/include/arch/arm/CortexM/error.h +++ b/include/arch/arm/CortexM/error.h @@ -49,5 +49,6 @@ extern void _SysFatalErrorHandler(unsigned int, const NANO_ESF *); #define _NANO_ERR_HW_EXCEPTION (0) /* MPU/Bus/Usage fault */ #define _NANO_ERR_INVALID_TASK_EXIT (1) /* Invalid task exit */ #define _NANO_ERR_STACK_CHK_FAIL (2) /* Stack corruption detected */ +#define _NANO_ERR_ALLOCATION_FAIL (3) /* Kernel Allocation Failure */ #endif /* _ARCH_ARM_CORTEXM_ERROR_H_ */ diff --git a/include/arch/x86/arch.h b/include/arch/x86/arch.h index a61c64c5879..b10c81db1c6 100644 --- a/include/arch/x86/arch.h +++ b/include/arch/x86/arch.h @@ -196,6 +196,7 @@ typedef struct nanoIsf { #define _NANO_ERR_GEN_PROT_FAULT (2) /* General protection fault */ #define _NANO_ERR_INVALID_TASK_EXIT (3) /* Invalid task exit */ #define _NANO_ERR_STACK_CHK_FAIL (4) /* Stack corruption detected */ +#define _NANO_ERR_ALLOCATION_FAIL (5) /* Kernel Allocation Failure */ #ifndef _ASMLANGUAGE