[SPM] checks if SIMD vectors are preserved

Populates the SIMD registers in the normal world, then modifies those in
the secure world. Upon return to the normal world checks that vectors
are restored to the original values.
Note: Does not check if SIMD vectors are preserved when returning back
to the secure world.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Signed-off-by: Max Shvetsov <maksims.svecovs@arm.com>
Change-Id: I3ae223af64597f83afa6624122109db2cf0077f7
diff --git a/include/runtime_services/spm_common.h b/include/runtime_services/spm_common.h
index f264af9..b090002 100644
--- a/include/runtime_services/spm_common.h
+++ b/include/runtime_services/spm_common.h
@@ -31,7 +31,6 @@
 	unsigned int feature;
 	unsigned int expected_ret;
 };
-unsigned int get_ffa_feature_test_target(const struct ffa_features_test **test_target);
 
 struct mailbox_buffers {
 	void *recv;
@@ -59,6 +58,28 @@
 			);							\
 	} while (false)
 
+/*
+ * Vector length:
+ * SIMD: 128 bits = 16 bytes
+ */
+#define SIMD_VECTOR_LEN_BYTES		16
+#define SIMD_NUM_VECTORS		32
+typedef uint8_t simd_vector_t[SIMD_VECTOR_LEN_BYTES];
+
+/*
+ * Fills SIMD registers with the content of the container v.
+ * Number of vectors is assumed to be SIMD_NUM_VECTORS.
+ */
+void fill_simd_vector_regs(const simd_vector_t v[SIMD_NUM_VECTORS]);
+
+/*
+ * Reads contents of SIMD registers into the provided container v.
+ * Number of vectors is assumed to be SIMD_NUM_VECTORS.
+ */
+void read_simd_vector_regs(simd_vector_t v[SIMD_NUM_VECTORS]);
+
 bool check_spmc_execution_level(void);
 
+unsigned int get_ffa_feature_test_target(const struct ffa_features_test **test_target);
+
 #endif /* SPM_COMMON_H */