equal
deleted
inserted
replaced
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "Eclipse Public License v1.0" |
4 // under the terms of the License "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
24 iDataOffset = static_cast<TInt64>(0); |
24 iDataOffset = static_cast<TInt64>(0); |
25 iSize = static_cast<TUint64>(0); |
25 iSize = static_cast<TUint64>(0); |
26 } |
26 } |
27 |
27 |
28 |
28 |
29 inline TInt TMsDataMemMap::BlockLength() const |
29 inline TUint32 TMsDataMemMap::BlockLength() const |
30 { |
30 { |
31 return KSectorSize; |
31 return iSectorSize; |
32 } |
32 } |
33 |
33 |
34 |
34 |
35 inline TUint64 TMsDataMemMap::DataSize() const |
35 inline TUint64 TMsDataMemMap::DataSize() const |
36 { |
36 { |
37 return iSize - iDataOffset; |
37 return iSize - iDataOffset; |
38 } |
38 } |
39 |
39 |
40 inline void TMsDataMemMap::InitDataArea(TUint32 aFirstDataSector, TUint32 aNumSectors) |
40 inline void TMsDataMemMap::InitDataArea(TUint32 aFirstDataSector, TUint32 aNumSectors, TUint32 aSectorSize) |
41 { |
41 { |
42 iDataOffset = static_cast<TInt64>(aFirstDataSector) * KSectorSize; |
42 iSectorSize = aSectorSize; |
43 iSize = static_cast<TInt64>(aNumSectors) * KSectorSize; |
43 |
44 } |
44 iFormatSectorShift = 0; |
|
45 while(aSectorSize) |
|
46 { |
|
47 ++iFormatSectorShift; |
|
48 aSectorSize >>= 1; |
|
49 } |
|
50 |
|
51 iDataOffset = static_cast<TInt64>(aFirstDataSector) * iSectorSize; |
|
52 iSize = static_cast<TInt64>(aNumSectors) * iSectorSize; |
|
53 } |
45 |
54 |
46 |
55 |
47 inline void TMsDataMemMap::InitDataArea(TUint64 aSize) |
56 inline void TMsDataMemMap::InitDataArea(TUint64 aSize) |
48 { |
57 { |
49 iSize = aSize - iDataOffset; |
58 iSize = aSize - iDataOffset; |
53 inline TInt64 TMsDataMemMap::GetDataPos(TInt64 aPos) const |
62 inline TInt64 TMsDataMemMap::GetDataPos(TInt64 aPos) const |
54 { |
63 { |
55 return aPos + iDataOffset; |
64 return aPos + iDataOffset; |
56 } |
65 } |
57 |
66 |
|
67 inline TInt TMsDataMemMap::FormatSectorShift() const |
|
68 { |
|
69 return iFormatSectorShift; |
|
70 } |
|
71 |