kernel/eka/drivers/locmedia/dmasupport.inl
changeset 279 957c583b417b
parent 0 a41df078684a
equal deleted inserted replaced
275:2b433474f2ba 279:957c583b417b
     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".
    12 //
    12 //
    13 // Description:
    13 // Description:
    14 //
    14 //
    15 
    15 
    16 
    16 
    17 inline TInt DDmaHelper::PageSizeLog2()	{ return iPageSizeLog2; }
       
    18 inline TBool DDmaHelper::IsPageAligned(TLinAddr aAddr)		{ return !(aAddr & iPageSizeMsk); }
    17 inline TBool DDmaHelper::IsPageAligned(TLinAddr aAddr)		{ return !(aAddr & iPageSizeMsk); }
    19 inline TLinAddr DDmaHelper::PageAlign(TLinAddr aAddr)	{ return aAddr & ~iPageSizeMsk; }
    18 inline TLinAddr DDmaHelper::PageAlign(TLinAddr aAddr)	{ return aAddr & ~iPageSizeMsk; }
    20 inline TLinAddr DDmaHelper::PageOffset(TLinAddr aAddr)		{ return aAddr & iPageSizeMsk; }
    19 inline TLinAddr DDmaHelper::PageOffset(TLinAddr aAddr)		{ return aAddr & iPageSizeMsk; }
    21 
    20 
    22 
    21 
    23 inline TInt DDmaHelper::MaxFragLength()	const { return iMaxPages << iPageSizeLog2; }
    22 inline TInt DDmaHelper::MaxFragLength()	const { return iMaxPages << iPageSizeLog2; }
    24 inline void DDmaHelper::SetFragLength(TInt aLength) { iFragLen = iFragLenRemaining = aLength; }
    23 inline void DDmaHelper::SetFragLength(TInt aLength) { iFragLen = iFragLenRemaining = aLength; }
    25 inline TInt DDmaHelper::FragLength()	const { return iFragLen; }
    24 inline TInt DDmaHelper::FragLength()	const { return iFragLen; }
    26 inline TInt DDmaHelper::LengthRemaining() const { return iReqLenClient - iLenConsumed; }
    25 inline TInt DDmaHelper::LengthRemaining() const { return iReqLenClient - iLenConsumed; }
    27 inline TUint32 DDmaHelper::LengthConsumed() const {return iLenConsumed; }
       
    28 
    26 
    29 
    27 
    30 inline TBool DDmaHelper::IsDmaAligned(TLinAddr aAddr)		{ return !(aAddr & (iDmaAlignment-1)); }
    28 inline TBool DDmaHelper::IsDmaAligned(TLinAddr aAddr)		{ return !(aAddr & (iDmaAlignment-1)); }
    31 
    29 
    32 inline TBool DDmaHelper::IsBlockAligned(TInt64 aPos)		{ return !(aPos & iMediaBlockSizeMask); }
    30 inline TBool DDmaHelper::IsBlockAligned(TInt64 aPos)		{ return !(aPos & iMediaBlockSizeMask); }