os/kernelhwsrv/kerneltest/e32test/resourceman/resourceman_psl/rescontrol_extended_psl.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2007-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 the License "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 // e32test\resourceman\resourceman_psl\rescontrol_extended_psl.h
    15 // 
    16 //
    17 
    18 #ifndef __RESCONTROL_EXTENDED_PSL_H__
    19 #define __RESCONTROL_EXTENDED_PSL_H__
    20 
    21 //Macro to establish dependency between the specified resource
    22 #define CREATE_DEPENDENCY_BETWEEN_NODES(pN1, pN2, pRes1, pRes2, priRes1, priRes2)			\
    23 	pN1->iPriority = priRes1;																\
    24 	pN1->iResource = pRes1;																	\
    25 	pN1->iPropagatedLevel = 0;																\
    26 	pN1->iVisited = EFalse;																	\
    27 	pN2->iPriority = priRes2;																\
    28 	pN2->iResource = pRes2;																	\
    29 	pN2->iPropagatedLevel = 0;																\
    30 	pN2->iVisited = EFalse;																	\
    31 	pN1->iResource->AddNode(pN2);															\
    32 	pN2->iResource->AddNode(pN1);														
    33 
    34 //class definition for multilevel single positive sense dependent resource
    35 NONSHARABLE_CLASS(DMLSLGLSPDependResource) : public DStaticPowerResourceD
    36 	{
    37 public:
    38     DMLSLGLSPDependResource();
    39     TInt DoRequest(TPowerRequest &req);
    40     TInt GetInfo(TDes8* aInfo) const;
    41 	TChangePropagationStatus TranslateDependentState(TInt aDepId, TInt aDepState, TInt& aResState);
    42 private:
    43     TInt iMinLevel;
    44     TInt iMaxLevel;
    45     TInt iCurrentLevel;
    46 	TInt iBlockTime; //Time duration the thread will be blocked. 
    47 	};
    48 
    49 //class definition for multilevel single negative sense dependent resource
    50 NONSHARABLE_CLASS(DMLSIGLSNDependResource) : public DStaticPowerResourceD
    51 	{
    52 public:
    53     DMLSIGLSNDependResource();
    54     TInt DoRequest(TPowerRequest &req);
    55     TInt GetInfo(TDes8* aInfo) const;
    56 	TChangePropagationStatus TranslateDependentState(TInt aDepId, TInt aDepState, TInt& aResState);
    57 private:
    58     TInt iMinLevel;
    59     TInt iMaxLevel;
    60     TInt iCurrentLevel;
    61 	TInt iBlockTime; //Time duration the thread will be blocked. 
    62 	};
    63 
    64 //class definition for binary single postive sense dependent resource
    65 NONSHARABLE_CLASS(DBSIGLSPDependResource) : public DStaticPowerResourceD
    66 	{
    67 public:
    68     DBSIGLSPDependResource();
    69     TInt DoRequest(TPowerRequest &req);
    70     TInt GetInfo(TDes8* aInfo) const;
    71 	TChangePropagationStatus TranslateDependentState(TInt aDepId, TInt aDepState, TInt& aResState);
    72 private:
    73     TInt iMinLevel;
    74     TInt iMaxLevel;
    75     TInt iCurrentLevel;
    76 	TInt iBlockTime; //Time duration the thread will be blocked. 
    77 	};
    78 
    79 //class definition for multilevel shared postive sense dependent resource
    80 NONSHARABLE_CLASS(DMLSHIGLSPDependResource) : public DStaticPowerResourceD
    81 	{
    82 public:
    83     DMLSHIGLSPDependResource();
    84     TInt DoRequest(TPowerRequest &req);
    85     TInt GetInfo(TDes8* aInfo) const;
    86 	TChangePropagationStatus TranslateDependentState(TInt aDepId, TInt aDepState, TInt& aResState);
    87 private:
    88     TInt iMinLevel;
    89     TInt iMaxLevel;
    90     TInt iCurrentLevel;
    91 	TInt iBlockTime; //Time duration the thread will be blocked. 
    92 	};
    93 
    94 //class definition for binary shared negative sense dependent resource
    95 NONSHARABLE_CLASS(DBSHLGLSNDependResource) : public DStaticPowerResourceD
    96 	{
    97 public:
    98     DBSHLGLSNDependResource();
    99     TInt DoRequest(TPowerRequest &req);
   100     TInt GetInfo(TDes8* aInfo) const;
   101 	TChangePropagationStatus TranslateDependentState(TInt aDepId, TInt aDepState, TInt& aResState);
   102 private:
   103     TInt iMinLevel;
   104     TInt iMaxLevel;
   105     TInt iCurrentLevel;
   106 	TInt iBlockTime; //Time duration the thread will be blocked. 
   107 	};
   108 
   109 //class definition for multilevel shared negative sense dependent resource
   110 NONSHARABLE_CLASS(DMLSHLGLSNDependResource) : public DStaticPowerResourceD
   111 	{
   112 public:
   113     DMLSHLGLSNDependResource();
   114     TInt DoRequest(TPowerRequest &req);
   115     TInt GetInfo(TDes8* aInfo) const;
   116 	TChangePropagationStatus TranslateDependentState(TInt aDepId, TInt aDepState, TInt& aResState);
   117 private:
   118     TInt iMinLevel;
   119     TInt iMaxLevel;
   120     TInt iCurrentLevel;
   121 	TInt iBlockTime; //Time duration the thread will be blocked. 
   122 	};
   123 
   124 //class definition for multilevel shared custom sense dependent resource
   125 NONSHARABLE_CLASS(DMLSHLGLSCDependResource) : public DStaticPowerResourceD
   126 	{
   127 public:
   128     DMLSHLGLSCDependResource();
   129     TInt DoRequest(TPowerRequest &req);
   130     TInt GetInfo(TDes8* aInfo) const;
   131 	TChangePropagationStatus TranslateDependentState(TInt aDepId, TInt aDepState, TInt& aResState);
   132 private:
   133     TInt iMinLevel;
   134     TInt iMaxLevel;
   135     TInt iCurrentLevel;
   136 	TInt iBlockTime; //Time duration the thread will be blocked. 
   137 	};
   138 
   139 #endif //__RESCONTROL_EXTENDED_PSL_H__