os/kernelhwsrv/kernel/eka/include/e32base_private.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 1994-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
// e32\include\e32base_private.h
sl@0
    15
// 
sl@0
    16
// WARNING: This file contains some APIs which are internal and are subject
sl@0
    17
//          to change without notice. Such APIs should therefore not be used
sl@0
    18
//          outside the Kernel and Hardware Services package.
sl@0
    19
//
sl@0
    20
sl@0
    21
/**
sl@0
    22
 @file
sl@0
    23
 @internalTechnology
sl@0
    24
 @released
sl@0
    25
*/
sl@0
    26
sl@0
    27
#ifndef __E32BASE_PRIVATE_H__
sl@0
    28
#define __E32BASE_PRIVATE_H__
sl@0
    29
#include <e32std.h>
sl@0
    30
#include <e32std_private.h>
sl@0
    31
#include <e32base.h>
sl@0
    32
sl@0
    33
/**
sl@0
    34
@internalComponent
sl@0
    35
*/
sl@0
    36
		struct	TObjectDataStr	//In use if this slot contains pointer to object.
sl@0
    37
			{			
sl@0
    38
			TInt16 instance;  
sl@0
    39
			TUint16 uniqueID;
sl@0
    40
			};
sl@0
    41
/**
sl@0
    42
@internalComponent
sl@0
    43
*/
sl@0
    44
		struct SObjectIxRec
sl@0
    45
			{
sl@0
    46
			union
sl@0
    47
			{
sl@0
    48
				TObjectDataStr str;	//This is in use if the slot contains pointer to CObject.	
sl@0
    49
				TInt nextEmpty;		//This is in use if the slot is empty. Points to the next empty slot ...
sl@0
    50
									//... in the list. 16 bits would be enough but ARM prefers 32 bytes.
sl@0
    51
			};
sl@0
    52
			CObject* obj;
sl@0
    53
			};
sl@0
    54
sl@0
    55
/**
sl@0
    56
@internalTechnology
sl@0
    57
@deprecated
sl@0
    58
*/
sl@0
    59
class CBitMapAllocator : public CBase
sl@0
    60
	{
sl@0
    61
public:
sl@0
    62
	IMPORT_C static CBitMapAllocator* New(TInt aSize);
sl@0
    63
	IMPORT_C static CBitMapAllocator* NewL(TInt aSize);
sl@0
    64
	IMPORT_C ~CBitMapAllocator();
sl@0
    65
	IMPORT_C TInt Alloc();
sl@0
    66
	IMPORT_C TInt AllocFrom(TInt aPos);
sl@0
    67
	IMPORT_C TInt Alloc(TInt aCount, TInt& aConsecutive);
sl@0
    68
	IMPORT_C TInt AllocAligned(TInt anAlignment);
sl@0
    69
	IMPORT_C TInt AllocAlignedBlock(TInt anAlignment);
sl@0
    70
	IMPORT_C TInt AllocFromTop();
sl@0
    71
	IMPORT_C TInt AllocFromTopFrom(TInt aPos);
sl@0
    72
	IMPORT_C void AllocAt(TInt aPos);
sl@0
    73
	IMPORT_C void AllocAt(TInt aPos, TInt aCount);
sl@0
    74
	IMPORT_C TBool IsFree(TInt aPos);
sl@0
    75
	IMPORT_C TBool IsFree(TInt aPos, TInt aCount);
sl@0
    76
	IMPORT_C void Free(TInt aPos);
sl@0
    77
	IMPORT_C void Free(TInt aPos, TInt aCount);
sl@0
    78
	IMPORT_C TInt Avail();
sl@0
    79
	IMPORT_C TInt Size();
sl@0
    80
	IMPORT_C TInt ExtractRamPages(TInt aConsecutive,TInt& aPageNo);
sl@0
    81
protected:
sl@0
    82
	IMPORT_C CBitMapAllocator(TInt aSize,TInt aLength);
sl@0
    83
protected:
sl@0
    84
	TInt iAvail;
sl@0
    85
	TInt iSize;
sl@0
    86
	TInt iLength;
sl@0
    87
	TUint iMap[1];
sl@0
    88
	};
sl@0
    89
sl@0
    90
sl@0
    91
#endif //__E32BASE_H__