sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: sl@0: inline TInt DDmaHelper::PageSizeLog2() { return iPageSizeLog2; } sl@0: inline TBool DDmaHelper::IsPageAligned(TLinAddr aAddr) { return !(aAddr & iPageSizeMsk); } sl@0: inline TLinAddr DDmaHelper::PageAlign(TLinAddr aAddr) { return aAddr & ~iPageSizeMsk; } sl@0: inline TLinAddr DDmaHelper::PageOffset(TLinAddr aAddr) { return aAddr & iPageSizeMsk; } sl@0: sl@0: sl@0: inline TInt DDmaHelper::MaxFragLength() const { return iMaxPages << iPageSizeLog2; } sl@0: inline void DDmaHelper::SetFragLength(TInt aLength) { iFragLen = iFragLenRemaining = aLength; } sl@0: inline TInt DDmaHelper::FragLength() const { return iFragLen; } sl@0: inline TInt DDmaHelper::LengthRemaining() const { return iReqLenClient - iLenConsumed; } sl@0: inline TUint32 DDmaHelper::LengthConsumed() const {return iLenConsumed; } sl@0: sl@0: sl@0: inline TBool DDmaHelper::IsDmaAligned(TLinAddr aAddr) { return !(aAddr & (iDmaAlignment-1)); } sl@0: sl@0: inline TBool DDmaHelper::IsBlockAligned(TInt64 aPos) { return !(aPos & iMediaBlockSizeMask); } sl@0: inline TInt64 DDmaHelper::BlockAlign(TInt64 aPos) { return aPos & ~iMediaBlockSizeMask; } sl@0: inline TInt DDmaHelper::BlockOffset(TInt64 aPos) { return TInt(aPos & iMediaBlockSizeMask); } sl@0: sl@0: inline TLinAddr DDmaHelper::LinAddress() const { return iLinAddressUser + ((TUint32) iReqRemoteDesOffset) + iLenConsumed; } sl@0: