Changeset 58466 in vbox for trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseUefiDecompressLib
- Timestamp:
- Oct 29, 2015 4:30:44 AM (9 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware
- Property svn:mergeinfo changed
/vendor/edk2/current merged: 103769-103776
- Property svn:mergeinfo changed
-
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c
r58459 r58466 72 72 // 73 73 Sd->mBitCount = (UINT16) (Sd->mBitCount - NumOfBits); 74 74 75 75 // 76 76 // Copy NumOfBits of bits from mSubBitBuf into mBitBuf … … 102 102 // 103 103 // Pop NumOfBits of Bits from Left 104 // 104 // 105 105 OutBits = (UINT32) (Sd->mBitBuf >> (BITBUFSIZ - NumOfBits)); 106 106 … … 167 167 Count[BitLen[Index]]++; 168 168 } 169 169 170 170 Start[0] = 0; 171 171 Start[1] = 0; … … 183 183 184 184 JuBits = (UINT16) (16 - TableBits); 185 185 186 186 Weight[0] = 0; 187 187 for (Index = 1; Index <= TableBits; Index++) { … … 192 192 while (Index <= 16) { 193 193 Weight[Index] = (UINT16) (1U << (16 - Index)); 194 Index++; 194 Index++; 195 195 } 196 196 … … 233 233 *Pointer = Avail++; 234 234 } 235 235 236 236 if (*Pointer < (2 * NC - 1)) { 237 237 if ((Index3 & Mask) != 0) { … … 336 336 ASSERT (nn <= NPT); 337 337 // 338 // Read Extra Set Code Length Array size 338 // Read Extra Set Code Length Array size 339 339 // 340 340 Number = (UINT16) GetBits (Sd, nbit); … … 361 361 // 362 362 // If a code length is less than 7, then it is encoded as a 3-bit 363 // value. Or it is encoded as a series of "1"s followed by a 363 // value. Or it is encoded as a series of "1"s followed by a 364 364 // terminating "0". The number of "1"s = Code length - 4. 365 365 // … … 371 371 } 372 372 } 373 373 374 374 FillBuf (Sd, (UINT16) ((CharC < 7) ? 3 : CharC - 3)); 375 375 376 376 Sd->mPTLen[Index++] = (UINT8) CharC; 377 378 // 379 // For Code&Len Set, 377 378 // 379 // For Code&Len Set, 380 380 // After the third length of the code length concatenation, 381 // a 2-bit value is used to indicated the number of consecutive 381 // a 2-bit value is used to indicated the number of consecutive 382 382 // zero lengths after the third length. 383 383 // … … 393 393 Sd->mPTLen[Index++] = 0; 394 394 } 395 395 396 396 return MakeTable (Sd, nn, Sd->mPTLen, 8, Sd->mPTTable); 397 397 } … … 505 505 // Starting a new block 506 506 // Read BlockSize from block header 507 // 507 // 508 508 Sd->mBlockSize = (UINT16) GetBits (Sd, 16); 509 509 … … 524 524 525 525 // 526 // Read in the Position Set Code Length Arrary, 526 // Read in the Position Set Code Length Arrary, 527 527 // Generate the Huffman code mapping table for the Position Set. 528 528 // … … 582 582 // 583 583 // Get one code from mBitBuf 584 // 584 // 585 585 CharC = DecodeC (Sd); 586 586 if (Sd->mBadTableFlag != 0) { … … 606 606 // 607 607 CharC = (UINT16) (CharC - (BIT8 - THRESHOLD)); 608 608 609 609 // 610 610 // Get string length … … 637 637 638 638 /** 639 Given a compressed source buffer, this function retrieves the size of 640 the uncompressed buffer and the size of the scratch buffer required 639 Given a compressed source buffer, this function retrieves the size of 640 the uncompressed buffer and the size of the scratch buffer required 641 641 to decompress the compressed source buffer. 642 642 643 Retrieves the size of the uncompressed buffer and the temporary scratch buffer 643 Retrieves the size of the uncompressed buffer and the temporary scratch buffer 644 644 required to decompress the buffer specified by Source and SourceSize. 645 645 If the size of the uncompressed buffer or the size of the scratch buffer cannot 646 be determined from the compressed data specified by Source and SourceData, 646 be determined from the compressed data specified by Source and SourceData, 647 647 then RETURN_INVALID_PARAMETER is returned. Otherwise, the size of the uncompressed 648 648 buffer is returned in DestinationSize, the size of the scratch buffer is returned 649 649 in ScratchSize, and RETURN_SUCCESS is returned. 650 This function does not have scratch buffer available to perform a thorough 650 This function does not have scratch buffer available to perform a thorough 651 651 checking of the validity of the source data. It just retrieves the "Original Size" 652 652 field from the beginning bytes of the source data and output it as DestinationSize. … … 663 663 by Source and SourceSize is decompressed. 664 664 @param ScratchSize A pointer to the size, in bytes, of the scratch buffer that 665 is required to decompress the compressed buffer specified 665 is required to decompress the compressed buffer specified 666 666 by Source and SourceSize. 667 667 668 @retval RETURN_SUCCESS The size of the uncompressed data was returned 669 in DestinationSize, and the size of the scratch 668 @retval RETURN_SUCCESS The size of the uncompressed data was returned 669 in DestinationSize, and the size of the scratch 670 670 buffer was returned in ScratchSize. 671 @retval RETURN_INVALID_PARAMETER 672 The size of the uncompressed data or the size of 673 the scratch buffer cannot be determined from 674 the compressed data specified by Source 671 @retval RETURN_INVALID_PARAMETER 672 The size of the uncompressed data or the size of 673 the scratch buffer cannot be determined from 674 the compressed data specified by Source 675 675 and SourceSize. 676 676 **/ … … 711 711 This function is designed so that the decompression algorithm can be implemented 712 712 without using any memory services. As a result, this function is not allowed to 713 call any memory allocation services in its implementation. It is the caller's 713 call any memory allocation services in its implementation. It is the caller's 714 714 responsibility to allocate and free the Destination and Scratch buffers. 715 If the compressed source data specified by Source is successfully decompressed 716 into Destination, then RETURN_SUCCESS is returned. If the compressed source data 715 If the compressed source data specified by Source is successfully decompressed 716 into Destination, then RETURN_SUCCESS is returned. If the compressed source data 717 717 specified by Source is not in a valid compressed data format, 718 718 then RETURN_INVALID_PARAMETER is returned. … … 725 725 @param Destination The destination buffer to store the decompressed data. 726 726 @param Scratch A temporary scratch buffer that is used to perform the decompression. 727 This is an optional parameter that may be NULL if the 727 This is an optional parameter that may be NULL if the 728 728 required scratch buffer size is 0. 729 730 @retval RETURN_SUCCESS Decompression completed successfully, and 729 730 @retval RETURN_SUCCESS Decompression completed successfully, and 731 731 the uncompressed buffer is returned in Destination. 732 @retval RETURN_INVALID_PARAMETER 733 The source buffer specified by Source is corrupted 732 @retval RETURN_INVALID_PARAMETER 733 The source buffer specified by Source is corrupted 734 734 (not in a valid compressed format). 735 735 **/ -
trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
r58459 r58466 21 21 MODULE_TYPE = BASE 22 22 VERSION_STRING = 1.0 23 LIBRARY_CLASS = UefiDecompressLib 23 LIBRARY_CLASS = UefiDecompressLib 24 24 25 25
Note:
See TracChangeset
for help on using the changeset viewer.