equal
deleted
inserted
replaced
|
1 // Copyright (c) 2006-2010 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 "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 // Syborg Virtual Hardware Memory implementation |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalTechnology |
|
19 @prototype |
|
20 */ |
|
21 |
|
22 #ifndef __SYBORGVIRTUALHWMEMORY_H__ |
|
23 #define __SYBORGVIRTUALHWMEMORY_H__ |
|
24 |
|
25 #include <klib.h> |
|
26 #include <graphics/virtualvideohwinterface.h> |
|
27 #include <graphics/guestvideodriverinterfaceconstants.h> |
|
28 |
|
29 /** |
|
30 |
|
31 Very simple memory manager for platsim virtual HW memory |
|
32 |
|
33 */ |
|
34 class DVirtualHWMemoryManager: public DBase |
|
35 { |
|
36 struct TAllocatedCell |
|
37 { |
|
38 TAllocatedCell( TInt aSize, TUint32 aBase ): |
|
39 iSize( aSize ), |
|
40 iBase( aBase ), |
|
41 iNext( NULL ) |
|
42 { |
|
43 } |
|
44 |
|
45 TInt iSize; |
|
46 TUint32 iBase; |
|
47 TAllocatedCell* iNext; |
|
48 }; |
|
49 |
|
50 public: |
|
51 DVirtualHWMemoryManager(TUint32 aBase, TInt aMaxSize); |
|
52 |
|
53 TUint32 Allocate(TInt aSize); |
|
54 |
|
55 void Deallocate(const TUint32 aPhysicalAddress); |
|
56 |
|
57 ~DVirtualHWMemoryManager(); |
|
58 |
|
59 private: |
|
60 TAllocatedCell iRoot; |
|
61 TAllocatedCell iLast; |
|
62 }; |
|
63 |
|
64 #endif |