os/kernelhwsrv/kernel/eka/include/drivers/resourceman.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kernel/eka/include/drivers/resourceman.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,84 @@
     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 the License "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 +// e32\include\drivers\resourceman.h
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +/**
    1.22 + @file
    1.23 + @publishedPartner
    1.24 + @released 9.5
    1.25 +*/
    1.26 +#ifndef __RESOURCEMAN_H__
    1.27 +#define __RESOURCEMAN_H__
    1.28 +
    1.29 +#ifdef PRM_ENABLE_EXTENDED_VERSION
    1.30 +#include <drivers/resource_extend.h>
    1.31 +#else
    1.32 +#include <drivers/resource.h>
    1.33 +#endif
    1.34 +
    1.35 +static const TUint KResManControlIoGetVersion=0x0;
    1.36 +static const TUint KResManControlIoRegisterDynamicResource=0x1;
    1.37 +static const TUint KResManControlIoDeregisterDynamicResource=0x2;
    1.38 +static const TUint KResManControlIoRegisterDependency=0x3;
    1.39 +static const TUint KResManControlIoDeregisterDependency=0x4;
    1.40 +static const TUint KResManControlIoGetNumDependents=0x5;
    1.41 +static const TUint KResManControlIoGetDependentsId=0x6;
    1.42 +
    1.43 +//Resource controller versions
    1.44 +static const TUint KResControllerBasicVersion=0x0;
    1.45 +static const TUint KResControllerExtendedVersion=0x01;
    1.46 +
    1.47 +/**
    1.48 +Resource Manager API class
    1.49 +API's are exported from this class to kernel side components
    1.50 +*/
    1.51 +NONSHARABLE_CLASS (PowerResourceManager)
    1.52 +	{
    1.53 +public:
    1.54 +    IMPORT_C static TInt RegisterClient(TUint& aClientId, const TDesC8& aName, TOwnerType aType=EOwnerProcess);
    1.55 +    IMPORT_C static TInt DeRegisterClient(TUint aClientId);
    1.56 +    IMPORT_C static TInt GetClientName(TUint aClientId, TUint aTargetClientId, TDes8& aName);
    1.57 +    IMPORT_C static TInt GetClientId(TUint aClientId, TDesC8& aClientName, TUint& aTargetClientId);
    1.58 +    IMPORT_C static TInt GetResourceId(TUint aClientId, TDesC8& aResourceName, TUint& aResourceId);
    1.59 +    IMPORT_C static TInt GetResourceInfo(TUint aClientId, TUint aResourceId, TAny* aInfo);
    1.60 +    IMPORT_C static TInt GetNumResourcesInUseByClient(TUint aClientId, TUint aTargetClientId, TUint& aNumResources);
    1.61 +    IMPORT_C static TInt GetInfoOnResourcesInUseByClient(TUint aClientId, TUint aTargetClientId, TUint& aNumResources, TAny* aInfo);
    1.62 +    IMPORT_C static TInt GetNumClientsUsingResource(TUint aClientId, TUint aResourceId, TUint& aNumClients);
    1.63 +    IMPORT_C static TInt GetInfoOnClientsUsingResource(TUint aClientId, TUint aResourceId, TUint& aNumClients, TAny* aInfo);
    1.64 +    IMPORT_C static TInt AllocReserve(TUint aClientId, TUint8 aNumCl, TUint8 aNumRm);
    1.65 +    IMPORT_C static TInt ChangeResourceState(TUint aClientId, TUint aResourceId, TInt aNewState, TPowerResourceCb* aCb=NULL);
    1.66 +    IMPORT_C static TInt GetResourceState(TUint aClientId, TUint aResourceId, TBool aCached, TInt& aState, TInt& aLevelOwnerId);
    1.67 +    IMPORT_C static TInt GetResourceState(TUint aClientId, TUint aResourceId, TBool aCached, TPowerResourceCb& aCb);
    1.68 +    IMPORT_C static TInt CancelAsyncRequestCallBack(TUint aClientId, TUint aResourceId, TPowerResourceCb& aCb);
    1.69 +    IMPORT_C static TInt RequestNotification(TUint aClientId, TUint aResourceId, DPowerResourceNotification& aN);
    1.70 +    IMPORT_C static TInt RequestNotification(TUint aClientId, TUint aResourceId, DPowerResourceNotification& aN, TInt aThreshold, TBool aDirection);
    1.71 +    IMPORT_C static TInt CancelNotification(TUint aClientId, TUint aResourceId, DPowerResourceNotification& aN);
    1.72 +	IMPORT_C static TInt DeRegisterClientLevelFromResource(TUint aClientId, TUint aResourceId);
    1.73 +    IMPORT_C static TInt ControlIO(TUint aClientId, TUint aFunction, TAny* aParam1, TAny* aParam2, TAny* aParam3 = NULL);
    1.74 +	inline static TInt GetResourceControllerVersion(TUint aClientId, TUint& aVersion);
    1.75 +#ifdef PRM_ENABLE_EXTENDED_VERSION
    1.76 +	inline static TInt RegisterDynamicResource(TUint aClientId, DDynamicPowerResource* aResource, TUint& aResourceId);
    1.77 +	inline static TInt DeRegisterDynamicResource(TUint aClientId, TUint aResourceId, TInt* aState);
    1.78 +	inline static TInt RegisterResourceDependency(TUint aClientId, SResourceDependencyInfo* aResDependecyInfo1, SResourceDependencyInfo* aResDependencyInfo2);
    1.79 +	inline static TInt DeRegisterResourceDependency(TUint aClientId, TUint aResourceId1, TUint aResourceId2);
    1.80 +	inline static TInt GetNumDependentsForResource(TUint aClientId, TUint aResourceId, TUint& aNumDepResource);
    1.81 +	inline static TInt GetDependentsIdForResource(TUint aClientId, TUint aResourceId, TAny* aResIdArray, TUint& aNumDepResources);
    1.82 +#endif
    1.83 +	};    
    1.84 +
    1.85 +#include <drivers/resourceman.inl>
    1.86 +
    1.87 +#endif //__RESOURCEMAN_H__