You can subscribe to this list here.
2010 |
Jan
(18) |
Feb
(75) |
Mar
(40) |
Apr
(18) |
May
(12) |
Jun
(13) |
Jul
(17) |
Aug
(25) |
Sep
(31) |
Oct
(16) |
Nov
(20) |
Dec
(13) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(5) |
Feb
(7) |
Mar
(6) |
Apr
(21) |
May
(12) |
Jun
(35) |
Jul
(29) |
Aug
(56) |
Sep
(64) |
Oct
(43) |
Nov
(60) |
Dec
(26) |
2012 |
Jan
(6) |
Feb
(12) |
Mar
(17) |
Apr
(10) |
May
(11) |
Jun
(13) |
Jul
(6) |
Aug
(2) |
Sep
(3) |
Oct
(9) |
Nov
(1) |
Dec
(2) |
2013 |
Jan
(5) |
Feb
(5) |
Mar
(1) |
Apr
(3) |
May
(3) |
Jun
(3) |
Jul
(8) |
Aug
(7) |
Sep
(2) |
Oct
(4) |
Nov
(14) |
Dec
(10) |
2014 |
Jan
(22) |
Feb
(7) |
Mar
(3) |
Apr
(4) |
May
(1) |
Jun
(6) |
Jul
(4) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: <yi...@us...> - 2014-02-20 08:55:39
|
Revision: 2650 http://sourceforge.net/p/edk2-buildtools/code/2650 Author: yingke Date: 2014-02-20 08:55:36 +0000 (Thu, 20 Feb 2014) Log Message: ----------- Large file supported by VolInfo. Reviewed-by: Liming Gao <lim...@in...> Reviewed-by: Star Zeng <zen...@in...> Signed-off-by: Yingke Liu <yin...@in...> Modified Paths: -------------- trunk/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c trunk/BaseTools/Source/C/Common/FirmwareVolumeBufferLib.h trunk/BaseTools/Source/C/VolInfo/VolInfo.c Modified: trunk/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c =================================================================== --- trunk/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c 2014-01-24 00:48:22 UTC (rev 2649) +++ trunk/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c 2014-02-20 08:55:36 UTC (rev 2650) @@ -1,6 +1,6 @@ /** @file -Copyright (c) 1999 - 2008, Intel Corporation. All rights reserved.<BR> +Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -32,7 +32,38 @@ ) \ ) +STATIC +UINT32 +FvBufGetSecHdrLen( + IN EFI_COMMON_SECTION_HEADER *SectionHeader + ) +{ + if (SectionHeader == NULL) { + return 0; + } + if (FvBufExpand3ByteSize(SectionHeader->Size) == 0xffffff) { + return sizeof(EFI_COMMON_SECTION_HEADER2); + } + return sizeof(EFI_COMMON_SECTION_HEADER); +} +STATIC +UINT32 +FvBufGetSecFileLen ( + IN EFI_COMMON_SECTION_HEADER *SectionHeader + ) +{ + UINT32 Length; + if (SectionHeader == NULL) { + return 0; + } + Length = FvBufExpand3ByteSize(SectionHeader->Size); + if (Length == 0xffffff) { + Length = ((EFI_COMMON_SECTION_HEADER2 *)SectionHeader)->ExtendedSize; + } + return Length; +} + // // Local prototypes // @@ -92,7 +123,7 @@ return Status; } - FileToRmLength = FvBufExpand3ByteSize (FileToRm->Size); + FileToRmLength = FvBufGetFfsFileSize (FileToRm); CommonLibBinderSetMem ( FileToRm, @@ -218,7 +249,7 @@ EFI_FFS_FILE_STATE StateBackup; UINT32 FileSize; - FileSize = FvBufExpand3ByteSize (File->Size); + FileSize = FvBufGetFfsFileSize (File); // // Fill in checksums and state, they must be 0 for checksumming. @@ -231,13 +262,13 @@ File->IntegrityCheck.Checksum.Header = FvBufCalculateChecksum8 ( (UINT8 *) File, - sizeof (EFI_FFS_FILE_HEADER) + FvBufGetFfsHeaderSize (File) ); if (File->Attributes & FFS_ATTRIB_CHECKSUM) { File->IntegrityCheck.Checksum.File = FvBufCalculateChecksum8 ( - (VOID*)(File + 1), - FileSize - sizeof (EFI_FFS_FILE_HEADER) + (VOID*)((UINT8 *)File + FvBufGetFfsHeaderSize (File)), + FileSize - FvBufGetFfsHeaderSize (File) ); } else { File->IntegrityCheck.Checksum.File = FFS_FIXED_CHECKSUM; @@ -568,7 +599,7 @@ } FvbAttributes = hdr->Attributes; - newSize = FvBufExpand3ByteSize (((EFI_FFS_FILE_HEADER*)File)->Size); + newSize = FvBufGetFfsFileSize ((EFI_FFS_FILE_HEADER*)File); for( offset = (UINTN)ALIGN_POINTER (hdr->HeaderLength, 8); @@ -587,7 +618,7 @@ // BUGBUG: Need to make sure that the new file does not already // exist. - fsize = FvBufExpand3ByteSize (fhdr->Size); + fsize = FvBufGetFfsFileSize (fhdr); if (fsize == 0 || (offset + fsize > fvSize)) { return EFI_VOLUME_CORRUPTED; } @@ -725,7 +756,7 @@ } erasedUint8 = (UINT8)((hdr->Attributes & EFI_FVB2_ERASE_POLARITY) ? 0xFF : 0); - NewFileSize = FvBufExpand3ByteSize (((EFI_FFS_FILE_HEADER*)File)->Size); + NewFileSize = FvBufGetFfsFileSize ((EFI_FFS_FILE_HEADER*)File); if (NewFileSize != (UINTN)ALIGN_POINTER (NewFileSize, 8)) { return EFI_INVALID_PARAMETER; @@ -739,7 +770,7 @@ LastFileSize = 0; do { Status = FvBufFindNextFile (Fv, &Key, (VOID **)&LastFile); - LastFileSize = FvBufExpand3ByteSize (((EFI_FFS_FILE_HEADER*)File)->Size); + LastFileSize = FvBufGetFfsFileSize ((EFI_FFS_FILE_HEADER*)File); } while (!EFI_ERROR (Status)); // @@ -812,6 +843,64 @@ } UINT32 +FvBufGetFfsFileSize ( + IN EFI_FFS_FILE_HEADER *Ffs + ) +/*++ + +Routine Description: + + Get the FFS file size. + +Arguments: + + Ffs - Pointer to FFS header + +Returns: + + UINT32 + +--*/ +{ + if (Ffs == NULL) { + return 0; + } + if (Ffs->Attributes & FFS_ATTRIB_LARGE_FILE) { + return ((EFI_FFS_FILE_HEADER2 *)Ffs)->ExtendedSize; + } + return FvBufExpand3ByteSize(Ffs->Size); +} + +UINT32 +FvBufGetFfsHeaderSize ( + IN EFI_FFS_FILE_HEADER *Ffs + ) +/*++ + +Routine Description: + + Get the FFS header size. + +Arguments: + + Ffs - Pointer to FFS header + +Returns: + + UINT32 + +--*/ +{ + if (Ffs == NULL) { + return 0; + } + if (Ffs->Attributes & FFS_ATTRIB_LARGE_FILE) { + return sizeof(EFI_FFS_FILE_HEADER2); + } + return sizeof(EFI_FFS_FILE_HEADER); +} + +UINT32 FvBufExpand3ByteSize ( IN VOID* Size ) @@ -897,7 +986,7 @@ ) { fhdr = (EFI_FFS_FILE_HEADER*) ((UINT8*)hdr + *Key); - fsize = FvBufExpand3ByteSize (fhdr->Size); + fsize = FvBufGetFfsFileSize (fhdr); if (!EFI_TEST_FFS_ATTRIBUTES_BIT( FvbAttributes, @@ -1089,8 +1178,8 @@ // // Raw filetypes don't have sections, so we just return the raw data // - *RawData = (VOID*)(File + 1); - *RawDataSize = FvBufExpand3ByteSize (File->Size) - sizeof (*File); + *RawData = (VOID*)((UINT8 *)File + FvBufGetFfsHeaderSize (File)); + *RawDataSize = FvBufGetFfsFileSize (File) - FvBufGetFfsHeaderSize (File); return EFI_SUCCESS; } @@ -1102,9 +1191,9 @@ return Status; } - *RawData = (VOID*)(Section + 1); + *RawData = (VOID*)((UINT8 *)Section + FvBufGetSecHdrLen(Section)); *RawDataSize = - FvBufExpand3ByteSize (Section->Size) - sizeof (*Section); + FvBufGetSecFileLen (Section) - FvBufGetSecHdrLen(Section); return EFI_SUCCESS; @@ -1144,16 +1233,28 @@ UINT32 NewFileSize; EFI_RAW_SECTION* NewSection; UINT32 NewSectionSize; + UINT32 FfsHdrLen; + UINT32 SecHdrLen; // // The section size is the DataSize + the size of the section header // NewSectionSize = (UINT32)sizeof (EFI_RAW_SECTION) + (UINT32)RawDataSize; + SecHdrLen = sizeof (EFI_RAW_SECTION); + if (NewSectionSize >= MAX_SECTION_SIZE) { + NewSectionSize = (UINT32)sizeof (EFI_RAW_SECTION2) + (UINT32)RawDataSize; + SecHdrLen = sizeof (EFI_RAW_SECTION2); + } // // The file size is the size of the file header + the section size // NewFileSize = sizeof (EFI_FFS_FILE_HEADER) + NewSectionSize; + FfsHdrLen = sizeof (EFI_FFS_FILE_HEADER); + if (NewFileSize >= MAX_FFS_SIZE) { + NewFileSize = sizeof (EFI_FFS_FILE_HEADER2) + NewSectionSize; + FfsHdrLen = sizeof (EFI_FFS_FILE_HEADER2); + } // // Try to allocate a buffer to build the new FFS file in @@ -1167,24 +1268,35 @@ // // The NewSection follow right after the FFS file header // - NewSection = (EFI_RAW_SECTION*)(NewFile + 1); - FvBufCompact3ByteSize (NewSection->Size, NewSectionSize); + NewSection = (EFI_RAW_SECTION*)((UINT8*)NewFile + FfsHdrLen); + if (NewSectionSize >= MAX_SECTION_SIZE) { + FvBufCompact3ByteSize (NewSection->Size, 0xffffff); + ((EFI_RAW_SECTION2 *)NewSection)->ExtendedSize = NewSectionSize; + } else { + FvBufCompact3ByteSize (NewSection->Size, NewSectionSize); + } NewSection->Type = EFI_SECTION_RAW; // // Copy the actual file data into the buffer // - CommonLibBinderCopyMem (NewSection + 1, RawData, RawDataSize); + CommonLibBinderCopyMem ((UINT8 *)NewSection + SecHdrLen, RawData, RawDataSize); // // Initialize the FFS file header // CommonLibBinderCopyMem (&NewFile->Name, Filename, sizeof (EFI_GUID)); - FvBufCompact3ByteSize (NewFile->Size, NewFileSize); + NewFile->Attributes = 0; + if (NewFileSize >= MAX_FFS_SIZE) { + FvBufCompact3ByteSize (NewFile->Size, 0x0); + ((EFI_FFS_FILE_HEADER2 *)NewFile)->ExtendedSize = NewFileSize; + NewFile->Attributes |= FFS_ATTRIB_LARGE_FILE; + } else { + FvBufCompact3ByteSize (NewFile->Size, NewFileSize); + } NewFile->Type = EFI_FV_FILETYPE_FREEFORM; - NewFile->Attributes = 0; NewFile->IntegrityCheck.Checksum.Header = - FvBufCalculateChecksum8 ((UINT8*)NewFile, sizeof (*NewFile)); + FvBufCalculateChecksum8 ((UINT8*)NewFile, FfsHdrLen); NewFile->IntegrityCheck.Checksum.File = FFS_FIXED_CHECKSUM; NewFile->State = (UINT8)~( EFI_FILE_HEADER_CONSTRUCTION | EFI_FILE_HEADER_VALID | @@ -1239,7 +1351,7 @@ } sectionHdr = (EFI_COMMON_SECTION_HEADER*)((UINT8*)SectionsStart + *Key); - sectionSize = FvBufExpand3ByteSize (sectionHdr->Size); + sectionSize = FvBufGetSecFileLen (sectionHdr); if (sectionSize < sizeof (EFI_COMMON_SECTION_HEADER)) { return EFI_NOT_FOUND; @@ -1287,10 +1399,10 @@ UINTN TotalSectionsSize; EFI_COMMON_SECTION_HEADER* NextSection; - SectionStart = (VOID*)((UINTN)FfsFile + sizeof (EFI_FFS_FILE_HEADER)); + SectionStart = (VOID*)((UINTN)FfsFile + FvBufGetFfsHeaderSize(FfsFile)); TotalSectionsSize = - FvBufExpand3ByteSize (((EFI_FFS_FILE_HEADER*)FfsFile)->Size) - - sizeof (EFI_FFS_FILE_HEADER); + FvBufGetFfsFileSize ((EFI_FFS_FILE_HEADER*)FfsFile) - + FvBufGetFfsHeaderSize(FfsFile); Key = 0; *Count = 0; while (TRUE) { @@ -1352,10 +1464,10 @@ UINTN TotalSectionsSize; EFI_COMMON_SECTION_HEADER* NextSection; - SectionStart = (VOID*)((UINTN)FfsFile + sizeof (EFI_FFS_FILE_HEADER)); + SectionStart = (VOID*)((UINTN)FfsFile + FvBufGetFfsHeaderSize(FfsFile)); TotalSectionsSize = - FvBufExpand3ByteSize (((EFI_FFS_FILE_HEADER*)FfsFile)->Size) - - sizeof (EFI_FFS_FILE_HEADER); + FvBufGetFfsFileSize ((EFI_FFS_FILE_HEADER*)FfsFile) - + FvBufGetFfsHeaderSize(FfsFile); Key = 0; while (TRUE) { Status = FvBufFindNextSection ( @@ -1436,7 +1548,7 @@ EndOfLastFile = (UINT8*)FvHdr + FvHdr->FvLength; while (!EFI_ERROR (FvBufFindNextFile (Fv, &Key, (VOID **)&FileIt))) { EndOfLastFile = - (VOID*)((UINT8*)FileIt + FvBufExpand3ByteSize (FileIt->Size)); + (VOID*)((UINT8*)FileIt + FvBufGetFfsFileSize (FileIt)); } // Modified: trunk/BaseTools/Source/C/Common/FirmwareVolumeBufferLib.h =================================================================== --- trunk/BaseTools/Source/C/Common/FirmwareVolumeBufferLib.h 2014-01-24 00:48:22 UTC (rev 2649) +++ trunk/BaseTools/Source/C/Common/FirmwareVolumeBufferLib.h 2014-02-20 08:55:36 UTC (rev 2650) @@ -1,6 +1,6 @@ /** @file -Copyright (c) 1999 - 2008, Intel Corporation. All rights reserved.<BR> +Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -82,6 +82,16 @@ IN VOID* Size ); +UINT32 +FvBufGetFfsFileSize ( + IN EFI_FFS_FILE_HEADER *Ffs + ); + +UINT32 +FvBufGetFfsHeaderSize ( + IN EFI_FFS_FILE_HEADER *Ffs + ); + EFI_STATUS FvBufExtend ( IN VOID **Fv, Modified: trunk/BaseTools/Source/C/VolInfo/VolInfo.c =================================================================== --- trunk/BaseTools/Source/C/VolInfo/VolInfo.c 2014-01-24 00:48:22 UTC (rev 2649) +++ trunk/BaseTools/Source/C/VolInfo/VolInfo.c 2014-02-20 08:55:36 UTC (rev 2650) @@ -1,6 +1,6 @@ /** @file -Copyright (c) 1999 - 2011, Intel Corporation. All rights reserved.<BR> +Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -975,22 +975,24 @@ UINT32 FileLength; UINT8 FileState; UINT8 Checksum; - EFI_FFS_FILE_HEADER BlankHeader; + EFI_FFS_FILE_HEADER2 BlankHeader; EFI_STATUS Status; UINT8 GuidBuffer[PRINTED_GUID_BUFFER_SIZE]; + UINT32 HeaderSize; #if (PI_SPECIFICATION_VERSION < 0x00010000) UINT16 *Tail; #endif // // Check if we have free space // + HeaderSize = FvBufGetFfsHeaderSize(FileHeader); if (ErasePolarity) { - memset (&BlankHeader, -1, sizeof (EFI_FFS_FILE_HEADER)); + memset (&BlankHeader, -1, HeaderSize); } else { - memset (&BlankHeader, 0, sizeof (EFI_FFS_FILE_HEADER)); + memset (&BlankHeader, 0, HeaderSize); } - if (memcmp (&BlankHeader, FileHeader, sizeof (EFI_FFS_FILE_HEADER)) == 0) { + if (memcmp (&BlankHeader, FileHeader, HeaderSize) == 0) { return EFI_SUCCESS; } // @@ -1008,7 +1010,7 @@ // PrintGuid (&FileHeader->Name); // printf ("\n"); // - FileLength = GetLength (FileHeader->Size); + FileLength = FvBufGetFfsFileSize (FileHeader); printf ("File Offset: 0x%08X\n", (unsigned) ((UINTN) FileHeader - (UINTN) FvImage)); printf ("File Length: 0x%08X\n", (unsigned) FileLength); printf ("File Attributes: 0x%02X\n", FileHeader->Attributes); @@ -1031,7 +1033,7 @@ case EFI_FILE_HEADER_VALID: printf (" EFI_FILE_HEADER_VALID\n"); - Checksum = CalculateSum8 ((UINT8 *) FileHeader, sizeof (EFI_FFS_FILE_HEADER)); + Checksum = CalculateSum8 ((UINT8 *) FileHeader, HeaderSize); Checksum = (UINT8) (Checksum - FileHeader->IntegrityCheck.Checksum.File); Checksum = (UINT8) (Checksum - FileHeader->State); if (Checksum != 0) { @@ -1053,7 +1055,7 @@ // // Calculate header checksum // - Checksum = CalculateSum8 ((UINT8 *) FileHeader, sizeof (EFI_FFS_FILE_HEADER)); + Checksum = CalculateSum8 ((UINT8 *) FileHeader, HeaderSize); Checksum = (UINT8) (Checksum - FileHeader->IntegrityCheck.Checksum.File); Checksum = (UINT8) (Checksum - FileHeader->State); if (Checksum != 0) { @@ -1061,13 +1063,13 @@ return EFI_ABORTED; } - FileLength = GetLength (FileHeader->Size); + FileLength = FvBufGetFfsFileSize (FileHeader); if (FileHeader->Attributes & FFS_ATTRIB_CHECKSUM) { // // Calculate file checksum // - Checksum = CalculateSum8 ((UINT8 *) (FileHeader + 1), FileLength - sizeof (EFI_FFS_FILE_HEADER)); + Checksum = CalculateSum8 ((UINT8 *)FileHeader + HeaderSize, FileLength - HeaderSize); Checksum = Checksum + FileHeader->IntegrityCheck.Checksum.File; if (Checksum != 0) { Error (NULL, 0, 0003, "error parsing FFS file", "FFS file with Guid %s has invalid file checksum", GuidBuffer); @@ -1180,8 +1182,8 @@ // All other files have sections // Status = ParseSection ( - (UINT8 *) ((UINTN) FileHeader + sizeof (EFI_FFS_FILE_HEADER)), - GetLength (FileHeader->Size) - sizeof (EFI_FFS_FILE_HEADER) + (UINT8 *) ((UINTN) FileHeader + HeaderSize), + FvBufGetFfsFileSize (FileHeader) - HeaderSize ); if (EFI_ERROR (Status)) { // @@ -1225,6 +1227,7 @@ EFI_SECTION_TYPE Type; UINT8 *Ptr; UINT32 SectionLength; + UINT32 SectionHeaderLen; CHAR8 *SectionName; EFI_STATUS Status; UINT32 ParsedLength; @@ -1246,6 +1249,10 @@ CHAR8 *ToolOutputFile; CHAR8 *SystemCommandFormatString; CHAR8 *SystemCommand; + EFI_GUID *EfiGuid; + UINT16 DataOffset; + UINT16 Attributes; + UINT32 RealHdrLen; ParsedLength = 0; while (ParsedLength < BufferLength) { @@ -1264,6 +1271,12 @@ continue; } + // + // Get real section file size + // + SectionLength = GetSectionFileLength ((EFI_COMMON_SECTION_HEADER *) Ptr); + SectionHeaderLen = GetSectionHeaderLength((EFI_COMMON_SECTION_HEADER *)Ptr); + SectionName = SectionNameToStr (Type); printf ("------------------------------------------------------------\n"); printf (" Type: %s\n Size: 0x%08X\n", SectionName, (unsigned) SectionLength); @@ -1283,7 +1296,7 @@ break; case EFI_SECTION_FIRMWARE_VOLUME_IMAGE: - Status = PrintFvInfo (((EFI_FIRMWARE_VOLUME_IMAGE_SECTION*)Ptr) + 1, TRUE); + Status = PrintFvInfo (Ptr + SectionHeaderLen, TRUE); if (EFI_ERROR (Status)) { Error (NULL, 0, 0003, "printing of FV section contents failed", NULL); return EFI_SECTION_ERROR; @@ -1304,15 +1317,22 @@ break; case EFI_SECTION_VERSION: - printf (" Build Number: 0x%02X\n", ((EFI_VERSION_SECTION *) Ptr)->BuildNumber); - printf (" Version Strg: %s\n", (char*) ((EFI_VERSION_SECTION *) Ptr)->VersionString); + printf (" Build Number: 0x%02X\n", *(UINT16 *)(Ptr + SectionHeaderLen)); + printf (" Version Strg: %s\n", (char*) (Ptr + SectionHeaderLen + sizeof (UINT16))); break; case EFI_SECTION_COMPRESSION: UncompressedBuffer = NULL; - CompressedLength = SectionLength - sizeof (EFI_COMPRESSION_SECTION); - UncompressedLength = ((EFI_COMPRESSION_SECTION *) Ptr)->UncompressedLength; - CompressionType = ((EFI_COMPRESSION_SECTION *) Ptr)->CompressionType; + if (SectionHeaderLen == sizeof (EFI_COMMON_SECTION_HEADER)) { + RealHdrLen = sizeof(EFI_COMPRESSION_SECTION); + UncompressedLength = ((EFI_COMPRESSION_SECTION *)Ptr)->UncompressedLength; + CompressionType = ((EFI_COMPRESSION_SECTION *)Ptr)->CompressionType; + } else { + RealHdrLen = sizeof(EFI_COMPRESSION_SECTION2); + UncompressedLength = ((EFI_COMPRESSION_SECTION2 *)Ptr)->UncompressedLength; + CompressionType = ((EFI_COMPRESSION_SECTION2 *)Ptr)->CompressionType; + } + CompressedLength = SectionLength - RealHdrLen; printf (" Uncompressed Length: 0x%08X\n", (unsigned) UncompressedLength); if (CompressionType == EFI_NOT_COMPRESSED) { @@ -1328,13 +1348,13 @@ return EFI_SECTION_ERROR; } - UncompressedBuffer = Ptr + sizeof (EFI_COMPRESSION_SECTION); + UncompressedBuffer = Ptr + RealHdrLen; } else if (CompressionType == EFI_STANDARD_COMPRESSION) { GetInfoFunction = EfiGetInfo; DecompressFunction = EfiDecompress; printf (" Compression Type: EFI_STANDARD_COMPRESSION\n"); - CompressedBuffer = Ptr + sizeof (EFI_COMPRESSION_SECTION); + CompressedBuffer = Ptr + RealHdrLen; Status = GetInfoFunction (CompressedBuffer, CompressedLength, &DstSize, &ScratchSize); if (EFI_ERROR (Status)) { @@ -1387,16 +1407,25 @@ break; case EFI_SECTION_GUID_DEFINED: + if (SectionHeaderLen == sizeof(EFI_COMMON_SECTION_HEADER)) { + EfiGuid = &((EFI_GUID_DEFINED_SECTION *) Ptr)->SectionDefinitionGuid; + DataOffset = ((EFI_GUID_DEFINED_SECTION *) Ptr)->DataOffset; + Attributes = ((EFI_GUID_DEFINED_SECTION *) Ptr)->Attributes; + } else { + EfiGuid = &((EFI_GUID_DEFINED_SECTION2 *) Ptr)->SectionDefinitionGuid; + DataOffset = ((EFI_GUID_DEFINED_SECTION2 *) Ptr)->DataOffset; + Attributes = ((EFI_GUID_DEFINED_SECTION2 *) Ptr)->Attributes; + } printf (" SectionDefinitionGuid: "); - PrintGuid (&((EFI_GUID_DEFINED_SECTION *) Ptr)->SectionDefinitionGuid); + PrintGuid (EfiGuid); printf ("\n"); - printf (" DataOffset: 0x%04X\n", (unsigned) ((EFI_GUID_DEFINED_SECTION *) Ptr)->DataOffset); - printf (" Attributes: 0x%04X\n", (unsigned) ((EFI_GUID_DEFINED_SECTION *) Ptr)->Attributes); + printf (" DataOffset: 0x%04X\n", (unsigned) DataOffset); + printf (" Attributes: 0x%04X\n", (unsigned) Attributes); ExtractionTool = LookupGuidedSectionToolPath ( mParsedGuidedSectionTools, - &((EFI_GUID_DEFINED_SECTION *) Ptr)->SectionDefinitionGuid + EfiGuid ); if (ExtractionTool != NULL) { @@ -1427,8 +1456,8 @@ Status = PutFileImage ( ToolInputFile, - (CHAR8*) SectionBuffer + ((EFI_GUID_DEFINED_SECTION *) Ptr)->DataOffset, - BufferLength - ((EFI_GUID_DEFINED_SECTION *) Ptr)->DataOffset + (CHAR8*) SectionBuffer + DataOffset, + BufferLength - DataOffset ); system (SystemCommand); @@ -1461,7 +1490,7 @@ // Check for CRC32 sections which we can handle internally if needed. // } else if (!CompareGuid ( - &((EFI_GUID_DEFINED_SECTION *) Ptr)->SectionDefinitionGuid, + EfiGuid, &gEfiCrc32GuidedSectionExtractionProtocolGuid ) ) { @@ -1469,8 +1498,8 @@ // CRC32 guided section // Status = ParseSection ( - SectionBuffer + ((EFI_GUID_DEFINED_SECTION *) Ptr)->DataOffset, - BufferLength - ((EFI_GUID_DEFINED_SECTION *) Ptr)->DataOffset + SectionBuffer + DataOffset, + BufferLength - DataOffset ); if (EFI_ERROR (Status)) { Error (NULL, 0, 0003, "parse of CRC32 GUIDED section failed", NULL); @@ -1540,8 +1569,8 @@ return EFI_SUCCESS; } - Ptr += sizeof (EFI_COMMON_SECTION_HEADER); - SectionLength -= sizeof (EFI_COMMON_SECTION_HEADER); + Ptr += GetSectionHeaderLength((EFI_COMMON_SECTION_HEADER *)Ptr); + SectionLength -= GetSectionHeaderLength((EFI_COMMON_SECTION_HEADER *)Ptr); while (SectionLength > 0) { printf (" "); switch (*Ptr) { @@ -1809,7 +1838,7 @@ // // Copyright declaration // - fprintf (stdout, "Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.\n\n"); + fprintf (stdout, "Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.\n\n"); // // Details Option This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hh...@us...> - 2014-01-24 00:48:27
|
Revision: 2649 http://sourceforge.net/p/edk2-buildtools/code/2649 Author: hhtian Date: 2014-01-24 00:48:22 +0000 (Fri, 24 Jan 2014) Log Message: ----------- Rollback the CRLF format change as this py file has executable attribute set. On BSD?\226?\128?\153ish Unix systems, Python scripts can be made directly executable, like shell scripts (...) On some platforms, this first line must end with a Unix-style line ending ('\n'), not a Windows ('\r\n') line ending. Signed-off-by: Tian, Hot <hot...@in...> Modified Paths: -------------- trunk/BaseTools/gcc/mingw-gcc-build.py Modified: trunk/BaseTools/gcc/mingw-gcc-build.py =================================================================== --- trunk/BaseTools/gcc/mingw-gcc-build.py 2014-01-23 05:00:23 UTC (rev 2648) +++ trunk/BaseTools/gcc/mingw-gcc-build.py 2014-01-24 00:48:22 UTC (rev 2649) @@ -1,564 +1,564 @@ -#!/usr/bin/env python - -## @file -# -# Automation of instructions from: -# http://mingw-w64.svn.sourceforge.net/viewvc/mingw-w64/trunk/mingw-w64-doc/ -# howto-build/mingw-w64-howto-build.txt?revision=216&view=markup -# -# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# - - -from optparse import OptionParser -import os -import shutil -import subprocess -import sys -import tarfile -import urllib -import urlparse -try: - from hashlib import md5 -except Exception: - from md5 import md5 - -if sys.version_info < (2, 5): - # - # This script (and edk2 BaseTools) require Python 2.5 or newer - # - print 'Python version 2.5 or later is required.' - sys.exit(-1) - -# -# Version and Copyright -# -VersionNumber = "0.01" -__version__ = "%prog Version " + VersionNumber -__copyright__ = "Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved." - -class Config: - """class Config - - Stores the configuration options for the rest of the script. - - Handles the command line options, and allows the code within - the script to easily interact with the 'config' requested by - the user. - """ - - def __init__(self): - self.base_dir = os.getcwd() - (self.options, self.args) = self.CheckOptions() - self.__init_dirs__() - - def CheckOptions(self): - Parser = \ - OptionParser( - description=__copyright__, - version=__version__, - prog="mingw-gcc-build", - usage="%prog [options] [target]" - ) - Parser.add_option( - "--arch", - action = "store", type = "string", - default = '', - dest = "arch", - help = "Processor architecture to build gcc for." - ) - Parser.add_option( - "--src-dir", - action = "store", type = "string", dest = "src_dir", - default = os.path.join(self.base_dir, 'src'), - help = "Directory to download/extract binutils/gcc sources" - ) - Parser.add_option( - "--build-dir", - action = "store", type = "string", dest = "build_dir", - default = os.path.join(self.base_dir, 'build'), - help = "Directory to download/extract binutils/gcc sources" - ) - Parser.add_option( - "--prefix", - action = "store", type = "string", dest = "prefix", - default = os.path.join(self.base_dir, 'install'), - help = "Prefix to install binutils/gcc into" - ) - Parser.add_option( - "--skip-binutils", - action = "store_true", dest = "skip_binutils", - default = False, - help = "Will skip building binutils" - ) - Parser.add_option( - "--skip-gcc", - action = "store_true", dest = "skip_gcc", - default = False, - help = "Will skip building GCC" - ) - Parser.add_option( - "--symlinks", - action = "store", type = "string", dest = "symlinks", - default = os.path.join(self.base_dir, 'symlinks'), - help = "Directory to create binutils/gcc symbolic links into." - ) - Parser.add_option( - "-v", "--verbose", - action="store_true", - type=None, help="Print verbose messages" - ) - - (Opt, Args) = Parser.parse_args() - - self.arch = Opt.arch.lower() - allowedArchs = ('ia32', 'x64', 'ipf') - if self.arch not in allowedArchs: - Parser.error( - 'Please use --arch to specify one of: %s' % - ', '.join(allowedArchs) - ) - self.target_arch = {'ia32': 'i686', 'x64': 'x86_64', 'ipf': 'ia64'}[self.arch] - self.target_sys = {'ia32': 'pc', 'x64': 'pc', 'ipf': 'pc'}[self.arch] - self.target_bin = {'ia32': 'mingw32', 'x64': 'mingw32', 'ipf': 'elf'}[self.arch] - self.target_combo = '-'.join((self.target_arch, self.target_sys, self.target_bin)) - - return (Opt, Args) - - def __init_dirs__(self): - self.src_dir = os.path.realpath(os.path.expanduser(self.options.src_dir)) - self.build_dir = os.path.realpath(os.path.expanduser(self.options.build_dir)) - self.prefix = os.path.realpath(os.path.expanduser(self.options.prefix)) - self.symlinks = os.path.realpath(os.path.expanduser(self.options.symlinks)) - - def IsConfigOk(self): - - building = [] - if not self.options.skip_binutils: - building.append('binutils') - if not self.options.skip_gcc: - building.append('gcc') - if len(building) == 0: - print "Nothing will be built!" - print - print "Please try using --help and then change the configuration." - return False - - print "Current directory:" - print " ", self.base_dir - print "Sources download/extraction:", self.Relative(self.src_dir) - print "Build directory :", self.Relative(self.build_dir) - print "Prefix (install) directory :", self.Relative(self.prefix) - print "Create symlinks directory :", self.Relative(self.symlinks) - print "Building :", ', '.join(building) - print - answer = raw_input("Is this configuration ok? (default = no): ") - if (answer.lower() not in ('y', 'yes')): - print - print "Please try using --help and then change the configuration." - return False - - if self.arch.lower() == 'ipf': - print - print 'Please note that the IPF compiler built by this script has' - print 'not yet been validated!' - print - answer = raw_input("Are you sure you want to build it? (default = no): ") - if (answer.lower() not in ('y', 'yes')): - print - print "Please try using --help and then change the configuration." - return False - - print - return True - - def Relative(self, path): - if path.startswith(self.base_dir): - return '.' + path[len(self.base_dir):] - return path - - def MakeDirs(self): - for path in (self.src_dir, self.build_dir,self.prefix, self.symlinks): - if not os.path.exists(path): - os.makedirs(path) - -class SourceFiles: - """class SourceFiles - - Handles the downloading of source files used by the script. - """ - - def __init__(self, config): - self.config = config - self.source_files = self.source_files[config.arch] - - if config.options.skip_binutils: - del self.source_files['binutils'] - - if config.options.skip_gcc: - del self.source_files['gcc'] - del self.source_files['mingw_hdr'] - - source_files_common = { - 'binutils': { - 'url': 'http://www.kernel.org/pub/linux/devel/binutils/' + \ - 'binutils-$version.tar.bz2', - 'version': '2.20.51.0.5', - 'md5': '6d2de7cdf7a8389e70b124e3d73b4d37', - }, - } - - source_files_x64 = { - 'gcc': { - 'url': 'http://ftpmirror.gnu.org/gcc/' + \ - 'gcc-$version/gcc-$version.tar.bz2', - 'version': '4.3.0', - 'md5': '197ed8468b38db1d3481c3111691d85b', - }, - } - - source_files_ia32 = { - 'gcc': source_files_x64['gcc'], - } - - source_files_ipf = source_files_x64.copy() - source_files_ipf['gcc']['configure-params'] = ( - '--with-gnu-as', '--with-gnu-ld', '--with-newlib', - '--verbose', '--disable-libssp', '--disable-nls', - '--enable-languages=c,c++' - ) - - source_files = { - 'ia32': [source_files_common, source_files_ia32], - 'x64': [source_files_common, source_files_x64], - 'ipf': [source_files_common, source_files_ipf], - } - - for arch in source_files: - mergedSourceFiles = {} - for source_files_dict in source_files[arch]: - mergedSourceFiles.update(source_files_dict) - for downloadItem in mergedSourceFiles: - fdata = mergedSourceFiles[downloadItem] - fdata['filename'] = fdata['url'].split('/')[-1] - if 'extract-dir' not in fdata: - for ext in ('.tar.gz', '.tar.bz2', '.zip'): - if fdata['filename'].endswith(ext): - fdata['extract-dir'] = fdata['filename'][:-len(ext)] - break - replaceables = ('extract-dir', 'filename', 'url') - for replaceItem in fdata: - if replaceItem in replaceables: continue - if type(fdata[replaceItem]) != str: continue - for replaceable in replaceables: - if type(fdata[replaceable]) != str: continue - if replaceable in fdata: - fdata[replaceable] = \ - fdata[replaceable].replace( - '$' + replaceItem, - fdata[replaceItem] - ) - source_files[arch] = mergedSourceFiles - #print 'source_files:', source_files - - def GetAll(self): - - def progress(received, blockSize, fileSize): - if fileSize < 0: return - wDots = (100 * received * blockSize) / fileSize / 10 - if wDots > self.dots: - for i in range(wDots - self.dots): - print '.', - sys.stdout.flush() - self.dots += 1 - - maxRetries = 1 - for (fname, fdata) in self.source_files.items(): - for retries in range(maxRetries): - try: - self.dots = 0 - local_file = os.path.join(self.config.src_dir, fdata['filename']) - url = fdata['url'] - print 'Downloading %s:' % fname, url - if retries > 0: - print '(retry)', - sys.stdout.flush() - - completed = False - if os.path.exists(local_file): - md5_pass = self.checkHash(fdata) - if md5_pass: - print '[md5 match]', - else: - print '[md5 mismatch]', - sys.stdout.flush() - completed = md5_pass - - if not completed: - urllib.urlretrieve(url, local_file, progress) - - # - # BUGBUG: Suggest proxy to user if download fails. - # - # export http_proxy=http://proxyservername.mycompany.com:911 - # export ftp_proxy=http://proxyservername.mycompany.com:911 - - if not completed and os.path.exists(local_file): - md5_pass = self.checkHash(fdata) - if md5_pass: - print '[md5 match]', - else: - print '[md5 mismatch]', - sys.stdout.flush() - completed = md5_pass - - if completed: - print '[done]' - break - else: - print '[failed]' - print ' Tried to retrieve', url - print ' to', local_file - print 'Possible fixes:' - print '* If you are behind a web-proxy, try setting the', - print 'http_proxy environment variable' - print '* You can try to download this file separately', - print 'and rerun this script' - raise Exception() - - except KeyboardInterrupt: - print '[KeyboardInterrupt]' - return False - - except Exception, e: - print e - - if not completed: return False - - return True - - def checkHash(self, fdata): - local_file = os.path.join(self.config.src_dir, fdata['filename']) - expect_md5 = fdata['md5'] - data = open(local_file).read() - md5sum = md5() - md5sum.update(data) - return md5sum.hexdigest().lower() == expect_md5.lower() - - def GetModules(self): - return self.source_files.keys() - - def GetFilenameOf(self, module): - return self.source_files[module]['filename'] - - def GetMd5Of(self, module): - return self.source_files[module]['md5'] - - def GetExtractDirOf(self, module): - return self.source_files[module]['extract-dir'] - - def GetAdditionalParameters(self, module, step): - key = step + '-params' - if key in self.source_files[module]: - return self.source_files[module][key] - else: - return tuple() - -class Extracter: - """class Extracter - - Handles the extraction of the source files from their downloaded - archive files. - """ - - def __init__(self, source_files, config): - self.source_files = source_files - self.config = config - - def Extract(self, module): - src = self.config.src_dir - extractDst = os.path.join(src, self.config.arch) - local_file = os.path.join(src, self.source_files.GetFilenameOf(module)) - moduleMd5 = self.source_files.GetMd5Of(module) - extracted = os.path.join(extractDst, os.path.split(local_file)[1] + '.extracted') - if not os.path.exists(extractDst): - os.mkdir(extractDst) - - extractedMd5 = None - if os.path.exists(extracted): - extractedMd5 = open(extracted).read() - - if extractedMd5 != moduleMd5: - print 'Extracting %s:' % self.config.Relative(local_file) - tar = tarfile.open(local_file) - tar.extractall(extractDst) - open(extracted, 'w').write(moduleMd5) - else: - pass - #print 'Previously extracted', self.config.Relative(local_file) - - def ExtractAll(self): - for module in self.source_files.GetModules(): - self.Extract(module) - -class Builder: - """class Builder - - Builds and installs the GCC tool suite. - """ - - def __init__(self, source_files, config): - self.source_files = source_files - self.config = config - - def Build(self): - if not self.config.options.skip_binutils: - self.BuildModule('binutils') - if not self.config.options.skip_gcc: - self.BuildModule('gcc') - self.MakeSymLinks() - - def IsBuildStepComplete(self, step): - return \ - os.path.exists( - os.path.join( - self.config.build_dir, self.config.arch, step + '.completed' - ) - ) - - def MarkBuildStepComplete(self, step): - open( - os.path.join( - self.config.build_dir, self.config.arch, step + '.completed' - ), - "w" - ).close() - - - def BuildModule(self, module): - base_dir = os.getcwd() - build_dir = os.path.join(self.config.build_dir, self.config.arch, module) - module_dir = self.source_files.GetExtractDirOf(module) - module_dir = os.path.realpath(os.path.join('src', self.config.arch, module_dir)) - configure = os.path.join(module_dir, 'configure') - prefix = self.config.prefix - if not os.path.exists(build_dir): - os.makedirs(build_dir) - os.chdir(build_dir) - - cmd = ( - configure, - '--target=%s' % self.config.target_combo, - '--prefix=' + prefix, - '--with-sysroot=' + prefix, - '--disable-werror', - ) - if os.path.exists('/opt/local/include/gmp.h'): - cmd += ('--with-gmp=/opt/local',) - if module == 'gcc': cmd += ('--oldincludedir=/opt/local/include',) - cmd += self.source_files.GetAdditionalParameters(module, 'configure') - self.RunCommand(cmd, module, 'config', skipable=True) - - cmd = ('make',) - if module == 'gcc': - cmd += ('all-gcc',) - self.RunCommand(cmd, module, 'build') - - cmd = ('make',) - if module == 'gcc': - cmd += ('install-gcc',) - else: - cmd += ('install',) - self.RunCommand(cmd, module, 'install') - - os.chdir(base_dir) - - print '%s module is now built and installed' % module - - def RunCommand(self, cmd, module, stage, skipable=False): - if skipable: - if self.IsBuildStepComplete('%s.%s' % (module, stage)): - return - - popen = lambda cmd: \ - subprocess.Popen( - cmd, - stdin=subprocess.PIPE, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT - ) - - print '%s [%s] ...' % (module, stage), - sys.stdout.flush() - p = popen(cmd) - output = p.stdout.read() - p.wait() - if p.returncode != 0: - print '[failed!]' - logFile = os.path.join(self.config.build_dir, 'log.txt') - f = open(logFile, "w") - f.write(output) - f.close() - raise Exception, 'Failed to %s %s\n' % (stage, module) + \ - 'See output log at %s' % self.config.Relative(logFile) - else: - print '[done]' - - if skipable: - self.MarkBuildStepComplete('%s.%s' % (module, stage)) - - def MakeSymLinks(self): - links_dir = os.path.join(self.config.symlinks, self.config.arch) - if not os.path.exists(links_dir): - os.makedirs(links_dir) - startPrinted = False - for link in ('ar', 'ld', 'gcc'): - src = os.path.join( - self.config.prefix, 'bin', self.config.target_combo + '-' + link - ) - linkdst = os.path.join(links_dir, link) - if not os.path.lexists(linkdst): - if not startPrinted: - print 'Making symlinks in %s:' % self.config.Relative(links_dir), - startPrinted = True - print link, - os.symlink(src, linkdst) - - if startPrinted: - print '[done]' - -class App: - """class App - - The main body of the application. - """ - - def __init__(self): - config = Config() - - if not config.IsConfigOk(): - return - - config.MakeDirs() - - sources = SourceFiles(config) - result = sources.GetAll() - if result: - print 'All files have been downloaded & verified' - else: - print 'An error occured while downloading a file' - return - - Extracter(sources, config).ExtractAll() - - Builder(sources, config).Build() - -App() - +#!/usr/bin/env python + +## @file +# +# Automation of instructions from: +# http://mingw-w64.svn.sourceforge.net/viewvc/mingw-w64/trunk/mingw-w64-doc/ +# howto-build/mingw-w64-howto-build.txt?revision=216&view=markup +# +# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR> +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# + + +from optparse import OptionParser +import os +import shutil +import subprocess +import sys +import tarfile +import urllib +import urlparse +try: + from hashlib import md5 +except Exception: + from md5 import md5 + +if sys.version_info < (2, 5): + # + # This script (and edk2 BaseTools) require Python 2.5 or newer + # + print 'Python version 2.5 or later is required.' + sys.exit(-1) + +# +# Version and Copyright +# +VersionNumber = "0.01" +__version__ = "%prog Version " + VersionNumber +__copyright__ = "Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved." + +class Config: + """class Config + + Stores the configuration options for the rest of the script. + + Handles the command line options, and allows the code within + the script to easily interact with the 'config' requested by + the user. + """ + + def __init__(self): + self.base_dir = os.getcwd() + (self.options, self.args) = self.CheckOptions() + self.__init_dirs__() + + def CheckOptions(self): + Parser = \ + OptionParser( + description=__copyright__, + version=__version__, + prog="mingw-gcc-build", + usage="%prog [options] [target]" + ) + Parser.add_option( + "--arch", + action = "store", type = "string", + default = '', + dest = "arch", + help = "Processor architecture to build gcc for." + ) + Parser.add_option( + "--src-dir", + action = "store", type = "string", dest = "src_dir", + default = os.path.join(self.base_dir, 'src'), + help = "Directory to download/extract binutils/gcc sources" + ) + Parser.add_option( + "--build-dir", + action = "store", type = "string", dest = "build_dir", + default = os.path.join(self.base_dir, 'build'), + help = "Directory to download/extract binutils/gcc sources" + ) + Parser.add_option( + "--prefix", + action = "store", type = "string", dest = "prefix", + default = os.path.join(self.base_dir, 'install'), + help = "Prefix to install binutils/gcc into" + ) + Parser.add_option( + "--skip-binutils", + action = "store_true", dest = "skip_binutils", + default = False, + help = "Will skip building binutils" + ) + Parser.add_option( + "--skip-gcc", + action = "store_true", dest = "skip_gcc", + default = False, + help = "Will skip building GCC" + ) + Parser.add_option( + "--symlinks", + action = "store", type = "string", dest = "symlinks", + default = os.path.join(self.base_dir, 'symlinks'), + help = "Directory to create binutils/gcc symbolic links into." + ) + Parser.add_option( + "-v", "--verbose", + action="store_true", + type=None, help="Print verbose messages" + ) + + (Opt, Args) = Parser.parse_args() + + self.arch = Opt.arch.lower() + allowedArchs = ('ia32', 'x64', 'ipf') + if self.arch not in allowedArchs: + Parser.error( + 'Please use --arch to specify one of: %s' % + ', '.join(allowedArchs) + ) + self.target_arch = {'ia32': 'i686', 'x64': 'x86_64', 'ipf': 'ia64'}[self.arch] + self.target_sys = {'ia32': 'pc', 'x64': 'pc', 'ipf': 'pc'}[self.arch] + self.target_bin = {'ia32': 'mingw32', 'x64': 'mingw32', 'ipf': 'elf'}[self.arch] + self.target_combo = '-'.join((self.target_arch, self.target_sys, self.target_bin)) + + return (Opt, Args) + + def __init_dirs__(self): + self.src_dir = os.path.realpath(os.path.expanduser(self.options.src_dir)) + self.build_dir = os.path.realpath(os.path.expanduser(self.options.build_dir)) + self.prefix = os.path.realpath(os.path.expanduser(self.options.prefix)) + self.symlinks = os.path.realpath(os.path.expanduser(self.options.symlinks)) + + def IsConfigOk(self): + + building = [] + if not self.options.skip_binutils: + building.append('binutils') + if not self.options.skip_gcc: + building.append('gcc') + if len(building) == 0: + print "Nothing will be built!" + print + print "Please try using --help and then change the configuration." + return False + + print "Current directory:" + print " ", self.base_dir + print "Sources download/extraction:", self.Relative(self.src_dir) + print "Build directory :", self.Relative(self.build_dir) + print "Prefix (install) directory :", self.Relative(self.prefix) + print "Create symlinks directory :", self.Relative(self.symlinks) + print "Building :", ', '.join(building) + print + answer = raw_input("Is this configuration ok? (default = no): ") + if (answer.lower() not in ('y', 'yes')): + print + print "Please try using --help and then change the configuration." + return False + + if self.arch.lower() == 'ipf': + print + print 'Please note that the IPF compiler built by this script has' + print 'not yet been validated!' + print + answer = raw_input("Are you sure you want to build it? (default = no): ") + if (answer.lower() not in ('y', 'yes')): + print + print "Please try using --help and then change the configuration." + return False + + print + return True + + def Relative(self, path): + if path.startswith(self.base_dir): + return '.' + path[len(self.base_dir):] + return path + + def MakeDirs(self): + for path in (self.src_dir, self.build_dir,self.prefix, self.symlinks): + if not os.path.exists(path): + os.makedirs(path) + +class SourceFiles: + """class SourceFiles + + Handles the downloading of source files used by the script. + """ + + def __init__(self, config): + self.config = config + self.source_files = self.source_files[config.arch] + + if config.options.skip_binutils: + del self.source_files['binutils'] + + if config.options.skip_gcc: + del self.source_files['gcc'] + del self.source_files['mingw_hdr'] + + source_files_common = { + 'binutils': { + 'url': 'http://www.kernel.org/pub/linux/devel/binutils/' + \ + 'binutils-$version.tar.bz2', + 'version': '2.20.51.0.5', + 'md5': '6d2de7cdf7a8389e70b124e3d73b4d37', + }, + } + + source_files_x64 = { + 'gcc': { + 'url': 'http://ftpmirror.gnu.org/gcc/' + \ + 'gcc-$version/gcc-$version.tar.bz2', + 'version': '4.3.0', + 'md5': '197ed8468b38db1d3481c3111691d85b', + }, + } + + source_files_ia32 = { + 'gcc': source_files_x64['gcc'], + } + + source_files_ipf = source_files_x64.copy() + source_files_ipf['gcc']['configure-params'] = ( + '--with-gnu-as', '--with-gnu-ld', '--with-newlib', + '--verbose', '--disable-libssp', '--disable-nls', + '--enable-languages=c,c++' + ) + + source_files = { + 'ia32': [source_files_common, source_files_ia32], + 'x64': [source_files_common, source_files_x64], + 'ipf': [source_files_common, source_files_ipf], + } + + for arch in source_files: + mergedSourceFiles = {} + for source_files_dict in source_files[arch]: + mergedSourceFiles.update(source_files_dict) + for downloadItem in mergedSourceFiles: + fdata = mergedSourceFiles[downloadItem] + fdata['filename'] = fdata['url'].split('/')[-1] + if 'extract-dir' not in fdata: + for ext in ('.tar.gz', '.tar.bz2', '.zip'): + if fdata['filename'].endswith(ext): + fdata['extract-dir'] = fdata['filename'][:-len(ext)] + break + replaceables = ('extract-dir', 'filename', 'url') + for replaceItem in fdata: + if replaceItem in replaceables: continue + if type(fdata[replaceItem]) != str: continue + for replaceable in replaceables: + if type(fdata[replaceable]) != str: continue + if replaceable in fdata: + fdata[replaceable] = \ + fdata[replaceable].replace( + '$' + replaceItem, + fdata[replaceItem] + ) + source_files[arch] = mergedSourceFiles + #print 'source_files:', source_files + + def GetAll(self): + + def progress(received, blockSize, fileSize): + if fileSize < 0: return + wDots = (100 * received * blockSize) / fileSize / 10 + if wDots > self.dots: + for i in range(wDots - self.dots): + print '.', + sys.stdout.flush() + self.dots += 1 + + maxRetries = 1 + for (fname, fdata) in self.source_files.items(): + for retries in range(maxRetries): + try: + self.dots = 0 + local_file = os.path.join(self.config.src_dir, fdata['filename']) + url = fdata['url'] + print 'Downloading %s:' % fname, url + if retries > 0: + print '(retry)', + sys.stdout.flush() + + completed = False + if os.path.exists(local_file): + md5_pass = self.checkHash(fdata) + if md5_pass: + print '[md5 match]', + else: + print '[md5 mismatch]', + sys.stdout.flush() + completed = md5_pass + + if not completed: + urllib.urlretrieve(url, local_file, progress) + + # + # BUGBUG: Suggest proxy to user if download fails. + # + # export http_proxy=http://proxyservername.mycompany.com:911 + # export ftp_proxy=http://proxyservername.mycompany.com:911 + + if not completed and os.path.exists(local_file): + md5_pass = self.checkHash(fdata) + if md5_pass: + print '[md5 match]', + else: + print '[md5 mismatch]', + sys.stdout.flush() + completed = md5_pass + + if completed: + print '[done]' + break + else: + print '[failed]' + print ' Tried to retrieve', url + print ' to', local_file + print 'Possible fixes:' + print '* If you are behind a web-proxy, try setting the', + print 'http_proxy environment variable' + print '* You can try to download this file separately', + print 'and rerun this script' + raise Exception() + + except KeyboardInterrupt: + print '[KeyboardInterrupt]' + return False + + except Exception, e: + print e + + if not completed: return False + + return True + + def checkHash(self, fdata): + local_file = os.path.join(self.config.src_dir, fdata['filename']) + expect_md5 = fdata['md5'] + data = open(local_file).read() + md5sum = md5() + md5sum.update(data) + return md5sum.hexdigest().lower() == expect_md5.lower() + + def GetModules(self): + return self.source_files.keys() + + def GetFilenameOf(self, module): + return self.source_files[module]['filename'] + + def GetMd5Of(self, module): + return self.source_files[module]['md5'] + + def GetExtractDirOf(self, module): + return self.source_files[module]['extract-dir'] + + def GetAdditionalParameters(self, module, step): + key = step + '-params' + if key in self.source_files[module]: + return self.source_files[module][key] + else: + return tuple() + +class Extracter: + """class Extracter + + Handles the extraction of the source files from their downloaded + archive files. + """ + + def __init__(self, source_files, config): + self.source_files = source_files + self.config = config + + def Extract(self, module): + src = self.config.src_dir + extractDst = os.path.join(src, self.config.arch) + local_file = os.path.join(src, self.source_files.GetFilenameOf(module)) + moduleMd5 = self.source_files.GetMd5Of(module) + extracted = os.path.join(extractDst, os.path.split(local_file)[1] + '.extracted') + if not os.path.exists(extractDst): + os.mkdir(extractDst) + + extractedMd5 = None + if os.path.exists(extracted): + extractedMd5 = open(extracted).read() + + if extractedMd5 != moduleMd5: + print 'Extracting %s:' % self.config.Relative(local_file) + tar = tarfile.open(local_file) + tar.extractall(extractDst) + open(extracted, 'w').write(moduleMd5) + else: + pass + #print 'Previously extracted', self.config.Relative(local_file) + + def ExtractAll(self): + for module in self.source_files.GetModules(): + self.Extract(module) + +class Builder: + """class Builder + + Builds and installs the GCC tool suite. + """ + + def __init__(self, source_files, config): + self.source_files = source_files + self.config = config + + def Build(self): + if not self.config.options.skip_binutils: + self.BuildModule('binutils') + if not self.config.options.skip_gcc: + self.BuildModule('gcc') + self.MakeSymLinks() + + def IsBuildStepComplete(self, step): + return \ + os.path.exists( + os.path.join( + self.config.build_dir, self.config.arch, step + '.completed' + ) + ) + + def MarkBuildStepComplete(self, step): + open( + os.path.join( + self.config.build_dir, self.config.arch, step + '.completed' + ), + "w" + ).close() + + + def BuildModule(self, module): + base_dir = os.getcwd() + build_dir = os.path.join(self.config.build_dir, self.config.arch, module) + module_dir = self.source_files.GetExtractDirOf(module) + module_dir = os.path.realpath(os.path.join('src', self.config.arch, module_dir)) + configure = os.path.join(module_dir, 'configure') + prefix = self.config.prefix + if not os.path.exists(build_dir): + os.makedirs(build_dir) + os.chdir(build_dir) + + cmd = ( + configure, + '--target=%s' % self.config.target_combo, + '--prefix=' + prefix, + '--with-sysroot=' + prefix, + '--disable-werror', + ) + if os.path.exists('/opt/local/include/gmp.h'): + cmd += ('--with-gmp=/opt/local',) + if module == 'gcc': cmd += ('--oldincludedir=/opt/local/include',) + cmd += self.source_files.GetAdditionalParameters(module, 'configure') + self.RunCommand(cmd, module, 'config', skipable=True) + + cmd = ('make',) + if module == 'gcc': + cmd += ('all-gcc',) + self.RunCommand(cmd, module, 'build') + + cmd = ('make',) + if module == 'gcc': + cmd += ('install-gcc',) + else: + cmd += ('install',) + self.RunCommand(cmd, module, 'install') + + os.chdir(base_dir) + + print '%s module is now built and installed' % module + + def RunCommand(self, cmd, module, stage, skipable=False): + if skipable: + if self.IsBuildStepComplete('%s.%s' % (module, stage)): + return + + popen = lambda cmd: \ + subprocess.Popen( + cmd, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT + ) + + print '%s [%s] ...' % (module, stage), + sys.stdout.flush() + p = popen(cmd) + output = p.stdout.read() + p.wait() + if p.returncode != 0: + print '[failed!]' + logFile = os.path.join(self.config.build_dir, 'log.txt') + f = open(logFile, "w") + f.write(output) + f.close() + raise Exception, 'Failed to %s %s\n' % (stage, module) + \ + 'See output log at %s' % self.config.Relative(logFile) + else: + print '[done]' + + if skipable: + self.MarkBuildStepComplete('%s.%s' % (module, stage)) + + def MakeSymLinks(self): + links_dir = os.path.join(self.config.symlinks, self.config.arch) + if not os.path.exists(links_dir): + os.makedirs(links_dir) + startPrinted = False + for link in ('ar', 'ld', 'gcc'): + src = os.path.join( + self.config.prefix, 'bin', self.config.target_combo + '-' + link + ) + linkdst = os.path.join(links_dir, link) + if not os.path.lexists(linkdst): + if not startPrinted: + print 'Making symlinks in %s:' % self.config.Relative(links_dir), + startPrinted = True + print link, + os.symlink(src, linkdst) + + if startPrinted: + print '[done]' + +class App: + """class App + + The main body of the application. + """ + + def __init__(self): + config = Config() + + if not config.IsConfigOk(): + return + + config.MakeDirs() + + sources = SourceFiles(config) + result = sources.GetAll() + if result: + print 'All files have been downloaded & verified' + else: + print 'An error occured while downloading a file' + return + + Extracter(sources, config).ExtractAll() + + Builder(sources, config).Build() + +App() + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hh...@us...> - 2014-01-23 05:00:30
|
Revision: 2648 http://sourceforge.net/p/edk2-buildtools/code/2648 Author: hhtian Date: 2014-01-23 05:00:23 +0000 (Thu, 23 Jan 2014) Log Message: ----------- Fix CRLF format Signed-off-by: Tian, Hot <hot...@in...> Modified Paths: -------------- trunk/BaseTools/Conf/XMLSchema/DistributionPackage.xsd trunk/BaseTools/Source/C/GNUmakefile trunk/BaseTools/Source/C/GenFw/Elf32Convert.c trunk/BaseTools/Source/C/GenFw/Elf32Convert.h trunk/BaseTools/Source/C/GenFw/Elf64Convert.c trunk/BaseTools/Source/C/GenFw/Elf64Convert.h trunk/BaseTools/Source/C/GenFw/ElfConvert.c trunk/BaseTools/Source/C/GenFw/ElfConvert.h trunk/BaseTools/Source/C/GenFw/GenFw.h trunk/BaseTools/Source/C/GenFw/elf32.h trunk/BaseTools/Source/C/GenFw/elf64.h trunk/BaseTools/Source/C/GenFw/elf_common.h trunk/BaseTools/Source/C/Include/Arm/ProcessorBind.h trunk/BaseTools/Source/C/Makefiles/NmakeSubdirs.bat trunk/BaseTools/Source/C/Makefiles/app.makefile trunk/BaseTools/Source/C/Makefiles/footer.makefile trunk/BaseTools/Source/C/Makefiles/ms.app trunk/BaseTools/Source/C/Makefiles/ms.common trunk/BaseTools/Source/C/Makefiles/ms.lib trunk/BaseTools/Source/C/Makefiles/ms.rule trunk/BaseTools/Source/C/PyEfiCompressor/Makefile trunk/BaseTools/Source/C/PyUtility/Makefile trunk/BaseTools/Source/C/VolInfo/VolInfo.c trunk/BaseTools/Source/C/VolInfo/VolInfo.h trunk/BaseTools/Source/Python/AutoGen/BuildEngine.py trunk/BaseTools/Source/Python/AutoGen/GenC.py trunk/BaseTools/Source/Python/AutoGen/GenMake.py trunk/BaseTools/Source/Python/Common/BuildToolError.py trunk/BaseTools/Source/Python/Common/EdkLogger.py trunk/BaseTools/Source/Python/Common/GlobalData.py trunk/BaseTools/Source/Python/Common/Misc.py trunk/BaseTools/Source/Python/Ecc/CLexer.py trunk/BaseTools/Source/Python/Ecc/CParser.py trunk/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py trunk/BaseTools/Source/Python/Ecc/Xml/__init__.py trunk/BaseTools/Source/Python/Eot/CLexer.py trunk/BaseTools/Source/Python/Eot/CParser.py trunk/BaseTools/Source/Python/Eot/FvImage.py trunk/BaseTools/Source/Python/GenFds/EfiSection.py trunk/BaseTools/Source/Python/GenFds/Fv.py trunk/BaseTools/Source/Python/GenFds/GenFds.py trunk/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py trunk/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py trunk/BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py trunk/BaseTools/Source/Python/Trim/Trim.py trunk/BaseTools/Source/Python/UPT/Core/__init__.py trunk/BaseTools/Source/Python/UPT/GenMetaFile/__init__.py trunk/BaseTools/Source/Python/UPT/Library/ExpressionValidate.py trunk/BaseTools/Source/Python/UPT/Library/GlobalData.py trunk/BaseTools/Source/Python/UPT/Library/Misc.py trunk/BaseTools/Source/Python/UPT/Library/Xml/__init__.py trunk/BaseTools/Source/Python/UPT/Library/__init__.py trunk/BaseTools/Source/Python/UPT/Logger/Log.py trunk/BaseTools/Source/Python/UPT/Logger/ToolError.py trunk/BaseTools/Source/Python/UPT/Xml/__init__.py trunk/BaseTools/Source/Python/Workspace/MetaFileParser.py trunk/BaseTools/Source/Python/sitecustomize.py trunk/BaseTools/Tests/CToolsTests.py trunk/BaseTools/Tests/CheckPythonSyntax.py trunk/BaseTools/Tests/PythonToolsTests.py trunk/BaseTools/Tests/RunTests.py trunk/BaseTools/Tests/TestTools.py trunk/BaseTools/Tests/TianoCompress.py trunk/BaseTools/building-gcc.txt trunk/BaseTools/gcc/mingw-gcc-build.py Modified: trunk/BaseTools/Conf/XMLSchema/DistributionPackage.xsd =================================================================== --- trunk/BaseTools/Conf/XMLSchema/DistributionPackage.xsd 2014-01-23 01:02:47 UTC (rev 2647) +++ trunk/BaseTools/Conf/XMLSchema/DistributionPackage.xsd 2014-01-23 05:00:23 UTC (rev 2648) @@ -1,2767 +1,2767 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -Filename: DistributionPackage.xsd - -Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved. - -This program and the accompanying materials are licensed and made available -under the terms and conditions of the BSD License which may be found at - http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - ---> -<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" - targetNamespace="http://www.uefi.org/2012/1.0" xmlns="http://www.uefi.org/2012/1.0"> - <xs:element name="DistributionPackage"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This schema defines the UEFI/PI Distribution Package description (PKG) - file. It describes the content of:</xs:documentation> - <xs:documentation xml:lang="en-us"> 1) Package descriptions with definitions and headers.</xs:documentation> - <xs:documentation xml:lang="en-us"> 2) Modules in either source or binary format. (Note that Binary format - is for FFS leaf section file types only, complete FFS files cannot be distributed using this - distribution format.) </xs:documentation> - <xs:documentation xml:lang="en-us"> 3) The distribution of custom tools used to modify the binary images to - create UEFI/PI compliant images. </xs:documentation> - <xs:documentation xml:lang="en-us"> 4) Finally, it can be used to distribute other miscellaneous content - that is not specific to UEFI/PI images. </xs:documentation> - <xs:documentation xml:lang="en-us"> The Package Surface Area describes the content of packages, while the - Module Surface Area provides information relevant to source and/or binary distributions. - </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:sequence> - <xs:element ref="DistributionHeader" minOccurs="1" maxOccurs="1"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This header contains (legal) information usually required - for distributing both binary and/or source code. </xs:documentation> - </xs:annotation> - </xs:element> - <xs:element ref="PackageSurfaceArea" minOccurs="0" maxOccurs="unbounded"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> The list of packages in this distribution. </xs:documentation> - <xs:documentation xml:lang="en-us"> Packages are groups of files and/or modules that are similar - in nature.</xs:documentation> - <xs:documentation xml:lang="en-us"> Packages are uniquely identified by a package GUID and a - package version. </xs:documentation> - <xs:documentation xml:lang="en-us"> A package can declare public mappings of C names to GUID - values. </xs:documentation> - <xs:documentation xml:lang="en-us"> A package can provide header files for library classes - and/or other industry standard definitions. </xs:documentation> - <xs:documentation xml:lang="en-us"> A package can also declare public mappings of platform - configuration database (PCD) "knobs" to control features and operation of modules - within a platform. </xs:documentation> - <xs:documentation xml:lang="en-us"> Finally, a package lists the library instances and/or - modules that are provided in a distribution package. </xs:documentation> - </xs:annotation> - </xs:element> - <xs:element ref="ModuleSurfaceArea" minOccurs="0" maxOccurs="unbounded"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> The listing of UEFI/PI compliant modules in this - distribution that are NOT part of a Package. Every module that is provided as part of a - package needs to be described in a PackageSurfaceArea.Modules section. </xs:documentation> - <xs:documentation xml:lang="en-us"> The ModuleSurfaceArea section describes how each module in a - distribution is coded, or, in the case of a binary module distribution, how it was built. </xs:documentation> - <xs:documentation xml:lang="en-us"> UEFI/PI compliant libraries and modules are uniquely - identified by the Module's GUID and version number. </xs:documentation> - <xs:documentation xml:lang="en-us"> This section will typically be used for modules that don't - require any additional files that would be included in a package. For example, the Enhanced - FAT driver binary does not need to have a package description, as no additional files are - provided. </xs:documentation> - </xs:annotation> - </xs:element> - <xs:element ref="Tools" minOccurs="0" maxOccurs="unbounded"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This section is for distributing vendor specific executable - tools, tool source code and/or configuration files. These tools are primarily for - manipulating code and/or binary images. </xs:documentation> - <xs:documentation xml:lang="en-us"> Tools in this section can:</xs:documentation> - <xs:documentation xml:lang="en-us"> 1) Parse build meta-data files to create source code files - and build scripts. </xs:documentation> - <xs:documentation xml:lang="en-us"> 2) Modify image files to conform to UEFI/PI specifications. </xs:documentation> - <xs:documentation xml:lang="en-us"> 3) Generate binary files from certain types of text/unicode - files. </xs:documentation> - <xs:documentation xml:lang="en-us"> 4) Generate PCI Option Roms or Firmware Device images. </xs:documentation> - <xs:documentation xml:lang="en-us"> 5) Implement external encoding/decoding/signature/GUIDed - tools. </xs:documentation> - <xs:documentation xml:lang="en-us"> 6) Distribution Package create/install/remove tools. - </xs:documentation> - </xs:annotation> - </xs:element> - <xs:element ref="MiscellaneousFiles" minOccurs="0" maxOccurs="unbounded"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> The list of miscellaneous files in this distribution. Any - files that are not listed in either the Package, Module or Tools sections can be listed - here. This section can be used to distribute specifications for packages and modules that - are not "industry standards" such as a specification for a chipset or a video - device. </xs:documentation> - </xs:annotation> - </xs:element> - <xs:element ref="UserExtensions" minOccurs="0" maxOccurs="unbounded"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> The UserExtensions section is used to disseminate processing - instructions that may be custom to the content provided by the distribution. This section - contains information that is common to all aspects of this disribution. </xs:documentation> - </xs:annotation> - </xs:element> - </xs:sequence> - - </xs:complexType> - </xs:element> - <!-- End of the DistributionPackage Description --> - - <xs:element name="DistributionHeader"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This section defines the content of the UEIF/PI compliant Distribution - Package Header. This is the only required element of a UEFI/PI compliant distribution package. - </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="1" maxOccurs="1" name="Name"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This is the User Interface Name for this Distribution - Package. </xs:documentation> - <xs:documentation xml:lang="en-us"> Each Distribution Package is uniquely identified by it's - GUID and Version number. </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:simpleContent> - <xs:extension base="xs:normalizedString"> - <xs:attribute name="BaseName" type="xs:NMTOKEN" use="optional"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> The reference name of the Distribution - Package file. This single word name can be used by tools as a keyword or for - directory and/or file creation. </xs:documentation> - <xs:documentation xml:lang="en-us"> White space and special characters (dash and - underscore characters may be used) are not permitted in this name. - </xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:simpleContent> - </xs:complexType> - </xs:element> - <xs:element minOccurs="1" maxOccurs="1" name="GUID"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This 128-bit GUID and the Version attribute uniquely - identify this Distribution Package. </xs:documentation> - <xs:documentation xml:lang="en-us"> Backward compatible releases of a distribution package need - only change the version number, while non-backward compatible changes require the GUID to - change (resetting the version number to 1.0 is optional.) </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:simpleContent> - <xs:extension base="RegistryFormatGuid"> - <xs:attribute name="Version" type="xs:decimal" use="required"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This value, along with the GUID, is used to - uniquely identify this object. The higher the number, the more recent the - content. </xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:simpleContent> - </xs:complexType> - </xs:element> - <xs:element minOccurs="1" maxOccurs="1" name="Vendor" type="xs:normalizedString"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> A string identifying who created this distribution package. - </xs:documentation> - </xs:annotation> - </xs:element> - <xs:element minOccurs="1" maxOccurs="1" name="Date" type="xs:dateTime"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> The date and time this distribution was created. The format - is: YYYY-MM-DDThh:mm:ss, for example: 2001-01-31T13:30:00 (note the T character separator - between the calendar date and the time. </xs:documentation> - </xs:annotation> - </xs:element> - <xs:element minOccurs="1" maxOccurs="unbounded" name="Copyright"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> The copyright for this file that is generated by the creator - of the distribution. If a derivative work is generated from an existing distribution, then - the existing copyright must be maintained, and additional copyrights may be appended to the - end of this element. It may also be the primary copyright for all code provided in the - Distribution Package. </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:simpleContent> - <xs:extension base="xs:string"> - <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"/> - </xs:extension> - </xs:simpleContent> - </xs:complexType> - - </xs:element> - <xs:element minOccurs="1" maxOccurs="unbounded" name="License"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> A license that describes any restrictions on the use of this - distribution. If a derivative work is allowed by the original license and a derivative work - is generated from an existing distribution, then the existing license must be maintained, - and additional licenses may be appended to the end of this element. It may also be the - primary license for all code provided in the distribution file. Alternatively, this may - point to a filename that contains the License. The file (included in the content zip file) - will be stored in the same location as the distribution package's .pkg file. - </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:simpleContent> - <xs:extension base="xs:string"> - <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"/> - </xs:extension> - </xs:simpleContent> - </xs:complexType> - </xs:element> - <xs:element minOccurs="1" maxOccurs="unbounded" name="Abstract"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> A one line description of the Distribution Package. - </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:simpleContent> - <xs:extension base="xs:normalizedString"> - <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"/> - </xs:extension> - </xs:simpleContent> - </xs:complexType> - </xs:element> - <xs:element minOccurs="0" maxOccurs="unbounded" name="Description"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> A complete description of the Distribution Package. This - description may include the release name of the file, the version of the file, and a - complete description of the file contents and/or features including a description of the - updates since the previous file release. </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:simpleContent> - <xs:extension base="xs:string"> - <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"/> - </xs:extension> - </xs:simpleContent> - </xs:complexType> - </xs:element> - <xs:element minOccurs="0" maxOccurs="1" name="Signature" type="Md5Sum"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> The packaging utilities will use this MD5 sum value of the - included ZIP file containing files and/or code. If this element is not present, then - installation tools should assume that the content is correct, or that other methods may be - needed to verify content. </xs:documentation> - </xs:annotation> - </xs:element> - <xs:element minOccurs="1" maxOccurs="1" name="XmlSpecification" type="xs:decimal" default="1.1"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This version of this XML Schema is 1.1 </xs:documentation> - <xs:documentation xml:lang="en-us"> Changes to 1.1 from 1.0 </xs:documentation> - <xs:documentation xml:lang="en-us"> #1 Updated to present date and new version which is - important to reflect the present state of the matter</xs:documentation> - <xs:documentation xml:lang="en-us"> #2 Added definition/enumeration of UNDEFIND type 2 is - important since there is a large body of legacy code for which the GUID’s and other - code/data objects were not decorated with their usage. This document will allow for - importing today’s source artifacts and producing decorations using the ‘Undefined’ versus - having an error</xs:documentation> - <xs:documentation xml:lang="en-us">#3 Allow for inclusion of ARM and future architecture - types</xs:documentation> - </xs:annotation> - </xs:element> - </xs:sequence> - <xs:attribute name="ReadOnly" type="xs:boolean" default="false" use="optional"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> If set to true, all content within this Distribution Package - should NOT be modified. The default permits modification of all content. </xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="RePackage" type="xs:boolean" default="false" use="optional"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> If set to true, then the content can be repackaged into another - distribution package. The default prohibits repackaging the Distribution content. - </xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:complexType> - </xs:element> - <!-- End of the DistributionHeader element. --> - - <xs:element name="PackageSurfaceArea"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> A package is a collection of related objects - Includes, Libraries and - Modules. </xs:documentation> - <xs:documentation xml:lang="en-us"> Each package is uniquely identified by it's GUID and Version number. - Backward compatible releases of a package need only change the version number, while non-backward - compatible changes require the GUID to change (resetting the version number to 1.0 is optional.) - </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:sequence> - - <xs:element minOccurs="1" maxOccurs="1" name="Header"> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="1" maxOccurs="1" name="Name"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This is the User Interface Name for this - package. </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:simpleContent> - <xs:extension base="xs:normalizedString"> - <xs:attribute name="BaseName" type="xs:NMTOKEN" use="required"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This is a single word BaseName - of the package. This BaseName can be used by tools as a keyword - and for directory/file creation. </xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:simpleContent> - </xs:complexType> - </xs:element> - <xs:element minOccurs="1" maxOccurs="1" name="GUID"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This GUID and the Version attribute uniquely - identify a given package. </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:simpleContent> - <xs:extension base="RegistryFormatGuid"> - <xs:attribute name="Version" type="xs:decimal" use="required"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This value, along with the GUID, - is used to uniquely identify this object. </xs:documentation> - <xs:documentation xml:lang="en-us"> Backward compatible changes must - make sure this number is incremented from the most recent - version. Non-backward compatible changes require a new GUID, and - the version can be reset. </xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:simpleContent> - </xs:complexType> - </xs:element> - <xs:element minOccurs="0" maxOccurs="unbounded" name="Copyright"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> If the package requires a different copyright - than the distribution package, this element can list one or more copyright - lines. </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:simpleContent> - <xs:extension base="xs:string"> - <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional" - /> - </xs:extension> - </xs:simpleContent> - </xs:complexType> - - </xs:element> - <xs:element minOccurs="0" maxOccurs="unbounded" name="License"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> If the package requires licenses that are - different from the distribution package license, this element can contain one or - more license text paragraphs (or license filenames.) </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:simpleContent> - <xs:extension base="xs:string"> - <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional" - /> - </xs:extension> - </xs:simpleContent> - </xs:complexType> - - </xs:element> - <xs:element minOccurs="0" maxOccurs="unbounded" name="Abstract"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> A one line description of this package. - </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:simpleContent> - <xs:extension base="xs:normalizedString"> - <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional" - /> - </xs:extension> - </xs:simpleContent> - </xs:complexType> - </xs:element> - <xs:element minOccurs="0" maxOccurs="unbounded" name="Description"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> A complete description of a package. This - description may include the release name of the package, the version of the - package, and a complete description of the package contents and/or features - including a description of the updates since the previous package’s release. - </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:simpleContent> - <xs:extension base="xs:string"> - <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional" - /> - </xs:extension> - </xs:simpleContent> - </xs:complexType> - </xs:element> - <xs:element minOccurs="1" maxOccurs="1" name="PackagePath" type="xs:anyURI"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This element is the location (in the ZIP file) - for the root directory of a package. </xs:documentation> - </xs:annotation> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - <!-- End of PackageSurfaceArea Header element. --> - - <xs:element minOccurs="0" maxOccurs="1" name="ClonedFrom"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> The term cloned is used here to indicate that this package - as been copied and modified to a completely different package. An example might be for a new - generation of chipsets that have few or no elements in common with the original. - </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="1" maxOccurs="1" name="GUID"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This GUID and the Version attribute uniquely - identify the Package that this Package was copied from. </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:simpleContent> - <xs:extension base="RegistryFormatGuid"> - <xs:attribute name="Version" type="xs:decimal" use="required"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This value, along with the GUID, - is used to uniquely identify the package that this package was - cloned from. </xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:simpleContent> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - <!-- End of PackageSurfaceArea ClonedFrom element. --> - - <xs:element minOccurs="0" maxOccurs="1" name="LibraryClassDeclarations"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> Library Classes are public interfaces that can be used by - modules. One or more library instances can implement a library class, however only one - library instance can be linked to an individual module. This provides the platform - integrator with the flexibility of choosing one library instance's implementation over a - different library instance. </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="1" maxOccurs="unbounded" name="LibraryClass"> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="1" maxOccurs="1" name="HeaderFile" type="xs:anyURI"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> The header file provides definitions - and function prototypes for a library class. Modules can be coded - against these functions, using the definitions in this header, - without concerning themselves about the libraries' implementation - details. This is a PackagePath relative path and filename for the - include file. </xs:documentation> - </xs:annotation> - </xs:element> - <xs:element minOccurs="0" maxOccurs="1" name="RecommendedInstance"> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="1" maxOccurs="1" name="GUID"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This GUID and the - Version attribute uniquely identify the Recommended Library - Instance. </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:simpleContent> - <xs:extension base="RegistryFormatGuid"> - <xs:attribute name="Version" type="xs:decimal" - use="optional"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This value, along with - the GUID, is used to uniquely identify this object. If this - value is not specified, then any version of the library - instance is recommended. </xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:simpleContent> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/> - </xs:sequence> - <xs:attribute name="Keyword" type="xs:NCName" use="required"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> The single word name of the Library - Class that module developers will use to identify a library class - dependency. </xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attributeGroup ref="SupportedArchMod"/> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - <!-- End of PackageSurfaceArea LibraryClassDeclarations element. --> - - <xs:element minOccurs="0" maxOccurs="1" name="IndustryStandardIncludes"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This section is used to list header files for industry - standards not under the auspices of UEFI.org. For example, headers that contain definitions - and data structures for the USB specifications. </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="1" maxOccurs="unbounded" name="IndustryStandardHeader"> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="1" maxOccurs="1" name="HeaderFile" type="xs:anyURI"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> The package relative path and - filename (in the content zip file) of the industry standard include - file. </xs:documentation> - </xs:annotation> - </xs:element> - <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - <!-- End of PackageSurfaceArea IndustryStdIncludes element. --> - - <xs:element minOccurs="0" maxOccurs="1" name="PackageIncludes"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> All top level header files that are included by a package - that are not listed above. They cannot be:</xs:documentation> - <xs:documentation xml:lang="en-us"> 1) Local to a module (module specific.) </xs:documentation> - <xs:documentation xml:lang="en-us"> 2) An industry standard header. </xs:documentation> - <xs:documentation xml:lang="en-us"> 3) A library class header. </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="1" maxOccurs="unbounded" name="PackageHeader"> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="1" maxOccurs="1" name="HeaderFile"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This is the Package relative path - and filename location within the content ZIP file. - </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:simpleContent> - <xs:extension base="xs:anyURI"> - <xs:attributeGroup ref="SupportedArchMod"/> - </xs:extension> - </xs:simpleContent> - </xs:complexType> - </xs:element> - <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - <!-- End of PackageSurfaceArea PackageIncluces element. --> - - <xs:element minOccurs="0" maxOccurs="1" name="Modules"> - <xs:complexType> - <xs:sequence> - <xs:element ref="ModuleSurfaceArea" minOccurs="1" maxOccurs="unbounded"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This section lists the Module Surface Area for - all modules provided with this package. </xs:documentation> - </xs:annotation> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - <!-- End of PackageSurfaceArea Modules element. --> - - <xs:element minOccurs="0" maxOccurs="1" name="GuidDeclarations"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This section defines the mapping of GUID C names to GUID - values as a Registry Format GUID. </xs:documentation> - <xs:documentation xml:lang="en-us"> Modules that use these GUIDs must specify their dependency - on this package. </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="1" maxOccurs="unbounded" name="Entry"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> Individual GUID Declarations </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/> - <xs:element minOccurs="1" maxOccurs="1" name="GuidValue" - type="RegistryFormatGuid"/> - <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/> - </xs:sequence> - <xs:attribute name="UiName" type="xs:normalizedString" use="optional"/> - <xs:attribute name="GuidTypes" type="GuidListType" use="optional"/> - <xs:attributeGroup ref="SupportedArchMod"/> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - <!-- End of PackageSurfaceArea GuidDeclarations element. --> - - <xs:element minOccurs="0" maxOccurs="1" name="ProtocolDeclarations"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This section defines the mapping of Protocol C names to GUID - values as a Registry Format GUID. </xs:documentation> - <xs:documentation xml:lang="en-us"> Modules that use these Protocols must specify their - dependency on this package. </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="1" maxOccurs="unbounded" name="Entry"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> Individual Protocol Declarations - </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/> - <xs:element minOccurs="1" maxOccurs="1" name="GuidValue" - type="RegistryFormatGuid"/> - <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/> - </xs:sequence> - <xs:attribute name="UiName" type="xs:normalizedString" use="optional"/> - <xs:attributeGroup ref="SupportedArchMod"/> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - <!-- End of PackageSurfaceArea ProtocolDeclarations element. --> - - <xs:element minOccurs="0" maxOccurs="1" name="PpiDeclarations"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This section defines the mapping of Ppi C names to GUID - values as a Registry Format GUID. </xs:documentation> - <xs:documentation xml:lang="en-us"> Modules that use these Ppis must specify their dependency on - this package. </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="1" maxOccurs="unbounded" name="Entry"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> Individual PPI Declarations </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/> - <xs:element minOccurs="1" maxOccurs="1" name="GuidValue" - type="RegistryFormatGuid"/> - <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/> - </xs:sequence> - <xs:attribute name="UiName" type="xs:normalizedString" use="optional"/> - <xs:attributeGroup ref="SupportedArchMod"/> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - <!-- End of PackageSurfaceArea PpiDeclarations element. --> - - <xs:element minOccurs="0" maxOccurs="1" name="PcdDeclarations"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This section is used to declare platform configuration knobs - that are defined by this package. </xs:documentation> - <xs:documentation xml:lang="en-us"> Modules that use these PCD values must specify their - dependency on this package. </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="1" maxOccurs="unbounded" name="PcdEntry"> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="1" maxOccurs="1" name="TokenSpaceGuidCname" - type="xs:NCName"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> Specifies the C name of the Token - Space GUID of which this PCD Entry is a member. This C name should - also be listed in the GUIDs section, (specified above,) where the C - name is assigned to a GUID value. </xs:documentation> - </xs:annotation> - </xs:element> - <xs:element minOccurs="1" maxOccurs="1" name="Token"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> Specifies the 32-bit token value for - this PCD Entry. The Token number must be unique to the Token Space - that declares the PCD. </xs:documentation> - <xs:documentation xml:lang="en-us"> The minLength of 3 is required to - handle the "0x" prefix to the hex number. </xs:documentation> - </xs:annotation> - <xs:simpleType> - <xs:restriction base="HexNumber"> - <xs:minLength value="3"/> - <xs:maxLength value="10"/> - </xs:restriction> - </xs:simpleType> - </xs:element> - <xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/> - <xs:element minOccurs="1" maxOccurs="1" name="DatumType" type="PcdDatumTypes"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> A string that contains the data type - of this PCD Entry. PCD data types are restricted to the following - set:UINT8, UINT16, UINT32, UINT64, VOID*, BOOLEAN. - </xs:documentation> - </xs:annotation> - </xs:element> - <xs:element minOccurs="1" maxOccurs="1" name="ValidUsage" type="PcdItemListType"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> A string that contains one or more - PCD Item types separated by spaces. The PCD Item types are - restricted to FeaturePcd, FixedPcd, PatchPcd, Pcd and/or PcdEx. - </xs:documentation> - </xs:annotation> - </xs:element> - <xs:element minOccurs="1" maxOccurs="1" name="DefaultValue" - type="xs:normalizedString"/> - <xs:element minOccurs="0" maxOccurs="1" name="MaxDatumSize"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> This is a recommended maximum data - size for VOID* data types, the actual value should be defined by the - Platform Integrator. It is not required for the other data types. </xs:documentation> - <xs:documentation xml:lang="en-us"> The minLength of 3 is required to - handle the "0x" prefix to the hex number. </xs:documentation> - - </xs:annotation> - <xs:simpleType> - <xs:restriction base="HexNumber"> - <xs:minLength value="3"/> - </xs:restriction> - </xs:simpleType> - </xs:element> - <xs:element minOccurs="0" maxOccurs="unbounded" name="Prompt"> - <xs:annotation> - <xs:documentation xml:lang="en-US"> This entry contains prompt - information, that may used by tools to assist platform integrators - with choosing the correct values </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:simpleContent> - <xs:extension base="xs:string"> - <xs:attribute name="Lang" type="xs:language" default="en-us" - use="optional"/> - </xs:extension> - </xs:simpleContent> - </xs:complexType> - </xs:element> - <xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/> - - <xs:element minOccurs="0" maxOccurs="unbounded" name="PcdError"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> Valid Error messages that may be - implemented in a module for the PCD Entry. Only One Error Number per - PcdError, (multiple ErrorMessage entries are permitted) and multiple - PcdError elements are permitted. </xs:documentation> - </xs:annotation> - <xs:complexType> - <xs:sequence> - <xs:choice minOccurs="1" maxOccurs="1"> - <xs:annotation> - <xs:documentation xml:lang="en-us"> One of the following - ... [truncated message content] |
From: <oli...@us...> - 2014-01-23 01:02:50
|
Revision: 2647 http://sourceforge.net/p/edk2-buildtools/code/2647 Author: oliviermartin Date: 2014-01-23 01:02:47 +0000 (Thu, 23 Jan 2014) Log Message: ----------- BaseTools/tools_def.template: Ensure Software floating point is used to build ARM32 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <oli...@ar...> Modified Paths: -------------- trunk/BaseTools/Conf/tools_def.template Modified: trunk/BaseTools/Conf/tools_def.template =================================================================== --- trunk/BaseTools/Conf/tools_def.template 2014-01-22 07:15:25 UTC (rev 2646) +++ trunk/BaseTools/Conf/tools_def.template 2014-01-23 01:02:47 UTC (rev 2647) @@ -3131,7 +3131,7 @@ DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe DEFINE GCC_IPF_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-min-latency -DEFINE GCC_ARM_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb +DEFINE GCC_ARM_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft DEFINE GCC_AARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mcmodel=large -mlittle-endian -fno-short-enums -save-temps -fverbose-asm -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-builtin -Wno-address DEFINE GCC_DLINK_FLAGS_COMMON = -nostdlib --pie DEFINE GCC_IA32_X64_DLINK_COMMON = DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections @@ -5545,7 +5545,7 @@ # # Use default values, or override in DSC file # -*_RVCT_ARM_ARCHCC_FLAGS = --thumb +*_RVCT_ARM_ARCHCC_FLAGS = --thumb --fpu=softvfp *_RVCT_ARM_ARCHASM_FLAGS = *_RVCT_ARM_ARCHDLINK_FLAGS = *_RVCT_ARM_PLATFORM_FLAGS = --cpu 7-A @@ -5587,7 +5587,7 @@ # # Use default values, or override in DSC file # -*_RVCTLINUX_ARM_ARCHCC_FLAGS = --thumb +*_RVCTLINUX_ARM_ARCHCC_FLAGS = --thumb --fpu=softvfp *_RVCTLINUX_ARM_ARCHASM_FLAGS = *_RVCTLINUX_ARM_ARCHDLINK_FLAGS = *_RVCTLINUX_ARM_PLATFORM_FLAGS = --cpu 7-A @@ -5634,7 +5634,7 @@ # # Use default values, or override in DSC file # -*_RVCTCYGWIN_ARM_ARCHCC_FLAGS = --thumb +*_RVCTCYGWIN_ARM_ARCHCC_FLAGS = --thumb --fpu=softvfp *_RVCTCYGWIN_ARM_ARCHASM_FLAGS = *_RVCTCYGWIN_ARM_ARCHDLINK_FLAGS = *_RVCTCYGWIN_ARM_PLATFORM_FLAGS = --cpu 7-A This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lg...@us...> - 2014-01-22 07:15:30
|
Revision: 2646 http://sourceforge.net/p/edk2-buildtools/code/2646 Author: lgao4 Date: 2014-01-22 07:15:25 +0000 (Wed, 22 Jan 2014) Log Message: ----------- VfrCompiler used memcpy() on the overlapped buffer and caused data corruption. This commit replaces memcpy() with memmove() if the source or the destination buffer is not created in the function, so that the overlapped buffers can be copied correctly. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Ching-Pang Lin <gl...@su...> Reviewed-by: Gao, Liming <lim...@in...> Modified Paths: -------------- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp =================================================================== --- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp 2014-01-16 02:46:46 UTC (rev 2645) +++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp 2014-01-22 07:15:25 UTC (rev 2646) @@ -82,7 +82,7 @@ IN UINT32 Len ) { - memcpy (mAddr, Addr, (mLen < Len ? mLen : Len)); + memmove (mAddr, Addr, (mLen < Len ? mLen : Len)); mFlag = ASSIGNED; } @@ -685,7 +685,7 @@ // // Override the restore buffer data. // - memcpy (LastFormEndAddr, InsertOpcodeAddr, InsertOpcodeNode->mBufferFree - InsertOpcodeAddr); + memmove (LastFormEndAddr, InsertOpcodeAddr, InsertOpcodeNode->mBufferFree - InsertOpcodeAddr); InsertOpcodeNode->mBufferFree -= NeedRestoreCodeLen; memset (InsertOpcodeNode->mBufferFree, 0, NeedRestoreCodeLen); } else { @@ -733,7 +733,7 @@ // // Override the restore buffer data. // - memcpy (InsertOpcodeNode->mBufferStart, InsertOpcodeAddr, InsertOpcodeNode->mBufferFree - InsertOpcodeAddr); + memmove (InsertOpcodeNode->mBufferStart, InsertOpcodeAddr, InsertOpcodeNode->mBufferFree - InsertOpcodeAddr); InsertOpcodeNode->mBufferFree -= InsertOpcodeAddr - InsertOpcodeNode->mBufferStart; // @@ -1542,7 +1542,7 @@ // ObjBinBuf = gCFormPkg.IfrBinBufferGet (mObjBinLen); if (ObjBinBuf != NULL) { - memcpy (ObjBinBuf, mObjBinBuf, mObjBinLen); + memmove (ObjBinBuf, mObjBinBuf, mObjBinLen); } // Modified: trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h =================================================================== --- trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2014-01-16 02:46:46 UTC (rev 2645) +++ trunk/BaseTools/Source/C/VfrCompile/VfrFormPkg.h 2014-01-22 07:15:25 UTC (rev 2646) @@ -368,7 +368,7 @@ VOID VARSTORE_INFO (OUT EFI_VARSTORE_INFO *Info) { if (Info != NULL) { Info->mVarStoreId = mHeader->VarStoreId; - memcpy (&Info->mVarStoreId, &mHeader->VarStoreInfo, sizeof (Info->mVarStoreId)); + memmove (&Info->mVarStoreId, &mHeader->VarStoreInfo, sizeof (Info->mVarStoreId)); } } @@ -615,7 +615,7 @@ } VOID SetGuid (IN EFI_GUID *Guid) { - memcpy (&mFormSet->Guid, Guid, sizeof (EFI_GUID)); + memmove (&mFormSet->Guid, Guid, sizeof (EFI_GUID)); } VOID SetFormSetTitle (IN EFI_STRING_ID FormSetTitle) { @@ -627,7 +627,7 @@ } VOID SetClassGuid (IN EFI_GUID *Guid) { - memcpy (&(mClassGuid[mFormSet->Flags++]), Guid, sizeof (EFI_GUID)); + memmove (&(mClassGuid[mFormSet->Flags++]), Guid, sizeof (EFI_GUID)); } UINT8 GetFlags() { @@ -749,7 +749,7 @@ IncLength (sizeof (EFI_IFR_FORM_MAP_METHOD)); mMethodMap->MethodTitle = MethodTitle; - memcpy (&(mMethodMap->MethodIdentifier), MethodGuid, sizeof (EFI_GUID)); + memmove (&(mMethodMap->MethodIdentifier), MethodGuid, sizeof (EFI_GUID)); mMethodMap ++; } } @@ -769,7 +769,7 @@ } VOID SetGuid (IN EFI_GUID *Guid) { - memcpy (&mVarStore->Guid, Guid, sizeof (EFI_GUID)); + memmove (&mVarStore->Guid, Guid, sizeof (EFI_GUID)); } VOID SetVarStoreId (IN EFI_VARSTORE_ID VarStoreId) { @@ -809,7 +809,7 @@ } VOID SetGuid (IN EFI_GUID *Guid) { - memcpy (&mVarStoreEfi->Guid, Guid, sizeof (EFI_GUID)); + memmove (&mVarStoreEfi->Guid, Guid, sizeof (EFI_GUID)); } VOID SetVarStoreId (IN UINT16 VarStoreId) { @@ -863,7 +863,7 @@ } VOID SetGuid (IN EFI_GUID *Guid) { - memcpy (&mVarStoreNameValue->Guid, Guid, sizeof (EFI_GUID)); + memmove (&mVarStoreNameValue->Guid, Guid, sizeof (EFI_GUID)); } VOID SetVarStoreId (IN UINT16 VarStoreId) { @@ -938,7 +938,7 @@ CIfrOpHeader (EFI_IFR_DEFAULT_OP, &mDefault->Header, Size) { mDefault->Type = Type; mDefault->DefaultId = DefaultId; - memcpy (&(mDefault->Value), &Value, Size - OFFSET_OF (EFI_IFR_DEFAULT, Value)); + memmove (&(mDefault->Value), &Value, Size - OFFSET_OF (EFI_IFR_DEFAULT, Value)); } VOID SetDefaultId (IN UINT16 DefaultId) { @@ -950,7 +950,7 @@ } VOID SetValue (IN EFI_IFR_TYPE_VALUE Value) { - memcpy (&mDefault->Value, &Value, mDefault->Header.Length - OFFSET_OF (EFI_IFR_DEFAULT, Value)); + memmove (&mDefault->Value, &Value, mDefault->Header.Length - OFFSET_OF (EFI_IFR_DEFAULT, Value)); } }; @@ -1673,7 +1673,7 @@ } VOID SetRefreshEventGroutId (IN EFI_GUID *RefreshEventGroupId) { - memcpy (&mRefreshId->RefreshEventGroupId, RefreshEventGroupId, sizeof (EFI_GUID)); + memmove (&mRefreshId->RefreshEventGroupId, RefreshEventGroupId, sizeof (EFI_GUID)); } }; @@ -1755,7 +1755,7 @@ } VOID SetValue (IN EFI_IFR_TYPE_VALUE Value) { - memcpy (&mOneOfOption->Value, &Value, mOneOfOption->Header.Length - OFFSET_OF (EFI_IFR_ONE_OF_OPTION, Value)); + memmove (&mOneOfOption->Value, &Value, mOneOfOption->Header.Length - OFFSET_OF (EFI_IFR_ONE_OF_OPTION, Value)); } UINT8 GetFlags (VOID) { @@ -1904,11 +1904,11 @@ } VOID SetGuid (IN EFI_GUID *Guid) { - memcpy (&mGuid->Guid, Guid, sizeof (EFI_GUID)); + memmove (&mGuid->Guid, Guid, sizeof (EFI_GUID)); } VOID SetData (IN UINT8* DataBuff, IN UINT8 Size) { - memcpy ((UINT8 *)mGuid + sizeof (EFI_IFR_GUID), DataBuff, Size); + memmove ((UINT8 *)mGuid + sizeof (EFI_IFR_GUID), DataBuff, Size); } }; @@ -2214,7 +2214,7 @@ } VOID SetPermissions (IN EFI_GUID *Permissions) { - memcpy (&mSecurity->Permissions, Permissions, sizeof (EFI_GUID)); + memmove (&mSecurity->Permissions, Permissions, sizeof (EFI_GUID)); } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yz...@us...> - 2014-01-16 02:46:52
|
Revision: 2645 http://sourceforge.net/p/edk2-buildtools/code/2645 Author: yzhen22 Date: 2014-01-16 02:46:46 +0000 (Thu, 16 Jan 2014) Log Message: ----------- Rollback change of revision r2615 Revision Links: -------------- http://sourceforge.net/p/edk2-buildtools/code/2615 Modified Paths: -------------- trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py Modified: trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py =================================================================== --- trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2014-01-15 17:07:09 UTC (rev 2644) +++ trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2014-01-16 02:46:46 UTC (rev 2645) @@ -1811,7 +1811,7 @@ else: Tool = ToolList[0] ToolChain = "*_*_*_%s_FLAGS" % Tool - ToolChainFamily = '' + ToolChainFamily = 'MSFT' # Edk.x only support MSFT tool chain #ignore not replaced macros in value ValueList = GetSplitList(' ' + Value, '/D') Dummy = ValueList[0] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Andrew F. <af...@ap...> - 2014-01-15 18:13:07
|
On Jan 15, 2014, at 10:08 AM, Olivier Martin <oli...@ar...> wrote: > I do not think it is possible to set a default value in the DSC when using > ENV(). > > You should not get an error if ENV(CLANG_BIN) is not defined (it is bug I > fixed in BaseTools a couple of years ago). > But you will definitely have an error if you still have DEF(CLANG_BIN) and > CLANG_BIN is not defined. > Sorry looks like I missed a DEF(CLANG_BIN) in the file. It was my error, just a bad merge. Thanks, Andrew Fish > Which kind of error do you have? Do you only use CLANG_BIN in your > tools_def.txt? Or are you also using this variable into your DSC file? > > >> -----Original Message----- >> From: Andrew Fish [mailto:af...@ap...] >> Sent: 15 January 2014 17:55 >> To: oli...@us... >> Cc: edk...@li... >> Subject: Re: SF.net SVN: edk2-buildtools:[2644] >> trunk/BaseTools/Conf/tools_def.template >> >> Olivier, >> >> It it possible to give a default value for CLANG_BIN in the .DSC file? >> >> I noticed I get an error if CLANG_BIN is not defined. >> >> Thanks, >> >> Andrew Fish >> >> On Jan 15, 2014, at 9:07 AM, oli...@us... wrote: >> >>> Revision: 2644 >>> http://sourceforge.net/p/edk2-buildtools/code/2644 >>> Author: oliviermartin >>> Date: 2014-01-15 17:07:09 +0000 (Wed, 15 Jan 2014) >>> Log Message: >>> ----------- >>> tools_def.template: Change CLANG_BIN from DEF to ENV >>> >>> Contributed-under: TianoCore Contribution Agreement 1.0 >>> Signed-off-by: Olivier Martin <oli...@ar...> >>> Reviewed-by: Andrew Fish <af...@ap...> >>> >>> Modified Paths: >>> -------------- >>> trunk/BaseTools/Conf/tools_def.template >>> >>> Modified: trunk/BaseTools/Conf/tools_def.template >>> =================================================================== >>> --- trunk/BaseTools/Conf/tools_def.template 2014-01-15 12:34:01 UTC >> (rev 2643) >>> +++ trunk/BaseTools/Conf/tools_def.template 2014-01-15 17:07:09 UTC >> (rev 2644) >>> @@ -192,11 +192,6 @@ >>> >>> DEFINE SOURCERY_CYGWIN_TOOLS = /cygdrive/c/Program >> Files/CodeSourcery/Sourcery G++ Lite/bin >>> >>> -# >>> -# Change to the location clang was built >>> -# >>> -DEFINE CLANG_BIN = /usr/bin/ >>> - >>> >> ####################################################################### >> ############# >>> # >>> # format: TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE = <string> >>> @@ -5484,15 +5479,15 @@ >>> RELEASE_XCLANG_*_MTOC_FLAGS = -align 0x20 >>> >>> >>> -*_XCLANG_*_CC_PATH = DEF(CLANG_BIN)clang >>> +*_XCLANG_*_CC_PATH = ENV(CLANG_BIN)clang >>> *_XCLANG_*_SLINK_PATH = libtool >>> *_XCLANG_*_DLINK_PATH = ld >>> *_XCLANG_*_ASM_PATH = as >>> -*_XCLANG_*_PP_PATH = DEF(CLANG_BIN)clang >>> -*_XCLANG_*_VFRPP_PATH = DEF(CLANG_BIN)clang >>> +*_XCLANG_*_PP_PATH = ENV(CLANG_BIN)clang >>> +*_XCLANG_*_VFRPP_PATH = ENV(CLANG_BIN)clang >>> *_XCLANG_*_ASL_PATH = iasl >>> -*_XCLANG_*_ASLCC_PATH = DEF(CLANG_BIN)clang >>> -*_XCLANG_*_ASLPP_PATH = DEF(CLANG_BIN)clang >>> +*_XCLANG_*_ASLCC_PATH = ENV(CLANG_BIN)clang >>> +*_XCLANG_*_ASLPP_PATH = ENV(CLANG_BIN)clang >>> *_XCLANG_*_ASLDLINK_PATH = ld >>> >>> #################### >>> >>> This was sent by the SourceForge.net collaborative development >> platform, the world's largest Open Source development site. >>> >>> >>> --------------------------------------------------------------------- >> --------- >>> CenturyLink Cloud: The Leader in Enterprise Cloud Services. >>> Learn Why More Businesses Are Choosing CenturyLink Cloud For >>> Critical Workloads, Development Environments & Everything In Between. >>> Get a Quote or Start a Free Trial Today. >>> >> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.c >> lktrk >>> _______________________________________________ >>> edk2-buildtools-commits mailing list >>> edk...@li... >>> https://lists.sourceforge.net/lists/listinfo/edk2-buildtools-commits >> >> >> ----------------------------------------------------------------------- >> ------- >> CenturyLink Cloud: The Leader in Enterprise Cloud Services. >> Learn Why More Businesses Are Choosing CenturyLink Cloud For >> Critical Workloads, Development Environments & Everything In Between. >> Get a Quote or Start a Free Trial Today. >> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.c >> lktrk >> _______________________________________________ >> edk2-buildtools-commits mailing list >> edk...@li... >> https://lists.sourceforge.net/lists/listinfo/edk2-buildtools-commits > > > > |
From: Olivier M. <oli...@ar...> - 2014-01-15 18:09:06
|
I do not think it is possible to set a default value in the DSC when using ENV(). You should not get an error if ENV(CLANG_BIN) is not defined (it is bug I fixed in BaseTools a couple of years ago). But you will definitely have an error if you still have DEF(CLANG_BIN) and CLANG_BIN is not defined. Which kind of error do you have? Do you only use CLANG_BIN in your tools_def.txt? Or are you also using this variable into your DSC file? > -----Original Message----- > From: Andrew Fish [mailto:af...@ap...] > Sent: 15 January 2014 17:55 > To: oli...@us... > Cc: edk...@li... > Subject: Re: SF.net SVN: edk2-buildtools:[2644] > trunk/BaseTools/Conf/tools_def.template > > Olivier, > > It it possible to give a default value for CLANG_BIN in the .DSC file? > > I noticed I get an error if CLANG_BIN is not defined. > > Thanks, > > Andrew Fish > > On Jan 15, 2014, at 9:07 AM, oli...@us... wrote: > > > Revision: 2644 > > http://sourceforge.net/p/edk2-buildtools/code/2644 > > Author: oliviermartin > > Date: 2014-01-15 17:07:09 +0000 (Wed, 15 Jan 2014) > > Log Message: > > ----------- > > tools_def.template: Change CLANG_BIN from DEF to ENV > > > > Contributed-under: TianoCore Contribution Agreement 1.0 > > Signed-off-by: Olivier Martin <oli...@ar...> > > Reviewed-by: Andrew Fish <af...@ap...> > > > > Modified Paths: > > -------------- > > trunk/BaseTools/Conf/tools_def.template > > > > Modified: trunk/BaseTools/Conf/tools_def.template > > =================================================================== > > --- trunk/BaseTools/Conf/tools_def.template 2014-01-15 12:34:01 UTC > (rev 2643) > > +++ trunk/BaseTools/Conf/tools_def.template 2014-01-15 17:07:09 UTC > (rev 2644) > > @@ -192,11 +192,6 @@ > > > > DEFINE SOURCERY_CYGWIN_TOOLS = /cygdrive/c/Program > Files/CodeSourcery/Sourcery G++ Lite/bin > > > > -# > > -# Change to the location clang was built > > -# > > -DEFINE CLANG_BIN = /usr/bin/ > > - > > > ####################################################################### > ############# > > # > > # format: TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE = <string> > > @@ -5484,15 +5479,15 @@ > > RELEASE_XCLANG_*_MTOC_FLAGS = -align 0x20 > > > > > > -*_XCLANG_*_CC_PATH = DEF(CLANG_BIN)clang > > +*_XCLANG_*_CC_PATH = ENV(CLANG_BIN)clang > > *_XCLANG_*_SLINK_PATH = libtool > > *_XCLANG_*_DLINK_PATH = ld > > *_XCLANG_*_ASM_PATH = as > > -*_XCLANG_*_PP_PATH = DEF(CLANG_BIN)clang > > -*_XCLANG_*_VFRPP_PATH = DEF(CLANG_BIN)clang > > +*_XCLANG_*_PP_PATH = ENV(CLANG_BIN)clang > > +*_XCLANG_*_VFRPP_PATH = ENV(CLANG_BIN)clang > > *_XCLANG_*_ASL_PATH = iasl > > -*_XCLANG_*_ASLCC_PATH = DEF(CLANG_BIN)clang > > -*_XCLANG_*_ASLPP_PATH = DEF(CLANG_BIN)clang > > +*_XCLANG_*_ASLCC_PATH = ENV(CLANG_BIN)clang > > +*_XCLANG_*_ASLPP_PATH = ENV(CLANG_BIN)clang > > *_XCLANG_*_ASLDLINK_PATH = ld > > > > #################### > > > > This was sent by the SourceForge.net collaborative development > platform, the world's largest Open Source development site. > > > > > > --------------------------------------------------------------------- > --------- > > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > > Learn Why More Businesses Are Choosing CenturyLink Cloud For > > Critical Workloads, Development Environments & Everything In Between. > > Get a Quote or Start a Free Trial Today. > > > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.c > lktrk > > _______________________________________________ > > edk2-buildtools-commits mailing list > > edk...@li... > > https://lists.sourceforge.net/lists/listinfo/edk2-buildtools-commits > > > ----------------------------------------------------------------------- > ------- > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > Learn Why More Businesses Are Choosing CenturyLink Cloud For > Critical Workloads, Development Environments & Everything In Between. > Get a Quote or Start a Free Trial Today. > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.c > lktrk > _______________________________________________ > edk2-buildtools-commits mailing list > edk...@li... > https://lists.sourceforge.net/lists/listinfo/edk2-buildtools-commits |
From: Andrew F. <af...@ap...> - 2014-01-15 17:55:12
|
Olivier, It it possible to give a default value for CLANG_BIN in the .DSC file? I noticed I get an error if CLANG_BIN is not defined. Thanks, Andrew Fish On Jan 15, 2014, at 9:07 AM, oli...@us... wrote: > Revision: 2644 > http://sourceforge.net/p/edk2-buildtools/code/2644 > Author: oliviermartin > Date: 2014-01-15 17:07:09 +0000 (Wed, 15 Jan 2014) > Log Message: > ----------- > tools_def.template: Change CLANG_BIN from DEF to ENV > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Olivier Martin <oli...@ar...> > Reviewed-by: Andrew Fish <af...@ap...> > > Modified Paths: > -------------- > trunk/BaseTools/Conf/tools_def.template > > Modified: trunk/BaseTools/Conf/tools_def.template > =================================================================== > --- trunk/BaseTools/Conf/tools_def.template 2014-01-15 12:34:01 UTC (rev 2643) > +++ trunk/BaseTools/Conf/tools_def.template 2014-01-15 17:07:09 UTC (rev 2644) > @@ -192,11 +192,6 @@ > > DEFINE SOURCERY_CYGWIN_TOOLS = /cygdrive/c/Program Files/CodeSourcery/Sourcery G++ Lite/bin > > -# > -# Change to the location clang was built > -# > -DEFINE CLANG_BIN = /usr/bin/ > - > #################################################################################### > # > # format: TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE = <string> > @@ -5484,15 +5479,15 @@ > RELEASE_XCLANG_*_MTOC_FLAGS = -align 0x20 > > > -*_XCLANG_*_CC_PATH = DEF(CLANG_BIN)clang > +*_XCLANG_*_CC_PATH = ENV(CLANG_BIN)clang > *_XCLANG_*_SLINK_PATH = libtool > *_XCLANG_*_DLINK_PATH = ld > *_XCLANG_*_ASM_PATH = as > -*_XCLANG_*_PP_PATH = DEF(CLANG_BIN)clang > -*_XCLANG_*_VFRPP_PATH = DEF(CLANG_BIN)clang > +*_XCLANG_*_PP_PATH = ENV(CLANG_BIN)clang > +*_XCLANG_*_VFRPP_PATH = ENV(CLANG_BIN)clang > *_XCLANG_*_ASL_PATH = iasl > -*_XCLANG_*_ASLCC_PATH = DEF(CLANG_BIN)clang > -*_XCLANG_*_ASLPP_PATH = DEF(CLANG_BIN)clang > +*_XCLANG_*_ASLCC_PATH = ENV(CLANG_BIN)clang > +*_XCLANG_*_ASLPP_PATH = ENV(CLANG_BIN)clang > *_XCLANG_*_ASLDLINK_PATH = ld > > #################### > > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. > > > ------------------------------------------------------------------------------ > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > Learn Why More Businesses Are Choosing CenturyLink Cloud For > Critical Workloads, Development Environments & Everything In Between. > Get a Quote or Start a Free Trial Today. > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > _______________________________________________ > edk2-buildtools-commits mailing list > edk...@li... > https://lists.sourceforge.net/lists/listinfo/edk2-buildtools-commits |
From: <oli...@us...> - 2014-01-15 17:07:14
|
Revision: 2644 http://sourceforge.net/p/edk2-buildtools/code/2644 Author: oliviermartin Date: 2014-01-15 17:07:09 +0000 (Wed, 15 Jan 2014) Log Message: ----------- tools_def.template: Change CLANG_BIN from DEF to ENV Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <oli...@ar...> Reviewed-by: Andrew Fish <af...@ap...> Modified Paths: -------------- trunk/BaseTools/Conf/tools_def.template Modified: trunk/BaseTools/Conf/tools_def.template =================================================================== --- trunk/BaseTools/Conf/tools_def.template 2014-01-15 12:34:01 UTC (rev 2643) +++ trunk/BaseTools/Conf/tools_def.template 2014-01-15 17:07:09 UTC (rev 2644) @@ -192,11 +192,6 @@ DEFINE SOURCERY_CYGWIN_TOOLS = /cygdrive/c/Program Files/CodeSourcery/Sourcery G++ Lite/bin -# -# Change to the location clang was built -# -DEFINE CLANG_BIN = /usr/bin/ - #################################################################################### # # format: TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE = <string> @@ -5484,15 +5479,15 @@ RELEASE_XCLANG_*_MTOC_FLAGS = -align 0x20 -*_XCLANG_*_CC_PATH = DEF(CLANG_BIN)clang +*_XCLANG_*_CC_PATH = ENV(CLANG_BIN)clang *_XCLANG_*_SLINK_PATH = libtool *_XCLANG_*_DLINK_PATH = ld *_XCLANG_*_ASM_PATH = as -*_XCLANG_*_PP_PATH = DEF(CLANG_BIN)clang -*_XCLANG_*_VFRPP_PATH = DEF(CLANG_BIN)clang +*_XCLANG_*_PP_PATH = ENV(CLANG_BIN)clang +*_XCLANG_*_VFRPP_PATH = ENV(CLANG_BIN)clang *_XCLANG_*_ASL_PATH = iasl -*_XCLANG_*_ASLCC_PATH = DEF(CLANG_BIN)clang -*_XCLANG_*_ASLPP_PATH = DEF(CLANG_BIN)clang +*_XCLANG_*_ASLCC_PATH = ENV(CLANG_BIN)clang +*_XCLANG_*_ASLPP_PATH = ENV(CLANG_BIN)clang *_XCLANG_*_ASLDLINK_PATH = ld #################### This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <oli...@us...> - 2014-01-15 12:34:04
|
Revision: 2643 http://sourceforge.net/p/edk2-buildtools/code/2643 Author: oliviermartin Date: 2014-01-15 12:34:01 +0000 (Wed, 15 Jan 2014) Log Message: ----------- BaseTools/tools_def.template: Bring GCC47 into line with ARMLINUXGCC and ARMGCC For GCC47 this ensures that all code is compiled for Thumb with -Os. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <oli...@ar...> Modified Paths: -------------- trunk/BaseTools/Conf/tools_def.template Modified: trunk/BaseTools/Conf/tools_def.template =================================================================== --- trunk/BaseTools/Conf/tools_def.template 2014-01-15 12:32:57 UTC (rev 2642) +++ trunk/BaseTools/Conf/tools_def.template 2014-01-15 12:34:01 UTC (rev 2643) @@ -3136,7 +3136,7 @@ DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe DEFINE GCC_IPF_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-min-latency -DEFINE GCC_ARM_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address +DEFINE GCC_ARM_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb DEFINE GCC_AARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mcmodel=large -mlittle-endian -fno-short-enums -save-temps -fverbose-asm -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-builtin -Wno-address DEFINE GCC_DLINK_FLAGS_COMMON = -nostdlib --pie DEFINE GCC_IA32_X64_DLINK_COMMON = DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections @@ -3184,7 +3184,7 @@ DEFINE GCC46_X64_DLINK_FLAGS = DEF(GCC45_X64_DLINK_FLAGS) DEFINE GCC46_ASM_FLAGS = DEF(GCC45_ASM_FLAGS) DEFINE GCC46_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ASM_FLAGS) -mlittle-endian -DEFINE GCC46_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC44_ALL_CC_FLAGS) -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char -mno-unaligned-access -Wno-address -fomit-frame-pointer +DEFINE GCC46_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC44_ALL_CC_FLAGS) DEF(GCC_ARM_CC_FLAGS) -mno-unaligned-access DEFINE GCC46_ARM_DLINK_FLAGS = DEF(GCC_ARM_AARCH64_DLINK_COMMON) --oformat=elf32-littlearm DEFINE GCC46_ARM_ASLDLINK_FLAGS = DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS) --oformat=elf32-littlearm @@ -3198,7 +3198,7 @@ DEFINE GCC47_ARM_ASM_FLAGS = DEF(GCC46_ARM_ASM_FLAGS) DEFINE GCC47_AARCH64_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ASM_FLAGS) -mlittle-endian DEFINE GCC47_ARM_CC_FLAGS = DEF(GCC46_ARM_CC_FLAGS) -DEFINE GCC47_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC44_ALL_CC_FLAGS) -mcmodel=large -mlittle-endian -fno-short-enums -save-temps -fverbose-asm -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-builtin -Wno-address +DEFINE GCC47_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC44_ALL_CC_FLAGS) DEF(GCC_AARCH64_CC_FLAGS) DEFINE GCC47_ARM_DLINK_FLAGS = DEF(GCC46_ARM_DLINK_FLAGS) DEFINE GCC47_AARCH64_DLINK_FLAGS = DEF(GCC_ARM_AARCH64_DLINK_COMMON) DEFINE GCC47_ARM_ASLDLINK_FLAGS = DEF(GCC46_ARM_ASLDLINK_FLAGS) @@ -3516,7 +3516,7 @@ *_GCC46_ARM_ASLPP_PATH = ENV(GCC46_ARM_PREFIX)gcc *_GCC46_ARM_RC_PATH = ENV(GCC46_ARM_PREFIX)objcopy -*_GCC46_ARM_ARCHCC_FLAGS = -mthumb +*_GCC46_ARM_ARCHCC_FLAGS = *_GCC46_ARM_PLATFORM_FLAGS = -march=armv7-a *_GCC46_ARM_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) @@ -3610,7 +3610,7 @@ *_GCC47_ARM_ASLPP_PATH = ENV(GCC47_ARM_PREFIX)gcc *_GCC47_ARM_RC_PATH = ENV(GCC47_ARM_PREFIX)objcopy -*_GCC47_ARM_ARCHCC_FLAGS = -mthumb +*_GCC47_ARM_ARCHCC_FLAGS = *_GCC47_ARM_PLATFORM_FLAGS = -march=armv7-a *_GCC47_ARM_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) @@ -5707,7 +5707,7 @@ # # Use default values, or override in DSC file # -*_ARMGCC_ARM_ARCHCC_FLAGS = -mthumb +*_ARMGCC_ARM_ARCHCC_FLAGS = *_ARMGCC_ARM_ARCHASM_FLAGS = *_ARMGCC_ARM_ARCHDLINK_FLAGS = *_ARMGCC_ARM_PLATFORM_FLAGS = -march=armv7-a @@ -5801,7 +5801,7 @@ # # Use default values, or override in DSC file # -*_ARMLINUXGCC_ARM_ARCHCC_FLAGS = -mthumb +*_ARMLINUXGCC_ARM_ARCHCC_FLAGS = *_ARMLINUXGCC_ARM_ARCHASM_FLAGS = *_ARMLINUXGCC_ARM_ARCHDLINK_FLAGS = *_ARMLINUXGCC_ARM_PLATFORM_FLAGS = -march=armv7-a This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <oli...@us...> - 2014-01-15 12:32:59
|
Revision: 2642 http://sourceforge.net/p/edk2-buildtools/code/2642 Author: oliviermartin Date: 2014-01-15 12:32:57 +0000 (Wed, 15 Jan 2014) Log Message: ----------- BaseTools/tools_def.template: Make ARMGCC and ARMLINUXGCC use GCC_ARM_AARCH64_DLINK_COMMON Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <oli...@ar...> Modified Paths: -------------- trunk/BaseTools/Conf/tools_def.template Modified: trunk/BaseTools/Conf/tools_def.template =================================================================== --- trunk/BaseTools/Conf/tools_def.template 2014-01-15 12:32:24 UTC (rev 2641) +++ trunk/BaseTools/Conf/tools_def.template 2014-01-15 12:32:57 UTC (rev 2642) @@ -5719,7 +5719,7 @@ *_ARMGCC_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h *_ARMGCC_ARM_SLINK_FLAGS = -rc -*_ARMGCC_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) -Ttext=0x0 --oformat=elf32-littlearm --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map +*_ARMGCC_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) DEF(GCC_ARM_AARCH64_DLINK_COMMON) --oformat=elf32-littlearm DEBUG_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -O0 RELEASE_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -Wno-unused @@ -5755,7 +5755,7 @@ *_ARMGCC_AARCH64_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h *_ARMGCC_AARCH64_SLINK_FLAGS = -rc -*_ARMGCC_AARCH64_DLINK_FLAGS = $(ARCHDLINK_FLAGS) -Ttext=0x0 --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map +*_ARMGCC_AARCH64_DLINK_FLAGS = $(ARCHDLINK_FLAGS) DEF(GCC_ARM_AARCH64_DLINK_COMMON) DEBUG_ARMGCC_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_AARCH64_CC_FLAGS) -Wno-address -O0 RELEASE_ARMGCC_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_AARCH64_CC_FLAGS) -Wno-address -Wno-unused-but-set-variable @@ -5813,7 +5813,7 @@ *_ARMLINUXGCC_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h *_ARMLINUXGCC_ARM_SLINK_FLAGS = -rc -*_ARMLINUXGCC_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) -Ttext=0x0 --oformat=elf32-littlearm --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map +*_ARMLINUXGCC_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) DEF(GCC_ARM_AARCH64_DLINK_COMMON) --oformat=elf32-littlearm DEBUG_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -fno-stack-protector -mno-unaligned-access -O0 RELEASE_ARMLINUXGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -fno-stack-protector -mno-unaligned-access -Wno-unused-but-set-variable @@ -5849,7 +5849,7 @@ *_ARMLINUXGCC_AARCH64_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h *_ARMLINUXGCC_AARCH64_SLINK_FLAGS = -rc -*_ARMLINUXGCC_AARCH64_DLINK_FLAGS = $(ARCHDLINK_FLAGS) -Ttext=0x0 --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map +*_ARMLINUXGCC_AARCH64_DLINK_FLAGS = $(ARCHDLINK_FLAGS) DEF(GCC_ARM_AARCH64_DLINK_COMMON) DEBUG_ARMLINUXGCC_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_AARCH64_CC_FLAGS) -Wno-address -O0 RELEASE_ARMLINUXGCC_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_AARCH64_CC_FLAGS) -Wno-address -Wno-unused-but-set-variable This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <oli...@us...> - 2014-01-15 12:32:33
|
Revision: 2641 http://sourceforge.net/p/edk2-buildtools/code/2641 Author: oliviermartin Date: 2014-01-15 12:32:24 +0000 (Wed, 15 Jan 2014) Log Message: ----------- BaseTools/tools_def.template: Remove the unused sections from the generated binary (ARM GCC toolchain) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <oli...@ar...> Modified Paths: -------------- trunk/BaseTools/Conf/tools_def.template Modified: trunk/BaseTools/Conf/tools_def.template =================================================================== --- trunk/BaseTools/Conf/tools_def.template 2014-01-09 09:14:08 UTC (rev 2640) +++ trunk/BaseTools/Conf/tools_def.template 2014-01-15 12:32:24 UTC (rev 2641) @@ -3140,7 +3140,7 @@ DEFINE GCC_AARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mcmodel=large -mlittle-endian -fno-short-enums -save-temps -fverbose-asm -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-builtin -Wno-address DEFINE GCC_DLINK_FLAGS_COMMON = -nostdlib --pie DEFINE GCC_IA32_X64_DLINK_COMMON = DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections -DEFINE GCC_ARM_AARCH64_DLINK_COMMON= -Ttext=0x0 --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map +DEFINE GCC_ARM_AARCH64_DLINK_COMMON= -Ttext=0x0 --emit-relocs -nostdlib --gc-sections -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map DEFINE GCC_IA32_X64_ASLDLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT) DEFINE GCC_ARM_AARCH64_ASLDLINK_FLAGS = DEF(GCC_ARM_AARCH64_DLINK_COMMON) --entry ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT) DEFINE GCC_IA32_X64_DLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _$(IMAGE_ENTRY_POINT) --file-alignment 0x20 --section-alignment 0x20 -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2014-01-09 09:14:12
|
Revision: 2640 http://sourceforge.net/p/edk2-buildtools/code/2640 Author: bobfeng Date: 2014-01-09 09:14:08 +0000 (Thu, 09 Jan 2014) Log Message: ----------- Fixed the issue that in the DSC file don't have the HII PCD's value, PcdLib get this PCD's value will fail. Signed-off-by: Feng, Bob C <bob...@in...> Reviewed-by: Yingke Liu <yin...@in...> Reviewed-by: Chen, Hesheng <hes...@in...> Modified Paths: -------------- trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py Modified: trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py =================================================================== --- trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2014-01-09 09:11:16 UTC (rev 2639) +++ trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2014-01-09 09:14:08 UTC (rev 2640) @@ -1,7 +1,7 @@ ## @file # This file is used to create a database used by build tool # -# Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR> +# Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -927,6 +927,10 @@ for pcd in Pcds.values(): SkuInfoObj = pcd.SkuInfoList.values()[0] pcdDecObject = self._DecPcds[pcd.TokenCName,pcd.TokenSpaceGuidCName] + # Only fix the value while no value provided in DSC file. + for sku in pcd.SkuInfoList.values(): + if (sku.HiiDefaultValue == "" or sku.HiiDefaultValue==None): + sku.HiiDefaultValue = pcdDecObject.DefaultValue if 'DEFAULT' not in pcd.SkuInfoList.keys() and 'COMMON' not in pcd.SkuInfoList.keys(): valuefromDec = pcdDecObject.DefaultValue SkuInfo = SkuInfoClass('DEFAULT', '0', SkuInfoObj.VariableName, SkuInfoObj.VariableGuid, SkuInfoObj.VariableOffset, valuefromDec) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2014-01-09 09:11:20
|
Revision: 2639 http://sourceforge.net/p/edk2-buildtools/code/2639 Author: bobfeng Date: 2014-01-09 09:11:16 +0000 (Thu, 09 Jan 2014) Log Message: ----------- Modify AutoGen.h for libraries when using FixedAtBuild PCD. update the patch: The Pcd must under the [FixedPcd] section for a Library rather than [Pcd] or [FixedPcd] sections. Signed-off-by: Feng, Bob C <bob...@in...> Reviewed-by: Gao, Liming <lim...@in...> Reviewed-by: Yingke Liu <yin...@in...> Modified Paths: -------------- trunk/BaseTools/Source/Python/AutoGen/AutoGen.py Modified: trunk/BaseTools/Source/Python/AutoGen/AutoGen.py =================================================================== --- trunk/BaseTools/Source/Python/AutoGen/AutoGen.py 2014-01-09 06:33:45 UTC (rev 2638) +++ trunk/BaseTools/Source/Python/AutoGen/AutoGen.py 2014-01-09 09:11:16 UTC (rev 2639) @@ -1,7 +1,7 @@ ## @file # Generate AutoGen.h, AutoGen.c and *.depex files # -# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR> +# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -2084,9 +2084,14 @@ if self._FixedAtBuildPcds: return self._FixedAtBuildPcds for Pcd in self.ModulePcdList: - if Pcd.Type == "FixedAtBuild": - if Pcd not in self._FixedAtBuildPcds: - self._FixedAtBuildPcds.append(Pcd) + if self.IsLibrary: + if not (Pcd.Pending == False and Pcd.Type == "FixedAtBuild"): + continue + elif Pcd.Type != "FixedAtBuild": + continue + if Pcd not in self._FixedAtBuildPcds: + self._FixedAtBuildPcds.append(Pcd) + return self._FixedAtBuildPcds # Macros could be used in build_rule.txt (also Makefile) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yi...@us...> - 2014-01-09 06:33:50
|
Revision: 2638 http://sourceforge.net/p/edk2-buildtools/code/2638 Author: yingke Date: 2014-01-09 06:33:45 +0000 (Thu, 09 Jan 2014) Log Message: ----------- Fix a bug which report error if a correct FD contains a region with no region type followed by another region whose offset is an expression staring with a PCD. Reviewed-by: Liming Gao <lim...@in...> Signed-off-by: Yingke Liu <yin...@in...> Modified Paths: -------------- trunk/BaseTools/Source/Python/GenFds/FdfParser.py Modified: trunk/BaseTools/Source/Python/GenFds/FdfParser.py =================================================================== --- trunk/BaseTools/Source/Python/GenFds/FdfParser.py 2014-01-09 06:25:14 UTC (rev 2637) +++ trunk/BaseTools/Source/Python/GenFds/FdfParser.py 2014-01-09 06:33:45 UTC (rev 2638) @@ -1,7 +1,7 @@ ## @file # parse FDF file # -# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR> +# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -77,6 +77,7 @@ RegionSizePattern = re.compile("\s*(?P<base>(?:0x|0X)?[a-fA-F0-9]+)\s*\|\s*(?P<size>(?:0x|0X)?[a-fA-F0-9]+)\s*") RegionSizeGuidPattern = re.compile("\s*(?P<base>\w+\.\w+)\s*\|\s*(?P<size>\w+\.\w+)\s*") +RegionOffsetPcdPattern = re.compile("\s*(?P<base>\w+\.\w+)\s*$") ShortcutPcdPattern = re.compile("\s*\w+\s*=\s*(?P<value>(?:0x|0X)?[a-fA-F0-9]+)\s*\|\s*(?P<name>\w+\.\w+)\s*") IncludeFileList = [] @@ -1768,18 +1769,26 @@ return True if not self.__Token in ("SET", "FV", "FILE", "DATA", "CAPSULE"): + # + # If next token is a word which is not a valid FV type, it might be part of [PcdOffset[|PcdSize]] + # Or it might be next region's offset described by an expression which starts with a PCD. + # PcdOffset[|PcdSize] or OffsetPcdExpression|Size + # self.__UndoToken() - RegionObj.PcdOffset = self.__GetNextPcdName() - self.Profile.PcdDict[RegionObj.PcdOffset] = "0x%08X" % (RegionObj.Offset + long(Fd.BaseAddress, 0)) - self.__PcdDict['%s.%s' % (RegionObj.PcdOffset[1], RegionObj.PcdOffset[0])] = "0x%x" % RegionObj.Offset - FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber) - self.Profile.PcdFileLineDict[RegionObj.PcdOffset] = FileLineTuple - if self.__IsToken( "|"): - RegionObj.PcdSize = self.__GetNextPcdName() - self.Profile.PcdDict[RegionObj.PcdSize] = "0x%08X" % RegionObj.Size - self.__PcdDict['%s.%s' % (RegionObj.PcdSize[1], RegionObj.PcdSize[0])] = "0x%x" % RegionObj.Size + IsRegionPcd = (RegionSizeGuidPattern.match(self.__CurrentLine()[self.CurrentOffsetWithinLine:]) or + RegionOffsetPcdPattern.match(self.__CurrentLine()[self.CurrentOffsetWithinLine:])) + if IsRegionPcd: + RegionObj.PcdOffset = self.__GetNextPcdName() + self.Profile.PcdDict[RegionObj.PcdOffset] = "0x%08X" % (RegionObj.Offset + long(Fd.BaseAddress, 0)) + self.__PcdDict['%s.%s' % (RegionObj.PcdOffset[1], RegionObj.PcdOffset[0])] = "0x%x" % RegionObj.Offset FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber) - self.Profile.PcdFileLineDict[RegionObj.PcdSize] = FileLineTuple + self.Profile.PcdFileLineDict[RegionObj.PcdOffset] = FileLineTuple + if self.__IsToken( "|"): + RegionObj.PcdSize = self.__GetNextPcdName() + self.Profile.PcdDict[RegionObj.PcdSize] = "0x%08X" % RegionObj.Size + self.__PcdDict['%s.%s' % (RegionObj.PcdSize[1], RegionObj.PcdSize[0])] = "0x%x" % RegionObj.Size + FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber) + self.Profile.PcdFileLineDict[RegionObj.PcdSize] = FileLineTuple if not self.__GetNextWord(): return True @@ -1806,6 +1815,9 @@ self.__UndoToken() self.__GetRegionDataType( RegionObj) else: + self.__UndoToken() + if self.__GetRegionLayout(Fd): + return True raise Warning("A valid region type was not found. " "Valid types are [SET, FV, CAPSULE, FILE, DATA]. This error occurred", self.FileName, self.CurrentLineNumber) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yi...@us...> - 2014-01-09 06:25:18
|
Revision: 2637 http://sourceforge.net/p/edk2-buildtools/code/2637 Author: yingke Date: 2014-01-09 06:25:14 +0000 (Thu, 09 Jan 2014) Log Message: ----------- Update unpack format to be portable. Reviewed-by: Andrew Fish <af...@ap...> Signed-off-by: Yingke Liu <yin...@in...> Modified Paths: -------------- trunk/BaseTools/Source/Python/build/BuildReport.py Modified: trunk/BaseTools/Source/Python/build/BuildReport.py =================================================================== --- trunk/BaseTools/Source/Python/build/BuildReport.py 2014-01-09 01:05:52 UTC (rev 2636) +++ trunk/BaseTools/Source/Python/build/BuildReport.py 2014-01-09 06:25:14 UTC (rev 2637) @@ -259,7 +259,7 @@ Statement = gOpCodeList[struct.unpack("B", OpCode)[0]] if Statement in ["BEFORE", "AFTER", "PUSH"]: GuidValue = "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X" % \ - struct.unpack("LHHBBBBBBBB", DepexFile.read(16)) + struct.unpack("=LHHBBBBBBBB", DepexFile.read(16)) GuidString = self._GuidDb.get(GuidValue, GuidValue) Statement = "%s %s" % (Statement, GuidString) DepexStatement.append(Statement) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yi...@us...> - 2014-01-09 01:05:58
|
Revision: 2636 http://sourceforge.net/p/edk2-buildtools/code/2636 Author: yingke Date: 2014-01-09 01:05:52 +0000 (Thu, 09 Jan 2014) Log Message: ----------- Rollback to revision 2634. Revision Links: -------------- http://sourceforge.net/p/edk2-buildtools/code/2634 Modified Paths: -------------- trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py Modified: trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py =================================================================== --- trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2014-01-09 01:04:39 UTC (rev 2635) +++ trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2014-01-09 01:05:52 UTC (rev 2636) @@ -640,11 +640,7 @@ def _ValidatePcd(self, PcdCName, TokenSpaceGuid, Setting, PcdType, LineNo): if self._DecPcds == None: - # - # Get all PCDs from DECs which are dependent by modules in components sections. - # - PlatformCommon = self._Bdb[self.MetaFile, 'COMMON', self._Target, self._Toolchain] - self._DecPcds = GetDeclaredPcd(PlatformCommon, self._Bdb, 'COMMON', self._Target, self._Toolchain) + self._DecPcds = GetDeclaredPcd(self, self._Bdb, self._Arch, self._Target, self._Toolchain) if (PcdCName, TokenSpaceGuid) not in self._DecPcds: EdkLogger.error('build', PARSER_ERROR, "Pcd (%s.%s) defined in DSC is not declared in DEC files." % (TokenSpaceGuid, PcdCName), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2014-01-09 01:04:43
|
Revision: 2635 http://sourceforge.net/p/edk2-buildtools/code/2635 Author: bobfeng Date: 2014-01-09 01:04:39 +0000 (Thu, 09 Jan 2014) Log Message: ----------- Modify AutoGen.h for libraries when using FixedAtBuild PCD. Signed-off-by: Feng, Bob C <bob...@in...> Reviewed-by: Liu Jiang A<jia...@in...> Reviewed-by: Yingke Liu <yin...@in...> Modified Paths: -------------- trunk/BaseTools/Source/Python/AutoGen/AutoGen.py trunk/BaseTools/Source/Python/AutoGen/GenC.py Modified: trunk/BaseTools/Source/Python/AutoGen/AutoGen.py =================================================================== --- trunk/BaseTools/Source/Python/AutoGen/AutoGen.py 2014-01-06 08:26:41 UTC (rev 2634) +++ trunk/BaseTools/Source/Python/AutoGen/AutoGen.py 2014-01-09 01:04:39 UTC (rev 2635) @@ -334,6 +334,7 @@ # Explicitly collect platform's dynamic PCDs # Pa.CollectPlatformDynamicPcds() + Pa.CollectFixedAtBuildPcds() self.AutoGenObjectList.append(Pa) # @@ -785,6 +786,7 @@ self._PcdTokenNumber = None # (TokenCName, TokenSpaceGuidCName) : GeneratedTokenNumber self._DynamicPcdList = None # [(TokenCName1, TokenSpaceGuidCName1), (TokenCName2, TokenSpaceGuidCName2), ...] self._NonDynamicPcdList = None # [(TokenCName1, TokenSpaceGuidCName1), (TokenCName2, TokenSpaceGuidCName2), ...] + self._NonDynamicPcdDict = {} self._ToolDefinitions = None self._ToolDefFile = None # toolcode : tool path @@ -851,6 +853,32 @@ (self.MetaFile, self.Arch)) self.IsMakeFileCreated = True + ## Deal with Shared FixedAtBuild Pcds + # + def CollectFixedAtBuildPcds(self): + for LibAuto in self.LibraryAutoGenList: + FixedAtBuildPcds = {} + ShareFixedAtBuildPcdsSameValue = {} + for Module in LibAuto._ReferenceModules: + for Pcd in Module.FixedAtBuildPcds + LibAuto.FixedAtBuildPcds: + key = ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCName)) + if key not in FixedAtBuildPcds: + ShareFixedAtBuildPcdsSameValue[key] = True + FixedAtBuildPcds[key] = Pcd.DefaultValue + else: + if FixedAtBuildPcds[key] != Pcd.DefaultValue: + ShareFixedAtBuildPcdsSameValue[key] = False + for Pcd in LibAuto.FixedAtBuildPcds: + key = ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCName)) + if (Pcd.TokenCName,Pcd.TokenSpaceGuidCName) not in self.NonDynamicPcdDict: + continue + else: + DscPcd = self.NonDynamicPcdDict[(Pcd.TokenCName,Pcd.TokenSpaceGuidCName)] + if DscPcd.Type != "FixedAtBuild": + continue + if key in ShareFixedAtBuildPcdsSameValue and ShareFixedAtBuildPcdsSameValue[key]: + LibAuto.ConstPcd[key] = Pcd.DefaultValue + ## Collect dynamic PCDs # # Gather dynamic PCDs list from each module and their settings from platform @@ -1296,6 +1324,13 @@ self._PackageList = list(self._PackageList) return self._PackageList + def _GetNonDynamicPcdDict(self): + if self._NonDynamicPcdDict: + return self._NonDynamicPcdDict + for Pcd in self.NonDynamicPcdList: + self._NonDynamicPcdDict[(Pcd.TokenCName,Pcd.TokenSpaceGuidCName)] = Pcd + return self._NonDynamicPcdDict + ## Get list of non-dynamic PCDs def _GetNonDynamicPcdList(self): if self._NonDynamicPcdList == None: @@ -1373,6 +1408,8 @@ for La in Ma.LibraryAutoGenList: if La not in self._LibraryAutoGenList: self._LibraryAutoGenList.append(La) + if Ma not in La._ReferenceModules: + La._ReferenceModules.append(Ma) ## Summarize ModuleAutoGen objects of all modules to be built for this platform def _GetModuleAutoGenList(self): @@ -1911,6 +1948,7 @@ PcdTokenNumber = property(_GetPcdTokenNumbers) # (TokenCName, TokenSpaceGuidCName) : GeneratedTokenNumber DynamicPcdList = property(_GetDynamicPcdList) # [(TokenCName1, TokenSpaceGuidCName1), (TokenCName2, TokenSpaceGuidCName2), ...] NonDynamicPcdList = property(_GetNonDynamicPcdList) # [(TokenCName1, TokenSpaceGuidCName1), (TokenCName2, TokenSpaceGuidCName2), ...] + NonDynamicPcdDict = property(_GetNonDynamicPcdDict) PackageList = property(_GetPackageList) ToolDefinition = property(_GetToolDefinition) # toolcode : tool path @@ -2027,12 +2065,30 @@ self._FinalBuildTargetList = None self._FileTypes = None self._BuildRules = None - + + ## The Modules referenced to this Library + # Only Library has this attribute + self._ReferenceModules = [] + + ## Store the FixedAtBuild Pcds + # + self._FixedAtBuildPcds = [] + self.ConstPcd = {} return True def __repr__(self): return "%s [%s]" % (self.MetaFile, self.Arch) + # Get FixedAtBuild Pcds of this Module + def _GetFixedAtBuildPcds(self): + if self._FixedAtBuildPcds: + return self._FixedAtBuildPcds + for Pcd in self.ModulePcdList: + if Pcd.Type == "FixedAtBuild": + if Pcd not in self._FixedAtBuildPcds: + self._FixedAtBuildPcds.append(Pcd) + return self._FixedAtBuildPcds + # Macros could be used in build_rule.txt (also Makefile) def _GetMacros(self): if self._Macro == None: @@ -3102,6 +3158,8 @@ BuildOption = property(_GetModuleBuildOption) BuildOptionIncPathList = property(_GetBuildOptionIncPathList) BuildCommand = property(_GetBuildCommand) + + FixedAtBuildPcds = property(_GetFixedAtBuildPcds) # This acts like the main() function for the script, unless it is 'import'ed into another script. if __name__ == '__main__': Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py =================================================================== --- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2014-01-06 08:26:41 UTC (rev 2634) +++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2014-01-09 01:04:39 UTC (rev 2635) @@ -1069,12 +1069,17 @@ AutoGenH.Append('#define %s %s_gPcd_BinaryPatch_%s\n' %(GetModeName, Type, TokenCName)) AutoGenH.Append('#define %s(Value) (%s = (Value))\n' % (SetModeName, PcdVariableName)) if PcdItemType == TAB_PCDS_FIXED_AT_BUILD or PcdItemType == TAB_PCDS_FEATURE_FLAG: + key = ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCName)) + AutoGenH.Append('extern const %s _gPcd_FixedAtBuild_%s%s;\n' %(DatumType, TokenCName, Array)) AutoGenH.Append('#define %s %s_gPcd_FixedAtBuild_%s\n' %(GetModeName, Type, TokenCName)) AutoGenH.Append('//#define %s ASSERT(FALSE) // It is not allowed to set value for a FIXED_AT_BUILD PCD\n' % SetModeName) + + if PcdItemType == TAB_PCDS_FIXED_AT_BUILD and key in Info.ConstPcd: + AutoGenH.Append('#define _PCD_VALUE_%s %s\n' %(TokenCName, Pcd.DefaultValue)) + - ## Create code for library constructor # # @param Info The ModuleAutoGen object This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yi...@us...> - 2014-01-06 08:26:45
|
Revision: 2634 http://sourceforge.net/p/edk2-buildtools/code/2634 Author: yingke Date: 2014-01-06 08:26:41 +0000 (Mon, 06 Jan 2014) Log Message: ----------- Fix a bug which causes build break even if the PCD usages in DSC are correct. Reviewed-by: Bob Feng <bob...@in...> Signed-off-by: Yingke Liu <yin...@in...> Modified Paths: -------------- trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py Modified: trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py =================================================================== --- trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2014-01-06 02:11:28 UTC (rev 2633) +++ trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2014-01-06 08:26:41 UTC (rev 2634) @@ -640,7 +640,11 @@ def _ValidatePcd(self, PcdCName, TokenSpaceGuid, Setting, PcdType, LineNo): if self._DecPcds == None: - self._DecPcds = GetDeclaredPcd(self, self._Bdb, self._Arch, self._Target, self._Toolchain) + # + # Get all PCDs from DECs which are dependent by modules in components sections. + # + PlatformCommon = self._Bdb[self.MetaFile, 'COMMON', self._Target, self._Toolchain] + self._DecPcds = GetDeclaredPcd(PlatformCommon, self._Bdb, 'COMMON', self._Target, self._Toolchain) if (PcdCName, TokenSpaceGuid) not in self._DecPcds: EdkLogger.error('build', PARSER_ERROR, "Pcd (%s.%s) defined in DSC is not declared in DEC files." % (TokenSpaceGuid, PcdCName), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jl...@us...> - 2014-01-06 02:11:33
|
Revision: 2633 http://sourceforge.net/p/edk2-buildtools/code/2633 Author: jliu66 Date: 2014-01-06 02:11:28 +0000 (Mon, 06 Jan 2014) Log Message: ----------- Correct the format of string table to support different variables for all SKU values of one HII PCD. Reviewed-by: Zeng, Star <sta...@in...> Reviewed-by: Feng, Bob C <bob...@in...> Signed-off-by: Jiang Liu <jia...@in...> Modified Paths: -------------- trunk/BaseTools/Source/Python/AutoGen/GenPcdDb.py Modified: trunk/BaseTools/Source/Python/AutoGen/GenPcdDb.py =================================================================== --- trunk/BaseTools/Source/Python/AutoGen/GenPcdDb.py 2014-01-05 12:49:35 UTC (rev 2632) +++ trunk/BaseTools/Source/Python/AutoGen/GenPcdDb.py 2014-01-06 02:11:28 UTC (rev 2633) @@ -1165,6 +1165,7 @@ SkuIndexTableTmp = [] SkuIndexTableTmp.append(0) SkuIdIndex = 1 + VariableHeadList = [] for SkuName in Pcd.SkuInfoList: Sku = Pcd.SkuInfoList[SkuName] SkuId = Sku.SkuId @@ -1180,28 +1181,36 @@ if len(Sku.VariableName) > 0: Pcd.TokenTypeList += ['PCD_TYPE_HII'] Pcd.InitString = 'INIT' - # store VariableName to stringTable and calculate the VariableHeadStringIndex - VariableNameStructure = StringToArray(Sku.VariableName) - if VariableNameStructure not in Dict['STRING_TABLE_VALUE']: - Dict['STRING_TABLE_CNAME'].append(CName) - Dict['STRING_TABLE_GUID'].append(TokenSpaceGuid) - if StringTableIndex == 0: - Dict['STRING_TABLE_INDEX'].append('') - else: - Dict['STRING_TABLE_INDEX'].append('_%d' % StringTableIndex) - VarNameSize = len(VariableNameStructure.replace(',',' ').split()) - Dict['STRING_TABLE_LENGTH'].append(VarNameSize ) - Dict['STRING_TABLE_VALUE'].append(VariableNameStructure) - StringHeadOffsetList.append(str(StringTableSize) + 'U') - VarStringDbOffsetList = [] - VarStringDbOffsetList.append(StringTableSize) - Dict['STRING_DB_VALUE'].append(VarStringDbOffsetList) - StringTableIndex += 1 - StringTableSize += len(VariableNameStructure.replace(',',' ').split()) - VariableHeadStringIndex = 0 - for Index in range(Dict['STRING_TABLE_VALUE'].index(VariableNameStructure)): - VariableHeadStringIndex += Dict['STRING_TABLE_LENGTH'][Index] - + # Store all variable names of one HII PCD under different SKU to stringTable + # and calculate the VariableHeadStringIndex + if SkuIdIndex - 2 == 0: + for SkuName in Pcd.SkuInfoList: + SkuInfo = Pcd.SkuInfoList[SkuName] + if SkuInfo.SkuId == None or SkuInfo.SkuId == '': + continue + VariableNameStructure = StringToArray(SkuInfo.VariableName) + if VariableNameStructure not in Dict['STRING_TABLE_VALUE']: + Dict['STRING_TABLE_CNAME'].append(CName) + Dict['STRING_TABLE_GUID'].append(TokenSpaceGuid) + if StringTableIndex == 0: + Dict['STRING_TABLE_INDEX'].append('') + else: + Dict['STRING_TABLE_INDEX'].append('_%d' % StringTableIndex) + VarNameSize = len(VariableNameStructure.replace(',',' ').split()) + Dict['STRING_TABLE_LENGTH'].append(VarNameSize ) + Dict['STRING_TABLE_VALUE'].append(VariableNameStructure) + StringHeadOffsetList.append(str(StringTableSize) + 'U') + VarStringDbOffsetList = [] + VarStringDbOffsetList.append(StringTableSize) + Dict['STRING_DB_VALUE'].append(VarStringDbOffsetList) + StringTableIndex += 1 + StringTableSize += len(VariableNameStructure.replace(',',' ').split()) + VariableHeadStringIndex = 0 + for Index in range(Dict['STRING_TABLE_VALUE'].index(VariableNameStructure)): + VariableHeadStringIndex += Dict['STRING_TABLE_LENGTH'][Index] + VariableHeadList.append(VariableHeadStringIndex) + + VariableHeadStringIndex = VariableHeadList[SkuIdIndex - 2] # store VariableGuid to GuidTable and get the VariableHeadGuidIndex VariableGuidStructure = Sku.VariableGuidValue VariableGuid = GuidStructureStringToGuidValueName(VariableGuidStructure) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2014-01-05 12:49:40
|
Revision: 2632 http://sourceforge.net/p/edk2-buildtools/code/2632 Author: bobfeng Date: 2014-01-05 12:49:35 +0000 (Sun, 05 Jan 2014) Log Message: ----------- update the error message for the case of the HII PCD VariableOffset exceed the maximum value of 0xFFFF. Signed-off-by: Feng, Bob C <bob...@in...> Reviewed-by: Hess Chen <hes...@in...> Reviewed-by: Liu, Yingke D <yin...@in...> Reviewed-by: Boyer, Donna J <don...@in...> Modified Paths: -------------- trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py Modified: trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py =================================================================== --- trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2014-01-02 01:30:54 UTC (rev 2631) +++ trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2014-01-05 12:49:35 UTC (rev 2632) @@ -36,6 +36,7 @@ from BuildClassObject import * from WorkspaceCommon import GetDeclaredPcd from Common.Misc import AnalyzeDscPcd +import re ## Platform build information from DSC file # @@ -890,6 +891,20 @@ if Setting == None: continue VariableName, VariableGuid, VariableOffset, DefaultValue = self._ValidatePcd(PcdCName, TokenSpaceGuid, Setting, Type, Dummy4) + + ExceedMax = False + if VariableOffset.isdigit(): + if int(VariableOffset,10) > 0xFFFF: + ExceedMax = True + elif re.match(r'[\t\s]*0[xX][a-fA-F0-9]+$',VariableOffset): + if int(VariableOffset,16) > 0xFFFF: + ExceedMax = True + else: + EdkLogger.error('Build', FORMAT_INVALID, "Invalid syntax or format of the variable offset value is incorrect for %s." % ".".join((TokenSpaceGuid,PcdCName))) + + if ExceedMax: + EdkLogger.error('Build', OPTION_VALUE_INVALID, "The variable offset value must not exceed the maximum value of 0xFFFF (UINT16) for %s." % ".".join((TokenSpaceGuid,PcdCName))) + SkuInfo = SkuInfoClass(SkuName, self.SkuIds[SkuName], VariableName, VariableGuid, VariableOffset, DefaultValue) if (PcdCName,TokenSpaceGuid) in Pcds.keys(): pcdObject = Pcds[PcdCName,TokenSpaceGuid] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yz...@us...> - 2014-01-02 01:31:00
|
Revision: 2631 http://sourceforge.net/p/edk2-buildtools/code/2631 Author: yzhen22 Date: 2014-01-02 01:30:54 +0000 (Thu, 02 Jan 2014) Log Message: ----------- Add the feature to append a binary directly as capsule payload. Signed-off-by: Yuxin Zheng <yux...@in...> Reviewed-by: Chen, Hesheng <hes...@in...> Reviewed-by: Liu, Yingke D <Yin...@in... > Reviewed-by: Feng, Bob C <bob...@in...> Modified Paths: -------------- trunk/BaseTools/Source/Python/GenFds/CapsuleData.py trunk/BaseTools/Source/Python/GenFds/FdfParser.py Modified: trunk/BaseTools/Source/Python/GenFds/CapsuleData.py =================================================================== --- trunk/BaseTools/Source/Python/GenFds/CapsuleData.py 2013-12-30 02:49:23 UTC (rev 2630) +++ trunk/BaseTools/Source/Python/GenFds/CapsuleData.py 2014-01-02 01:30:54 UTC (rev 2631) @@ -1,7 +1,7 @@ ## @file # generate capsule # -# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR> +# Copyright (c) 2007-2013, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -134,4 +134,24 @@ # @retval string Generated file name # def GenCapsuleSubItem(self): + return self.FileName + +## Afile class for capsule data +# +# +class CapsuleAfile (CapsuleData): + ## The constructor + # + # @param self The object pointer + # + def __init__(self) : + self.Ffs = None + self.FileName = None + + ## generate Afile capsule data + # + # @param self The object pointer + # @retval string Generated file name + # + def GenCapsuleSubItem(self): return self.FileName \ No newline at end of file Modified: trunk/BaseTools/Source/Python/GenFds/FdfParser.py =================================================================== --- trunk/BaseTools/Source/Python/GenFds/FdfParser.py 2013-12-30 02:49:23 UTC (rev 2630) +++ trunk/BaseTools/Source/Python/GenFds/FdfParser.py 2014-01-02 01:30:54 UTC (rev 2631) @@ -3095,7 +3095,8 @@ IsFv = self.__GetFvStatement(Obj) IsFd = self.__GetFdStatement(Obj) IsAnyFile = self.__GetAnyFileStatement(Obj) - if not (IsInf or IsFile or IsFv or IsFd or IsAnyFile): + IsAfile = self.__GetAfileStatement(Obj) + if not (IsInf or IsFile or IsFv or IsFd or IsAnyFile or IsAfile): break ## __GetFvStatement() method @@ -3187,7 +3188,48 @@ CapsuleAnyFile.FileName = AnyFileName CapsuleObj.CapsuleDataList.append(CapsuleAnyFile) return True + + ## __GetAfileStatement() method + # + # Get Afile for capsule + # + # @param self The object pointer + # @param CapsuleObj for whom Afile is got + # @retval True Successfully find a Afile statement + # @retval False Not able to find a Afile statement + # + def __GetAfileStatement(self, CapsuleObj): + if not self.__IsKeyword("APPEND"): + return False + + if not self.__IsToken("="): + raise Warning("expected '='", self.FileName, self.CurrentLineNumber) + + if not self.__GetNextToken(): + raise Warning("expected Afile name", self.FileName, self.CurrentLineNumber) + + AfileName = self.__Token + AfileBaseName = os.path.basename(AfileName) + + if os.path.splitext(AfileBaseName)[1] not in [".bin",".BIN",".Bin",".dat",".DAT",".Dat",".data",".DATA",".Data"]: + raise Warning('invalid binary file type, should be one of "bin","BIN","Bin","dat","DAT","Dat","data","DATA","Data"', \ + self.FileName, self.CurrentLineNumber) + + if not os.path.isabs(AfileName): + AfileName = GenFdsGlobalVariable.ReplaceWorkspaceMacro(AfileName) + self.__VerifyFile(AfileName) + else: + if not os.path.exists(AfileName): + raise Warning('%s does not exist' % AfileName, self.FileName, self.CurrentLineNumber) + else: + pass + + CapsuleAfile = CapsuleData.CapsuleAfile() + CapsuleAfile.FileName = AfileName + CapsuleObj.CapsuleDataList.append(CapsuleAfile) + return True + ## __GetRule() method # # Get Rule section contents and store its data into rule list of self.Profile This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yi...@us...> - 2013-12-30 02:49:29
|
Revision: 2630 http://sourceforge.net/p/edk2-buildtools/code/2630 Author: yingke Date: 2013-12-30 02:49:23 +0000 (Mon, 30 Dec 2013) Log Message: ----------- Update code to match the updated spec about FixedAtBuild PCD. Reviewed-by: Jiang Liu <jia...@in...> Signed-off-by: Yingke Liu <yin...@in...> Modified Paths: -------------- trunk/BaseTools/Source/Python/Common/Misc.py Modified: trunk/BaseTools/Source/Python/Common/Misc.py =================================================================== --- trunk/BaseTools/Source/Python/Common/Misc.py 2013-12-26 01:55:21 UTC (rev 2629) +++ trunk/BaseTools/Source/Python/Common/Misc.py 2013-12-30 02:49:23 UTC (rev 2630) @@ -1238,9 +1238,16 @@ Value = FieldList[0] Size = '' if len(FieldList) > 1: - Size = FieldList[1] + Type = FieldList[1] + # Fix the PCD type when no DataType input + if Type == 'VOID*': + DataType = 'VOID*' + else: + Size = FieldList[1] + if len(FieldList) > 2: + Size = FieldList[2] if DataType == 'VOID*': - IsValid = (len(FieldList) <= 2) + IsValid = (len(FieldList) <= 3) else: IsValid = (len(FieldList) <= 1) return [Value, '', Size], IsValid, 0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lg...@us...> - 2013-12-26 01:55:27
|
Revision: 2629 http://sourceforge.net/p/edk2-buildtools/code/2629 Author: lgao4 Date: 2013-12-26 01:55:21 +0000 (Thu, 26 Dec 2013) Log Message: ----------- Fixed the error of Pcd's size is incorrect for void* pcd Signed-off-by: Feng, Bob C <bob...@in...> Reviewed-by: Hess Chen <hes...@in...> Reviewed-by: Liu, Yingke D <yin...@in...> Reviewed-by: Zeng, Star <sta...@in...> Modified Paths: -------------- trunk/BaseTools/Source/Python/AutoGen/GenPcdDb.py trunk/BaseTools/Source/Python/Common/Misc.py trunk/BaseTools/Source/Python/Common/String.py trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py Modified: trunk/BaseTools/Source/Python/AutoGen/GenPcdDb.py =================================================================== --- trunk/BaseTools/Source/Python/AutoGen/GenPcdDb.py 2013-12-18 08:52:05 UTC (rev 2628) +++ trunk/BaseTools/Source/Python/AutoGen/GenPcdDb.py 2013-12-26 01:55:21 UTC (rev 2629) @@ -528,13 +528,20 @@ if RawDataList is None: RawDataList = [] DbItemList.__init__(self, ItemSize, DataList, RawDataList) + def GetListSize(self): + length = 0 + for Data in self.RawDataList: + length += (1 + len(Data[1])) + return length * self.ItemSize def PackData(self): - PackStr = "=HH" + PackStr = "=H" Buffer = '' for Data in self.RawDataList: Buffer += pack(PackStr, - GetIntegerValue(Data[0]), - GetIntegerValue(Data[1])) + GetIntegerValue(Data[0])) + for subData in Data[1]: + Buffer += pack(PackStr, + GetIntegerValue(subData)) return Buffer ## DbStringItemList @@ -732,7 +739,7 @@ DbPcdNameOffsetTable = DbItemList(4,RawDataList = PcdNameOffsetTable) SizeTableValue = zip(Dict['SIZE_TABLE_MAXIMUM_LENGTH'], Dict['SIZE_TABLE_CURRENT_LENGTH']) - DbSizeTableValue = DbSizeTableItemList(4, RawDataList = SizeTableValue) + DbSizeTableValue = DbSizeTableItemList(2, RawDataList = SizeTableValue) InitValueUint16 = Dict['INIT_DB_VALUE_UINT16'] DbInitValueUint16 = DbComItemList(2, RawDataList = InitValueUint16) VardefValueUint16 = Dict['VARDEF_DB_VALUE_UINT16'] @@ -812,7 +819,7 @@ SkuIndexIndexTable = [(0) for i in xrange(len(Dict['SKU_INDEX_VALUE']))] SkuIndexIndexTable[0] = 0 #Dict['SKU_INDEX_VALUE'][0][0] for i in range(1,len(Dict['SKU_INDEX_VALUE'])): - SkuIndexIndexTable[i] = SkuIndexIndexTable[i-1]+Dict['SKU_INDEX_VALUE'][i-1][0] + SkuIndexIndexTable[i] = SkuIndexIndexTable[i-1]+Dict['SKU_INDEX_VALUE'][i-1][0] + 1 for (LocalTokenNumberTableIndex, (Offset, Table)) in enumerate(LocalTokenNumberTable): DbIndex = 0 DbOffset = FixedHeaderLen @@ -829,7 +836,7 @@ LocalTokenNumberTable[LocalTokenNumberTableIndex] = DbOffset|int(TokenTypeValue) # if PCD_TYPE_SKU_ENABLED, then we need to fix up the SkuTable - SkuIndexTabalOffset = SkuIdTableOffset + Dict['SKUID_VALUE'][0] + SkuIndexTabalOffset = SkuIdTableOffset + Dict['SKUID_VALUE'][0] + 1 if (TokenTypeValue & (0x2 << 28)): SkuTable[SkuHeaderIndex] = (DbOffset|int(TokenTypeValue & ~(0x2<<28)), SkuIndexTabalOffset + SkuIndexIndexTable[SkuHeaderIndex]) LocalTokenNumberTable[LocalTokenNumberTableIndex] = (SkuTableOffset + SkuHeaderIndex * 8) | int(TokenTypeValue) @@ -1106,6 +1113,7 @@ GuidList = [] i = 0 for Pcd in Platform.DynamicPcdList: + VoidStarTypeCurrSize = [] i += 1 CName = Pcd.TokenCName TokenSpaceGuidCName = Pcd.TokenSpaceGuidCName @@ -1258,11 +1266,8 @@ # Also add the VOID* string of VPD PCD to SizeTable if Pcd.DatumType == 'VOID*': NumberOfSizeItems += 1 - Dict['SIZE_TABLE_CNAME'].append(CName) - Dict['SIZE_TABLE_GUID'].append(TokenSpaceGuid) # For VPD type of PCD, its current size is equal to its MAX size. - Dict['SIZE_TABLE_CURRENT_LENGTH'].append(str(Pcd.MaxDatumSize) + 'U') - Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append(str(Pcd.MaxDatumSize) + 'U') + VoidStarTypeCurrSize = [str(Pcd.MaxDatumSize) + 'U'] continue if Pcd.DatumType == 'VOID*': @@ -1285,29 +1290,31 @@ Dict['STRING_TABLE_VALUE'].append(DefaultValueBinStructure) elif Sku.DefaultValue[0] == '"': DefaultValueBinStructure = StringToArray(Sku.DefaultValue) - Size = len(DefaultValueBinStructure.replace(',',' ').split()) + Size = len(Sku.DefaultValue) -2 + 1 Dict['STRING_TABLE_VALUE'].append(DefaultValueBinStructure) elif Sku.DefaultValue[0] == '{': DefaultValueBinStructure = StringToArray(Sku.DefaultValue) - Size = len(DefaultValueBinStructure.replace(',',' ').split()) + Size = len(Sku.DefaultValue.split(",")) Dict['STRING_TABLE_VALUE'].append(DefaultValueBinStructure) StringHeadOffsetList.append(str(StringTableSize) + 'U') StringDbOffsetList.append(StringTableSize) - Dict['SIZE_TABLE_CNAME'].append(CName) - Dict['SIZE_TABLE_GUID'].append(TokenSpaceGuid) if Pcd.MaxDatumSize != '': MaxDatumSize = int(Pcd.MaxDatumSize, 0) if MaxDatumSize < Size: - MaxDatumSize = Size - Size = MaxDatumSize - if Size % 2: - Size += 1 - Dict['SIZE_TABLE_CURRENT_LENGTH'].append(str(Size) + 'U') - Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append(str(Pcd.MaxDatumSize) + 'U') - Dict['STRING_TABLE_LENGTH'].append(Size) + EdkLogger.error("build", AUTOGEN_ERROR, + "The maximum size of VOID* type PCD '%s.%s' is less than its actual size occupied." % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName), + ExtraData="[%s]" % str(Platform)) + else: + MaxDatumSize = Size + StringTabLen = MaxDatumSize + if StringTabLen % 2: + StringTabLen += 1 + if Sku.VpdOffset == '': + VoidStarTypeCurrSize.append(str(Size) + 'U') + Dict['STRING_TABLE_LENGTH'].append(StringTabLen) StringTableIndex += 1 - StringTableSize += (Size) + StringTableSize += (StringTabLen) else: if "PCD_TYPE_HII" not in Pcd.TokenTypeList: Pcd.TokenTypeList += ['PCD_TYPE_DATA'] @@ -1333,8 +1340,14 @@ DbValueList.append(Sku.DefaultValue) Pcd.TokenTypeList = list(set(Pcd.TokenTypeList)) + if Pcd.DatumType == 'VOID*': + Dict['SIZE_TABLE_CNAME'].append(CName) + Dict['SIZE_TABLE_GUID'].append(TokenSpaceGuid) + Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append(str(Pcd.MaxDatumSize) + 'U') + Dict['SIZE_TABLE_CURRENT_LENGTH'].append(VoidStarTypeCurrSize) - SkuIndexTableTmp[0] = len(SkuIndexTableTmp) + + SkuIndexTableTmp[0] = len(SkuIndexTableTmp) - 1 if len(Pcd.SkuInfoList) > 1: Dict['SKU_INDEX_VALUE'].append(SkuIndexTableTmp) @@ -1511,7 +1524,7 @@ if Dict['SIZE_TABLE_CNAME'] == []: Dict['SIZE_TABLE_CNAME'].append('') Dict['SIZE_TABLE_GUID'].append('') - Dict['SIZE_TABLE_CURRENT_LENGTH'].append('0U') + Dict['SIZE_TABLE_CURRENT_LENGTH'].append(['0U']) Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append('0U') if NumberOfLocalTokens != 0: @@ -1534,7 +1547,7 @@ if NumberOfSkuEnabledPcd != 0: Dict['SKU_HEAD_SIZE'] = str(NumberOfSkuEnabledPcd) + 'U' - Dict['SKUID_VALUE'][0] = len(Dict['SKUID_VALUE']) + Dict['SKUID_VALUE'][0] = len(Dict['SKUID_VALUE']) - 1 AutoGenH.Append(gPcdDatabaseAutoGenH.Replace(Dict)) if NumberOfLocalTokens == 0: Modified: trunk/BaseTools/Source/Python/Common/Misc.py =================================================================== --- trunk/BaseTools/Source/Python/Common/Misc.py 2013-12-18 08:52:05 UTC (rev 2628) +++ trunk/BaseTools/Source/Python/Common/Misc.py 2013-12-26 01:55:21 UTC (rev 2629) @@ -1255,7 +1255,12 @@ Size = FieldList[2] else: if Type == 'VOID*': - Size = str(len(Value)) + if Value.startswith("L"): + Size = str((len(Value)- 3 + 1) * 2) + elif Value.startswith("{"): + Size = str(len(Value.split(","))) + else: + Size = str(len(Value) -2 + 1 ) if DataType == 'VOID*': IsValid = (len(FieldList) <= 3) else: Modified: trunk/BaseTools/Source/Python/Common/String.py =================================================================== --- trunk/BaseTools/Source/Python/Common/String.py 2013-12-18 08:52:05 UTC (rev 2628) +++ trunk/BaseTools/Source/Python/Common/String.py 2013-12-26 01:55:21 UTC (rev 2629) @@ -809,7 +809,7 @@ else: return "{%s, 0x00,0x00}" % ", ".join(["0x%02x" % ord(C) for C in String[1:-1]]) elif String.startswith('{'): - StringLen = len(String[1:-1]) + StringLen = len(String.split(",")) if StringLen % 2: return "{%s, 0x00}" % ", ".join([ C for C in String[1:-1].split(',')]) else: Modified: trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py =================================================================== --- trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2013-12-18 08:52:05 UTC (rev 2628) +++ trunk/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 2013-12-26 01:55:21 UTC (rev 2629) @@ -814,6 +814,16 @@ if (PcdCName,TokenSpaceGuid) in Pcds.keys(): pcdObject = Pcds[PcdCName,TokenSpaceGuid] pcdObject.SkuInfoList[SkuName] = SkuInfo + if MaxDatumSize.strip(): + CurrentMaxSize = int(MaxDatumSize.strip(),0) + else: + CurrentMaxSize = 0 + if pcdObject.MaxDatumSize: + PcdMaxSize = int(pcdObject.MaxDatumSize,0) + else: + PcdMaxSize = 0 + if CurrentMaxSize > PcdMaxSize: + pcdObject.MaxDatumSize = str(CurrentMaxSize) else: Pcds[PcdCName, TokenSpaceGuid] = PcdClassObject( PcdCName, @@ -843,27 +853,7 @@ if 'DEFAULT' in pcd.SkuInfoList.keys() and SkuObj.SystemSkuId not in pcd.SkuInfoList.keys(): pcd.SkuInfoList[SkuObj.SystemSkuId] = pcd.SkuInfoList['DEFAULT'] del(pcd.SkuInfoList['DEFAULT']) - - - if pcd.MaxDatumSize.strip(): - MaxSize = int(pcd.MaxDatumSize,0) - else: - MaxSize = 0 - if pcdDecObject.DatumType == 'VOID*': - for (skuname,skuobj) in pcd.SkuInfoList.items(): - if skuobj.DefaultValue.startswith("L"): - datalen = len(skuobj.DefaultValue) * 2 - elif skuobj.DefaultValue.startswith("{"): - datalen = len(skuobj.DefaultValue.split(",")) - else: - datalen = len(skuobj.DefaultValue) - if datalen>MaxSize: - MaxSize = datalen - if MaxSize % 2: - MaxSize += 1 - pcd.MaxDatumSize = str(MaxSize) - - + return Pcds ## Retrieve dynamic HII PCD settings @@ -944,16 +934,15 @@ MaxSize = 0 if pcdDecObject.DatumType == 'VOID*': for (skuname,skuobj) in pcd.SkuInfoList.items(): - if skuobj.DefaultValue.startswith("L"): - datalen = len(skuobj.DefaultValue) * 2 - elif skuobj.DefaultValue.startswith("{"): - datalen = len(skuobj.DefaultValue.split(",")) + datalen = 0 + if skuobj.HiiDefaultValue.startswith("L"): + datalen = (len(skuobj.HiiDefaultValue)- 3 + 1) * 2 + elif skuobj.HiiDefaultValue.startswith("{"): + datalen = len(skuobj.HiiDefaultValue.split(",")) else: - datalen = len(skuobj.DefaultValue) + datalen = len(skuobj.HiiDefaultValue) -2 + 1 if datalen>MaxSize: MaxSize = datalen - if MaxSize % 2: - MaxSize += 1 pcd.MaxDatumSize = str(MaxSize) return Pcds @@ -1001,6 +990,16 @@ if (PcdCName,TokenSpaceGuid) in Pcds.keys(): pcdObject = Pcds[PcdCName,TokenSpaceGuid] pcdObject.SkuInfoList[SkuName] = SkuInfo + if MaxDatumSize.strip(): + CurrentMaxSize = int(MaxDatumSize.strip(),0) + else: + CurrentMaxSize = 0 + if pcdObject.MaxDatumSize: + PcdMaxSize = int(pcdObject.MaxDatumSize,0) + else: + PcdMaxSize = 0 + if CurrentMaxSize > PcdMaxSize: + pcdObject.MaxDatumSize = str(CurrentMaxSize) else: Pcds[PcdCName, TokenSpaceGuid] = PcdClassObject( PcdCName, @@ -1031,23 +1030,6 @@ pcd.SkuInfoList[SkuObj.SystemSkuId] = pcd.SkuInfoList['DEFAULT'] del(pcd.SkuInfoList['DEFAULT']) - if pcd.MaxDatumSize.strip(): - MaxSize = int(pcd.MaxDatumSize,0) - else: - MaxSize = 0 - if pcdDecObject.DatumType == 'VOID*': - for (skuname,skuobj) in pcd.SkuInfoList.items(): - if skuobj.DefaultValue.startswith("L"): - datalen = len(skuobj.DefaultValue) * 2 - elif skuobj.DefaultValue.startswith("{"): - datalen = len(skuobj.DefaultValue.split(",")) - else: - datalen = len(skuobj.DefaultValue) - if datalen>MaxSize: - MaxSize = datalen - if MaxSize % 2: - MaxSize += 1 - pcd.MaxDatumSize = str(MaxSize) return Pcds ## Add external modules This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |