Core: Move context information to the service db

This commit removes the ctx array, and moves all the service context
related data.

Two new dummy services are added, one for the non-secure PE, and one
for the core. The latter, TFM_SEC_FUNC_CORE_ID, is used as running
service when calling secure tests. This way the checks done at context
switch pass.

Change-Id: I4fc3cad59a57e8dea630c642b8c363cbacfd58f3
Signed-off-by: Mate Toth-Pal <mate.toth-pal@arm.com>
diff --git a/secure_fw/spm/user_service_defines.inc b/secure_fw/spm/user_service_defines.inc
index e3fbbf5..59ab7bc 100644
--- a/secure_fw/spm/user_service_defines.inc
+++ b/secure_fw/spm/user_service_defines.inc
@@ -13,6 +13,13 @@
 #include "target_cfg.h"
 #include "service_defs.h"
 
+/* TFM_SEC_FUNC_NON_SECURE and TFM_SEC_FUNC_CORE are not real services, we
+ * only created them to have an entry for them in the database. They don't have
+ * their dedicated sections in the scatter file, so no symbols are needed to
+ * be declared.
+ */
+/* SERVICE_DECLARE(TFM_SEC_FUNC_NON_SECURE) */
+/* SERVICE_DECLARE(TFM_SEC_FUNC_CORE) */
 SERVICE_DECLARE(TFM_SEC_FUNC_STORAGE)
 
 #ifdef CORE_TEST_SERVICES
@@ -28,6 +35,8 @@
 #define __SPM_ADD_USER_SERVICES__
 
 /* Order must be same as id!!! */
+DUMMY_SERVICE_ADD(TFM_SEC_FUNC_NON_SECURE)
+DUMMY_SERVICE_ADD(TFM_SEC_FUNC_CORE)
 SERVICE_ADD(TFM_SEC_FUNC_STORAGE)
 
 #ifdef CORE_TEST_SERVICES