First public contribution.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
17 inline TInt DDmaHelper::PageSizeLog2() { return iPageSizeLog2; }
18 inline TBool DDmaHelper::IsPageAligned(TLinAddr aAddr) { return !(aAddr & iPageSizeMsk); }
19 inline TLinAddr DDmaHelper::PageAlign(TLinAddr aAddr) { return aAddr & ~iPageSizeMsk; }
20 inline TLinAddr DDmaHelper::PageOffset(TLinAddr aAddr) { return aAddr & iPageSizeMsk; }
23 inline TInt DDmaHelper::MaxFragLength() const { return iMaxPages << iPageSizeLog2; }
24 inline void DDmaHelper::SetFragLength(TInt aLength) { iFragLen = iFragLenRemaining = aLength; }
25 inline TInt DDmaHelper::FragLength() const { return iFragLen; }
26 inline TInt DDmaHelper::LengthRemaining() const { return iReqLenClient - iLenConsumed; }
27 inline TUint32 DDmaHelper::LengthConsumed() const {return iLenConsumed; }
30 inline TBool DDmaHelper::IsDmaAligned(TLinAddr aAddr) { return !(aAddr & (iDmaAlignment-1)); }
32 inline TBool DDmaHelper::IsBlockAligned(TInt64 aPos) { return !(aPos & iMediaBlockSizeMask); }
33 inline TInt64 DDmaHelper::BlockAlign(TInt64 aPos) { return aPos & ~iMediaBlockSizeMask; }
34 inline TInt DDmaHelper::BlockOffset(TInt64 aPos) { return TInt(aPos & iMediaBlockSizeMask); }
36 inline TLinAddr DDmaHelper::LinAddress() const { return iLinAddressUser + ((TUint32) iReqRemoteDesOffset) + iLenConsumed; }