From cb7f0c33bd6733dab9f76adaaa1eeea77065054c Mon Sep 17 00:00:00 2001 From: Michael Ryleev Date: Thu, 26 Mar 2015 19:31:25 -0700 Subject: trusty: add couple non-secure memory related helper routines trusty_encode_page_info - encodes page physical address, memory type and other attributes into architecture specific structure that can be parsed by secure side. trusty_call32_mem_buf - can be used by drivers to make specified smc call with physicaly contigues memory buffer as an argument. Memory buffer info in retrieved by trusty_encode_page_info and along with buffer size is encoded into series of 32-bit smc call parameters. Change-Id: Iae155c0eff0bb6269be1abbe53ee42f27a1c23f5 Signed-off-by: Michael Ryleev --- include/linux/trusty/trusty.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/linux') diff --git a/include/linux/trusty/trusty.h b/include/linux/trusty/trusty.h index abb77f1db..d084d9d68 100644 --- a/include/linux/trusty/trusty.h +++ b/include/linux/trusty/trusty.h @@ -16,6 +16,9 @@ #include #include +#include +#include + #ifdef CONFIG_TRUSTY s32 trusty_std_call32(struct device *dev, u32 smcnr, u32 a0, u32 a1, u32 a2); @@ -53,4 +56,16 @@ int trusty_call_notifier_register(struct device *dev, int trusty_call_notifier_unregister(struct device *dev, struct notifier_block *n); const char *trusty_version_str_get(struct device *dev); + +struct ns_mem_page_info { + uint64_t attr; +}; + +int trusty_encode_page_info(struct ns_mem_page_info *inf, + struct page *page, pgprot_t pgprot); + +int trusty_call32_mem_buf(struct device *dev, u32 smcnr, + struct page *page, u32 size, + pgprot_t pgprot); + #endif -- cgit v1.2.2