os/kernelhwsrv/kerneltest/e32test/mmu/d_sharedio.h
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 the License "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
// e32test\mmu\d_sharedio.h
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
#ifndef __D_SLDD_H__
sl@0
    19
#define __D_SLDD_H__
sl@0
    20
#include <e32cmn.h>
sl@0
    21
#ifndef __KERNEL_MODE__
sl@0
    22
#include <e32std.h>
sl@0
    23
#endif
sl@0
    24
sl@0
    25
const TInt KSizeGlobalBuffer=0x2000;
sl@0
    26
const TInt KMagic1=12345;
sl@0
    27
const TInt KMagic2=54321;
sl@0
    28
sl@0
    29
class RTestLdd : public RBusLogicalChannel
sl@0
    30
	{
sl@0
    31
public:
sl@0
    32
	enum TControl
sl@0
    33
		{
sl@0
    34
		ECreateBuffer,
sl@0
    35
		EMapInGlobalBuffer,
sl@0
    36
		EMapOutGlobalBuffer,
sl@0
    37
		EDestroyGlobalBuffer,
sl@0
    38
		ECreateBufferPhysAddr,
sl@0
    39
		EDestroyBufferPhysAddr,
sl@0
    40
		EMapInBuffer,
sl@0
    41
		EMapOutBuffer,
sl@0
    42
		EDestroyBuffer,
sl@0
    43
		ECheckBuffer,
sl@0
    44
		EFillBuffer,
sl@0
    45
		EThreadRW
sl@0
    46
		};
sl@0
    47
public:
sl@0
    48
	inline TInt Open();
sl@0
    49
	inline TInt CreateBuffer(TInt aLength);
sl@0
    50
	inline TInt MapInGlobalBuffer(TUint aProcessId,TAny*& aAddress,TUint32& aLength);
sl@0
    51
	inline TInt MapOutGlobalBuffer();
sl@0
    52
	inline TInt DestroyGlobalBuffer();
sl@0
    53
	inline TInt CreateBufferPhysAddr(TInt aLength);
sl@0
    54
	inline TInt DestroyBufferPhysAddr();
sl@0
    55
	inline TInt MapInBuffer(TAny** aAddress,TUint32* aLength);
sl@0
    56
	inline TInt MapOutBuffer();
sl@0
    57
	inline TInt DestroyBuffer();
sl@0
    58
	inline TInt CheckBuffer(TUint32 key);
sl@0
    59
	inline TInt FillBuffer(TUint32 key);
sl@0
    60
	inline TInt ThreadRW(TDes8& aDes,TInt aThreadId=-1);
sl@0
    61
	};
sl@0
    62
sl@0
    63
_LIT(KSharedIoTestLddName,"D_SHAREDIO");
sl@0
    64
sl@0
    65
#ifndef __KERNEL_MODE__
sl@0
    66
inline TInt RTestLdd::Open()
sl@0
    67
	{ return DoCreate(KSharedIoTestLddName,TVersion(),KNullUnit,NULL,NULL); }
sl@0
    68
inline TInt RTestLdd::CreateBuffer(TInt aLength)
sl@0
    69
	{ return DoControl(ECreateBuffer,(TAny*)aLength); }
sl@0
    70
inline TInt RTestLdd::MapInGlobalBuffer(TUint aProcessId,TAny*& aAddress,TUint32& aLength)
sl@0
    71
	{
sl@0
    72
	TUint a = aProcessId;
sl@0
    73
	TInt r=DoControl(EMapInGlobalBuffer,&a,&aLength);
sl@0
    74
	aAddress = (TAny*)a;
sl@0
    75
	return r;
sl@0
    76
	}
sl@0
    77
inline TInt RTestLdd::MapOutGlobalBuffer()
sl@0
    78
	{ return DoControl(EMapOutGlobalBuffer); }
sl@0
    79
inline TInt RTestLdd::DestroyGlobalBuffer()
sl@0
    80
	{ return DoControl(EDestroyGlobalBuffer); }
sl@0
    81
inline TInt RTestLdd::CreateBufferPhysAddr(TInt aLength)
sl@0
    82
	{ return DoControl(ECreateBufferPhysAddr,(TAny*)aLength);	}
sl@0
    83
inline TInt RTestLdd::DestroyBufferPhysAddr()
sl@0
    84
	{ return DoControl(EDestroyBufferPhysAddr); }
sl@0
    85
inline TInt RTestLdd::MapInBuffer(TAny** aAddress,TUint32* aLength)
sl@0
    86
	{ return DoControl(EMapInBuffer,aAddress,aLength); }
sl@0
    87
inline TInt RTestLdd::MapOutBuffer()
sl@0
    88
	{ return DoControl(EMapOutBuffer); }
sl@0
    89
inline TInt RTestLdd::DestroyBuffer()
sl@0
    90
	{ return DoControl(EDestroyBuffer); }
sl@0
    91
inline TInt RTestLdd::CheckBuffer(TUint32 key)
sl@0
    92
	{ return DoControl(ECheckBuffer,(TAny*)key); }
sl@0
    93
inline TInt RTestLdd::FillBuffer(TUint32 key)
sl@0
    94
	{ return DoControl(EFillBuffer,(TAny*)key); }
sl@0
    95
inline TInt RTestLdd::ThreadRW(TDes8& aDes,TInt aThreadId)
sl@0
    96
	{ return DoControl(EThreadRW,(TAny*)&aDes,(TAny*)aThreadId); }
sl@0
    97
#endif
sl@0
    98
sl@0
    99
#endif
sl@0
   100