kernel/eka/include/drivers/dma_hai.inl
changeset 45 329ab0095843
equal deleted inserted replaced
44:36bfc973b146 45:329ab0095843
       
     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 "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_hai.inl
       
    15 // DMA Framework - Symbian Hardware Abstraction Interface (SHAI).
       
    16 //
       
    17 //
       
    18 
       
    19 
       
    20 // TDmac
       
    21 
       
    22 inline void TDmac::Wait()
       
    23 	{
       
    24 	NKern::FMWait(&iLock);
       
    25 	}
       
    26 
       
    27 inline void TDmac::Signal()
       
    28 	{
       
    29 	NKern::FMSignal(&iLock);
       
    30 	}
       
    31 
       
    32 inline TDmaTransferArgs& TDmac::HdrToDes(const SDmaDesHdr& aHdr) const
       
    33 	{
       
    34 	return static_cast<TDmaTransferArgs*>(iDesPool)[&aHdr - iHdrPool];
       
    35 	}
       
    36 
       
    37 inline TAny* TDmac::HdrToHwDes(const SDmaDesHdr& aHdr) const
       
    38 	{
       
    39 	return static_cast<TUint8*>(iDesPool) + iDesSize * (&aHdr - iHdrPool);
       
    40 	}
       
    41 
       
    42 inline TUint32 TDmac::HwDesLinToPhys(TAny* aDes) const
       
    43 	{
       
    44 #ifdef __WINS__
       
    45 	(void)aDes;
       
    46 	return 0xDEADBEEF;
       
    47 #else
       
    48 	return iHwDesChunk->iPhysAddr +
       
    49 		(reinterpret_cast<TLinAddr>(aDes) - iHwDesChunk->iLinAddr);
       
    50 #endif
       
    51 	}
       
    52 
       
    53 
       
    54 // ---