SPCI: SPCI_FEATURES implementation.
Change-Id: I1bb3e32808d503ee75303a5e70b41645b2d7e86b
diff --git a/inc/hf/api.h b/inc/hf/api.h
index 406b620..024973e 100644
--- a/inc/hf/api.h
+++ b/inc/hf/api.h
@@ -66,3 +66,4 @@
struct vm_locked to_locked, struct vm_locked from_locked,
struct spci_memory_region *memory_region, uint32_t memory_to_attributes,
enum spci_memory_share share);
+struct spci_value api_spci_features(uint32_t function_id);
diff --git a/inc/vmapi/hf/call.h b/inc/vmapi/hf/call.h
index 9091875..52396aa 100644
--- a/inc/vmapi/hf/call.h
+++ b/inc/vmapi/hf/call.h
@@ -297,3 +297,19 @@
{
return spci_call((struct spci_value){.func = SPCI_VERSION_32});
}
+
+/**
+ * Discovery function returning information about the implementation of optional
+ * SPCI interfaces.
+ *
+ * Returns:
+ * - SPCI_SUCCESS in .func if the the optional interface with function_id is
+ * implemented.
+ * - SPCI_ERROR in .func if the optional interface with function_id is not
+ * implemented.
+ */
+static inline struct spci_value spci_features(uint32_t function_id)
+{
+ return spci_call((struct spci_value){.func = SPCI_FEATURES_32,
+ .arg1 = function_id});
+}