|
1 // Copyright (c) 2002-2010 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 "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 // include/drivers/dma_compat.inl |
|
15 // DMA Framework - Client API definition. |
|
16 // |
|
17 // Inline implementations of functions which (originally) exposed DMA HAI |
|
18 // details that are now, after the header file split into dma_v2.h and |
|
19 // dma_hai.h, no longer meant to be visible to DMA clients. This file is only |
|
20 // included for DMA_APIV2 clients. |
|
21 // |
|
22 // This file is not meant to be a permanent one, and may eventually be removed |
|
23 // together with the deprecated functions it implements. |
|
24 // |
|
25 // |
|
26 |
|
27 |
|
28 inline const TDmac* TDmaChannel::Controller() const |
|
29 { |
|
30 return iController; |
|
31 } |
|
32 |
|
33 static inline TUint32 RequestFlags2SrcConfigFlags(TUint aFlags) |
|
34 { |
|
35 TUint32 flags = (aFlags & KDmaMemSrc) ? KDmaMemAddr : 0; |
|
36 flags |= (aFlags & KDmaPhysAddrSrc) ? KDmaPhysAddr : 0; |
|
37 if ((flags & KDmaMemAddr) && (flags & KDmaPhysAddr)) |
|
38 flags |= KDmaMemIsContiguous; |
|
39 return flags; |
|
40 } |
|
41 |
|
42 static inline TUint32 RequestFlags2DstConfigFlags(TUint aFlags) |
|
43 { |
|
44 TUint32 flags = (aFlags & KDmaMemDest) ? KDmaMemAddr : 0; |
|
45 flags |= (aFlags & KDmaPhysAddrDest) ? KDmaPhysAddr : 0; |
|
46 if ((flags & KDmaMemAddr) && (flags & KDmaPhysAddr)) |
|
47 flags |= KDmaMemIsContiguous; |
|
48 return flags; |
|
49 } |
|
50 |
|
51 inline TInt TDmaChannel::MaxTransferSize(TUint aFlags, TUint32 aPslInfo) |
|
52 { |
|
53 TUint src_flags = RequestFlags2SrcConfigFlags(aFlags); |
|
54 TUint dst_flags = RequestFlags2DstConfigFlags(aFlags); |
|
55 return MaxTransferLength(src_flags, dst_flags, aPslInfo); |
|
56 } |
|
57 |
|
58 inline TUint TDmaChannel::MemAlignMask(TUint aFlags, TUint32 aPslInfo) |
|
59 { |
|
60 TUint src_flags = RequestFlags2SrcConfigFlags(aFlags); |
|
61 TUint dst_flags = RequestFlags2DstConfigFlags(aFlags); |
|
62 return AddressAlignMask(src_flags, dst_flags, aPslInfo); |
|
63 } |
|
64 |
|
65 |
|
66 // --- |