os/graphics/graphicshwdrivers/surfacemgr/test/testdriver/d_sharedchunk.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/graphicshwdrivers/surfacemgr/test/testdriver/d_sharedchunk.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,87 @@
     1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef __D_SHAREDCHUNK_H__
    1.20 +#define __D_SHAREDCHUNK_H__
    1.21 +
    1.22 +#include <e32cmn.h>
    1.23 +#ifndef __KERNEL_MODE__
    1.24 +#include <e32std.h>
    1.25 +#endif
    1.26 +
    1.27 +_LIT(KSharedChunkLddName,"D_SHAREDCHUNK");
    1.28 +
    1.29 +enum TCreateFlags
    1.30 +	{
    1.31 +	ESingle				= 0x00,
    1.32 +	EMultiple			= 0x01,
    1.33 +	EOwnsMemory			= 0x02,
    1.34 +	EBadType			= 0x80,
    1.35 +	ECreateFlagsMask	= 0xff
    1.36 +	};
    1.37 +
    1.38 +enum TCacheAttribute
    1.39 +	{
    1.40 +	/** CPU cached */
    1.41 +	ECached = 0,
    1.42 +	/** Non CPU cached */
    1.43 +	ENotCached = 1
    1.44 +	};
    1.45 +
    1.46 +enum TCommitType
    1.47 +	{
    1.48 +	ENonContiguous			= 0x00,
    1.49 +	EContiguous				= 0x01,
    1.50 +	ECommitTypeMask			= 0x0f
    1.51 +	};
    1.52 +
    1.53 +class RSharedChunkLdd : public RBusLogicalChannel
    1.54 +	{
    1.55 +public:
    1.56 +	enum TControl
    1.57 +		{
    1.58 +		ECreateChunk,
    1.59 +		EGetChunkHandle,
    1.60 +		ECommitMemory,
    1.61 +		ECloseChunk,
    1.62 +		ECacheAttribute,
    1.63 +		EContiguousAttribute,
    1.64 +		ECloseChunkHandle
    1.65 +		};
    1.66 +
    1.67 +
    1.68 +#ifndef __KERNEL_MODE__
    1.69 +public:
    1.70 +	inline TInt Open()
    1.71 +		{ return DoCreate(KSharedChunkLddName,TVersion(),KNullUnit,NULL,NULL,EOwnerProcess,ETrue); }
    1.72 +	inline TInt CreateChunk(TInt aSize, TAny** aKernelAddress=0)
    1.73 +		{ return DoControl(ECreateChunk,(TAny*)aSize,aKernelAddress); }
    1.74 +	inline TInt GetChunkHandle(RChunk& aChunk)
    1.75 +		{ return aChunk.SetReturnedHandle(DoControl(EGetChunkHandle)); }
    1.76 +	inline TInt CommitMemory(TInt aOffset, TInt aSize)
    1.77 +		{ return DoControl(ECommitMemory,(TAny*)aOffset,(TAny*)aSize); }
    1.78 +	inline TInt CloseChunk()
    1.79 +		{ return DoControl(ECloseChunk); }
    1.80 +	inline TInt GetCacheAttribute()
    1.81 +		{return DoControl(ECacheAttribute);}
    1.82 +	inline TBool GetContiguousAttribute()
    1.83 +		{return DoControl(EContiguousAttribute);}
    1.84 +	inline TInt CloseChunkHandle(RChunk aChunk)
    1.85 +		{ return DoControl(ECloseChunkHandle,(TAny*)aChunk.Handle()); }
    1.86 +#endif
    1.87 +	};
    1.88 +
    1.89 +
    1.90 +#endif