From e810dcbc09c375a39ce36f461eb0cc2f7e9a1aed Mon Sep 17 00:00:00 2001 From: Aruna Balakrishnaiah Date: Thu, 31 Jul 2014 14:46:06 +0530 Subject: ATTN: Set up attention area to handle attention At present CPU control area ntuple in SPIRA structure is NULL. ATTN component in Service Processor side checks for this field and if its empty, it logs hardcoded SRC (0xBB821410) and generates SYSDUMP. So we have 1 SRC for all failure (assert call) from OPAL side. This makes difficult to debug the issue. Service processor provides attention area interface (FIPS PHyp Attentions spec), so that we can pass SRC and user data (error message) to service processor. This will helps us identify different failures in OPAL. This patch enables attention area and provides interface (update_sp_attn_area()) to add src and user data (error message) through assert macro. Attention SRC format: 1st byte - Opal src type 2-4 bytes - Holds the address of the assert function call Signed-off-by: Aruna Balakrishnaiah Signed-off-by: Vasant Hegde Signed-off-by: Benjamin Herrenschmidt --- libc/include/assert.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libc') diff --git a/libc/include/assert.h b/libc/include/assert.h index 755fc71..fbfb2cc 100644 --- a/libc/include/assert.h +++ b/libc/include/assert.h @@ -13,11 +13,15 @@ #ifndef _ASSERT_H #define _ASSERT_H +extern void update_sp_attn_area(const char *msg); + #define assert(cond) \ - do { if (!(cond)) \ + do { if (!(cond)) { \ + update_sp_attn_area(__FILE__ \ + ":" stringify(__LINE__)); \ assert_fail(__FILE__ \ ":" stringify(__LINE__) \ - ":" stringify(cond)); \ + ":" stringify(cond)); } \ } while(0) void __attribute__((noreturn)) assert_fail(const char *msg); -- cgit v1.1