public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Undefined types referenced in MdePkg
@ 2018-08-01 17:49 edk2-lists
  2018-08-01 21:55 ` Laszlo Ersek
  0 siblings, 1 reply; 5+ messages in thread
From: edk2-lists @ 2018-08-01 17:49 UTC (permalink / raw)
  To: edk2-devel

When including MdePkg/Include/Library/HobLib.h in my project I get errors
indicating that the following types are undefined:

*	EFI_RESOURCE_TYPE, lines 206 and 231
*	EFI_RESOURCE_ATTRIBUTE_TYPE, lines 207 and 232

 

A similar thing is happening with MdePkg/Include/Protocol/FirmwareVolume2.h.

*	EFI_FV_FILE_ATTRIBUTES, lines 309, 443, 612

 

I updated my EDK II tree then searched the entire tree for these types.  They
only show up in the locations mentioned above; never defined.

 

Am I missing something or are these really undefined?

 

I don't want to just disable these errors since that could hide a bigger
problem.

 

Thanks,

Daryl McDaniel

The Year of the Justifiably Defensive Lobster.

The Season of the fraternizing CEOs.

 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Undefined types referenced in MdePkg
  2018-08-01 17:49 Undefined types referenced in MdePkg edk2-lists
@ 2018-08-01 21:55 ` Laszlo Ersek
  2018-08-01 23:51   ` edk2-lists
  0 siblings, 1 reply; 5+ messages in thread
From: Laszlo Ersek @ 2018-08-01 21:55 UTC (permalink / raw)
  To: edk2-lists, edk2-devel

On 08/01/18 19:49, edk2-lists@mc2research.org wrote:
> When including MdePkg/Include/Library/HobLib.h in my project I get errors
> indicating that the following types are undefined:
> 
> *	EFI_RESOURCE_TYPE, lines 206 and 231
> *	EFI_RESOURCE_ATTRIBUTE_TYPE, lines 207 and 232
> 
>  
> 
> A similar thing is happening with MdePkg/Include/Protocol/FirmwareVolume2.h.
> 
> *	EFI_FV_FILE_ATTRIBUTES, lines 309, 443, 612
> 
>  
> 
> I updated my EDK II tree then searched the entire tree for these types.  They
> only show up in the locations mentioned above; never defined.
> 
>  
> 
> Am I missing something or are these really undefined?
> 
>  
> 
> I don't want to just disable these errors since that could hide a bigger
> problem.

IMO, the header files you mention should include the following files,
respectively:

- MdePkg/Include/Library/HobLib.h
  --> MdePkg/Include/Pi/PiHob.h

- MdePkg/Include/Protocol/FirmwareVolume2.h
  --> MdePkg/Include/Pi/PiFirmwareVolume.h

I'm firmly in the camp that believes that developers should not have to
hunt down themselves the dependencies of the main API header file that
they are actually interested in.

Thanks
Laszlo


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Undefined types referenced in MdePkg
  2018-08-01 21:55 ` Laszlo Ersek
@ 2018-08-01 23:51   ` edk2-lists
  2018-08-02 13:05     ` Gao, Liming
  0 siblings, 1 reply; 5+ messages in thread
From: edk2-lists @ 2018-08-01 23:51 UTC (permalink / raw)
  To: 'Laszlo Ersek', edk2-devel

Laszlo,

Thank you for the pointers to the dependent header files.

I agree that main API header files should include any headers that they depend upon and not require the developer to search out the dependencies.  Most modern pre-processors and compilers have optimizations to mitigate reading the same header file multiple times.  This invalidates the old rationale for policies that don't allow header files to include other header files.

Now, I need to find out why my search tool didn't find those headers.  ☹

In gratitude,
Daryl McDaniel
The Year of the Justifiably Defensive Lobster.
The Season of the fraternizing CEOs.

-----Original Message-----
From: edk2-devel <edk2-devel-bounces@lists.01.org> On Behalf Of Laszlo Ersek
Sent: Wednesday, August 1, 2018 2:56 PM
To: edk2-lists@mc2research.org; edk2-devel@lists.01.org
Subject: Re: [edk2] Undefined types referenced in MdePkg

On 08/01/18 19:49, edk2-lists@mc2research.org wrote:
> When including MdePkg/Include/Library/HobLib.h in my project I get 
> errors indicating that the following types are undefined:
> 
> *	EFI_RESOURCE_TYPE, lines 206 and 231
> *	EFI_RESOURCE_ATTRIBUTE_TYPE, lines 207 and 232
> 
>  
> 
> A similar thing is happening with MdePkg/Include/Protocol/FirmwareVolume2.h.
> 
> *	EFI_FV_FILE_ATTRIBUTES, lines 309, 443, 612
> 
>  
> 
> I updated my EDK II tree then searched the entire tree for these 
> types.  They only show up in the locations mentioned above; never defined.
> 
>  
> 
> Am I missing something or are these really undefined?
> 
>  
> 
> I don't want to just disable these errors since that could hide a 
> bigger problem.

IMO, the header files you mention should include the following files,
respectively:

- MdePkg/Include/Library/HobLib.h
  --> MdePkg/Include/Pi/PiHob.h

