提交 641833db 编写于 作者: R Rob Clark 提交者: Alexander Graf

efi_loader: add helper macro to construct protocol objects

There are a bunch of protocols which should be exposed by GUID but are
not.  Add a helper macro to create an efi_object, to avoid much typing.

Note that using the pointer for efiobj->handle is semi-arbitrary.  We
just need a unique value to match the efiobj supporting the protocol
with the handle that LocateHandle() returns..

See LibLocateProtocol() in gnu-efi.  It does LocateHandle() to find all
the handles, and then loops over them calling HandleProtocol() with the
GUID of the protocol it is trying to find.
Signed-off-by: NRob Clark <robdclark@gmail.com>
Signed-off-by: NAlexander Graf <agraf@suse.de>
上级 804b1d73
......@@ -66,6 +66,14 @@ struct efi_object {
void *handle;
};
#define EFI_PROTOCOL_OBJECT(_guid, _protocol) (struct efi_object){ \
.protocols = {{ \
.guid = &(_guid), \
.protocol_interface = (void *)(_protocol), \
}}, \
.handle = (void *)(_protocol), \
}
/**
* struct efi_event
*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册