kernel/eka/memmodel/epoc/flexible/mmu/mdatapaging.cpp
branchRCL_3
changeset 294 039a3e647356
parent 257 3e88ff8f41d5
equal deleted inserted replaced
268:345b1ca54e88 294:039a3e647356
   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 
       
   809 	if (!NKern::CompareAndSwap((TAny*&)iDevice, (TAny*)NULL, (TAny*)aDevice))
   800 	if (!NKern::CompareAndSwap((TAny*&)iDevice, (TAny*)NULL, (TAny*)aDevice))
   810 		{// Data paging device already installed.
   801 		{// Data paging device already installed.
   811 		__KTRACE_OPT2(KPAGING,KBOOT,Kern::Printf("**** Attempt to install more than one data paging device !!!!!!!! ****"));
   802 		__KTRACE_OPT2(KPAGING,KBOOT,Kern::Printf("**** Attempt to install more than one data paging device !!!!!!!! ****"));
   812 		return KErrAlreadyExists;
   803 		return KErrAlreadyExists;
   813 		}
   804 		}