kernel/eka/memmodel/epoc/flexible/mmu/mm.h
branchRCL_3
changeset 257 3e88ff8f41d5
parent 256 c1f20ce4abcf
equal deleted inserted replaced
256:c1f20ce4abcf 257:3e88ff8f41d5
    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;
       
    32 class DPhysicalPinMapping;
    31 class DPhysicalPinMapping;
    33 
    32 
    34 /**
    33 /**
    35 Memory object types for MM::MemoryNew which indicates how the
    34 Memory object types for MM::MemoryNew which indicates how the
    36 contents of a memory object are to be managed.
    35 contents of a memory object are to be managed.
   159 	EMemoryCreateCustomManager			= 1<<30,
   158 	EMemoryCreateCustomManager			= 1<<30,
   160 
   159 
   161 	/**
   160 	/**
   162 	Memory object contents are to be demand paged. 
   161 	Memory object contents are to be demand paged. 
   163 	*/
   162 	*/
   164 	EMemoryCreateDemandPaged			= 1U<<31
   163 	EMemoryCreateDemandPaged			= 1<<31
   165 	};
   164 	};
   166 
   165 
   167 
   166 
   168 /**
   167 /**
   169 Attributes that the memory in a memory object has.
   168 Attributes that the memory in a memory object has.
   310 	/**
   309 	/**
   311 	Don't allocate any virtual memory in the address space, just used the
   310 	Don't allocate any virtual memory in the address space, just used the
   312 	specified address.
   311 	specified address.
   313 	@internalTechnology
   312 	@internalTechnology
   314 	*/
   313 	*/
   315 	EMappingCreateFixedVirtual	= 1U<<31
   314 	EMappingCreateFixedVirtual	= 1<<31
   316 	};
   315 	};
   317 
   316 
   318 
   317 
   319 class DMemModelChunk;
   318 class DMemModelChunk;
   320 class TPagedCodeInfo;
   319 class TPagedCodeInfo;
   882 
   881 
   883 	/**
   882 	/**
   884 	Find and open the mapping that maps a virtual address in the address space of the specified
   883 	Find and open the mapping that maps a virtual address in the address space of the specified
   885 	process.
   884 	process.
   886 
   885 
   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 
       
   907 	The caller must close the mapping when it has finished using it.  The caller must ensure that
   886 	The caller must close the mapping when it has finished using it.  The caller must ensure that
   908 	the process can't be destroyed while calling this method.
   887 	the process can't be destroyed while calling this method.
   909 
   888 
   910 	@param aOsAsid The identifier for the address space in which the mapping appears.
   889 	@param aOsAsid The identifier for the address space in which the mapping appears.
   911 	@param aAddr The virtual address for which the mapping is to be found.
   890 	@param aAddr The virtual address for which the mapping is to be found.
  1065 	static void AsyncAddressSpaceFree(TUint aOsAsid);
  1044 	static void AsyncAddressSpaceFree(TUint aOsAsid);
  1066 	static TInt VirtualAllocCommon(TLinAddr& aLinAddr, TUint aSize, TBool aDemandPaged);
  1045 	static TInt VirtualAllocCommon(TLinAddr& aLinAddr, TUint aSize, TBool aDemandPaged);
  1067 	static void VirtualFreeCommon(TLinAddr aLinAddr, TUint aSize);
  1046 	static void VirtualFreeCommon(TLinAddr aLinAddr, TUint aSize);
  1068 	static TInt VirtualAlloc(TInt aOsAsid, TLinAddr& aLinAddr, TUint aSize, TBool aDemandPaged);
  1047 	static TInt VirtualAlloc(TInt aOsAsid, TLinAddr& aLinAddr, TUint aSize, TBool aDemandPaged);
  1069 	static void VirtualFree(TInt aOsAsid, TLinAddr aLinAddr, TUint aSize);
  1048 	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
       
  1082 
  1049 
  1083 	/**
  1050 	/**
  1084 	Enumeration of panic values for category "MemModel".
  1051 	Enumeration of panic values for category "MemModel".
  1085 	*/
  1052 	*/
  1086 	enum TMemModelPanic
  1053 	enum TMemModelPanic