kernel/eka/memmodel/epoc/flexible/mmu/mdatapaging.cpp
branchRCL_3
changeset 42 a179b74831c9
parent 28 5b5d147c7838
child 43 c1f20ce4abcf
equal deleted inserted replaced
41:0ffb4e86fcc9 42:a179b74831c9
   795 		{// No paging allowed so don't register the device.
   795 		{// No paging allowed so don't register the device.
   796 		return KErrNone;
   796 		return KErrNone;
   797 		}
   797 		}
   798 
   798 
   799 	// Store the device, blocking any other devices from installing.
   799 	// Store the device, blocking any other devices from installing.
       
   800 	// unless the device is a media extension device
       
   801 	if(aDevice->iType & DPagingDevice::EMediaExtension)
       
   802 		{
       
   803 		delete iSwapManager;
       
   804 		iSwapManager = NULL;
       
   805 		TAny* null = 0;
       
   806 		__e32_atomic_store_ord_ptr(&iDevice, null);
       
   807 		}
       
   808 
   800 	if (!NKern::CompareAndSwap((TAny*&)iDevice, (TAny*)NULL, (TAny*)aDevice))
   809 	if (!NKern::CompareAndSwap((TAny*&)iDevice, (TAny*)NULL, (TAny*)aDevice))
   801 		{// Data paging device already installed.
   810 		{// Data paging device already installed.
   802 		__KTRACE_OPT2(KPAGING,KBOOT,Kern::Printf("**** Attempt to install more than one data paging device !!!!!!!! ****"));
   811 		__KTRACE_OPT2(KPAGING,KBOOT,Kern::Printf("**** Attempt to install more than one data paging device !!!!!!!! ****"));
   803 		return KErrAlreadyExists;
   812 		return KErrAlreadyExists;
   804 		}
   813 		}