Split ffa_memory_send into a separate version for TEE.

This refactoring avoids checking for the TEE case several times, and
makes the memory ownership more consistent. The ffa_memory module is now
responsible for forwarding memory send calls on to the TEE.

Bug: 132429380
Change-Id: I32bc216d9201e690c1d90c1349ae53e125969987
diff --git a/inc/hf/api.h b/inc/hf/api.h
index e56a2d2..bfeed7c 100644
--- a/inc/hf/api.h
+++ b/inc/hf/api.h
@@ -62,8 +62,7 @@
 			     const struct vcpu *current, struct vcpu **next);
 struct ffa_value api_ffa_mem_send(uint32_t share_func, uint32_t length,
 				  uint32_t fragment_length, ipaddr_t address,
-				  uint32_t page_count, struct vcpu *current,
-				  struct vcpu **next);
+				  uint32_t page_count, struct vcpu *current);
 struct ffa_value api_ffa_mem_retrieve_req(uint32_t length,
 					  uint32_t fragment_length,
 					  ipaddr_t address, uint32_t page_count,
diff --git a/inc/hf/ffa_memory.h b/inc/hf/ffa_memory.h
index 30be4d8..9715918 100644
--- a/inc/hf/ffa_memory.h
+++ b/inc/hf/ffa_memory.h
@@ -21,10 +21,15 @@
 
 #include "vmapi/hf/ffa.h"
 
-struct ffa_value ffa_memory_send(struct vm *to, struct vm_locked from_locked,
+struct ffa_value ffa_memory_send(struct vm_locked from_locked,
 				 struct ffa_memory_region *memory_region,
 				 uint32_t memory_share_length,
-				 uint32_t share_func, struct mpool *page_pool);
+				 uint32_t fragment_length, uint32_t share_func,
+				 struct mpool *page_pool);
+struct ffa_value ffa_memory_tee_send(
+	struct vm_locked from_locked, struct vm_locked to_locked,
+	struct ffa_memory_region *memory_region, uint32_t memory_share_length,
+	uint32_t fragment_length, uint32_t share_func, struct mpool *page_pool);
 struct ffa_value ffa_memory_retrieve(struct vm_locked to_locked,
 				     struct ffa_memory_region *retrieve_request,
 				     uint32_t retrieve_request_length,