- MdePkg/Include/Protocol/FirmwareVolume2.h
  --> MdePkg/Include/Pi/PiFirmwareVolume.h

I'm firmly in the camp that believes that developers should not have to hunt down themselves the dependencies of the main API header file that they are actually interested in.

Thanks
Laszlo
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Undefined types referenced in MdePkg
  2018-08-01 23:51   ` edk2-lists
@ 2018-08-02 13:05     ` Gao, Liming
  2018-08-02 18:24       ` Laszlo Ersek
  0 siblings, 1 reply; 5+ messages in thread
From: Gao, Liming @ 2018-08-02 13:05 UTC (permalink / raw)
  To: edk2-lists@mc2research.org, 'Laszlo Ersek',
	edk2-devel@lists.01.org

MdePkg provides the basic module type header file, such as PiPei.h, PiDxe.h, Uefi.h. PiPei.h and PiDxe.h will include the basic PI definition. They have included PiHob.h and PiFirmwareVolume.h. 
Because the module type header file is included into AutoGen.h based on the module type. And, AutoGen.h is always included by compiler option. So, in edk2 build system, there is no issue to include HobLib.h and Protocol/FirmwareVolume2.h in source files. 

Thanks
Liming
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of edk2-lists@mc2research.org
> Sent: Thursday, August 2, 2018 7:51 AM
> To: 'Laszlo Ersek' <lersek@redhat.com>; edk2-devel@lists.01.org
> Subject: Re: [edk2] Undefined types referenced in MdePkg
> 
> Laszlo,
> 
> Thank you for the pointers to the dependent header files.
> 
> I agree that main API header files should include any headers that they depend upon and not require the developer to search out the
> dependencies.  Most modern pre-processors and compilers have optimizations to mitigate reading the same header file multiple
> times.  This invalidates the old rationale for policies that don't allow header files to include other header files.
> 
> Now, I need to find out why my search tool didn't find those headers.  ☹
> 
> In gratitude,
> Daryl McDaniel
> The Year of the Justifiably Defensive Lobster.
> The Season of the fraternizing CEOs.
> 
> -----Original Message-----
> From: edk2-devel <edk2-devel-bounces@lists.01.org> On Behalf Of Laszlo Ersek
> Sent: Wednesday, August 1, 2018 2:56 PM
> To: edk2-lists@mc2research.org; edk2-devel@lists.01.org
> Subject: Re: [edk2] Undefined types referenced in MdePkg
> 
> On 08/01/18 19:49, edk2-lists@mc2research.org wrote:
> > When including MdePkg/Include/Library/HobLib.h in my project I get
> > errors indicating that the following types are undefined:
> >
> > *	EFI_RESOURCE_TYPE, lines 206 and 231
> > *	EFI_RESOURCE_ATTRIBUTE_TYPE, lines 207 and 232
> >
> >
> >
> > A similar thing is happening with MdePkg/Include/Protocol/FirmwareVolume2.h.
> >
> > *	EFI_FV_FILE_ATTRIBUTES, lines 309, 443, 612
> >
> >
> >
> > I updated my EDK II tree then searched the entire tree for these
> > types.  They only show up in the locations mentioned above; never defined.
> >
> >
> >
> > Am I missing something or are these really undefined?
> >
> >
> >
> > I don't want to just disable these errors since that could hide a
> > bigger problem.
> 
> IMO, the header files you mention should include the following files,
> respectively:
> 
> - MdePkg/Include/Library/HobLib.h
>   --> MdePkg/Include/Pi/PiHob.h
> 
> - MdePkg/Include/Protocol/FirmwareVolume2.h
>   --> MdePkg/Include/Pi/PiFirmwareVolume.h
> 
> I'm firmly in the camp that believes that developers should not have to hunt down themselves the dependencies of the main API header
> file that they are actually interested in.
> 
> Thanks
> Laszlo
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Undefined types referenced in MdePkg
  2018-08-02 13:05     ` Gao, Liming
@ 2018-08-02 18:24       ` Laszlo Ersek
  0 siblings, 0 replies; 5+ messages in thread
From: Laszlo Ersek @ 2018-08-02 18:24 UTC (permalink / raw)
  To: Gao, Liming, edk2-lists@mc2research.org, edk2-devel@lists.01.org

On 08/02/18 15:05, Gao, Liming wrote:
> MdePkg provides the basic module type header file, such as PiPei.h,
> PiDxe.h, Uefi.h. PiPei.h and PiDxe.h will include the basic PI
> definition. They have included PiHob.h and PiFirmwareVolume.h. 
> Because the module type header file is included into AutoGen.h based
> on the module type. And, AutoGen.h is always included by compiler
> option. So, in edk2 build system, there is no issue to include
> HobLib.h and Protocol/FirmwareVolume2.h in source files.

Thanks, this is helpful!
Laszlo


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-08-02 18:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-01 17:49 Undefined types referenced in MdePkg edk2-lists
2018-08-01 21:55 ` Laszlo Ersek
2018-08-01 23:51   ` edk2-lists
2018-08-02 13:05     ` Gao, Liming
2018-08-02 18:24       ` Laszlo Ersek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox