Add wrapper functions for all the hvcs.

Change-Id: If40a04a84041611e98634dc6d9c6c1af308e8dd6
diff --git a/driver/linux b/driver/linux
index 2f62b42..5570423 160000
--- a/driver/linux
+++ b/driver/linux
@@ -1 +1 @@
-Subproject commit 2f62b42954c627cc4d619831e22fc36ea926b06e
+Subproject commit 5570423fa47f8559d85b4db39a93ba3afba05cad
diff --git a/inc/vmapi/hf/call.h b/inc/vmapi/hf/call.h
index 6dd1e88..dd339a0 100644
--- a/inc/vmapi/hf/call.h
+++ b/inc/vmapi/hf/call.h
@@ -1,7 +1,21 @@
 #ifndef _VMAPI_HF_HVC_H
 #define _VMAPI_HF_HVC_H
 
+#if defined(__linux__) && defined(__KERNEL__)
+
+#include <linux/types.h>
+
+typedef phys_addr_t hf_ipaddr_t;
+
+#else
+
+#include <stdbool.h>
 #include <stddef.h>
+#include <stdint.h>
+
+typedef uintptr_t hf_ipaddr_t;
+
+#endif
 
 /* Keep macro alignment */
 /* clang-format off */
@@ -24,26 +38,87 @@
 
 /* clang-format on */
 
-/*
- * This function must be implemented to trigger the architecture specific call
- * to the hypervisor.
+/**
+ * This function must be implemented to trigger the architecture specific
+ * mechanism to call to the hypervisor.
  */
-long hf_call(size_t arg0, size_t arg1, size_t arg2, size_t arg3);
+size_t hf_call(size_t arg0, size_t arg1, size_t arg2, size_t arg3);
 
-/*
+/**
+ * Runs the given vcpu of the given vm.
+ */
+static inline int32_t hf_vcpu_run(uint32_t vm_idx, uint32_t vcpu_idx)
+{
+	return hf_call(HF_VCPU_RUN, vm_idx, vcpu_idx, 0);
+}
+
+/**
  * Returns the number of secondary VMs.
  */
-static inline long hf_vm_get_count(void)
+static inline int32_t hf_vm_get_count(void)
 {
 	return hf_call(HF_VM_GET_COUNT, 0, 0, 0);
 }
 
-/*
+/**
  * Returns the number of VCPUs configured in the given secondary VM.
  */
-static inline long hf_vcpu_get_count(size_t vm_idx)
+static inline int32_t hf_vcpu_get_count(uint32_t vm_idx)
 {
 	return hf_call(HF_VCPU_GET_COUNT, vm_idx, 0, 0);
 }
 
+/**
+ * Configures the pages to send/receive data through. The pages must not be
+ * shared.
+ */
+static inline int32_t hf_vm_configure(hf_ipaddr_t send, hf_ipaddr_t recv)
+{
+	return hf_call(HF_VM_CONFIGURE, send, recv, 0);
+}
+
+/**
+ * Called by the primary VM to send an RPC request to a secondary VM. Data is
+ * copied from the caller's send buffer to the destination's receive buffer.
+ */
+static inline int32_t hf_rpc_request(uint32_t vm_idx, size_t size)
+{
+	return hf_call(HF_RPC_REQUEST, vm_idx, size, 0);
+}
+
+/**
+ * Called by the primary VM to read a request sent from a previous call to
+ * api_rpc_request. If one isn't available, this function can optionally block
+ * the caller until one becomes available.
+ *
+ * Once the caller has completed handling a request, it must indicate it by
+ * either calling api_rpc_reply or api_rpc_ack. No new requests can be accepted
+ * until the current one is acknowledged.
+ */
+static inline int32_t hf_rpc_read_request(bool block)
+{
+	return hf_call(HF_RPC_READ_REQUEST, block, 0, 0);
+}
+
+/**
+ * Acknowledges that either a request or a reply has been received and handled.
+ * After this call completes, the caller will be able to receive additional
+ * requests or replies.
+ */
+static inline int32_t hf_rpc_ack(void)
+{
+	return hf_call(HF_RPC_ACK, 0, 0, 0);
+}
+
+/**
+ * Called by a secondary VM to send a reply to the primary VM. Data is copied
+ * from the caller's send buffer to the destination's receive buffer.
+ *
+ * It can optionally acknowledge the pending request.
+ */
+static inline int32_t hf_rpc_reply(size_t size, bool ack)
+{
+	return hf_call(HF_RPC_REPLY, size, ack, 0);
+}
+
 #endif /* _VMAPI_HF_HVC_H */