[edk2] Reply to Tim's Message: 3 re: edk2-devel Digest, Vol 36, Issue 29

Subject: [edk2] Reply to Tim's Message: 3 re: edk2-devel Digest, Vol 36, Issue 29

From: "Miller, Carl H" <carl.miller@pnnl.gov>

To: "edk2-devel@lists.sourceforge.net" <edk2-devel@lists.sourceforge.net>

Date: 2012-12-14 18:30:59

Hi Tim, 
I think it is more than just an error in the comment, if you pass in two identical guids to CompareGuid, it returns 0, not 1....

-----Original Message-----
From: edk2-devel-request@lists.sourceforge.net [mailto:edk2-devel-request@lists.sourceforge.net] 
Sent: Friday, December 14, 2012 9:21 AM
To: edk2-devel@lists.sourceforge.net
Subject: edk2-devel Digest, Vol 36, Issue 29

Send edk2-devel mailing list submissions to
	edk2-devel@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
	https://lists.sourceforge.net/lists/listinfo/edk2-devel
or, via email, send a message with subject or body 'help' to
	edk2-devel-request@lists.sourceforge.net

You can reach the person managing the list at
	edk2-devel-owner@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific than "Re: Contents of edk2-devel digest..."


Today's Topics:

   1. Replay to message #5 of  edk2-devel Digest, Vol 36, Issue 22
      (Alexei Fedorov)
   2. bug in either CompareGuid or check for 'IsFFS3FV' (Miller, Carl H)
   3. Re: bug in either CompareGuid or check for 'IsFFS3FV' (Tim Lewis)


----------------------------------------------------------------------

Message: 1
Date: Fri, 14 Dec 2012 10:37:06 +0000
From: Alexei Fedorov 
Subject: [edk2] Replay to message #5 of  edk2-devel Digest, Vol 36,
	Issue 22
To: "edk2-devel@lists.sourceforge.net"
	
Message-ID:
	<20E136AF98049A48A90A7417B4343D5E284414D03F@BUNGLE.Emea.Arm.com>
Content-Type: text/plain; charset="windows-1252"

Hi Elvin,



It happens in both variants with Consplitter included & not.



Regards.

Alexei.



>Message: 5

>Date: Thu, 13 Dec 2012 00:53:26 +0000

>From: "Li, Elvin" 

>Subject: Re: [edk2] Graphics Console produces no output in RELEASE

>     build

>To: "edk2-devel@lists.sourceforge.net"

>     

>Message-ID:

>     
> <85D5955FC01BBD45B061B0BD47E129190FE1F776@SHSMSX102.ccr.corp.intel.com
> >

>

>Content-Type: text/plain; charset="us-ascii"

>

>Alexei:

>     May I know that your BIOS includes Consplitter driver?

>

>

>Thanks

>Elvin

-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 2
Date: Fri, 14 Dec 2012 08:06:28 -0800
From: "Miller, Carl H" 
Subject: [edk2] bug in either CompareGuid or check for 'IsFFS3FV'
To: "edk2-devel@lists.sourceforge.net"
	
Message-ID:
	
Content-Type: text/plain; charset="us-ascii"

I believe there is a bug  in something i see in the UDK code I have (UDK2010.SR1.UP1).
It appears to me as though either the 'CompareGuid' routine should be returning the opposite of what it is, or the tests using the variable IsFfs3Fv should be modified:

i.e.,:
in FwVol.c

  IsFfs3Fv = CompareGuid (&FwVolHeader->FileSystemGuid, &gEfiFirmwareFileSystem3Guid); ...

    if (IS_FFS_FILE2 (*FileHeader)) {
      if (!IsFfs3Fv) {
        DEBUG ((EFI_D_ERROR, "It is a FFS3 formatted file: %g in a non-FFS3 formatted FV.\n", &(*FileHeader)->Name));
      }
      FileLength = FFS_FILE2_SIZE (*FileHeader); ...

and CompareGuid says:
                //Returns:
                //  =  0  if Guid1 == Guid2
                //  != 0  if Guid1 != Guid2

so if FwVolHeader->FileSystemGuid == gEfiFirmwareFileSystem3Guid then IsFfs3Fv will be 0 if FwVolHeader->FileSystemGuid is a FFS3

(which makes 'IsFfs3Fv' seems as though it should have been named 'IsNotFfs3Fv'

and therefore the test:
                if (!IsFfs3Fv) {
                                .. do something if not FFS3

should be
FwVolHeader->FileSystemGuid
                if (IsFfs3Fv) {
                                .. do something if not FFS3

-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 3
Date: Fri, 14 Dec 2012 17:20:41 +0000
From: Tim Lewis 
Subject: Re: [edk2] bug in either CompareGuid or check for 'IsFFS3FV'
To: "edk2-devel@lists.sourceforge.net"
	
Message-ID:
	<7236196A5DF6C040855A6D96F556A53F016C75@msmail.insydesw.com.tw>
Content-Type: text/plain; charset="us-ascii"

Carl -

It looks like the comment is wrong. I believe it should be != 0 if Guid1 == Guid1 and == 0 if Guid1 != Guid2

Tim

From: Miller, Carl H [mailto:carl.miller@pnnl.gov]
Sent: Friday, December 14, 2012 8:06 AM
To: edk2-devel@lists.sourceforge.net
Subject: [edk2] bug in either CompareGuid or check for 'IsFFS3FV'

I believe there is a bug  in something i see in the UDK code I have (UDK2010.SR1.UP1).
It appears to me as though either the 'CompareGuid' routine should be returning the opposite of what it is, or the tests using the variable IsFfs3Fv should be modified:

i.e.,:
in FwVol.c

  IsFfs3Fv = CompareGuid (&FwVolHeader->FileSystemGuid, &gEfiFirmwareFileSystem3Guid); ...

    if (IS_FFS_FILE2 (*FileHeader)) {
      if (!IsFfs3Fv) {
        DEBUG ((EFI_D_ERROR, "It is a FFS3 formatted file: %g in a non-FFS3 formatted FV.\n", &(*FileHeader)->Name));
      }
      FileLength = FFS_FILE2_SIZE (*FileHeader); ...

and CompareGuid says:
                //Returns:
                //  =  0  if Guid1 == Guid2
                //  != 0  if Guid1 != Guid2

so if FwVolHeader->FileSystemGuid == gEfiFirmwareFileSystem3Guid then IsFfs3Fv will be 0 if FwVolHeader->FileSystemGuid is a FFS3

(which makes 'IsFfs3Fv' seems as though it should have been named 'IsNotFfs3Fv'

and therefore the test:
                if (!IsFfs3Fv) {
                                .. do something if not FFS3

should be
FwVolHeader->FileSystemGuid
                if (IsFfs3Fv) {
                                .. do something if not FFS3

-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d

------------------------------

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


End of edk2-devel Digest, Vol 36, Issue 29
******************************************

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel