kernel/eka/include/page_alloc.h
changeset 109 b3a1d9898418
child 167 b41fc9c39ca7
equal deleted inserted replaced
102:ef2a444a7410 109:b3a1d9898418
       
     1 // Copyright (c) 1994-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 // kernel\eka\include\page_alloc.h
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __KERNEL_MODE__ 
       
    19 
       
    20 const int MAXSMALLPAGEBITS = 68<<3;
       
    21 #define MINPAGEPOWER	PAGESHIFT+2
       
    22 
       
    23 struct paged_bitmap
       
    24 {
       
    25 	public:
       
    26 		inline paged_bitmap() : iBase(0), iNbits(0) {}
       
    27 		void Init(unsigned char* p, unsigned size, unsigned bit);
       
    28 //
       
    29 		inline unsigned char* Addr() const;
       
    30 		inline unsigned Size() const;
       
    31 //
       
    32 		inline void Set(unsigned ix, unsigned bit);
       
    33 		inline unsigned operator[](unsigned ix) const;
       
    34 		bool Is(unsigned ix, unsigned len, unsigned bit) const;
       
    35 		void Set(unsigned ix, unsigned len, unsigned val);
       
    36 		void Setn(unsigned ix, unsigned len, unsigned bit);
       
    37 		unsigned Bits(unsigned ix, unsigned len) const;	// little endian
       
    38 		int Find(unsigned start, unsigned bit) const;
       
    39 	private:
       
    40 		unsigned char* iBase;
       
    41 		unsigned iNbits;
       
    42 };
       
    43 
       
    44 #endif  // __KERNEL_MODE__