[if !mso]> [if !mso]>

RE: [Edk2 Dev] Potential DXE IPL compatibility issue.

Subject: RE: [Edk2 Dev] Potential DXE IPL compatibility issue.

From: "Huang, Qing" <qing.huang@intel.com>

To: <dev@edk2.tianocore.org>

Date: 2008-07-19 18:15:44

Andrew,

            Yes, your suggestion can further help to save the extra GUID copy and reduce one parameter of DxeIplFindDxeCore().

I have checked in to refine the code as you have suggested. Really appreciate your contributions to improve our source level code quality!

 

 

Thanks & Best Regards,

Huang, Qing


From: Andrew Fish [mailto:afish@apple.com]
Sent: Saturday, July 19, 2008 7:30 AM
To: dev@edk2.tianocore.org
Subject: Re: [Edk2 Dev] Potential DXE IPL compatibility issue.

 

Qing,

 

Your fix looks good, but I don't think we need DxeCoreFileName. We are just copying the GUID data from the buffer from GetFileInfo into a buffer on our stack so we can take the address of it and pass it into BuildModuleHob (). Why not just pass in the pointer to the GUID from FvFileInfo like this:

 

  BuildModuleHob (

    &FvFileInfo.FileName

    DxeCoreAddress,

    EFI_SIZE_TO_PAGES ((UINT32) DxeCoreSize) * EFI_PAGE_SIZE,

    DxeCoreEntryPoint

    );

 

We could then remove DxeCoreFileName and simplify the code.

 

 

Andrew Fish

Work iPhone: 360-259-7562

 

 

 

 

On Jul 17, 2008, at 8:05 PM, Huang, Qing wrote:



Andrew,

            Yes, I agree with you. DxeIpl should never assume the DxeCore GUID File Name is the first part of FileHandle, which is the implementation choice of PeiCore.

I have updated DxeIpl to use the PEI SERVICE GetFileInfo() to extract that GUID in the implementation of DxeIplFindDxeCore():

  //

  // Extract the DxeCore GUID file name.

  //

  Status = PeiServicesFfsGetFileInfo (FileHandle, &FvFileInfo);

  ASSERT_EFI_ERROR (Status);

  CopyGuid (DxeCoreFileName, &FvFileInfo.FileName);

            Thank you very much for pointing out this potential compatibility issue.

 

Thanks & Best Regards,

Huang, Qing


From: Andrew Fish [mailto:afish@apple.com] 
Sent: Friday, July 18, 2008 5:27 AM
To: dev@edk2.tianocore.org
Subject: [Edk2 Dev] Potential DXE IPL compatibility issue.

 

I don't think it is really legal to cast a FileHandle to (EFI_FFS_FILE_HEADER *). The PEI core does not have to implement the FileHandle this way. 

 

I think it would be cleaner to pass DxeCoreFileName back from DxeIplFindDxeCore ().

  //
  // Look in all the FVs present in PEI and find the DXE Core
  //
  FileHandle = NULL;
  Status = DxeIplFindDxeCore (&FileHandle);
  ASSERT_EFI_ERROR (Status);
 
  CopyGuid(&DxeCoreFileName, &(((EFI_FFS_FILE_HEADER*)FileHandle)->Name));

 

 

Andrew Fish

Work iPhone: 360-259-7562