1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/drivers/dma.inl Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,139 @@
1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// 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
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// e32\include\drivers\dma.inl
1.18 +// DMA framework public inline functions
1.19 +// This file should not be modified when porting the DMA framework to
1.20 +// new hardware.
1.21 +// TDmaChannel
1.22 +//
1.23 +//
1.24 +
1.25 +inline void TDmaChannel::Wait()
1.26 + {
1.27 + NKern::FMWait(&iLock);
1.28 + }
1.29 +
1.30 +inline void TDmaChannel::Signal()
1.31 + {
1.32 + NKern::FMSignal(&iLock);
1.33 + }
1.34 +
1.35 +inline TBool TDmaChannel::IsOpened() const
1.36 + {
1.37 + return iController != NULL;
1.38 + }
1.39 +
1.40 +inline TBool TDmaChannel::IsQueueEmpty() const
1.41 + {
1.42 + return const_cast<TDmaChannel*>(this)->iReqQ.IsEmpty();
1.43 + }
1.44 +
1.45 +inline TUint32 TDmaChannel::PslId() const
1.46 + {
1.47 + return iPslId;
1.48 + }
1.49 +
1.50 +inline TInt TDmaChannel::FailNext(TInt /*aFragmentCount*/)
1.51 + {
1.52 + return iController->FailNext(*this);
1.53 + }
1.54 +
1.55 +inline TInt TDmaChannel::MissNextInterrupts(TInt aInterruptCount)
1.56 + {
1.57 + return iController->MissNextInterrupts(*this, aInterruptCount);
1.58 + }
1.59 +
1.60 +/** Function allowing platform-specific layer to extend API with new
1.61 + channel-specific operations.
1.62 + @param aCmd Command identifier. Negative values are reserved for Symbian use.
1.63 + @param aArg PSL-specific
1.64 + @return KErrNotSupported if aCmd is not supported. PSL-specific value otherwise.
1.65 + */
1.66 +
1.67 +inline TInt TDmaChannel::Extension(TInt aCmd, TAny* aArg)
1.68 + {
1.69 + return iController->Extension(*this, aCmd, aArg);
1.70 + }
1.71 +
1.72 +inline const TDmac* TDmaChannel::Controller() const
1.73 + {
1.74 + return iController;
1.75 + }
1.76 +
1.77 +inline TInt TDmaChannel::MaxTransferSize(TUint aFlags, TUint32 aPslInfo)
1.78 + {
1.79 + return iController->MaxTransferSize(*this, aFlags, aPslInfo);
1.80 + }
1.81 +
1.82 +inline TUint TDmaChannel::MemAlignMask(TUint aFlags, TUint32 aPslInfo)
1.83 + {
1.84 + return iController->MemAlignMask(*this, aFlags, aPslInfo);
1.85 + }
1.86 +
1.87 +// DDmaRequest
1.88 +
1.89 +/** Called when request is removed from request queue in channel */
1.90 +
1.91 +inline void DDmaRequest::OnDeque()
1.92 + {
1.93 + iQueued = EFalse;
1.94 + iLastHdr->iNext = NULL;
1.95 + iChannel.DoUnlink(*iLastHdr);
1.96 + }
1.97 +
1.98 +// TDmac
1.99 +
1.100 +inline void TDmac::Wait()
1.101 + {
1.102 + NKern::FMWait(&iLock);
1.103 + }
1.104 +
1.105 +inline void TDmac::Signal()
1.106 + {
1.107 + NKern::FMSignal(&iLock);
1.108 + }
1.109 +
1.110 +inline SDmaPseudoDes& TDmac::HdrToDes(const SDmaDesHdr& aHdr) const
1.111 + {
1.112 + return static_cast<SDmaPseudoDes*>(iDesPool)[&aHdr - iHdrPool];
1.113 + }
1.114 +
1.115 +inline TAny* TDmac::HdrToHwDes(const SDmaDesHdr& aHdr) const
1.116 + {
1.117 + return static_cast<TUint8*>(iDesPool) + iDesSize*(&aHdr - iHdrPool);
1.118 + }
1.119 +
1.120 +inline TUint32 TDmac::DesLinToPhys(TAny* aDes) const
1.121 + {
1.122 +#ifdef __WINS__
1.123 + (void)aDes;
1.124 + return 0xDEADBEEF;
1.125 +#else
1.126 + return iHwDesChunk->iPhysAddr + ((TLinAddr)aDes - iHwDesChunk->iLinAddr);
1.127 +#endif
1.128 + }
1.129 +
1.130 +// DmaChannelMgr
1.131 +
1.132 +inline void DmaChannelMgr::Wait()
1.133 + {
1.134 + NKern::FMWait(&Lock);
1.135 + }
1.136 +
1.137 +inline void DmaChannelMgr::Signal()
1.138 + {
1.139 + NKern::FMSignal(&Lock);
1.140 + }
1.141 +
1.142 +//---