os/kernelhwsrv/kernel/eka/drivers/dma/dma2_shared.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
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
// e32/drivers/dma2_shared.cpp
sl@0
    15
// DMA Platform Independent Layer (PIL)
sl@0
    16
//
sl@0
    17
//
sl@0
    18
sl@0
    19
#include <drivers/dmadefs.h>
sl@0
    20
sl@0
    21
sl@0
    22
//
sl@0
    23
// Exported default constructor.
sl@0
    24
//
sl@0
    25
#ifdef DMA_APIV2
sl@0
    26
KEXPORT_C
sl@0
    27
#endif
sl@0
    28
TDmaTransferConfig::TDmaTransferConfig()
sl@0
    29
	: iAddr(0),
sl@0
    30
	  iAddrMode(KDmaAddrModeConstant),
sl@0
    31
	  iElementSize(0),
sl@0
    32
	  iElementsPerFrame(0),
sl@0
    33
	  iElementsPerPacket(0),
sl@0
    34
	  iFramesPerTransfer(0),
sl@0
    35
	  iElementSkip(0),
sl@0
    36
	  iFrameSkip(0),
sl@0
    37
	  iBurstSize(KDmaBurstSizeAny),
sl@0
    38
	  iFlags(0),
sl@0
    39
	  iSyncFlags(KDmaSyncAuto),
sl@0
    40
	  iPslTargetInfo(0),
sl@0
    41
	  iRepeatCount(0),
sl@0
    42
	  iDelta(~0u),
sl@0
    43
	  iReserved(0)
sl@0
    44
	{
sl@0
    45
	}
sl@0
    46
sl@0
    47
sl@0
    48
//
sl@0
    49
// General use version.
sl@0
    50
//
sl@0
    51
#ifdef DMA_APIV2
sl@0
    52
KEXPORT_C
sl@0
    53
#endif
sl@0
    54
TDmaTransferConfig::TDmaTransferConfig(
sl@0
    55
	TUint32 aAddr,
sl@0
    56
	TUint aTransferFlags,
sl@0
    57
	TDmaAddrMode aAddrMode,
sl@0
    58
	TUint aSyncFlags,
sl@0
    59
	TDmaBurstSize aBurstSize,
sl@0
    60
	TUint aElementSize,
sl@0
    61
	TUint aElementsPerPacket,
sl@0
    62
	TUint aPslTargetInfo,
sl@0
    63
	TInt aRepeatCount
sl@0
    64
	)
sl@0
    65
	:
sl@0
    66
	iAddr(aAddr),
sl@0
    67
	iAddrMode(aAddrMode),
sl@0
    68
	iElementSize(aElementSize),
sl@0
    69
	iElementsPerFrame(0),
sl@0
    70
	iElementsPerPacket(aElementsPerPacket),
sl@0
    71
	iFramesPerTransfer(0),
sl@0
    72
	iElementSkip(0),
sl@0
    73
	iFrameSkip(0),
sl@0
    74
	iBurstSize(aBurstSize),
sl@0
    75
	iFlags(aTransferFlags),
sl@0
    76
	iSyncFlags(aSyncFlags),
sl@0
    77
	iPslTargetInfo(aPslTargetInfo),
sl@0
    78
	iRepeatCount(aRepeatCount),
sl@0
    79
	iDelta(~0u),
sl@0
    80
	iReserved(0)
sl@0
    81
	{
sl@0
    82
	}
sl@0
    83
sl@0
    84
sl@0
    85
//
sl@0
    86
// 1D/2D version.
sl@0
    87
//
sl@0
    88
#ifdef DMA_APIV2
sl@0
    89
KEXPORT_C
sl@0
    90
#endif
sl@0
    91
TDmaTransferConfig::TDmaTransferConfig(
sl@0
    92
	TUint32 aAddr,
sl@0
    93
	TUint aElementSize,
sl@0
    94
	TUint aElementsPerFrame,
sl@0
    95
	TUint aFramesPerTransfer,
sl@0
    96
	TInt aElementSkip,
sl@0
    97
	TInt aFrameSkip,
sl@0
    98
	TUint aTransferFlags,
sl@0
    99
	TUint aSyncFlags,
sl@0
   100
	TDmaBurstSize aBurstSize,
sl@0
   101
	TUint aElementsPerPacket,
sl@0
   102
	TUint aPslTargetInfo,
sl@0
   103
	TInt aRepeatCount
sl@0
   104
	)
sl@0
   105
	:
sl@0
   106
	iAddr(aAddr),
sl@0
   107
	iAddrMode( // deduce transfer mode from skips
sl@0
   108
		(aFrameSkip != 0) ? KDmaAddrMode2DIndex :
sl@0
   109
		(aElementSkip != 0)? KDmaAddrMode1DIndex :
sl@0
   110
		KDmaAddrModePostIncrement),
sl@0
   111
	iElementSize(aElementSize),
sl@0
   112
	iElementsPerFrame(aElementsPerFrame),
