libsp: Add high level RXTX buffer handling interface.

This layer provides functions for mapping, unmapping and accessing
FF-A RXTX buffers. It allows other high level interfaces (like memory
management) to use the RXTX buffers internally without the need for
forwarding the RXTX buffer information externally by the user.

Signed-off-by: Imre Kis <imre.kis@arm.com>
Change-Id: I946bcbf818599b2eb12f6ff029f9fc429ccb12b7
diff --git a/components/messaging/ffa/libsp/include/sp_rxtx.h b/components/messaging/ffa/libsp/include/sp_rxtx.h
new file mode 100644
index 0000000..a5b0f6a
--- /dev/null
+++ b/components/messaging/ffa/libsp/include/sp_rxtx.h
@@ -0,0 +1,76 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/*
+ * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
+ */
+
+#ifndef LIBSP_INCLUDE_SP_RXTX_H_
+#define LIBSP_INCLUDE_SP_RXTX_H_
+
+/**
+ * @file  sp_rxtx.h
+ * @brief The functions of this file provide a higher API for the FF-A RXTX
+ *        buffer handling.
+ */
+
+#include "sp_api_defines.h"
+#include "sp_api_types.h"
+#include <stddef.h>
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief      Maps the RX/TX buffer pair in the callee's translation regime.
+ *
+ * @param[in]  tx_buffer  The transmit buffer
+ * @param[in]  rx_buffer  The receive buffer
+ * @param[in]  size       The buffer size
+ *
+ * @return     The SP API result
+ */
+sp_result sp_rxtx_buffer_map(void *tx_buffer, const void *rx_buffer,
+			     size_t size);
+
+/**
+ * @brief      Unmaps the RX/TX buffer pair in the callee's translation regime.
+ *
+ * @return     The SP API result
+ */
+sp_result sp_rxtx_buffer_unmap(void);
+
+/**
+ * @brief      Queries the required alignment boundary of the RXTX buffers.
+ *
+ * @param[out] alignment  The minimal buffer size and alignment boundary
+ *
+ * @return     The SP API result
+ */
+sp_result sp_rxtx_buffer_alignment_boundary_get(uintptr_t *alignment);
+
+/**
+ * @brief      Queries the RX buffer's address and size.
+ *
+ * @param[out] buffer  The buffer address
+ * @param[out] size    The buffer size
+ *
+ * @return     The SP API result
+ */
+sp_result sp_rxtx_buffer_rx_get(const void **buffer, size_t *size);
+
+/**
+ * @brief      Queries the TX buffer's address and size.
+ *
+ * @param      buffer  The buffer address
+ * @param      size    The buffer size
+ *
+ * @return     The SP API result
+ */
+sp_result sp_rxtx_buffer_tx_get(void **buffer, size_t *size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* LIBSP_INCLUDE_SP_RXTX_H_ */