Hi Ard, On Sat, Nov 26, 2022 at 06:34 AM, Ard Biesheuvel wrote: > > The remaining code still looks a bit clunky to me. Can't we just > return an error from the library constructor of the library cannot > initialize due to a missing prerequisite?
The problem with returning an error code from a library constructor is that it generates an ASSERT for debug builds. The reason is that the generated code in AutoGen.c looks as shown below: VOID EFIAPI ProcessLibraryConstructorList ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) { EFI_STATUS Status; Status = HobLibConstructor (ImageHandle, SystemTable); ASSERT_EFI_ERROR (Status); ... Status = ArmTrngLibConstructor (); ASSERT_RETURN_ERROR (Status); } -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#97070): https://edk2.groups.io/g/devel/message/97070 Mute This Topic: https://groups.io/mt/95240503/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-