On 01/30/20 13:57, [email protected] wrote:
> Thank you, may I just create a new GUID (sysHostGuid),

Right, just get your own GUID with "uuidgen".

> then call BuildGuidDataHob passing in it the sysHostGuid

Yes.

> and SYSHOST structure?

Well, not exactly. It depends.

If your SYSHOST structure is a few KB tops (up to 64-ish KB), then sure,
you can embed the SYSHOST structure right into the HOB.

Otherwise, you should
- make your PEI code dependent on gEfiPeiMemoryDiscoveredPpiGuid,
- call the AllocatePages() PEI service,
- populate the allocated area with the SYSHOST structure,
- take the 64-bit EFI_PHYSICAL_ADDRESS, output by AllocatePages(), as a
UINT64,
- call BuildGuidDataHob() on the *UINT64*. In other words, embed the
address of the structure, not the structure.

> Will I be able to find the structure in the DXE phase looking up by the 
> sysHostGuid?

Yes, with GetFirstGuidHob().

If you embedded the structure in the HOB, then you can consume it right
from the HOB (at the address returned by GetFirstGuidHob()).

Otherwise, you should read the address (the UINT64 object) out of the
HOB. Then dereference it as a pointer, and that's where your struct will be.

The point is that memory allocated in the PEI phase with the
AllocatePages() PEI service, *after* permanent RAM has been installed
(i.e. after gEfiPeiMemoryDiscoveredPpiGuid is placed in the PPI
database), is stable. You can pass the address from PEI to DXE using a
GUID HOB.

Thanks
Laszlo


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#53582): https://edk2.groups.io/g/devel/message/53582
Mute This Topic: https://groups.io/mt/70267536/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to