|
1 /* |
|
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #if !defined(__MEMMAP_H__) |
|
20 #define __MEMMAP_H__ |
|
21 |
|
22 #include "memmaputils.h" |
|
23 |
|
24 /** |
|
25 class Memmap |
|
26 |
|
27 @internalComponent |
|
28 @released |
|
29 */ |
|
30 class Memmap |
|
31 { |
|
32 private: |
|
33 // Output image file name |
|
34 String iOutFileName; |
|
35 // Map pointer |
|
36 char *iData; |
|
37 // Maximum size of the memory map |
|
38 unsigned long iMaxMapSize; |
|
39 // Start offset of the memory map |
|
40 unsigned long iStartOffset; |
|
41 |
|
42 // Flag to fill the map after creating |
|
43 int iFillFlg; |
|
44 |
|
45 // Interface to platform utility functions |
|
46 MemmapUtils *iUtils; |
|
47 |
|
48 // Fill the memory map |
|
49 int FillMemMap( unsigned char fillVal = 0 ); |
|
50 public: |
|
51 |
|
52 Memmap( int aFillFlg, String aOutputFile ); |
|
53 Memmap( int aFillFlg = 1); |
|
54 ~Memmap( ); |
|
55 |
|
56 // Create memory map |
|
57 int CreateMemoryMap( unsigned long aStartOffset = 0, unsigned char aFillVal = 0 ); |
|
58 // Close the memory map |
|
59 void CloseMemoryMap( int aCloseFile = 1 ); |
|
60 // Dump the memory map into a file |
|
61 void WriteToOutputFile( ); |
|
62 |
|
63 // Set the output image file name |
|
64 void SetOutputFile( String aOutputFile ); |
|
65 // Set the maximum memory map size |
|
66 void SetMaxMapSize( unsigned long aMaxSize ); |
|
67 // Get the memory map pointer |
|
68 char* GetMemoryMapPointer( ); |
|
69 // Get the map size |
|
70 unsigned long GetMapSize( ); |
|
71 |
|
72 // Operator [] for accessing memory map |
|
73 char& operator[]( unsigned long aIndex ); |
|
74 }; |
|
75 |
|
76 #endif //__MEMMAP_H__ |