aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@linux.intel.com>2011-07-13 11:44:10 +0100
committerMatt Fleming <matt.fleming@linux.intel.com>2011-07-28 12:22:32 +0100
commitaaf56a110683a6f46ad255a5065aa057161b02b6 (patch)
tree9c8ee57509c23cb4023c7ef5ae5a2df23d92b4f3
parenta2821f29fdf972f73f1ff208311704422c7f3386 (diff)
downloadefilinux-aaf56a110683a6f46ad255a5065aa057161b02b6.tar.gz
protocol.h: Add locate_protocol()
Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
-rw-r--r--protocol.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/protocol.h b/protocol.h
index 6881d70..88b4a7b 100644
--- a/protocol.h
+++ b/protocol.h
@@ -51,6 +51,19 @@ handle_protocol(EFI_HANDLE handle, EFI_GUID *protocol, void **interface)
}
/**
+ * locate_protocol - Returns the first protocol instance for @protocol
+ * @protocol: the protocol to search for
+ * @registration: optional registration key
+ * @interface: used to return a pointer to the first matching interface
+ */
+static inline EFI_STATUS
+locate_protocol(EFI_GUID *protocol, void *registration, void **interface)
+{
+ return uefi_call_wrapper(boot->LocateProtocol, 3, protocol,
+ registration, interface);
+}
+
+/**
* locate_handle - Search for handles that support @protocol
* @type: the search type, which handles are returned
* @protocol: the protocol to search by (only valid if @type is ByProtocol)