os/kernelhwsrv/kernel/eka/include/drivers/dma_compat.inl
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// include/drivers/dma_compat.inl
sl@0
    15
// DMA Framework - Client API definition.
sl@0
    16
//
sl@0
    17
// Inline implementations of functions which (originally) exposed DMA HAI
sl@0
    18
// details that are now, after the header file split into dma_v2.h and
sl@0
    19
// dma_hai.h, no longer meant to be visible to DMA clients. This file is only
sl@0
    20
// included for DMA_APIV2 clients.
sl@0
    21
//
sl@0
    22
// This file is not meant to be a permanent one, and may eventually be removed
sl@0
    23
// together with the deprecated functions it implements.
sl@0
    24
//
sl@0
    25
//
sl@0
    26
sl@0
    27
sl@0
    28
inline const TDmac* TDmaChannel::Controller() const
sl@0
    29
	{
sl@0
    30
	return iController;
sl@0
    31
	}
sl@0
    32
sl@0
    33
static inline TUint32 RequestFlags2SrcConfigFlags(TUint aFlags)
sl@0
    34
	{
sl@0
    35
	TUint32 flags = (aFlags & KDmaMemSrc) ? KDmaMemAddr : 0;
sl@0
    36
	flags |= (aFlags & KDmaPhysAddrSrc) ? KDmaPhysAddr : 0;
sl@0
    37
	return flags;
sl@0
    38
	}
sl@0
    39
sl@0
    40
static inline TUint32 RequestFlags2DstConfigFlags(TUint aFlags)
sl@0
    41
	{
sl@0
    42
	TUint32 flags = (aFlags & KDmaMemDest) ? KDmaMemAddr : 0;
sl@0
    43
	flags |= (aFlags & KDmaPhysAddrDest) ? KDmaPhysAddr : 0;
sl@0
    44
	return flags;
sl@0
    45
	}
sl@0
    46
sl@0
    47
inline TInt TDmaChannel::MaxTransferSize(TUint aFlags, TUint32 aPslInfo)
sl@0
    48
	{
sl@0
    49
	TUint src_flags = RequestFlags2SrcConfigFlags(aFlags);
sl@0
    50
	TUint dst_flags = RequestFlags2DstConfigFlags(aFlags);
sl@0
    51
	return MaxTransferLength(src_flags, dst_flags, aPslInfo);
sl@0
    52
	}
sl@0
    53
sl@0
    54
inline TUint TDmaChannel::MemAlignMask(TUint aFlags, TUint32 aPslInfo)
sl@0
    55
	{
sl@0
    56
	TUint src_flags = RequestFlags2SrcConfigFlags(aFlags);
sl@0
    57
	TUint dst_flags = RequestFlags2DstConfigFlags(aFlags);
sl@0
    58
	return AddressAlignMask(src_flags, dst_flags, aPslInfo);
sl@0
    59
	}
sl@0
    60
sl@0
    61
sl@0
    62
// ---