Page MenuHomeFreeBSD

loader.efi: replace HandleProtocol() with OpenProtocol()
ClosedPublic

Authored by tsoome on Sun, Aug 4, 9:11 PM.

Details

Summary

The HandleProtocol() is deprecated interface and we should use OpenProtocol() instead. Moreover, in some firmware implementation(s), the HandleProtocol() does return device path using static storage, so we can not keep the value returned there. With same firmware, the OpenProtocol() does return data we do not need to clone.

Test Plan

Tested by network and disk boot.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

tsoome created this revision.Sun, Aug 4, 9:11 PM
imp added a comment.Mon, Aug 5, 1:53 AM

love the idea, but think it would be better to create a centralized location where we wrap this.
Call me paranoid, but I fear there may be a EFI bios we need to do this for :(
But also, it will make the code easier to read, so win/win.

stand/efi/boot1/proto.c
64 ↗(On Diff #60452)

maybe we should create wrappers for this stuff to make it less verbose everywhere we use it.

imp accepted this revision.Mon, Aug 5, 1:54 AM
This revision is now accepted and ready to land.Mon, Aug 5, 1:54 AM
tsoome added a comment.Mon, Aug 5, 6:07 AM
In D21162#459738, @imp wrote:

love the idea, but think it would be better to create a centralized location where we wrap this.
Call me paranoid, but I fear there may be a EFI bios we need to do this for :(
But also, it will make the code easier to read, so win/win.

hm, I got some idea about it, I'll think a bit...

tsoome updated this revision to Diff 60464.Mon, Aug 5, 10:11 AM

Implement OpenProtocolByHandle()

This revision now requires review to proceed.Mon, Aug 5, 10:11 AM
tsoome marked an inline comment as done.Mon, Aug 5, 10:18 AM
imp accepted this revision.Tue, Aug 6, 5:29 PM
This revision is now accepted and ready to land.Tue, Aug 6, 5:29 PM
This revision was automatically updated to reflect the committed changes.