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