summaryrefslogtreecommitdiffstats
path: root/src/include/sys
diff options
context:
space:
mode:
authorMike Jones <mjjones@us.ibm.com>2013-08-29 10:50:19 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-08-29 12:15:40 -0500
commitad26bf3da1ed2aea73047d89f5f4f3946edff5e1 (patch)
tree894a65b9eea2f99aa8b6c03666edcec8ea3ead14 /src/include/sys
parent662ec83a81786c4ec4a03a2464e58326d8d9fc7e (diff)
downloadtalos-hostboot-ad26bf3da1ed2aea73047d89f5f4f3946edff5e1.tar.gz
talos-hostboot-ad26bf3da1ed2aea73047d89f5f4f3946edff5e1.zip
Ensure task_crash not optimized out
User space assert() calls the task_crash() macro to crash the thread, this writes to address NULL, but the write is optimized out. Therefore an assert does not cause the task to crash as intended. If istep code asserts, the istepdispatcher does not notice and Hostboot hangs instead of TIing. This is fixed with a volatile. Change-Id: Icc27d94d76e937000189655c2f8a640620456673 RTC: 80657 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5968 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/sys')
-rw-r--r--src/include/sys/task.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/sys/task.h b/src/include/sys/task.h
index 0fbec617b..c52da0627 100644
--- a/src/include/sys/task.h
+++ b/src/include/sys/task.h
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2010,2012 */
+/* COPYRIGHT International Business Machines Corp. 2010,2013 */
/* */
/* p1 */
/* */
@@ -85,7 +85,7 @@ void task_end2(void* retval) NO_RETURN;
* @brief End the calling task as if it crashed.
*
*/
-#define task_crash() ((*(char*)NULL) = 'F')
+#define task_crash() ((*(volatile char*)NULL) = 'F')
/** @fn task_gettid
* @brief Get task ID of calling task.
OpenPOWER on IntegriCloud