summaryrefslogtreecommitdiff
path: root/services/spd/tlkd/tlkd_main.c
diff options
context:
space:
mode:
authorVarun Wadekar <vwadekar@nvidia.com>2015-03-13 14:59:03 +0530
committerVarun Wadekar <vwadekar@nvidia.com>2015-03-31 10:06:51 +0530
commit6e159e7a8c0dd73d6e95b8cbc1d8035d67da4bab (patch)
tree400e83c5a11cdce346d09c27ae5cb471bf14964a /services/spd/tlkd/tlkd_main.c
parent77199df7bceba229a8a2f9b8473088f969737d85 (diff)
Translate secure/non-secure virtual addresses
This patch adds functionality to translate virtual addresses from secure or non-secure worlds. This functionality helps Trusted Apps to share virtual addresses directly and allows the NS world to pass virtual addresses to TLK directly. Change-Id: I77b0892963e0e839c448b5d0532920fb7e54dc8e Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'services/spd/tlkd/tlkd_main.c')
-rw-r--r--services/spd/tlkd/tlkd_main.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/services/spd/tlkd/tlkd_main.c b/services/spd/tlkd/tlkd_main.c
index 8d2d437e..eb6b89de 100644
--- a/services/spd/tlkd/tlkd_main.c
+++ b/services/spd/tlkd/tlkd_main.c
@@ -188,6 +188,7 @@ uint64_t tlkd_smc_handler(uint32_t smc_fid,
{
cpu_context_t *ns_cpu_context;
uint32_t ns;
+ uint64_t vaddr, type, par;
/* Passing a NULL context is a critical programming error */
assert(handle);
@@ -247,6 +248,24 @@ uint64_t tlkd_smc_handler(uint32_t smc_fid,
SMC_RET0(&tlk_ctx.cpu_ctx);
/*
+ * Translate NS/EL1-S virtual addresses
+ */
+ case TLK_VA_TRANSLATE:
+ if (ns || !tlk_args_results_buf)
+ SMC_RET1(handle, SMC_UNK);
+
+ /* virtual address and type: ns/s */
+ vaddr = tlk_args_results_buf->args[0];
+ type = tlk_args_results_buf->args[1];
+
+ par = tlkd_va_translate(vaddr, type);
+
+ /* Save PA for use by the SP on return */
+ store_tlk_args_results(par, 0, 0, 0);
+
+ SMC_RET0(handle);
+
+ /*
* This is a request from the SP to mark completion of
* a standard function ID.
*/