Migrate secure payload dispatchers to new SMC terminology

Since Issue B (November 2016) of the SMC Calling Convention document
standard SMC calls are renamed to yielding SMC calls to help avoid
confusion with the standard service SMC range, which remains unchanged.

http://infocenter.arm.com/help/topic/com.arm.doc.den0028b/ARM_DEN0028B_SMC_Calling_Convention.pd

A previous patch introduced a new define for yielding SMC call type.
This patch updates the secure payload dispatchers (except the TSPD) to
use this new define and also migrates the code to use the new
terminology.

Change-Id: I3d2437c04e3b21fdbd32019f55c066c87679a5bf
Signed-off-by: David Cunado <david.cunado@arm.com>
diff --git a/services/spd/tlkd/tlkd_common.c b/services/spd/tlkd/tlkd_common.c
index a36a908..599d7a3 100644
--- a/services/spd/tlkd/tlkd_common.c
+++ b/services/spd/tlkd/tlkd_common.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -88,7 +88,7 @@
 
 	/* Associate this context with the cpu specified */
 	tlk_ctx->mpidr = read_mpidr_el1();
-	clr_std_smc_active_flag(tlk_ctx->state);
+	clr_yield_smc_active_flag(tlk_ctx->state);
 	cm_set_context(&tlk_ctx->cpu_ctx, SECURE);
 
 	if (rw == SP_AARCH64)
diff --git a/services/spd/tlkd/tlkd_main.c b/services/spd/tlkd/tlkd_main.c
index 572e022..2748868 100644
--- a/services/spd/tlkd/tlkd_main.c
+++ b/services/spd/tlkd/tlkd_main.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -195,7 +195,7 @@
 	 *    Applications.
 	 * c. open/close sessions
 	 * d. issue commands to the Trusted Apps
-	 * e. resume the preempted standard SMC call.
+	 * e. resume the preempted yielding SMC call.
 	 */
 	case TLK_REGISTER_LOGBUF:
 	case TLK_REGISTER_REQBUF:
@@ -217,15 +217,15 @@
 		assert(handle == cm_get_context(NON_SECURE));
 
 		/*
-		 * Check if we are already processing a standard SMC
+		 * Check if we are already processing a yielding SMC
 		 * call. Of all the supported fids, only the "resume"
 		 * fid expects the flag to be set.
 		 */
 		if (smc_fid == TLK_RESUME_FID) {
-			if (!get_std_smc_active_flag(tlk_ctx.state))
+			if (!get_yield_smc_active_flag(tlk_ctx.state))
 				SMC_RET1(handle, SMC_UNK);
 		} else {
-			if (get_std_smc_active_flag(tlk_ctx.state))
+			if (get_yield_smc_active_flag(tlk_ctx.state))
 				SMC_RET1(handle, SMC_UNK);
 		}
 
@@ -239,7 +239,7 @@
 		/*
 		 * Mark the SP state as active.
 		 */
-		set_std_smc_active_flag(tlk_ctx.state);
+		set_yield_smc_active_flag(tlk_ctx.state);
 
 		/*
 		 * We are done stashing the non-secure context. Ask the
@@ -298,7 +298,7 @@
 
 	/*
 	 * This is a request from the SP to mark completion of
-	 * a standard function ID.
+	 * a yielding function ID.
 	 */
 	case TLK_REQUEST_DONE:
 		if (ns)
@@ -307,7 +307,7 @@
 		/*
 		 * Mark the SP state as inactive.
 		 */
-		clr_std_smc_active_flag(tlk_ctx.state);
+		clr_yield_smc_active_flag(tlk_ctx.state);
 
 		/* Get a reference to the non-secure context */
 		ns_cpu_context = cm_get_context(NON_SECURE);
@@ -411,13 +411,13 @@
 	tlkd_smc_handler
 );
 
-/* Define a SPD runtime service descriptor for standard SMC calls */
+/* Define a SPD runtime service descriptor for yielding SMC calls */
 DECLARE_RT_SVC(
 	tlkd_tos_std,
 
 	OEN_TOS_START,
 	OEN_TOS_END,
-	SMC_TYPE_STD,
+	SMC_TYPE_YIELD,
 	NULL,
 	tlkd_smc_handler
 );
@@ -433,13 +433,13 @@
 	tlkd_smc_handler
 );
 
-/* Define a SPD runtime service descriptor for standard SMC calls */
+/* Define a SPD runtime service descriptor for yielding SMC calls */
 DECLARE_RT_SVC(
 	tlkd_tap_std,
 
 	OEN_TAP_START,
 	OEN_TAP_END,
-	SMC_TYPE_STD,
+	SMC_TYPE_YIELD,
 	NULL,
 	tlkd_smc_handler
 );
diff --git a/services/spd/tlkd/tlkd_private.h b/services/spd/tlkd/tlkd_private.h
index 130544f..ba66098 100644
--- a/services/spd/tlkd/tlkd_private.h
+++ b/services/spd/tlkd/tlkd_private.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -14,7 +14,7 @@
 #include <psci.h>
 
 /*
- * This flag is used by the TLKD to determine if the SP is servicing a standard
+ * This flag is used by the TLKD to determine if the SP is servicing a yielding
  * SMC request prior to programming the next entry into the SP e.g. if SP
  * execution is preempted by a non-secure interrupt and handed control to the
  * normal world. If another request which is distinct from what the SP was
@@ -22,15 +22,16 @@
  * reject the new request or service it while ensuring that the previous context
  * is not corrupted.
  */
-#define STD_SMC_ACTIVE_FLAG_SHIFT	2
-#define STD_SMC_ACTIVE_FLAG_MASK	1
-#define get_std_smc_active_flag(state)	(((state) >> STD_SMC_ACTIVE_FLAG_SHIFT) \
-					 & STD_SMC_ACTIVE_FLAG_MASK)
-#define set_std_smc_active_flag(state)	((state) |=                           \
-					 (1 << STD_SMC_ACTIVE_FLAG_SHIFT))
-#define clr_std_smc_active_flag(state)	((state) &=                           \
-					 ~(STD_SMC_ACTIVE_FLAG_MASK           \
-					   << STD_SMC_ACTIVE_FLAG_SHIFT))
+#define YIELD_SMC_ACTIVE_FLAG_SHIFT	2
+#define YIELD_SMC_ACTIVE_FLAG_MASK	1
+#define get_yield_smc_active_flag(state)				\
+			(((state) >> YIELD_SMC_ACTIVE_FLAG_SHIFT)	\
+			& YIELD_SMC_ACTIVE_FLAG_MASK)
+#define set_yield_smc_active_flag(state)	((state) |=		\
+					 (1 << YIELD_SMC_ACTIVE_FLAG_SHIFT))
+#define clr_yield_smc_active_flag(state)	((state) &=		\
+					 ~(YIELD_SMC_ACTIVE_FLAG_MASK	\
+					 << YIELD_SMC_ACTIVE_FLAG_SHIFT))
 
 /*******************************************************************************
  * Translate virtual address received from the NS world