On Jan 3, 2013, at 8:13 AM, 雅虎邮箱 <[email protected]> wrote:

> Hi All,
> I got a trouble during learing UEFI that when I tried to retrive more 
> information about protocols defined in the path of MdePkg\Include\Protocol, I 
> only see the header files but not find the corresponding file of *.c

Think of the protocol .h file as the public class definition.  The EFI_GUID 
global extern in the .h file is the name that is set to the #define 
*_PROTOCOL_GUID value. 

So for example if you look at 
https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/MdePkg/Include/Protocol/BlockIo.h
 you can search the code base for gEfiBlockIoProtocolGuid to see the producers 
and consumers of Block IO protocol.

The modules that produce or consume the Block IO protocol will include 
gEfiBlockIoProtocolGuid in the [Protocols] section of their INF file and this 
will cause the build generated AutoGen.c file to contain:
EFI_GUID gEfiBlockIoProtocolGuid = EFI_BLOCK_IO_PROTOCOL_GUID

Producers will use gBS->InstallProtocolInterface() or 
gBS->InstallMultipleProtocolInterfaces() to register the protocol instance(s) 
that they produce. 
Consumers will use gBS->OpenProtocol(), gBS->HandleProtocol(), or 
gBS->LocolProtocol() to discover the protocol instance. 

In both the consumers and producers you will see &gEfiBlockIoProtocolGuid 
passed as an argument. 

Thanks,

Andrew Fish

>  
> Could you offer me some information about this question?!
> I am looking forward to your reply!
>  
> Thanks & Best Regards!
>  
> Justin Lin
> From TJ China
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. ON SALE this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122712_______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/edk2-devel

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to