build(ffa): introduce assert macro

Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
Change-Id: I2e7c7320574de056bac6c685cc3ef86330186664
diff --git a/inc/hf/assert.h b/inc/hf/assert.h
new file mode 100644
index 0000000..197c5d6
--- /dev/null
+++ b/inc/hf/assert.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2021 The Hafnium Authors.
+ *
+ * Use of this source code is governed by a BSD-style
+ * license that can be found in the LICENSE file or at
+ * https://opensource.org/licenses/BSD-3-Clause.
+ */
+
+#pragma once
+
+#if !defined(__cplusplus)
+
+#include "hf/panic.h"
+
+#ifndef PLAT_LOG_LEVEL_ASSERT
+#define PLAT_LOG_LEVEL_ASSERT LOG_LEVEL
+#endif
+
+#if ENABLE_ASSERTIONS
+#if PLAT_LOG_LEVEL_ASSERT >= LOG_LEVEL_VERBOSE
+#define assert(e) \
+	((e) ? (void)0 : panic("ASSERT: %s:%d:%s\n", __FILE__, __LINE__, #e))
+#elif PLAT_LOG_LEVEL_ASSERT >= LOG_LEVEL_INFO
+#define assert(e) ((e) ? (void)0 : panic("ASSERT: %s:%d\n", __FILE__, __LINE__))
+#else
+#define assert(e) ((e) ? (void)0 : panic("ASSERT\n"))
+#endif
+#else
+#define assert(e) ((void)0)
+#endif /* ENABLE_ASSERTIONS */
+
+#endif /* !defined(__cplusplus) */