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