Hi Gerd, Thanks, Chao On 2024/4/25 15:53, Gerd Hoffmann wrote: > Hi, > >> +UINTN mFwCfgSelectorAddress; >> +UINTN mFwCfgDataAddress; >> +UINTN mFwCfgDmaAddress; > Hmm, global variables for PEI? I think the point of storing these in > the HOB is to avoid the need for global variables? Also does that work > when running PEI in-place from flash? I think it would be useful if some platforms(not LoongArch) could use the global variables in PEI, because the global variables are faster. > >> +RETURN_STATUS >> +EFIAPI >> +QemuFwCfgInitialize ( >> + VOID >> + ) >> +{ >> + VOID *DeviceTreeBase; >> + INT32 Node; >> + INT32 Prev; >> + CONST CHAR8 *Type; >> + INT32 Len; >> + CONST UINT64 *Reg; >> + UINT64 FwCfgSelectorAddress; >> + UINT64 FwCfgSelectorSize; >> + UINT64 FwCfgDataAddress; >> + UINT64 FwCfgDataSize; >> + UINT64 FwCfgDmaAddress; >> + UINT64 FwCfgDmaSize; > First thing this function should do is check whenever the HOB already > exists. Should that be the case there is no need to parse the device > tree. This is a constructor in PEI, that has to parse the device tree and then build the HOBs. > > take care, > Gerd > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118278): https://edk2.groups.io/g/devel/message/118278 Mute This Topic: https://groups.io/mt/105724970/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-