54 unsigned int mask = ~inc; |
55 unsigned int mask = ~inc; |
55 unsigned int val = (unsigned int)v; |
56 unsigned int val = (unsigned int)v; |
56 unsigned int res = (val+inc) & mask; |
57 unsigned int res = (val+inc) & mask; |
57 return (T)res; |
58 return (T)res; |
58 } |
59 } |
59 |
|
60 // Need a default constructor for TVersion, but don't want all the other stuff in h_utl.cpp |
|
61 /** |
|
62 Default constructor for TVersion class. |
|
63 @internalComponent |
|
64 @released |
|
65 */ |
|
66 TVersion::TVersion(){} |
|
67 |
|
68 /** |
|
69 Constructor for TVersion class. |
|
70 @internalComponent |
|
71 @released |
|
72 */ |
|
73 TVersion::TVersion(TInt aMajor, TInt aMinor, TInt aBuild): |
|
74 iMajor((TInt8)aMajor), iMinor((TInt8)aMinor), iBuild((TInt16)aBuild) |
|
75 { |
|
76 } |
|
77 |
|
78 |
60 |
79 /** |
61 /** |
80 Constructor for E32ImageChunkDesc class. |
62 Constructor for E32ImageChunkDesc class. |
81 @internalComponent |
63 @internalComponent |
82 @released |
64 @released |
1175 { |
1157 { |
1176 iHdr->iFlags &=~ KImageHWFloatMask; |
1158 iHdr->iFlags &=~ KImageHWFloatMask; |
1177 |
1159 |
1178 if (iUseCase->GetFPU() == 1) |
1160 if (iUseCase->GetFPU() == 1) |
1179 iHdr->iFlags |= KImageHWFloat_VFPv2; |
1161 iHdr->iFlags |= KImageHWFloat_VFPv2; |
|
1162 else if (iUseCase->GetFPU() == 2) |
|
1163 iHdr->iFlags |= KImageHWFloat_VFPv3; |
|
1164 else if (iUseCase->GetFPU() == 3) |
|
1165 iHdr->iFlags |= KImageHWFloat_VFPv3D16; |
1180 } |
1166 } |
1181 |
1167 |
1182 /** |
1168 /** |
1183 This function sets the paging attribute in the E32 image. |
1169 This function sets the paging attribute in the E32 image. |
1184 @internalComponent |
1170 @internalComponent |
1430 { |
1416 { |
1431 size_t aHeaderSize = GetExtendedE32ImageHeaderSize(); |
1417 size_t aHeaderSize = GetExtendedE32ImageHeaderSize(); |
1432 os->write(iE32Image, aHeaderSize); |
1418 os->write(iE32Image, aHeaderSize); |
1433 |
1419 |
1434 // Compress and write out code part |
1420 // Compress and write out code part |
|
1421 CBytePair bpe; |
1435 int srcStart = GetExtendedE32ImageHeaderSize(); |
1422 int srcStart = GetExtendedE32ImageHeaderSize(); |
1436 CompressPages( (TUint8*)iE32Image + srcStart, iHdr->iCodeSize, *os); |
1423 CompressPages( (TUint8*)iE32Image + srcStart, iHdr->iCodeSize, *os, &bpe); |
1437 |
1424 |
1438 |
1425 |
1439 // Compress and write out data part |
1426 // Compress and write out data part |
1440 srcStart += iHdr->iCodeSize; |
1427 srcStart += iHdr->iCodeSize; |
1441 int srcLen = GetE32ImageSize() - srcStart; |
1428 int srcLen = GetE32ImageSize() - srcStart; |
1442 |
1429 |
1443 CompressPages((TUint8*)iE32Image + srcStart, srcLen, *os); |
1430 CompressPages((TUint8*)iE32Image + srcStart, srcLen, *os, &bpe); |
1444 |
1431 |
1445 } |
1432 } |
1446 else if (compression == 0) |
1433 else if (compression == 0) |
1447 { |
1434 { |
1448 os->write(iE32Image, GetE32ImageSize()); // image not compressed |
1435 os->write(iE32Image, GetE32ImageSize()); // image not compressed |
1767 if (aImage.iData==NULL) |
1754 if (aImage.iData==NULL) |
1768 return is; |
1755 return is; |
1769 oh = aImage.iOrigHdr; |
1756 oh = aImage.iOrigHdr; |
1770 |
1757 |
1771 // Read and decompress code part of the image |
1758 // Read and decompress code part of the image |
1772 |
1759 CBytePair bpe; |
1773 unsigned int uncompressedCodeSize = DecompressPages((TUint8 *) (aImage.iData + orighdrsz), is); |
1760 unsigned int uncompressedCodeSize = DecompressPages((TUint8 *) (aImage.iData + orighdrsz), is, &bpe); |
1774 |
1761 |
1775 |
1762 |
1776 // Read and decompress data part of the image |
1763 // Read and decompress data part of the image |
1777 |
1764 |
1778 unsigned int uncompressedDataSize = DecompressPages((TUint8 *) (aImage.iData + orighdrsz + uncompressedCodeSize), is); |
1765 unsigned int uncompressedDataSize = DecompressPages((TUint8 *) (aImage.iData + orighdrsz + uncompressedCodeSize), is, &bpe); |
1779 |
1766 |
1780 if (uncompressedCodeSize + uncompressedDataSize != uncompsize) |
1767 if (uncompressedCodeSize + uncompressedDataSize != uncompsize) |
1781 MessageHandler::GetInstance()->ReportMessage(WARNING, BYTEPAIRINCONSISTENTSIZEERROR); |
1768 MessageHandler::GetInstance()->ReportMessage(WARNING, BYTEPAIRINCONSISTENTSIZEERROR); |
1782 |
1769 |
1783 if ((TUint)orighdrsz > oh->iCodeOffset) |
1770 if ((TUint)orighdrsz > oh->iCodeOffset) |