os/kernelhwsrv/userlibandfileserver/fileserver/shostmassstorage/msproxy/tmsmemmap.inl
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 /**
    17  @file
    18  @internalTechnology
    19 */
    20 
    21 
    22 inline void TMsDataMemMap::Reset()
    23     {
    24     iDataOffset = static_cast<TInt64>(0);
    25     iSize = static_cast<TUint64>(0);
    26     }
    27 
    28 
    29 inline TInt TMsDataMemMap::BlockLength() const
    30     {
    31     return KSectorSize;
    32     }
    33 
    34 
    35 inline TUint64 TMsDataMemMap::DataSize() const
    36     {
    37     return iSize - iDataOffset;
    38     }
    39 
    40 inline void TMsDataMemMap::InitDataArea(TUint32 aFirstDataSector, TUint32 aNumSectors)
    41     {
    42     iDataOffset = static_cast<TInt64>(aFirstDataSector) * KSectorSize;
    43     iSize = static_cast<TInt64>(aNumSectors) * KSectorSize;
    44     }
    45 
    46 
    47 inline void TMsDataMemMap::InitDataArea(TUint64 aSize)
    48     {
    49     iSize = aSize - iDataOffset;
    50     }
    51 
    52 
    53 inline TInt64 TMsDataMemMap::GetDataPos(TInt64 aPos) const
    54     {
    55     return aPos + iDataOffset;
    56     }
    57