1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/e32utils/demandpaging/dptest.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,128 @@
1.4 +// Copyright (c) 2006-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 +// Functions for test and analysis of demand paging.
1.18 +//
1.19 +//
1.20 +
1.21 +/**
1.22 + @file
1.23 + @test
1.24 + @publishedPartner
1.25 + @publishedPartner
1.26 + @test
1.27 +*/
1.28 +class DPTest
1.29 + {
1.30 +public:
1.31 + /**
1.32 + The attributes of the demand paging system.
1.33 + */
1.34 + enum TAttributes
1.35 + {
1.36 + /**
1.37 + The ROM is being demand paged.
1.38 + */
1.39 + ERomPaging = 1<<0,
1.40 +
1.41 + /**
1.42 + Individual executable files can be demand paged.
1.43 + */
1.44 + ECodePaging = 1<<1,
1.45 +
1.46 + /**
1.47 + User RAM can be demand paged.
1.48 + */
1.49 + EDataPaging = 1<<2
1.50 + };
1.51 +
1.52 + /**
1.53 + Return the attributes of the demand paging system.
1.54 + This is a bitfield consisting of values from enum TAttributes
1.55 + */
1.56 + IMPORT_C static TUint32 Attributes();
1.57 +
1.58 + /**
1.59 + Evict the contents of the virtual memory cache and reduce it to its minimum size.
1.60 +
1.61 + @return KErrNone, if successful; otherwise one of the other system wide error codes.
1.62 +
1.63 + @capability WriteDeviceData
1.64 + */
1.65 + IMPORT_C static TInt FlushCache();
1.66 +
1.67 + /**
1.68 + Change the minimum and maximum RAM sizes used for the virtual memory cache.
1.69 +
1.70 + These values may be silently restricted to platforn specific limits.
1.71 + If required, GetCacheSize can be used to verify sizes actually applied to the system.
1.72 +
1.73 + If there is not enough memory to set the specified cache size then KErrNoMemory is
1.74 + returned, however the cache size may still have been modified in an attempt to
1.75 + service the request.
1.76 +
1.77 + @param aMinSize Minimum size for cache in bytes.
1.78 + @param aMaxSize Maximum size for cache in bytes.
1.79 + Using zero for this value will restore cache sizes to the
1.80 + initial values used after boot.
1.81 +
1.82 + @return KErrNone, if successful;
1.83 + KErrNoMemory if the is not enough memory;
1.84 + KErrArgument if aMinSize>aMaxSize
1.85 + otherwise one of the other system wide error codes.
1.86 +
1.87 + @capability WriteDeviceData
1.88 + */
1.89 + IMPORT_C static TInt SetCacheSize(TUint aMinSize,TUint aMaxSize);
1.90 +
1.91 + /**
1.92 + Get the current values of the RAM sizes used for the virtual memory cache.
1.93 +
1.94 + @param[out] aMinSize Minimum size for cache in bytes.
1.95 + @param[out] aMaxSize Maximum size for cache in bytes.
1.96 + @param[out] aCurrentSize The current size for cache in bytes.
1.97 + This may be greater than aMaxSize.
1.98 +
1.99 + @return KErrNone, if successful; otherwise one of the other system wide error codes.
1.100 + */
1.101 + IMPORT_C static TInt CacheSize(TUint& aMinSize,TUint& aMaxSize,TUint& aCurrentSize);
1.102 +
1.103 + /**
1.104 + Paging event information.
1.105 + */
1.106 + struct TEventInfo
1.107 + {
1.108 + /**
1.109 + The total number of page faults which have occurred.
1.110 + */
1.111 + TUint64 iPageFaultCount;
1.112 +
1.113 + /**
1.114 + The total number of page faults which resulted in reading a page
1.115 + from storage media.
1.116 + */
1.117 + TUint64 iPageInReadCount;
1.118 + };
1.119 +
1.120 + /**
1.121 + Get paging event information.
1.122 +
1.123 + @param[out] aInfo A descriptor to hold the returned information.
1.124 + The contents of the descriptor are in the form of a #TEventInfo object.
1.125 +
1.126 + @return KErrNone, if successful; otherwise one of the other system wide error codes.
1.127 + */
1.128 + IMPORT_C static TInt EventInfo(TDes8& aInfo);
1.129 + };
1.130 +
1.131 +