SPM: Adjust fundamental headers - lists and bits
Fundamental headers contain preprocessors, the headers do not belong
to a specific module.
- Move lists.h into common SPM 'include' root.
- Move bit operations from 'utilities.h' to a dedicated header file,
and put this new header under SPM 'include' root.
Change-Id: Icb6627f7172721b651632cb94f1546a34368cb3b
Signed-off-by: Ken Liu <Ken.Liu@arm.com>
diff --git a/secure_fw/spm/include/bitops.h b/secure_fw/spm/include/bitops.h
new file mode 100644
index 0000000..ed3ddd9
--- /dev/null
+++ b/secure_fw/spm/include/bitops.h
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2021, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+#ifndef __BITOPS_H__
+#define __BITOPS_H__
+
+#include <stdint.h>
+
+/* Check if there is only one bit availiable in a 32bit number */
+#define IS_ONLY_ONE_BIT_IN_UINT32(n) \
+ ((uint32_t)(n) && !((uint32_t)(n) & ((uint32_t)(n)-1)))
+#endif /* __BITOPS_H__ */
diff --git a/secure_fw/spm/include/ffm/lists.h b/secure_fw/spm/include/lists.h
similarity index 100%
rename from secure_fw/spm/include/ffm/lists.h
rename to secure_fw/spm/include/lists.h
diff --git a/secure_fw/spm/include/utilities.h b/secure_fw/spm/include/utilities.h
index f191ff6..76c9128 100644
--- a/secure_fw/spm/include/utilities.h
+++ b/secure_fw/spm/include/utilities.h
@@ -35,6 +35,4 @@
#define ERROR_MSG(msg)
-bool tfm_is_one_bit_set(uint32_t n);
-
#endif /* __TFM_UTILS_H__ */