kernel/eka/memmodel/epoc/flexible/mmu/mm.h
changeset 109 b3a1d9898418
parent 102 ef2a444a7410
child 201 43365a9b78a3
equal deleted inserted replaced
102:ef2a444a7410 109:b3a1d9898418
    26 
    26 
    27 
    27 
    28 class DMemoryObject;
    28 class DMemoryObject;
    29 class DMemoryMapping;
    29 class DMemoryMapping;
    30 class DMemModelThread;
    30 class DMemModelThread;
       
    31 class DMemModelProcess;
    31 class DPhysicalPinMapping;
    32 class DPhysicalPinMapping;
    32 
    33 
    33 /**
    34 /**
    34 Memory object types for MM::MemoryNew which indicates how the
    35 Memory object types for MM::MemoryNew which indicates how the
    35 contents of a memory object are to be managed.
    36 contents of a memory object are to be managed.
   158 	EMemoryCreateCustomManager			= 1<<30,
   159 	EMemoryCreateCustomManager			= 1<<30,
   159 
   160 
   160 	/**
   161 	/**
   161 	Memory object contents are to be demand paged. 
   162 	Memory object contents are to be demand paged. 
   162 	*/
   163 	*/
   163 	EMemoryCreateDemandPaged			= 1<<31
   164 	EMemoryCreateDemandPaged			= 1U<<31
   164 	};
   165 	};
   165 
   166 
   166 
   167 
   167 /**
   168 /**
   168 Attributes that the memory in a memory object has.
   169 Attributes that the memory in a memory object has.
   309 	/**
   310 	/**
   310 	Don't allocate any virtual memory in the address space, just used the
   311 	Don't allocate any virtual memory in the address space, just used the
   311 	specified address.
   312 	specified address.
   312 	@internalTechnology
   313 	@internalTechnology
   313 	*/
   314 	*/
   314 	EMappingCreateFixedVirtual	= 1<<31
   315 	EMappingCreateFixedVirtual	= 1U<<31
   315 	};
   316 	};
   316 
   317 
   317 
   318 
   318 class DMemModelChunk;
   319 class DMemModelChunk;
   319 class TPagedCodeInfo;
   320 class TPagedCodeInfo;
   881 
   882 
   882 	/**
   883 	/**
   883 	Find and open the mapping that maps a virtual address in the address space of the specified
   884 	Find and open the mapping that maps a virtual address in the address space of the specified
   884 	process.
   885 	process.
   885 
   886 
       
   887 	The caller must close the mapping when it has finished using it.
       
   888 
       
   889 	@param aProcess The process whose address space is to be searched.
       
   890 	@param aAddr The virtual address for which the mapping is to be found.
       
   891 	@param aSize The size, in bytes, of the region at aAddr.
       
   892 	@param aOffsetInMapping A reference which is set to the offset, in bytes, into the
       
   893 							mapping of the start address.
       
   894 	@param aInstanceCount	The instance count of the found mapping.
       
   895 
       
   896 	@return The mapping, or NULL if no mapping was found.
       
   897 
       
   898 	@pre Calling thread must be in a critical section.
       
   899 	*/
       
   900 	static DMemoryMapping* FindMappingInProcess(DMemModelProcess* aProcess, TLinAddr aAddr, TUint aSize, 
       
   901 												TUint& aOffsetInMapping, TUint& aInstanceCount);
       
   902 
       
   903 	/**
       
   904 	Find and open the mapping that maps a virtual address in the address space of the specified
       
   905 	process.
       
   906 
   886 	The caller must close the mapping when it has finished using it.  The caller must ensure that
   907 	The caller must close the mapping when it has finished using it.  The caller must ensure that
   887 	the process can't be destroyed while calling this method.
   908 	the process can't be destroyed while calling this method.
   888 
   909 
   889 	@param aOsAsid The identifier for the address space in which the mapping appears.
   910 	@param aOsAsid The identifier for the address space in which the mapping appears.
   890 	@param aAddr The virtual address for which the mapping is to be found.
   911 	@param aAddr The virtual address for which the mapping is to be found.
  1044 	static void AsyncAddressSpaceFree(TUint aOsAsid);
  1065 	static void AsyncAddressSpaceFree(TUint aOsAsid);
  1045 	static TInt VirtualAllocCommon(TLinAddr& aLinAddr, TUint aSize, TBool aDemandPaged);
  1066 	static TInt VirtualAllocCommon(TLinAddr& aLinAddr, TUint aSize, TBool aDemandPaged);
  1046 	static void VirtualFreeCommon(TLinAddr aLinAddr, TUint aSize);
  1067 	static void VirtualFreeCommon(TLinAddr aLinAddr, TUint aSize);
  1047 	static TInt VirtualAlloc(TInt aOsAsid, TLinAddr& aLinAddr, TUint aSize, TBool aDemandPaged);
  1068 	static TInt VirtualAlloc(TInt aOsAsid, TLinAddr& aLinAddr, TUint aSize, TBool aDemandPaged);
  1048 	static void VirtualFree(TInt aOsAsid, TLinAddr aLinAddr, TUint aSize);
  1069 	static void VirtualFree(TInt aOsAsid, TLinAddr aLinAddr, TUint aSize);
       
  1070 
       
  1071 #ifdef _DEBUG
       
  1072 	/**
       
  1073 	Force a region of paged memory to be paged out.
       
  1074 
       
  1075 	If the memory is not paged this call has no effect.
       
  1076 
       
  1077 	@return KErrNone, or KErrBadDescriptor if a single mapping containing the region could not be
       
  1078 	        found.
       
  1079 	*/
       
  1080 	static TInt FlushRegion(DMemModelProcess*, TLinAddr aStartAddress, TUint aSize);
       
  1081 #endif
  1049 
  1082 
  1050 	/**
  1083 	/**
  1051 	Enumeration of panic values for category "MemModel".
  1084 	Enumeration of panic values for category "MemModel".
  1052 	*/
  1085 	*/
  1053 	enum TMemModelPanic
  1086 	enum TMemModelPanic