Separate out CASSERT macro into own header

Separate out the CASSERT macro out of bl_common.h into its own
header to allow more efficient header inclusion.

Change-Id: I291be0b6b8f9879645e839a8f0dd1ec9b3db9639
diff --git a/include/bl31/context.h b/include/bl31/context.h
index cb4cd8e..b0c9810 100644
--- a/include/bl31/context.h
+++ b/include/bl31/context.h
@@ -31,8 +31,8 @@
 #ifndef __CONTEXT_H__
 #define __CONTEXT_H__
 
-#include <bl_common.h>
 #include <arch.h>
+#include <cassert.h>
 
 /*******************************************************************************
  * Constants that allow assembler code to access members of and the 'gp_regs'
diff --git a/include/bl31/runtime_svc.h b/include/bl31/runtime_svc.h
index 148c0bc..ab2137d 100644
--- a/include/bl31/runtime_svc.h
+++ b/include/bl31/runtime_svc.h
@@ -31,7 +31,7 @@
 #ifndef __RUNTIME_SVC_H__
 #define __RUNTIME_SVC_H__
 #include <psci.h>
-#include <bl_common.h>
+#include <cassert.h>
 
 /*******************************************************************************
  * Bit definitions inside the function id as per the SMC calling convention
diff --git a/include/bl32/payloads/tsp.h b/include/bl32/payloads/tsp.h
index 9d747d7..68a65b2 100644
--- a/include/bl32/payloads/tsp.h
+++ b/include/bl32/payloads/tsp.h
@@ -31,8 +31,8 @@
 #ifndef __TSP_H__
 #define __TSP_H__
 
-#include <bl_common.h>
 #include <platform.h>
+#include <cassert.h>
 
 /*
  * SMC function IDs that TSP uses to signal various forms of completions
diff --git a/include/common/bl_common.h b/include/common/bl_common.h
index a751d78..527f647 100644
--- a/include/common/bl_common.h
+++ b/include/common/bl_common.h
@@ -48,14 +48,6 @@
 #define BOT_LOAD	!TOP_LOAD
 #define LOAD_MASK	(1 << 0)
 
-/*******************************************************************************
- * Macro to flag a compile time assertion. It uses the preprocessor to generate
- * an invalid C construct if 'cond' evaluates to false.
- * The following  compilation error is triggered if the assertion fails:
- * "error: size of array 'msg' is negative"
- ******************************************************************************/
-#define CASSERT(cond, msg)	typedef char msg[(cond) ? 1 : -1]
-
 /******************************************************************************
  * Opcode passed in x0 to tell next EL that we want to run an image.
  * Corresponds to the function ID of the only SMC that the BL1 exception
diff --git a/include/lib/cassert.h b/include/lib/cassert.h
new file mode 100644
index 0000000..0e5529d
--- /dev/null
+++ b/include/lib/cassert.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2014, ARM Limited and Contributors. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * Neither the name of ARM nor the names of its contributors may be used
+ * to endorse or promote products derived from this software without specific
+ * prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __CASSERT_H__
+#define __CASSERT_H__
+
+/*******************************************************************************
+ * Macro to flag a compile time assertion. It uses the preprocessor to generate
+ * an invalid C construct if 'cond' evaluates to false.
+ * The following  compilation error is triggered if the assertion fails:
+ * "error: size of array 'msg' is negative"
+ ******************************************************************************/
+#define CASSERT(cond, msg)	typedef char msg[(cond) ? 1 : -1]
+
+#endif /* __CASSERT_H__ */
diff --git a/services/spd/tspd/tspd_private.h b/services/spd/tspd/tspd_private.h
index 69cf199..9eff9ec 100644
--- a/services/spd/tspd/tspd_private.h
+++ b/services/spd/tspd/tspd_private.h
@@ -35,6 +35,7 @@
 #include <arch.h>
 #include <psci.h>
 #include <tsp.h>
+#include <cassert.h>
 
 /*******************************************************************************
  * Secure Payload PM state information e.g. SP is suspended, uninitialised etc