sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description: Declaration of CMmapControllerNode
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
|
sl@0
|
20 |
#ifndef MMAP_CONTROLLER_NODE_H
|
sl@0
|
21 |
#define MMAP_CONTROLLER_NODE_H
|
sl@0
|
22 |
|
sl@0
|
23 |
// INCLUDES
|
sl@0
|
24 |
#include <e32base.h>
|
sl@0
|
25 |
#include <e32std.h>
|
sl@0
|
26 |
#include "mmapmemorynode.h"
|
sl@0
|
27 |
#include "base.h"
|
sl@0
|
28 |
|
sl@0
|
29 |
// CONSTANTS
|
sl@0
|
30 |
|
sl@0
|
31 |
// MACROS
|
sl@0
|
32 |
|
sl@0
|
33 |
// FORWARD DECLARATIONS
|
sl@0
|
34 |
class CMmapMemoryNode;
|
sl@0
|
35 |
|
sl@0
|
36 |
// DATA TYPES
|
sl@0
|
37 |
|
sl@0
|
38 |
// FUNCTION PROTOTYPES
|
sl@0
|
39 |
|
sl@0
|
40 |
// CLASS DECLARATION
|
sl@0
|
41 |
|
sl@0
|
42 |
/*
|
sl@0
|
43 |
* This class is responsible to managing the memory mapped nodes.
|
sl@0
|
44 |
* This will maintain the mapped memory in a list format.
|
sl@0
|
45 |
* @since MRT 2.0
|
sl@0
|
46 |
*/
|
sl@0
|
47 |
NONSHARABLE_CLASS ( CMmapControllerNode ): public BBase
|
sl@0
|
48 |
{
|
sl@0
|
49 |
public:
|
sl@0
|
50 |
/*
|
sl@0
|
51 |
* 1st phase constructor.
|
sl@0
|
52 |
*/
|
sl@0
|
53 |
static CMmapControllerNode * NewL();
|
sl@0
|
54 |
|
sl@0
|
55 |
/*
|
sl@0
|
56 |
* Default destructor.
|
sl@0
|
57 |
*/
|
sl@0
|
58 |
~CMmapControllerNode();
|
sl@0
|
59 |
|
sl@0
|
60 |
/*
|
sl@0
|
61 |
* To create a mapped memory and add in mmap node list
|
sl@0
|
62 |
*/
|
sl@0
|
63 |
|
sl@0
|
64 |
static TAny* AddMmapNodeL(struct _reent *r, size_t len, int flag, \
|
sl@0
|
65 |
int shmflg, int fildes, off_t offset, size_t maplen);
|
sl@0
|
66 |
|
sl@0
|
67 |
/*
|
sl@0
|
68 |
* To unmap a mapped memory and delete from mmap node list
|
sl@0
|
69 |
*/
|
sl@0
|
70 |
|
sl@0
|
71 |
int DeleteMmapNode(TAny* aAddr, int& anerror);
|
sl@0
|
72 |
|
sl@0
|
73 |
/*
|
sl@0
|
74 |
* To sync a mapped memory into the file below
|
sl@0
|
75 |
*/
|
sl@0
|
76 |
|
sl@0
|
77 |
int SyncMmapNode(TAny* aAddr, size_t len, int flags, int& anerror);
|
sl@0
|
78 |
|
sl@0
|
79 |
/*
|
sl@0
|
80 |
* To modify protection mode of a mapped memory.
|
sl@0
|
81 |
*/
|
sl@0
|
82 |
|
sl@0
|
83 |
int ChprotMmapNode(const TAny* addr, size_t len, int prot, int& anerrno);
|
sl@0
|
84 |
|
sl@0
|
85 |
/*
|
sl@0
|
86 |
* To delete a mapped memory from node list.
|
sl@0
|
87 |
*/
|
sl@0
|
88 |
|
sl@0
|
89 |
static void RemoveControllerL(void *p);
|
sl@0
|
90 |
|
sl@0
|
91 |
private:
|
sl@0
|
92 |
/*
|
sl@0
|
93 |
* Default constructor.
|
sl@0
|
94 |
*/
|
sl@0
|
95 |
CMmapControllerNode();
|
sl@0
|
96 |
|
sl@0
|
97 |
/*
|
sl@0
|
98 |
* 2nd phase constructor.
|
sl@0
|
99 |
*/
|
sl@0
|
100 |
void ConstructL();
|
sl@0
|
101 |
|
sl@0
|
102 |
private: // data
|
sl@0
|
103 |
TSglQue<CMmapMemoryNode> iMmapQueue;
|
sl@0
|
104 |
TSglQueIter<CMmapMemoryNode> iMmapQueueIter;
|
sl@0
|
105 |
};
|
sl@0
|
106 |
|
sl@0
|
107 |
#endif // MMAP_CONTROLLER_NODE_H
|
sl@0
|
108 |
|
sl@0
|
109 |
// End of File
|