1 // Copyright (c) 2002-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 "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32\include\drivers\dma.inl
15 // DMA framework public inline functions
16 // This file should not be modified when porting the DMA framework to
22 inline void TDmaChannel::Wait()
24 NKern::FMWait(&iLock);
27 inline void TDmaChannel::Signal()
29 NKern::FMSignal(&iLock);
32 inline TBool TDmaChannel::IsOpened() const
34 return iController != NULL;
37 inline TBool TDmaChannel::IsQueueEmpty() const
39 return const_cast<TDmaChannel*>(this)->iReqQ.IsEmpty();
42 inline TUint32 TDmaChannel::PslId() const
47 inline TInt TDmaChannel::FailNext(TInt /*aFragmentCount*/)
49 return iController->FailNext(*this);
52 inline TInt TDmaChannel::MissNextInterrupts(TInt aInterruptCount)
54 return iController->MissNextInterrupts(*this, aInterruptCount);
57 /** Function allowing platform-specific layer to extend API with new
58 channel-specific operations.
59 @param aCmd Command identifier. Negative values are reserved for Symbian use.
60 @param aArg PSL-specific
61 @return KErrNotSupported if aCmd is not supported. PSL-specific value otherwise.
64 inline TInt TDmaChannel::Extension(TInt aCmd, TAny* aArg)
66 return iController->Extension(*this, aCmd, aArg);
69 inline const TDmac* TDmaChannel::Controller() const
74 inline TInt TDmaChannel::MaxTransferSize(TUint aFlags, TUint32 aPslInfo)
76 return iController->MaxTransferSize(*this, aFlags, aPslInfo);
79 inline TUint TDmaChannel::MemAlignMask(TUint aFlags, TUint32 aPslInfo)
81 return iController->MemAlignMask(*this, aFlags, aPslInfo);
86 /** Called when request is removed from request queue in channel */
88 inline void DDmaRequest::OnDeque()
91 iLastHdr->iNext = NULL;
92 iChannel.DoUnlink(*iLastHdr);
97 inline void TDmac::Wait()
99 NKern::FMWait(&iLock);
102 inline void TDmac::Signal()
104 NKern::FMSignal(&iLock);
107 inline SDmaPseudoDes& TDmac::HdrToDes(const SDmaDesHdr& aHdr) const
109 return static_cast<SDmaPseudoDes*>(iDesPool)[&aHdr - iHdrPool];
112 inline TAny* TDmac::HdrToHwDes(const SDmaDesHdr& aHdr) const
114 return static_cast<TUint8*>(iDesPool) + iDesSize*(&aHdr - iHdrPool);
117 inline TUint32 TDmac::DesLinToPhys(TAny* aDes) const
123 return iHwDesChunk->iPhysAddr + ((TLinAddr)aDes - iHwDesChunk->iLinAddr);
129 inline void DmaChannelMgr::Wait()
131 NKern::FMWait(&Lock);
134 inline void DmaChannelMgr::Signal()
136 NKern::FMSignal(&Lock);