sl@0
   113
	iElementsPerPacket(aElementsPerPacket),
sl@0
   114
	iFramesPerTransfer(aFramesPerTransfer),
sl@0
   115
	iElementSkip(aElementSkip),
sl@0
   116
	iFrameSkip(aFrameSkip),
sl@0
   117
	iBurstSize(aBurstSize),
sl@0
   118
	iFlags(aTransferFlags),
sl@0
   119
	iSyncFlags(aSyncFlags),
sl@0
   120
	iPslTargetInfo(aPslTargetInfo),
sl@0
   121
	iRepeatCount(aRepeatCount),
sl@0
   122
	iDelta(~0u),
sl@0
   123
	iReserved(0)
sl@0
   124
	{
sl@0
   125
	}
sl@0
   126
sl@0
   127
sl@0
   128
//
sl@0
   129
// Exported default constructor.
sl@0
   130
//
sl@0
   131
#ifdef DMA_APIV2
sl@0
   132
KEXPORT_C
sl@0
   133
#endif
sl@0
   134
TDmaTransferArgs::TDmaTransferArgs()
sl@0
   135
	: iTransferCount(0),
sl@0
   136
	  iGraphicsOps(KDmaGraphicsOpNone),
sl@0
   137
	  iFlags(0),
sl@0
   138
	  iChannelPriority(KDmaPriorityNone),
sl@0
   139
	  iPslRequestInfo(0),
sl@0
   140
	  iDelta(~0u),
sl@0
   141
	  iReserved1(0),
sl@0
   142
	  iChannelCookie(0),
sl@0
   143
	  iReserved2(0)
sl@0
   144
	{
sl@0
   145
	}
sl@0
   146
sl@0
   147
sl@0
   148
//
sl@0
   149
// .
sl@0
   150
//
sl@0
   151
#ifdef DMA_APIV2
sl@0
   152
KEXPORT_C
sl@0
   153
#endif
sl@0
   154
TDmaTransferArgs::TDmaTransferArgs (
sl@0
   155
	TUint aSrcAddr,
sl@0
   156
	TUint aDstAddr,
sl@0
   157
	TUint aCount,
sl@0
   158
	TUint aDmaTransferFlags,
sl@0
   159
	TUint aDmaSyncFlags,
sl@0
   160
	TUint aDmaPILFlags,
sl@0
   161
	TDmaAddrMode aMode,
sl@0
   162
	TUint aElementSize,
sl@0
   163
	TUint aChannelPriority,
sl@0
   164
	TDmaBurstSize aBurstSize,
sl@0
   165
	TUint aPslRequestInfo,
sl@0
   166
	TDmaGraphicsOps aGraphicOp,
sl@0
   167
	TUint32 aColour
sl@0
   168
	)
sl@0
   169
	:
sl@0
   170
	iSrcConfig(aSrcAddr, aDmaTransferFlags, aMode, aDmaSyncFlags, aBurstSize, aElementSize),
sl@0
   171
	iDstConfig(aDstAddr, aDmaTransferFlags, aMode, aDmaSyncFlags, aBurstSize, aElementSize),
sl@0
   172
	iTransferCount(aCount),
sl@0
   173
	iGraphicsOps(aGraphicOp),
sl@0
   174
	iColour(aColour),
sl@0
   175
	iFlags(aDmaPILFlags),
sl@0
   176
	iChannelPriority(aChannelPriority),
sl@0
   177
	iPslRequestInfo(aPslRequestInfo)
sl@0
   178
	{
sl@0
   179
	}
sl@0
   180
sl@0
   181
sl@0
   182
//
sl@0
   183
// .
sl@0
   184
//
sl@0
   185
#ifdef DMA_APIV2
sl@0
   186
KEXPORT_C
sl@0
   187
#endif
sl@0
   188
TDmaTransferArgs::TDmaTransferArgs(
sl@0
   189
	const TDmaTransferConfig& aSrc,
sl@0
   190
	const TDmaTransferConfig& aDst,
sl@0
   191
	TUint32 aFlags,
sl@0
   192
	TUint aChannelPriority,
sl@0
   193
	TUint aPslRequestInfo,
sl@0
   194
	TDmaGraphicsOps aGraphicOp,
sl@0
   195
	TUint32 aColour
sl@0
   196
	)
sl@0
   197
	: iSrcConfig(aSrc),
sl@0
   198
	  iDstConfig(aDst),
sl@0
   199
	  iTransferCount(0),
sl@0
   200
	  iGraphicsOps(aGraphicOp),
sl@0
   201
	  iColour(aColour),
sl@0
   202
	  iFlags(aFlags),
sl@0
   203
	  iChannelPriority(aChannelPriority),
sl@0
   204
	  iPslRequestInfo(aPslRequestInfo),
sl@0
   205
	  iDelta(~0u),
sl@0
   206
	  iReserved1(0),
sl@0
   207
	  iChannelCookie(0),
sl@0
   208
	  iReserved2(0)
sl@0
   209
	{
sl@0
   210
	}