Revision: 201013 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 31 Mar 2010 23:38:45 +0300
branchRCL_3
changeset 22 2f92ad2dc5db
parent 21 e7d2d738d3c2
child 23 1df514389a47
Revision: 201013 Kit: 201013
brdbootldr/ubootldr/base_ubootldr.mrp
brdbootldr/ubootldr/bld.inf
brdbootldr/ubootldr/ubootldrldd/ubootldrldd_generic.mmp
kernel/eka/debug/securityServer/inc/rm_debug_logging.h
kernel/eka/debug/securityServer/src/c_security_svr_server.cpp
kernel/eka/drivers/debug/rmdebug/d_rmd_breakpoints.cpp
kernel/eka/drivers/debug/rmdebug/d_rmd_breakpoints.h
kernel/eka/drivers/debug/rmdebug/d_rmd_breakpoints_debug.inl
kernel/eka/drivers/dma/dma2_pil.cpp
kernel/eka/drivers/dma/dmapil.cpp
kernel/eka/drivers/pbus/mmc/sdcard/Obtaining_PSL_Software_Source_Code.txt
kernel/eka/drivers/pbus/mmc/sdcard/bmarm/sdcard3c/epbusmu.def
kernel/eka/drivers/pbus/mmc/sdcard/bmarm/sdcard3c/sdio/epbusmu.def
kernel/eka/drivers/pbus/mmc/sdcard/bwins/sdcard3c/epbusmu.def
kernel/eka/drivers/pbus/mmc/sdcard/bwins/sdcard3c/sdio/epbusmu.def
kernel/eka/drivers/pbus/mmc/sdcard/bx86/sdcard3c/epbusmu.def
kernel/eka/drivers/pbus/mmc/sdcard/bx86/sdcard3c/sdio/epbusmu.def
kernel/eka/drivers/pbus/mmc/sdcard/eabi/sdcard3c/epbusmu.def
kernel/eka/drivers/pbus/mmc/sdcard/sdcard3c/sdcard.cpp
kernel/eka/drivers/usbcc/chapter9.cpp
kernel/eka/drivers/usbcc/ps_usbc.cpp
kernel/eka/euser/us_ksvr.cpp
kernel/eka/euser/us_test.cpp
kernel/eka/include/d32otgdi.h
kernel/eka/include/d32otgdi_errors.h
kernel/eka/include/d32usbdi.h
kernel/eka/include/d32usbdi.inl
kernel/eka/include/drivers/dma_hai.h
kernel/eka/include/drivers/dma_v1.h
kernel/eka/include/drivers/sdcard.h
kernel/eka/include/drivers/usbcshared.h
kernel/eka/include/e32ver.h
kernel/eka/include/memmodel/epoc/mmubase/ramalloc.h
kernel/eka/kernel/sexec.cpp
kernel/eka/kernel/skernel.cpp
kernel/eka/memmodel/epoc/flexible/mmu/mcodepaging.cpp
kernel/eka/memmodel/epoc/flexible/mmu/mcodepaging.h
kernel/eka/memmodel/epoc/flexible/mmu/mdatapaging.cpp
kernel/eka/memmodel/epoc/flexible/mmu/mexport.cpp
kernel/eka/memmodel/epoc/flexible/mmu/mm.cpp
kernel/eka/memmodel/epoc/flexible/mmu/mm.h
kernel/eka/memmodel/epoc/flexible/mmu/mmanager.cpp
kernel/eka/memmodel/epoc/flexible/mmu/mmanager.h
kernel/eka/memmodel/epoc/flexible/mmu/mmapping.cpp
kernel/eka/memmodel/epoc/flexible/mmu/mmappinglist.cpp
kernel/eka/memmodel/epoc/flexible/mmu/mmappinglist.h
kernel/eka/memmodel/epoc/flexible/mmu/mmu.cpp
kernel/eka/memmodel/epoc/flexible/mmu/mmu.h
kernel/eka/memmodel/epoc/flexible/mmu/mpagearray.cpp
kernel/eka/memmodel/epoc/flexible/mmu/mpagearray.h
kernel/eka/memmodel/epoc/flexible/mmu/mpager.cpp
kernel/eka/memmodel/epoc/flexible/mmu/mpager.h
kernel/eka/memmodel/epoc/flexible/mmu/mpdalloc.cpp
kernel/eka/memmodel/epoc/flexible/mmu/mptalloc.cpp
kernel/eka/memmodel/epoc/flexible/mmu/mrom.cpp
kernel/eka/memmodel/epoc/flexible/mmu/mvalloc.cpp
kernel/eka/memmodel/epoc/mmubase/defragbase.cpp
kernel/eka/memmodel/epoc/mmubase/mmubase.cpp
kernel/eka/memmodel/epoc/mmubase/ramalloc.cpp
kernel/eka/memmodel/epoc/moving/arm/xmmu.cpp
kernel/eka/memmodel/epoc/multiple/arm/xmmu.cpp
kernel/eka/release.txt
kerneltest/e32test/benchmark/bm_rapu_pdd.cpp
kerneltest/e32test/demandpaging/t_tbus_datapaging.cpp
kerneltest/e32test/dma/d_dma.cpp
kerneltest/e32test/dma/dmasim.cpp
kerneltest/e32test/dma/t_dma.cpp
kerneltest/e32test/dmav2/test_cases.cpp
kerneltest/e32test/group/bm_pdd.mmp
kerneltest/e32test/group/d_cache.mmp
kerneltest/e32test/group/t_crashmonitor_lib.mmp
kerneltest/e32test/group/t_rmdebug.mmp
kerneltest/e32test/group/t_rmdebug2.mmh
kerneltest/e32test/group/t_rmdebug2.mmp
kerneltest/e32test/group/t_rmdebug2_oem.mmp
kerneltest/e32test/group/t_rmdebug2_oem2.mmp
kerneltest/e32test/group/t_rmdebug2_oemtoken.mmp
kerneltest/e32test/group/t_rmdebug2_oemtoken2.mmp
kerneltest/e32test/group/t_rmdebug_app.mmp
kerneltest/e32test/group/t_rmdebug_dll.mmp
kerneltest/e32test/group/t_rmdebug_security0.mmp
kerneltest/e32test/group/t_rmdebug_security1.mmp
kerneltest/e32test/group/t_rmdebug_security2.mmp
kerneltest/e32test/group/t_rmdebug_security3.mmp
kerneltest/e32test/group/t_suser.mmp
kerneltest/e32test/group/t_trkdummyapp.mmp
kerneltest/e32test/mmu/d_memorytest.h
kerneltest/e32test/prime/t_timer.cpp
kerneltest/e32test/realtime/d_latncy.cpp
kerneltest/e32test/rm_debug/basic_tests/t_rmdebug2.cpp
kerneltest/e32test/rm_debug/basic_tests/t_rmdebug2.h
kerneltest/e32test/rm_debug/d_demand_paging.cia
kerneltest/e32test/rm_debug/d_demand_paging.h
kerneltest/e32test/rm_debug/d_rmdebug_step_test.h
kerneltest/e32test/rm_debug/d_rmdebug_step_test.s
kerneltest/e32test/rm_debug/d_rmdebug_step_test_armv4.h
kerneltest/e32test/rm_debug/d_rmdebug_step_test_armv4.s
kerneltest/e32test/rm_debug/d_rmdebugclient.h
kerneltest/e32test/rm_debug/d_rmdebugserver.cpp
kerneltest/e32test/rm_debug/d_rmdebugserver.h
kerneltest/e32test/rm_debug/d_rmdebugthread.cpp
kerneltest/e32test/rm_debug/d_rmdebugthread.h
kerneltest/e32test/rm_debug/d_rmdebugthread2.cpp
kerneltest/e32test/rm_debug/d_rmdebugthread2.h
kerneltest/e32test/rm_debug/d_rmdebugthreadasm.cia
kerneltest/e32test/rm_debug/d_rmdebugthreadasm2.cia
kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_bkpt_test.h
kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_bkpt_test.s
kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_step_test.s
kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthread2.cpp
kerneltest/e32test/rm_debug/group/t_rmdebug2.mmh
kerneltest/e32test/rm_debug/r_kernel_low_memory_security_svr_session.cpp
kerneltest/e32test/rm_debug/r_kernel_low_memory_security_svr_session.h
kerneltest/e32test/rm_debug/r_low_memory_security_svr_session.cpp
kerneltest/e32test/rm_debug/r_low_memory_security_svr_session.h
kerneltest/e32test/rm_debug/r_user_low_memory_security_svr_session.cpp
kerneltest/e32test/rm_debug/r_user_low_memory_security_svr_session.h
kerneltest/e32test/rm_debug/t_rmdebug.cpp
kerneltest/e32test/rm_debug/t_rmdebug.h
kerneltest/e32test/rm_debug/t_rmdebug2.cpp
kerneltest/e32test/rm_debug/t_rmdebug2.h
kerneltest/e32test/rm_debug/t_rmdebug2_oemtoken.cpp
kerneltest/e32test/rm_debug/t_rmdebug_app.cpp
kerneltest/e32test/rm_debug/t_rmdebug_app.h
kerneltest/e32test/rm_debug/t_rmdebug_dll.cpp
kerneltest/e32test/rm_debug/t_rmdebug_dll.h
kerneltest/e32test/rm_debug/t_rmdebug_security.cpp
kerneltest/e32test/rm_debug/t_rmdebug_security.h
kerneltest/e32test/rm_debug/t_trkdummyapp.cpp
kerneltest/e32test/rm_debug/t_trkdummyapp.h
kerneltest/e32test/secure/t_suser.cpp
kerneltest/e32test/system/d_mstim.cpp
kerneltest/e32test/system/d_tick.cpp
kerneltest/f32test/shostmassstorage/msman/app/husbconsapp.cpp
kerneltest/f32test/shostmassstorage/msman/src/cusbhost.cpp
kerneltest/f32test/shostmassstorage/msman/src/cusbhostao.cpp
kerneltest/f32test/shostmassstorage/msman/src/rextfilesystem.cpp
kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/inc/tfatbootsector.inl
package_definition.xml
userlibandfileserver/fileserver/etshell/ts_com.cpp
userlibandfileserver/fileserver/fs_utils/filesystem_utils.inl
userlibandfileserver/fileserver/group/release.txt
userlibandfileserver/fileserver/inc/f32ver.h
userlibandfileserver/fileserver/sfat32/common_constants.h
userlibandfileserver/fileserver/sfat32/fat_config.cpp
userlibandfileserver/fileserver/sfat32/fat_dir_entry.h
userlibandfileserver/fileserver/sfat32/fat_dir_entry.inl
userlibandfileserver/fileserver/sfat32/fat_table32.cpp
userlibandfileserver/fileserver/sfat32/inc/fat_table32.h
userlibandfileserver/fileserver/sfat32/inc/sl_bpb.h
userlibandfileserver/fileserver/sfat32/inc/sl_bpb.inl
userlibandfileserver/fileserver/sfat32/inc/sl_scandrv.h
userlibandfileserver/fileserver/sfat32/inc/sl_std.h
userlibandfileserver/fileserver/sfat32/inc/sl_std.inl
userlibandfileserver/fileserver/sfat32/ram_fat_table32.cpp
userlibandfileserver/fileserver/sfat32/sl_bpb32.cpp
userlibandfileserver/fileserver/sfat32/sl_dir_cache.cpp
userlibandfileserver/fileserver/sfat32/sl_dir_cache.h
userlibandfileserver/fileserver/sfat32/sl_drv.cpp
userlibandfileserver/fileserver/sfat32/sl_fatcache.cpp
userlibandfileserver/fileserver/sfat32/sl_fatmisc32.cpp
userlibandfileserver/fileserver/sfat32/sl_file.cpp
userlibandfileserver/fileserver/sfat32/sl_fmt.cpp
userlibandfileserver/fileserver/sfat32/sl_leafdir_cache.cpp
userlibandfileserver/fileserver/sfat32/sl_mnt.cpp
userlibandfileserver/fileserver/sfat32/sl_mnt32.cpp
userlibandfileserver/fileserver/sfat32/sl_scan32.cpp
userlibandfileserver/fileserver/sfat32/sl_vfat.cpp
userlibandfileserver/fileserver/sfile/sf_ext.cpp
userlibandfileserver/fileserver/sfile/sf_file.cpp
userlibandfileserver/fileserver/sfsrv/cl_cli.cpp
userlibandfileserver/fileserver/shostmassstorage/msproxy/hostusbmsproxy.cpp
userlibandfileserver/fileserver/shostmassstorage/server/protocol/cmassstoragefsm.cpp
userlibandfileserver/fileserver/shostmassstorage/server/protocol/cscsiprotocol.cpp
userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/cscsiprotocol.h
userlibandfileserver/fileserver/shostmassstorage/server/shared/msctypes.h
userlibandfileserver/fileserver/shostmassstorage/server/transport/cbulkonlytransport.cpp
userlibandfileserver/fileserver/shostmassstorage/server/transport/cusbifacehandler.cpp
userlibandfileserver/fileserver/shostmassstorage/server/transport/include/cusbifacehandler.h
userlibandfileserver/fileserver/smassstorage/inc/tfatbootsector.inl
--- a/brdbootldr/ubootldr/base_ubootldr.mrp	Mon Mar 15 12:45:50 2010 +0200
+++ b/brdbootldr/ubootldr/base_ubootldr.mrp	Wed Mar 31 23:38:45 2010 +0300
@@ -3,9 +3,10 @@
 component	base_ubootldr
 source	\sf\os\kernelhwsrv\brdbootldr\ubootldr
 
+binary	\sf\os\kernelhwsrv\brdbootldr\ubootldr all
+
 notes_source	\component_defs\release.src
 
-
 ipr E 
 ipr T \sf\os\kernelhwsrv\brdbootldr\ubootldr\inc
 ipr T \sf\os\kernelhwsrv\brdbootldr\ubootldr\ubootldrldd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/brdbootldr/ubootldr/bld.inf	Wed Mar 31 23:38:45 2010 +0300
@@ -0,0 +1,23 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: Dummy file to keep build tools happy
+//
+
+
+PRJ_PLATFORMS
+ARMV5
+
+
+PRJ_MMPFILES
+ubootldrldd/ubootldrldd_generic.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/brdbootldr/ubootldr/ubootldrldd/ubootldrldd_generic.mmp	Wed Mar 31 23:38:45 2010 +0300
@@ -0,0 +1,29 @@
+// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description: Dummy mmp file to keep build tools happy
+//
+
+#include "kernel/kern_ext.mmh"
+
+target         	_generic_ubootldr.ldd
+targettype		ldd
+sourcepath		.
+source			ubootldrldd.cpp
+epocallowdlldata
+
+capability		all
+vendorid		0x70000001
+macro			__SECURE_API__
+
+SMPSAFE
+
--- a/kernel/eka/debug/securityServer/inc/rm_debug_logging.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/debug/securityServer/inc/rm_debug_logging.h	Wed Mar 31 23:38:45 2010 +0300
@@ -34,30 +34,48 @@
     #include <kernel/kernel.h>
     #include <nkern/nk_trace.h>
 
-    #define LOG_MSG( a )            __KTRACE_OPT(KDEBUGGER, Kern::Printf( a ))
-    #define LOG_MSG2( a, b )        __KTRACE_OPT(KDEBUGGER, Kern::Printf( a, b ))
-    #define LOG_MSG3( a, b, c )     __KTRACE_OPT(KDEBUGGER, Kern::Printf( a, b, c ))
-    #define LOG_MSG4( a, b, c, d )  __KTRACE_OPT(KDEBUGGER, Kern::Printf( a, b, c, d ))
-    #define LOG_MSG5( a, b, c, d, e )  __KTRACE_OPT(KDEBUGGER, Kern::Printf( a, b, c, d, e ))
+    #define LOG_MSG(args...)			__KTRACE_OPT(KDEBUGGER, Kern::Printf(args))
+	#define LOG_ENTRY()					__KTRACE_OPT(KDEBUGGER, Kern::Printf("+%s", __PRETTY_FUNCTION__))
+	#define LOG_EXIT()					__KTRACE_OPT(KDEBUGGER, Kern::Printf("-%s", __PRETTY_FUNCTION__))
+	#define LOG_ARGS(fmt, args...)		__KTRACE_OPT(KDEBUGGER, Kern::Printf("+%s " fmt, __PRETTY_FUNCTION__, args))
+	#define LOG_RETURN(x)				__KTRACE_OPT(KDEBUGGER, Kern::Printf("Returning %d from [%s]", x, __PRETTY_FUNCTION__)
+
+	// These kept for compatability
+    #define LOG_MSG2( a, b )			__KTRACE_OPT(KDEBUGGER, Kern::Printf( a, b ))
+    #define LOG_MSG3( a, b, c )			__KTRACE_OPT(KDEBUGGER, Kern::Printf( a, b, c ))
+    #define LOG_MSG4( a, b, c, d )		__KTRACE_OPT(KDEBUGGER, Kern::Printf( a, b, c, d ))
+    #define LOG_MSG5( a, b, c, d, e )	__KTRACE_OPT(KDEBUGGER, Kern::Printf( a, b, c, d, e ))
   #else
 
     #include <e32debug.h>
 
-    #define LOG_MSG( a )              RDebug::Printf( a )
-    #define LOG_MSG2( a, b )          RDebug::Printf( a, b )
-    #define LOG_MSG3( a, b, c )       RDebug::Printf( a, b, c )
-    #define LOG_MSG4( a, b, c, d )    RDebug::Printf( a, b, c, d )
-    #define LOG_MSG5( a, b, c, d, e )    RDebug::Printf( a, b, c, d, e )
+    #define LOG_MSG(args...)			RDebug::Printf(args)
+	#define LOG_DES(args...)			RDebug::Print(args) // For wide descriptors
+	#define LOG_ENTRY()					RDebug::Printf("+%s", __PRETTY_FUNCTION__)
+	#define LOG_EXIT()					RDebug::Printf("-%s", __PRETTY_FUNCTION__)
+	#define LOG_ARGS(fmt, args...)		RDebug::Printf("+%s " fmt, __PRETTY_FUNCTION__, args)
+	#define LOG_RETURN(x)				RDebug::Printf("Returning %d from [%s]", x, __PRETTY_FUNCTION__)
+
+    #define LOG_MSG2( a, b )			RDebug::Printf( a, b )
+    #define LOG_MSG3( a, b, c )			RDebug::Printf( a, b, c )
+    #define LOG_MSG4( a, b, c, d )		RDebug::Printf( a, b, c, d )
+    #define LOG_MSG5( a, b, c, d, e )	RDebug::Printf( a, b, c, d, e )
 
   #endif
 
 #else
 
-  #define LOG_MSG( a )
-  #define LOG_MSG2( a, b )
-  #define LOG_MSG3( a, b, c )
-  #define LOG_MSG4( a, b, c, d )
-  #define LOG_MSG5( a, b, c, d, e )
+	#define LOG_MSG(args...)
+	#define LOG_DES(args...)
+	#define LOG_ENTRY()
+	#define LOG_EXIT()
+	#define LOG_ARGS(fmt, args...)
+	#define LOG_RETURN(x)
+
+	#define LOG_MSG2( a, b )
+	#define LOG_MSG3( a, b, c )
+	#define LOG_MSG4( a, b, c, d )
+	#define LOG_MSG5( a, b, c, d, e )
 
 #endif
 
--- a/kernel/eka/debug/securityServer/src/c_security_svr_server.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/debug/securityServer/src/c_security_svr_server.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -113,17 +113,18 @@
 // Session constructor
 //
 	{
-	LOG_MSG("CSecuritySvrServer::NewSessionL()\n");
+	LOG_ARGS("version=%d.%d.%d", aRequiredVersion.iMajor, aRequiredVersion.iMinor, aRequiredVersion.iBuild);
 
 	//assert compatible version
 	TVersion currentVersion(KDebugServMajorVersionNumber, KDebugServMinorVersionNumber, KDebugServPatchVersionNumber);
 	if(!User::QueryVersionSupported(currentVersion, aRequiredVersion))
 		{
-		return NULL;
+		LOG_MSG("Requested version not compatible with this version. Asked for %d.%d.%d but this is %d.%d.%d", aRequiredVersion.iMajor, aRequiredVersion.iMinor, aRequiredVersion.iBuild, KDebugServMajorVersionNumber, KDebugServMinorVersionNumber, KDebugServPatchVersionNumber);
+		User::Leave(KErrNotSupported);
 		}
 
 	//create session
-	LOG_MSG( "  About to call new(ELeave) CSecuritySvrSession()\n" );
+	LOG_MSG("About to call new(ELeave) CSecuritySvrSession()");
 	CSecuritySvrSession* servSession = new(ELeave) CSecuritySvrSession();
 
 	CleanupStack::PushL(servSession);
--- a/kernel/eka/drivers/debug/rmdebug/d_rmd_breakpoints.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/drivers/debug/rmdebug/d_rmd_breakpoints.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -1566,9 +1566,9 @@
 				{
 				LOG_MSG2("Error returned from DoEnableBreak: %d", err);
 				iBreakPointList[i].iDisabledForStep = EFalse;
+				return err;
 				}
-			return err;
-			}		
+			}
 		}
 	
 	return KErrNone;
--- a/kernel/eka/drivers/debug/rmdebug/d_rmd_breakpoints.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/drivers/debug/rmdebug/d_rmd_breakpoints.h	Wed Mar 31 23:38:45 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -169,6 +169,10 @@
 
 	TInt DoGetBreakList(TUint32* aBuffer, const TUint32 aBufSize, const TUint32 aElement, TUint32& aLastElement);
 
+	// Useful helper functions for debugging breakpoint issues
+	inline void print_BreakpointsDisabledForStep();
+	inline void print_BreakpointsList();
+
 private:
 	// Locked versions of public functions
 	TInt priv_DoSetBreak(TInt32 &aBreakId, const TUint64 aId,  const TBool aThreadSpecific, const TUint32 aAddress, const Debug::TArchitectureMode aMode );
@@ -204,4 +208,6 @@
 	TBool iInitialised;
 };
 
+#include "d_rmd_breakpoints_debug.inl" 
+
 #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/debug/rmdebug/d_rmd_breakpoints_debug.inl	Wed Mar 31 23:38:45 2010 +0300
@@ -0,0 +1,39 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "debug_logging.h"
+
+// Print breakpoints disabled for stepping
+inline void D_RMD_Breakpoints::print_BreakpointsDisabledForStep()
+	{
+	for (TInt i = 0; i < iBreakPointList.Count(); i++)
+		{
+		if(iBreakPointList[i].iDisabledForStep)
+			{
+				LOG_MSG2("Breakpoint disabled for stepping: iBreakPointList[%d]", i);
+				LOG_MSG4("iBreakId = %x, iId = %d, iAddress = %x", iBreakPointList[i].iBreakId, iBreakPointList[i].iId, iBreakPointList[i].iAddress );
+			}
+		}
+	}
+
+// Print breakpoint list
+inline void D_RMD_Breakpoints::print_BreakpointsList()
+	{
+	for (TInt i = NUMBER_OF_TEMP_BREAKPOINTS; i < iBreakPointList.Count(); i++)
+		{
+			LOG_MSG2("Breakpoint list: iBreakPointList[%d]", i);
+			LOG_MSG4("iBreakId = %x, iId = %d, iAddress = %x", iBreakPointList[i].iBreakId, iBreakPointList[i].iId, iBreakPointList[i].iAddress );
+		}
+	}
--- a/kernel/eka/drivers/dma/dma2_pil.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/drivers/dma/dma2_pil.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -1955,20 +1955,6 @@
 		stop = __e32_atomic_load_acq32(&iIsrDfc) & (TUint32)KCancelFlagMask;
 		}
 
-	// Some interrupts may be missed (double-buffer and scatter-gather
-	// controllers only) if two or more transfers complete while interrupts are
-	// disabled in the CPU. If this happens, the framework will go out of sync
-	// and leave some orphaned requests in the queue.
-	//
-	// To ensure correctness we handle this case here by checking that the request
-	// queue is empty when all transfers have completed and, if not, cleaning up
-	// and notifying the client of the completion of the orphaned requests.
-	//
-	// Note that if some interrupts are missed and the controller raises an
-	// error while transferring a subsequent fragment, the error will be reported
-	// on a fragment which was successfully completed.  There is no easy solution
-	// to this problem, but this is okay as the only possible action following a
-	// failure is to flush the whole queue.
 	if (stop)
 		{
 		// If another thread set the cancel flag, it should have
@@ -1989,66 +1975,6 @@
 		// release threads doing CancelAll()
 		waiters->Signal();
 		}
-	else if (!error && !iReqQ.IsEmpty() && iController->IsIdle(*this))
-		{
-#ifdef __SMP__
-		// On an SMP system we must call stop transfer, it will block until
-		// any ISRs have completed so that the system does not spuriously
-		// attempt to recover from a missed interrupt.
-		//
-		// On an SMP system it is possible for the code here to execute
-		// concurrently with the DMA ISR. It is therefore possible that at this
-		// point the previous transfer has already completed (so that IsIdle
-		// reports true), but that the ISR has not yet queued a DFC. Therefore
-		// we must wait for the ISR to complete.
-		//
-		// StopTransfer should have no other side effect, given that the
-		// channel is already idle.
-		iController->StopTransfer(*this); // should block till ISR completion
-#endif
-
-		const TBool cleanup = !iDfc.Queued();
-		if(cleanup)
-			{
-			__KTRACE_OPT(KDMA, Kern::Printf("Missed interrupt(s) - draining request queue"));
-			ResetStateMachine();
-
-			// Move orphaned requests to temporary queue so channel queue can
-			// accept new requests.
-			SDblQue q;
-			q.MoveFrom(&iReqQ);
-
-			SDblQueLink* pL;
-			while ((pL = q.GetFirst()) != NULL)
-				{
-				DDmaRequest* const pR = _LOFF(pL, DDmaRequest, iLink);
-				__KTRACE_OPT(KDMA, Kern::Printf("Removing request from queue and notifying client"));
-				pR->OnDeque();
-				// Old style callback
-				DDmaRequest::TCallback const cb = pR->iCb;
-				if (cb)
-					{
-					TAny* const arg = pR->iCbArg;
-					Signal();
-					(*cb)(DDmaRequest::EOk, arg);
-					Wait();
-					}
-				else
-					{
-					// New style callback
-					TDmaCallback const ncb = pR->iDmaCb;
-					if (ncb)
-						{
-						TAny* const arg = pR->iDmaCbArg;
-						Signal();
-						(*ncb)(EDmaCallbackRequestCompletion, EDmaResultOK, arg, NULL);
-						Wait();
-						}
-					}
-				}
-			}
-		Signal();
-		}
 	else
 		Signal();
 
--- a/kernel/eka/drivers/dma/dmapil.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/drivers/dma/dmapil.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -861,6 +861,7 @@
 		// release threads doing CancelAll()
 		waiters->Signal();
 		}
+#ifndef DISABLE_MISSED_IRQ_RECOVERY
 	// (iController may be NULL here if the channel was closed in the client callback.)
 	else if (!error &&
 			 iController && iController->IsIdle(*this) &&
@@ -919,6 +920,7 @@
 		req_count_after = iQueuedRequests;
 		Signal();
 		}
+#endif  // #ifndef DISABLE_MISSED_IRQ_RECOVERY
 	else
 		{
 		req_count_after = iQueuedRequests;
--- a/kernel/eka/drivers/pbus/mmc/sdcard/Obtaining_PSL_Software_Source_Code.txt	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-The distribution of the SD Card PIL and PSL Software Source Code 
-and Documentation is subject to the relevant party entering into 
-the necessary agreement(s) with SD-3C LLC and/or 4C LLC.
-
-PIL Software Source Code for Symbian OS is distributed in the
-sdcard3c and sdcard4c subdirectories of this directory. 
-PSL source code for special SD card hardware fitted to an
-ARM Integrator development board is distributed in sdcard3c
-and sdcard4c subdirectories within the Integrator component. 
-If you have not received this source code, then you can obtain
-it from Symbian after proving that you have made the appropriate
-agreement(s).
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/bmarm/sdcard3c/epbusmu.def	Wed Mar 31 23:38:45 2010 +0300
@@ -0,0 +1,115 @@
+EXPORTS
+	__9DMMCStackiP10DMMCSocket @ 1 NONAME ; DMMCStack::DMMCStack(int, DMMCSocket *)
+	AddNewCard__12TMMCardArrayPCUcP4TRCA @ 2 NONAME ; TMMCardArray::AddNewCard(unsigned char const *, TRCA *)
+	Add__11DPBusSocketP13TPBusCallBack @ 3 NONAME ; DPBusSocket::Add(TPBusCallBack *)
+	AllocCards__12TMMCardArray @ 4 NONAME ; TMMCardArray::AllocCards(void)
+	Block__9DMMCStackP11DMMCSessionUl @ 5 NONAME ; DMMCStack::Block(DMMCSession *, unsigned long)
+	CIMReadWriteBlocksSM__9DMMCStack @ 6 NONAME ; DMMCStack::CIMReadWriteBlocksSM(void)
+	CSDField__C4TCSDRCUiT1 @ 7 NONAME ; TCSD::CSDField(unsigned int const &, unsigned int const &) const
+	CardDetect__9DMMCStackUi @ 8 NONAME ; DMMCStack::CardDetect(unsigned int)
+	Create__16DMediaChangeBase @ 9 NONAME ; DMediaChangeBase::Create(void)
+	Create__26TMMCardControllerInterface @ 10 NONAME ; TMMCardControllerInterface::Create(void)
+	DeclareCardAsGone__12TMMCardArrayUi @ 11 NONAME ; TMMCardArray::DeclareCardAsGone(unsigned int)
+	DeltaCurrentConsumption__11DPBusSocketi @ 12 NONAME ; DPBusSocket::DeltaCurrentConsumption(int)
+	DeviceSize__C4TCSD @ 13 NONAME ; TCSD::DeviceSize(void) const
+	Direction__C15TMMCCommandDesc @ 14 NONAME ; TMMCCommandDesc::Direction(void) const
+	Dispatch__16TMMCStateMachine @ 15 NONAME ; TMMCStateMachine::Dispatch(void)
+	DoCreate__12DPBusPsuBase @ 16 NONAME ; DPBusPsuBase::DoCreate(void)
+	DoCreate__7DMMCPsu @ 17 NONAME ; DMMCPsu::DoCreate(void)
+	DoTickService__12DPBusPsuBase @ 18 NONAME ; DPBusPsuBase::DoTickService(void)
+	DoorClosedService__16DMediaChangeBase @ 19 NONAME ; DMediaChangeBase::DoorClosedService(void)
+	DoorOpenService__16DMediaChangeBase @ 20 NONAME ; DMediaChangeBase::DoorOpenService(void)
+	EffectiveModes__9DMMCStackRC15TMMCStackConfig @ 21 NONAME ; DMMCStack::EffectiveModes(TMMCStackConfig const &)
+	EndInCritical__11DPBusSocket @ 22 NONAME ; DPBusSocket::EndInCritical(void)
+	Engage__11DMMCSession @ 23 NONAME ; DMMCSession::Engage(void)
+	EpocErrorCode__C11DMMCSession @ 24 NONAME ; DMMCSession::EpocErrorCode(void) const
+	EraseGroupSize__C4TCSD @ 25 NONAME ; TCSD::EraseGroupSize(void) const
+	EraseSectorSize__C4TCSD @ 26 NONAME ; TCSD::EraseSectorSize(void) const
+	ForceMediaChange__11DPBusSocket @ 27 NONAME ; DPBusSocket::ForceMediaChange(void)
+	InCritical__11DPBusSocket @ 28 NONAME ; DPBusSocket::InCritical(void)
+	Init__9DMMCStack @ 29 NONAME ; DMMCStack::Init(void)
+	IsLocked__12DPBusPsuBase @ 30 NONAME ; DPBusPsuBase::IsLocked(void)
+	IsLocked__C7TMMCard @ 31 NONAME ; TMMCard::IsLocked(void) const
+	IsMappingIncorrect__17TMMCPasswordStoreRC4TCIDRCt5TBuf81i16 @ 32 NONAME ; TMMCPasswordStore::IsMappingIncorrect(TCID const &, TBuf8<16> const &)
+	IsReady__C7TMMCard @ 33 NONAME ; TMMCard::IsReady(void) const
+	Jump__16TMMCStateMachinePFPv_Uli @ 34 NONAME ; TMMCStateMachine::Jump(unsigned long (*)(void *), int)
+	MaxReadCurrentInMilliamps__C4TCSD @ 35 NONAME ; TCSD::MaxReadCurrentInMilliamps(void) const
+	MaxTranSpeedInKilohertz__C4TCSD @ 36 NONAME ; TCSD::MaxTranSpeedInKilohertz(void) const
+	MaxWriteCurrentInMilliamps__C4TCSD @ 37 NONAME ; TCSD::MaxWriteCurrentInMilliamps(void) const
+	MediaType__C4TCSD @ 38 NONAME ; TCSD::MediaType(void) const
+	MinReadCurrentInMilliamps__C4TCSD @ 39 NONAME ; TCSD::MinReadCurrentInMilliamps(void) const
+	MinWriteCurrentInMilliamps__C4TCSD @ 40 NONAME ; TCSD::MinWriteCurrentInMilliamps(void) const
+	Panic__10DMMCSocketQ210DMMCSocket9TMMCPanic @ 41 NONAME ; DMMCSocket::Panic(DMMCSocket::TMMCPanic)
+	Panic__11DPBusSocketQ211DPBusSocket6TPanic @ 42 NONAME ; DPBusSocket::Panic(DPBusSocket::TPanic)
+	PowerDownStack__9DMMCStack @ 43 NONAME ; DMMCStack::PowerDownStack(void)
+	PowerUpSequenceComplete__11DPBusSocketi @ 44 NONAME ; DPBusSocket::PowerUpSequenceComplete(int)
+	PowerUpStack__9DMMCStack @ 45 NONAME ; DMMCStack::PowerUpStack(void)
+	PowerUp__11DPBusSocket @ 46 NONAME ; DPBusSocket::PowerUp(void)
+	Push__16TMMCStateMachinePFPv_Uli @ 47 NONAME ; TMMCStateMachine::Push(unsigned long (*)(void *), int)
+	ReadBlockLength__C4TCSD @ 48 NONAME ; TCSD::ReadBlockLength(void) const
+	ReceiveVoltageCheckResult__12DPBusPsuBasei @ 49 NONAME ; DPBusPsuBase::ReceiveVoltageCheckResult(int)
+	Remove__13TPBusCallBack @ 50 NONAME ; TPBusCallBack::Remove(void)
+	Reset__16TMMCStateMachine @ 51 NONAME ; TMMCStateMachine::Reset(void)
+	SetCard__11DMMCSessionP7TMMCard @ 52 NONAME ; DMMCSession::SetCard(TMMCard *)
+	SetSocket__13TPBusCallBacki @ 53 NONAME ; TPBusCallBack::SetSocket(int)
+	SetState__12DPBusPsuBase13TPBusPsuState @ 54 NONAME ; DPBusPsuBase::SetState(TPBusPsuState)
+	SetupCIMEraseGroup__11DMMCSessionG12TMMCArgumentUl @ 55 NONAME ; DMMCSession::SetupCIMEraseGroup(TMMCArgument, unsigned long)
+	SetupCIMEraseSector__11DMMCSessionG12TMMCArgumentUl @ 56 NONAME ; DMMCSession::SetupCIMEraseSector(TMMCArgument, unsigned long)
+	SetupCIMLockUnlock__11DMMCSessionUlPUc @ 57 NONAME ; DMMCSession::SetupCIMLockUnlock(unsigned long, unsigned char *)
+	SetupCIMReadBlock__11DMMCSessionG12TMMCArgumentUlPUc @ 58 NONAME ; DMMCSession::SetupCIMReadBlock(TMMCArgument, unsigned long, unsigned char *)
+	SetupCIMReadIO__11DMMCSessionUcUlPUc @ 59 NONAME ; DMMCSession::SetupCIMReadIO(unsigned char, unsigned long, unsigned char *)
+	SetupCIMReadMBlock__11DMMCSessionG12TMMCArgumentUlPUcUl @ 60 NONAME ; DMMCSession::SetupCIMReadMBlock(TMMCArgument, unsigned long, unsigned char *, unsigned long)
+	SetupCIMWriteBlock__11DMMCSessionG12TMMCArgumentUlPUc @ 61 NONAME ; DMMCSession::SetupCIMWriteBlock(TMMCArgument, unsigned long, unsigned char *)
+	SetupCIMWriteIO__11DMMCSessionUcUlPUc @ 62 NONAME ; DMMCSession::SetupCIMWriteIO(unsigned char, unsigned long, unsigned char *)
+	SetupCIMWriteMBlock__11DMMCSessionG12TMMCArgumentUlPUcUl @ 63 NONAME ; DMMCSession::SetupCIMWriteMBlock(TMMCArgument, unsigned long, unsigned char *, unsigned long)
+	SetupCommand__11DMMCSession15TMMCCommandEnumG12TMMCArgument @ 64 NONAME ; DMMCSession::SetupCommand(TMMCCommandEnum, TMMCArgument)
+	SetupDTCommand__11DMMCSession15TMMCCommandEnumG12TMMCArgumentUlPUcUli14TMMCCmdDirEnumUl @ 65 NONAME ; DMMCSession::SetupDTCommand(TMMCCommandEnum, TMMCArgument, unsigned long, unsigned char *, unsigned long, int, TMMCCmdDirEnum, unsigned long)
+	SetupRSCommand__11DMMCSession15TMMCCommandEnumG12TMMCArgumentUl19TMMCCommandTypeEnum20TMMCResponseTypeEnumUl @ 66 NONAME ; DMMCSession::SetupRSCommand(TMMCCommandEnum, TMMCArgument, unsigned long, TMMCCommandTypeEnum, TMMCResponseTypeEnum, unsigned long)
+	SocketFromId__11DPBusSocketi @ 67 NONAME ; DPBusSocket::SocketFromId(int)
+	Stop__9DMMCStackP7TMMCard @ 68 NONAME ; DMMCStack::Stop(TMMCard *)
+	UnBlock__9DMMCStackP11DMMCSessionUlUl @ 69 NONAME ; DMMCStack::UnBlock(DMMCSession *, unsigned long, unsigned long)
+	WriteBlockLength__C4TCSD @ 70 NONAME ; TCSD::WriteBlockLength(void) const
+	WriteProtected__9DMMCStackUi @ 71 NONAME ; DMMCStack::WriteProtected(unsigned int)
+	"_._11DMMCSession" @ 72 NONAME ; DMMCSession::~DMMCSession(void)
+	__10DMMCSocketiP17TMMCPasswordStore @ 73 NONAME ; DMMCSocket::DMMCSocket(int, TMMCPasswordStore *)
+	__11DMMCSessionRC12TMMCCallBack @ 74 NONAME ; DMMCSession::DMMCSession(TMMCCallBack const &)
+	__13TPBusCallBack @ 75 NONAME ; TPBusCallBack::TPBusCallBack(void)
+	__13TPBusCallBackPFPviPvPv_vPv @ 76 NONAME ; TPBusCallBack::TPBusCallBack(void (*)(void *, int, void *, void *), void *)
+	__13TPBusCallBackPFPvi_vPvUi @ 77 NONAME ; TPBusCallBack::TPBusCallBack(void (*)(void *, int), void *, unsigned int)
+	__15DMMCMediaChangei @ 78 NONAME ; DMMCMediaChange::DMMCMediaChange(int)
+	__16DMediaChangeBasei @ 79 NONAME ; DMediaChangeBase::DMediaChangeBase(int)
+	__7DMMCPsuii @ 80 NONAME ; DMMCPsu::DMMCPsu(int, int)
+	AcquireStackSM__9DMMCStack @ 81 NONAME ; DMMCStack::AcquireStackSM(void)
+	Create__15DMMCMediaChange @ 82 NONAME ; DMMCMediaChange::Create(void)
+	AllocSession__C9DMMCStackRC12TMMCCallBack @ 83 NONAME ; DMMCStack::AllocSession(TMMCCallBack const &) const
+	CIMReadWriteBlocksSMST__9DMMCStackPv @ 84 NONAME ; DMMCStack::CIMReadWriteBlocksSMST(void *)
+	CardRCA__11DMMCSession @ 85 NONAME ; DMMCSession::CardRCA(void)
+	FillCommandArgs__11DMMCSessionG12TMMCArgumentUlPUcUl @ 86 NONAME ; DMMCSession::FillCommandArgs(TMMCArgument, unsigned long, unsigned char *, unsigned long)
+	FillCommandDesc__11DMMCSession @ 87 NONAME ; DMMCSession::FillCommandDesc(void)
+	FillCommandDesc__11DMMCSession15TMMCCommandEnum @ 88 NONAME ; DMMCSession::FillCommandDesc(TMMCCommandEnum)
+	FillCommandDesc__11DMMCSession15TMMCCommandEnumG12TMMCArgument @ 89 NONAME ; DMMCSession::FillCommandDesc(TMMCCommandEnum, TMMCArgument)
+	GetMacro__C11DMMCSessioni @ 90 NONAME ; DMMCSession::GetMacro(int) const
+	IssueMMCCommandSMST__9DMMCStackPv @ 91 NONAME ; DMMCStack::IssueMMCCommandSMST(void *)
+	PowerDownComplete__11DPBusSocket @ 92 NONAME ; DPBusSocket::PowerDownComplete(void)
+	RequestAsyncPowerDown__11DPBusSocket @ 93 NONAME ; DPBusSocket::RequestAsyncPowerDown(void)
+	InitStackAfterUnlockSM__9DMMCStack @ 94 NONAME ; DMMCStack::InitStackAfterUnlockSM(void)
+	RegisterMediaDevices__26TMMCardControllerInterfacei @ 95 NONAME ; TMMCardControllerInterface::RegisterMediaDevices(int)
+	ModifyCardCapabilitySM__9DMMCStack @ 96 NONAME R3UNUSED ; DMMCStack::ModifyCardCapabilitySM(void)
+	Dummy1__9DMMCStack @ 97 NONAME R3UNUSED ; DMMCStack::Dummy1(void)
+	GetInterface__9DMMCStackQ29DMMCStack12TInterfaceIdRPQ29DMMCStack10MInterface @ 98 NONAME R3UNUSED ; DMMCStack::GetInterface(DMMCStack::TInterfaceId, DMMCStack::MInterface *&)
+	MachineInfo__9DMMCStackR5TDes8 @ 99 NONAME R3UNUSED ; DMMCStack::MachineInfo(TDes8 &)
+	SetBusWidth__9DMMCStackUl @ 100 NONAME R3UNUSED ; DMMCStack::SetBusWidth(unsigned long)
+	ControlIO__11DPBusSocketiPvT2 @ 101 NONAME ; DPBusSocket::ControlIO(int, void *, void *)
+	AllocCards__12TSDCardArray @ 102 NONAME R3UNUSED ; TSDCardArray::AllocCards(void)
+	AllocSession__C8DSDStackRC12TMMCCallBack @ 103 NONAME R3UNUSED ; DSDStack::AllocSession(TMMCCallBack const &) const
+	CIMReadWriteBlocksSM__8DSDStack @ 104 NONAME R3UNUSED ; DSDStack::CIMReadWriteBlocksSM(void)
+	DeclareCardAsGone__12TSDCardArrayUi @ 105 NONAME R3UNUSED ; TSDCardArray::DeclareCardAsGone(unsigned int)
+	Dummy1__8DSDStack @ 106 NONAME R3UNUSED ; DSDStack::Dummy1(void)
+	Dummy2__8DSDStack @ 107 NONAME R3UNUSED ; DSDStack::Dummy2(void)
+	Dummy3__8DSDStack @ 108 NONAME R3UNUSED ; DSDStack::Dummy3(void)
+	CardType__8DSDStackii @ 109 NONAME R3UNUSED ; DSDStack::CardType(int, int)
+	InitStackAfterUnlockSM__8DSDStack @ 110 NONAME R3UNUSED ; DSDStack::InitStackAfterUnlockSM(void)
+	Init__8DSDStack @ 111 NONAME R3UNUSED ; DSDStack::Init(void)
+	ModifyCardCapabilitySM__8DSDStack @ 112 NONAME R3UNUSED ; DSDStack::ModifyCardCapabilitySM(void)
+	AcquireStackSM__8DSDStack @ 113 NONAME R3UNUSED ; DSDStack::AcquireStackSM(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/bmarm/sdcard3c/sdio/epbusmu.def	Wed Mar 31 23:38:45 2010 +0300
@@ -0,0 +1,217 @@
+EXPORTS
+	__9DMMCStackiP10DMMCSocket @ 1 NONAME ; DMMCStack::DMMCStack(int, DMMCSocket *)
+	AddNewCard__12TMMCardArrayPCUcP4TRCA @ 2 NONAME ; TMMCardArray::AddNewCard(unsigned char const *, TRCA *)
+	Add__11DPBusSocketP13TPBusCallBack @ 3 NONAME ; DPBusSocket::Add(TPBusCallBack *)
+	AllocCards__12TMMCardArray @ 4 NONAME ; TMMCardArray::AllocCards(void)
+	Block__9DMMCStackP11DMMCSessionUl @ 5 NONAME ; DMMCStack::Block(DMMCSession *, unsigned long)
+	CIMReadWriteBlocksSM__9DMMCStack @ 6 NONAME ; DMMCStack::CIMReadWriteBlocksSM(void)
+	CSDField__C4TCSDRCUiT1 @ 7 NONAME ; TCSD::CSDField(unsigned int const &, unsigned int const &) const
+	CardDetect__9DMMCStackUi @ 8 NONAME ; DMMCStack::CardDetect(unsigned int)
+	Create__16DMediaChangeBase @ 9 NONAME ; DMediaChangeBase::Create(void)
+	Create__26TMMCardControllerInterface @ 10 NONAME ; TMMCardControllerInterface::Create(void)
+	DeclareCardAsGone__12TMMCardArrayUi @ 11 NONAME ; TMMCardArray::DeclareCardAsGone(unsigned int)
+	DeltaCurrentConsumption__11DPBusSocketi @ 12 NONAME ; DPBusSocket::DeltaCurrentConsumption(int)
+	DeviceSize__C4TCSD @ 13 NONAME ; TCSD::DeviceSize(void) const
+	Direction__C15TMMCCommandDesc @ 14 NONAME ; TMMCCommandDesc::Direction(void) const
+	Dispatch__16TMMCStateMachine @ 15 NONAME ; TMMCStateMachine::Dispatch(void)
+	DoCreate__12DPBusPsuBase @ 16 NONAME ; DPBusPsuBase::DoCreate(void)
+	DoCreate__7DMMCPsu @ 17 NONAME ; DMMCPsu::DoCreate(void)
+	DoTickService__12DPBusPsuBase @ 18 NONAME ; DPBusPsuBase::DoTickService(void)
+	DoorClosedService__16DMediaChangeBase @ 19 NONAME ; DMediaChangeBase::DoorClosedService(void)
+	DoorOpenService__16DMediaChangeBase @ 20 NONAME ; DMediaChangeBase::DoorOpenService(void)
+	EffectiveModes__9DMMCStackRC15TMMCStackConfig @ 21 NONAME ; DMMCStack::EffectiveModes(TMMCStackConfig const &)
+	EndInCritical__11DPBusSocket @ 22 NONAME ; DPBusSocket::EndInCritical(void)
+	Engage__11DMMCSession @ 23 NONAME ; DMMCSession::Engage(void)
+	EpocErrorCode__C11DMMCSession @ 24 NONAME ; DMMCSession::EpocErrorCode(void) const
+	EraseGroupSize__C4TCSD @ 25 NONAME ; TCSD::EraseGroupSize(void) const
+	EraseSectorSize__C4TCSD @ 26 NONAME ; TCSD::EraseSectorSize(void) const
+	ForceMediaChange__11DPBusSocket @ 27 NONAME ; DPBusSocket::ForceMediaChange(void)
+	InCritical__11DPBusSocket @ 28 NONAME ; DPBusSocket::InCritical(void)
+	Init__9DMMCStack @ 29 NONAME ; DMMCStack::Init(void)
+	IsLocked__12DPBusPsuBase @ 30 NONAME ; DPBusPsuBase::IsLocked(void)
+	IsLocked__C7TMMCard @ 31 NONAME ; TMMCard::IsLocked(void) const
+	IsMappingIncorrect__17TMMCPasswordStoreRC4TCIDRCt5TBuf81i16 @ 32 NONAME ; TMMCPasswordStore::IsMappingIncorrect(TCID const &, TBuf8<16> const &)
+	IsReady__C7TMMCard @ 33 NONAME ; TMMCard::IsReady(void) const
+	Jump__16TMMCStateMachinePFPv_Uli @ 34 NONAME ; TMMCStateMachine::Jump(unsigned long (*)(void *), int)
+	MaxReadCurrentInMilliamps__C4TCSD @ 35 NONAME ; TCSD::MaxReadCurrentInMilliamps(void) const
+	MaxTranSpeedInKilohertz__C4TCSD @ 36 NONAME ; TCSD::MaxTranSpeedInKilohertz(void) const
+	MaxWriteCurrentInMilliamps__C4TCSD @ 37 NONAME ; TCSD::MaxWriteCurrentInMilliamps(void) const
+	MediaType__C4TCSD @ 38 NONAME ; TCSD::MediaType(void) const
+	MinReadCurrentInMilliamps__C4TCSD @ 39 NONAME ; TCSD::MinReadCurrentInMilliamps(void) const
+	MinWriteCurrentInMilliamps__C4TCSD @ 40 NONAME ; TCSD::MinWriteCurrentInMilliamps(void) const
+	Panic__10DMMCSocketQ210DMMCSocket9TMMCPanic @ 41 NONAME ; DMMCSocket::Panic(DMMCSocket::TMMCPanic)
+	Panic__11DPBusSocketQ211DPBusSocket6TPanic @ 42 NONAME ; DPBusSocket::Panic(DPBusSocket::TPanic)
+	PowerDownStack__9DMMCStack @ 43 NONAME ; DMMCStack::PowerDownStack(void)
+	PowerUpSequenceComplete__11DPBusSocketi @ 44 NONAME ; DPBusSocket::PowerUpSequenceComplete(int)
+	PowerUpStack__9DMMCStack @ 45 NONAME ; DMMCStack::PowerUpStack(void)
+	PowerUp__11DPBusSocket @ 46 NONAME ; DPBusSocket::PowerUp(void)
+	Push__16TMMCStateMachinePFPv_Uli @ 47 NONAME ; TMMCStateMachine::Push(unsigned long (*)(void *), int)
+	ReadBlockLength__C4TCSD @ 48 NONAME ; TCSD::ReadBlockLength(void) const
+	ReceiveVoltageCheckResult__12DPBusPsuBasei @ 49 NONAME ; DPBusPsuBase::ReceiveVoltageCheckResult(int)
+	Remove__13TPBusCallBack @ 50 NONAME ; TPBusCallBack::Remove(void)
+	Reset__16TMMCStateMachine @ 51 NONAME ; TMMCStateMachine::Reset(void)
+	SetCard__11DMMCSessionP7TMMCard @ 52 NONAME ; DMMCSession::SetCard(TMMCard *)
+	SetSocket__13TPBusCallBacki @ 53 NONAME ; TPBusCallBack::SetSocket(int)
+	SetState__12DPBusPsuBase13TPBusPsuState @ 54 NONAME ; DPBusPsuBase::SetState(TPBusPsuState)
+	SetupCIMEraseGroup__11DMMCSessionG12TMMCArgumentUl @ 55 NONAME ; DMMCSession::SetupCIMEraseGroup(TMMCArgument, unsigned long)
+	SetupCIMEraseSector__11DMMCSessionG12TMMCArgumentUl @ 56 NONAME ; DMMCSession::SetupCIMEraseSector(TMMCArgument, unsigned long)
+	SetupCIMLockUnlock__11DMMCSessionUlPUc @ 57 NONAME ; DMMCSession::SetupCIMLockUnlock(unsigned long, unsigned char *)
+	SetupCIMReadBlock__11DMMCSessionG12TMMCArgumentUlPUc @ 58 NONAME ; DMMCSession::SetupCIMReadBlock(TMMCArgument, unsigned long, unsigned char *)
+	SetupCIMReadIO__11DMMCSessionUcUlPUc @ 59 NONAME ; DMMCSession::SetupCIMReadIO(unsigned char, unsigned long, unsigned char *)
+	SetupCIMReadMBlock__11DMMCSessionG12TMMCArgumentUlPUcUl @ 60 NONAME ; DMMCSession::SetupCIMReadMBlock(TMMCArgument, unsigned long, unsigned char *, unsigned long)
+	SetupCIMWriteBlock__11DMMCSessionG12TMMCArgumentUlPUc @ 61 NONAME ; DMMCSession::SetupCIMWriteBlock(TMMCArgument, unsigned long, unsigned char *)
+	SetupCIMWriteIO__11DMMCSessionUcUlPUc @ 62 NONAME ; DMMCSession::SetupCIMWriteIO(unsigned char, unsigned long, unsigned char *)
+	SetupCIMWriteMBlock__11DMMCSessionG12TMMCArgumentUlPUcUl @ 63 NONAME ; DMMCSession::SetupCIMWriteMBlock(TMMCArgument, unsigned long, unsigned char *, unsigned long)
+	SetupCommand__11DMMCSession15TMMCCommandEnumG12TMMCArgument @ 64 NONAME ; DMMCSession::SetupCommand(TMMCCommandEnum, TMMCArgument)
+	SetupDTCommand__11DMMCSession15TMMCCommandEnumG12TMMCArgumentUlPUcUli14TMMCCmdDirEnumUl @ 65 NONAME ; DMMCSession::SetupDTCommand(TMMCCommandEnum, TMMCArgument, unsigned long, unsigned char *, unsigned long, int, TMMCCmdDirEnum, unsigned long)
+	SetupRSCommand__11DMMCSession15TMMCCommandEnumG12TMMCArgumentUl19TMMCCommandTypeEnum20TMMCResponseTypeEnumUl @ 66 NONAME ; DMMCSession::SetupRSCommand(TMMCCommandEnum, TMMCArgument, unsigned long, TMMCCommandTypeEnum, TMMCResponseTypeEnum, unsigned long)
+	SocketFromId__11DPBusSocketi @ 67 NONAME ; DPBusSocket::SocketFromId(int)
+	Stop__9DMMCStackP7TMMCard @ 68 NONAME ; DMMCStack::Stop(TMMCard *)
+	UnBlock__9DMMCStackP11DMMCSessionUlUl @ 69 NONAME ; DMMCStack::UnBlock(DMMCSession *, unsigned long, unsigned long)
+	WriteBlockLength__C4TCSD @ 70 NONAME ; TCSD::WriteBlockLength(void) const
+	WriteProtected__9DMMCStackUi @ 71 NONAME ; DMMCStack::WriteProtected(unsigned int)
+	"_._11DMMCSession" @ 72 NONAME ; DMMCSession::~DMMCSession(void)
+	__10DMMCSocketiP17TMMCPasswordStore @ 73 NONAME ; DMMCSocket::DMMCSocket(int, TMMCPasswordStore *)
+	__11DMMCSessionRC12TMMCCallBack @ 74 NONAME ; DMMCSession::DMMCSession(TMMCCallBack const &)
+	__13TPBusCallBack @ 75 NONAME ; TPBusCallBack::TPBusCallBack(void)
+	__13TPBusCallBackPFPviPvPv_vPv @ 76 NONAME ; TPBusCallBack::TPBusCallBack(void (*)(void *, int, void *, void *), void *)
+	__13TPBusCallBackPFPvi_vPvUi @ 77 NONAME ; TPBusCallBack::TPBusCallBack(void (*)(void *, int), void *, unsigned int)
+	__15DMMCMediaChangei @ 78 NONAME ; DMMCMediaChange::DMMCMediaChange(int)
+	__16DMediaChangeBasei @ 79 NONAME ; DMediaChangeBase::DMediaChangeBase(int)
+	__7DMMCPsuii @ 80 NONAME ; DMMCPsu::DMMCPsu(int, int)
+	AcquireStackSM__9DMMCStack @ 81 NONAME ; DMMCStack::AcquireStackSM(void)
+	Create__15DMMCMediaChange @ 82 NONAME ; DMMCMediaChange::Create(void)
+	AllocSession__C9DMMCStackRC12TMMCCallBack @ 83 NONAME ; DMMCStack::AllocSession(TMMCCallBack const &) const
+	CIMReadWriteBlocksSMST__9DMMCStackPv @ 84 NONAME ; DMMCStack::CIMReadWriteBlocksSMST(void *)
+	CardRCA__11DMMCSession @ 85 NONAME ; DMMCSession::CardRCA(void)
+	FillCommandArgs__11DMMCSessionG12TMMCArgumentUlPUcUl @ 86 NONAME ; DMMCSession::FillCommandArgs(TMMCArgument, unsigned long, unsigned char *, unsigned long)
+	FillCommandDesc__11DMMCSession @ 87 NONAME ; DMMCSession::FillCommandDesc(void)
+	FillCommandDesc__11DMMCSession15TMMCCommandEnum @ 88 NONAME ; DMMCSession::FillCommandDesc(TMMCCommandEnum)
+	FillCommandDesc__11DMMCSession15TMMCCommandEnumG12TMMCArgument @ 89 NONAME ; DMMCSession::FillCommandDesc(TMMCCommandEnum, TMMCArgument)
+	GetMacro__C11DMMCSessioni @ 90 NONAME ; DMMCSession::GetMacro(int) const
+	IssueMMCCommandSMST__9DMMCStackPv @ 91 NONAME ; DMMCStack::IssueMMCCommandSMST(void *)
+	PowerDownComplete__11DPBusSocket @ 92 NONAME ; DPBusSocket::PowerDownComplete(void)
+	RequestAsyncPowerDown__11DPBusSocket @ 93 NONAME ; DPBusSocket::RequestAsyncPowerDown(void)
+	InitStackAfterUnlockSM__9DMMCStack @ 94 NONAME ; DMMCStack::InitStackAfterUnlockSM(void)
+	RegisterMediaDevices__26TMMCardControllerInterfacei @ 95 NONAME ; TMMCardControllerInterface::RegisterMediaDevices(int)
+	ModifyCardCapabilitySM__9DMMCStack @ 96 NONAME R3UNUSED ; DMMCStack::ModifyCardCapabilitySM(void)
+	Dummy1__9DMMCStack @ 97 NONAME R3UNUSED ; DMMCStack::Dummy1(void)
+	GetInterface__9DMMCStackQ29DMMCStack12TInterfaceIdRPQ29DMMCStack10MInterface @ 98 NONAME R3UNUSED ; DMMCStack::GetInterface(DMMCStack::TInterfaceId, DMMCStack::MInterface *&)
+	MachineInfo__9DMMCStackR5TDes8 @ 99 NONAME R3UNUSED ; DMMCStack::MachineInfo(TDes8 &)
+	SetBusWidth__9DMMCStackUl @ 100 NONAME R3UNUSED ; DMMCStack::SetBusWidth(unsigned long)
+	ControlIO__11DPBusSocketiPvT2 @ 101 NONAME ; DPBusSocket::ControlIO(int, void *, void *)
+	AllocCards__12TSDCardArray @ 102 NONAME R3UNUSED ; TSDCardArray::AllocCards(void)
+	AllocSession__C8DSDStackRC12TMMCCallBack @ 103 NONAME R3UNUSED ; DSDStack::AllocSession(TMMCCallBack const &) const
+	CIMReadWriteBlocksSM__8DSDStack @ 104 NONAME R3UNUSED ; DSDStack::CIMReadWriteBlocksSM(void)
+	DeclareCardAsGone__12TSDCardArrayUi @ 105 NONAME R3UNUSED ; TSDCardArray::DeclareCardAsGone(unsigned int)
+	Dummy1__8DSDStack @ 106 NONAME R3UNUSED ; DSDStack::Dummy1(void)
+	Dummy2__8DSDStack @ 107 NONAME R3UNUSED ; DSDStack::Dummy2(void)
+	Dummy3__8DSDStack @ 108 NONAME R3UNUSED ; DSDStack::Dummy3(void)
+	CardType__8DSDStackii @ 109 NONAME R3UNUSED ; DSDStack::CardType(int, int)
+	InitStackAfterUnlockSM__8DSDStack @ 110 NONAME R3UNUSED ; DSDStack::InitStackAfterUnlockSM(void)
+	Init__8DSDStack @ 111 NONAME R3UNUSED ; DSDStack::Init(void)
+	ModifyCardCapabilitySM__8DSDStack @ 112 NONAME R3UNUSED ; DSDStack::ModifyCardCapabilitySM(void)
+	AcquireStackSM__8DSDStack @ 113 NONAME R3UNUSED ; DSDStack::AcquireStackSM(void)
+	DummyExport10__13DDummySession @ 114 NONAME R3UNUSED ; DDummySession::DummyExport10(void)
+	DummyExport11__13DDummySession @ 115 NONAME R3UNUSED ; DDummySession::DummyExport11(void)
+	DummyExport12__13DDummySession @ 116 NONAME R3UNUSED ; DDummySession::DummyExport12(void)
+	DummyExport13__13DDummySession @ 117 NONAME R3UNUSED ; DDummySession::DummyExport13(void)
+	DummyExport14__13DDummySession @ 118 NONAME R3UNUSED ; DDummySession::DummyExport14(void)
+	DummyExport15__13DDummySession @ 119 NONAME R3UNUSED ; DDummySession::DummyExport15(void)
+	DummyExport1__13DDummySession @ 120 NONAME R3UNUSED ; DDummySession::DummyExport1(void)
+	DummyExport2__13DDummySession @ 121 NONAME R3UNUSED ; DDummySession::DummyExport2(void)
+	DummyExport3__13DDummySession @ 122 NONAME R3UNUSED ; DDummySession::DummyExport3(void)
+	DummyExport4__13DDummySession @ 123 NONAME R3UNUSED ; DDummySession::DummyExport4(void)
+	DummyExport5__13DDummySession @ 124 NONAME R3UNUSED ; DDummySession::DummyExport5(void)
+	DummyExport6__13DDummySession @ 125 NONAME R3UNUSED ; DDummySession::DummyExport6(void)
+	DummyExport7__13DDummySession @ 126 NONAME R3UNUSED ; DDummySession::DummyExport7(void)
+	DummyExport8__13DDummySession @ 127 NONAME R3UNUSED ; DDummySession::DummyExport8(void)
+	DummyExport9__13DDummySession @ 128 NONAME R3UNUSED ; DDummySession::DummyExport9(void)
+	AllocCards__14TSDIOCardArray @ 129 NONAME R3UNUSED ; TSDIOCardArray::AllocCards(void)
+	AllocSession__C10DSDIOStackRC12TMMCCallBack @ 130 NONAME R3UNUSED ; DSDIOStack::AllocSession(TMMCCallBack const &) const
+	Bind__14TSDIOInterruptPFPv_vPv @ 131 NONAME R3UNUSED ; TSDIOInterrupt::Bind(void (*)(void *), void *)
+	BlockIOSession__10DSDIOStackQ210DSDIOStack22TSDIOBlockingCondition @ 132 NONAME R3UNUSED ; DSDIOStack::BlockIOSession(DSDIOStack::TSDIOBlockingCondition)
+	CIMIoModifySM__10DSDIOStack @ 133 NONAME R3UNUSED ; DSDIOStack::CIMIoModifySM(void)
+	CIMIoReadWriteDirectSM__10DSDIOStack @ 134 NONAME R3UNUSED ; DSDIOStack::CIMIoReadWriteDirectSM(void)
+	CIMIoReadWriteExtendedSM__10DSDIOStack @ 135 NONAME R3UNUSED ; DSDIOStack::CIMIoReadWriteExtendedSM(void)
+	CIMReadWriteBlocksSM__10DSDIOStack @ 136 NONAME R3UNUSED ; DSDIOStack::CIMReadWriteBlocksSM(void)
+	CapabilitiesMatch__17TSDIOFunctionCapsR17TSDIOFunctionCapsUl @ 137 NONAME R3UNUSED ; TSDIOFunctionCaps::CapabilitiesMatch(TSDIOFunctionCaps &, unsigned long)
+	CheckCIS__9TSDIOCard @ 138 NONAME R3UNUSED ; TSDIOCard::CheckCIS(void)
+	DeclareCardAsGone__14TSDIOCardArrayUi @ 139 NONAME R3UNUSED ; TSDIOCardArray::DeclareCardAsGone(unsigned int)
+	DeregisterClient__13TSDIOFunctionP5DBase @ 140 NONAME R3UNUSED ; TSDIOFunction::DeregisterClient(DBase *)
+	Disable__13TSDIOFunction @ 141 NONAME R3UNUSED ; TSDIOFunction::Disable(void)
+	Disable__14TSDIOInterrupt @ 142 NONAME R3UNUSED ; TSDIOInterrupt::Disable(void)
+	DoCreate__8DSDIOPsu @ 143 NONAME R3UNUSED ; DSDIOPsu::DoCreate(void)
+	DoTickService__8DSDIOPsu @ 144 NONAME R3UNUSED ; DSDIOPsu::DoTickService(void)
+	Dummy1__10DSDIOStack @ 145 NONAME R3UNUSED ; DSDIOStack::Dummy1(void)
+	Dummy2__10DSDIOStack @ 146 NONAME R3UNUSED ; DSDIOStack::Dummy2(void)
+	Dummy3__10DSDIOStack @ 147 NONAME R3UNUSED ; DSDIOStack::Dummy3(void)
+	Dummy4__10DSDIOStack @ 148 NONAME R3UNUSED ; DSDIOStack::Dummy4(void)
+	Enable__13TSDIOFunctioni @ 149 NONAME R3UNUSED ; TSDIOFunction::Enable(int)
+	Enable__14TSDIOInterrupt @ 150 NONAME R3UNUSED ; TSDIOInterrupt::Enable(void)
+	FillAppCommandDesc__12DSDIOSessionR15TMMCCommandDesc @ 151 NONAME R3UNUSED ; DSDIOSession::FillAppCommandDesc(TMMCCommandDesc &)
+	FillAppCommandDesc__12DSDIOSessionR15TMMCCommandDesc11TSDIOAppCmd @ 152 NONAME R3UNUSED ; DSDIOSession::FillAppCommandDesc(TMMCCommandDesc &, TSDIOAppCmd)
+	FillAppCommandDesc__12DSDIOSessionR15TMMCCommandDesc11TSDIOAppCmdG12TMMCArgument @ 153 NONAME R3UNUSED ; DSDIOSession::FillAppCommandDesc(TMMCCommandDesc &, TSDIOAppCmd, TMMCArgument)
+	FindFunction__C9TSDIOCardR17TSDIOFunctionCapsUlP13TSDIOFunction @ 154 NONAME ; TSDIOCard::FindFunction(TSDIOFunctionCaps &, unsigned long, TSDIOFunction *) const
+	FindReadCommonConfig__10TCisReaderR15TSDIOCardConfig @ 155 NONAME R3UNUSED ; TCisReader::FindReadCommonConfig(TSDIOCardConfig &)
+	FindReadFunctionConfig__10TCisReaderR17TSDIOFunctionCaps @ 156 NONAME R3UNUSED ; TCisReader::FindReadFunctionConfig(TSDIOFunctionCaps &)
+	FindReadTuple__10TCisReaderUcR5TDes8Ui @ 157 NONAME ; TCisReader::FindReadTuple(unsigned char, TDes8 &, unsigned int)
+	GetMacro__C12DSDIOSessioni @ 158 NONAME R3UNUSED ; DSDIOSession::GetMacro(int) const
+	HandleSDIOInterrupt__10DSDIOStackUi @ 159 NONAME R3UNUSED ; DSDIOStack::HandleSDIOInterrupt(unsigned int)
+	Init__10DSDIOStack @ 160 NONAME R3UNUSED ; DSDIOStack::Init(void)
+	IsLocked__8DSDIOPsu @ 161 NONAME R3UNUSED ; DSDIOPsu::IsLocked(void)
+	IsReady__13TSDIOFunctionRi @ 162 NONAME R3UNUSED ; TSDIOFunction::IsReady(int &)
+	Modify8__22DSDIORegisterInterfaceUlUcUcPUc @ 163 NONAME ; DSDIORegisterInterface::Modify8(unsigned long, unsigned char, unsigned char, unsigned char *)
+	ModifyCardCapabilitySM__10DSDIOStack @ 164 NONAME R3UNUSED ; DSDIOStack::ModifyCardCapabilitySM(void)
+	Read8__22DSDIORegisterInterfaceUlPUc @ 165 NONAME R3UNUSED ; DSDIORegisterInterface::Read8(unsigned long, unsigned char *)
+	ReadMultiple8__22DSDIORegisterInterfaceUlPUcUli @ 166 NONAME ; DSDIORegisterInterface::ReadMultiple8(unsigned long, unsigned char *, unsigned long, int)
+	ReadTuple__10TCisReaderR5TDes8 @ 167 NONAME R3UNUSED ; TCisReader::ReadTuple(TDes8 &)
+	RegisterClient__13TSDIOFunctionP5DBaseP6DMutex @ 168 NONAME R3UNUSED ; TSDIOFunction::RegisterClient(DBase *, DMutex *)
+	RegisterMediaDevices__28TSDIOCardControllerInterfacei @ 169 NONAME R3UNUSED ; TSDIOCardControllerInterface::RegisterMediaDevices(int)
+	Register__21TSDIOFunctionCallbackP10DMMCSocket @ 170 NONAME R3UNUSED ; TSDIOFunctionCallback::Register(DMMCSocket *)
+	RequestAsyncSleep__11DSDIOSocket @ 171 NONAME R3UNUSED ; DSDIOSocket::RequestAsyncSleep(void)
+	Restart__10TCisReader @ 172 NONAME R3UNUSED ; TCisReader::Restart(void)
+	SelectCis__10TCisReaderUiUiUiUc @ 173 NONAME ; TCisReader::SelectCis(unsigned int, unsigned int, unsigned int, unsigned char)
+	SetAsync__22DSDIORegisterInterfaceR12TMMCCallBack @ 174 NONAME R3UNUSED ; DSDIORegisterInterface::SetAsync(TMMCCallBack &)
+	SetPriority__13TSDIOFunction21TSDIOFunctionPriority @ 175 NONAME R3UNUSED ; TSDIOFunction::SetPriority(TSDIOFunctionPriority)
+	SetSync__22DSDIORegisterInterface @ 176 NONAME R3UNUSED ; DSDIORegisterInterface::SetSync(void)
+	SetupCIMIoModify__12DSDIOSessionUlUcUcPUc @ 177 NONAME ; DSDIOSession::SetupCIMIoModify(unsigned long, unsigned char, unsigned char, unsigned char *)
+	SetupCIMIoReadMultiple__12DSDIOSessionUlUlPUci @ 178 NONAME ; DSDIOSession::SetupCIMIoReadMultiple(unsigned long, unsigned long, unsigned char *, int)
+	SetupCIMIoRead__12DSDIOSessionUlPUc @ 179 NONAME R3UNUSED ; DSDIOSession::SetupCIMIoRead(unsigned long, unsigned char *)
+	SetupCIMIoWriteMultiple__12DSDIOSessionUlUlPUci @ 180 NONAME ; DSDIOSession::SetupCIMIoWriteMultiple(unsigned long, unsigned long, unsigned char *, int)
+	SetupCIMIoWrite__12DSDIOSessionUlUcPUc @ 181 NONAME ; DSDIOSession::SetupCIMIoWrite(unsigned long, unsigned char, unsigned char *)
+	SleepComplete__11DSDIOSocket @ 182 NONAME R3UNUSED ; DSDIOSocket::SleepComplete(void)
+	Unbind__14TSDIOInterrupt @ 183 NONAME R3UNUSED ; TSDIOInterrupt::Unbind(void)
+	UnblockIOSession__10DSDIOStackQ210DSDIOStack22TSDIOBlockingConditionUl @ 184 NONAME R3UNUSED ; DSDIOStack::UnblockIOSession(DSDIOStack::TSDIOBlockingCondition, unsigned long)
+	Write8__22DSDIORegisterInterfaceUlUcPUc @ 185 NONAME ; DSDIORegisterInterface::Write8(unsigned long, unsigned char, unsigned char *)
+	WriteMultiple8__22DSDIORegisterInterfaceUlPUcUli @ 186 NONAME ; DSDIORegisterInterface::WriteMultiple8(unsigned long, unsigned char *, unsigned long, int)
+	"_._13TSDIOFunction" @ 187 NONAME R3UNUSED ; TSDIOFunction::~TSDIOFunction(void)
+	"_._14TSDIOInterrupt" @ 188 NONAME R3UNUSED ; TSDIOInterrupt::~TSDIOInterrupt(void)
+	"_._22DSDIORegisterInterface" @ 189 NONAME R3UNUSED ; DSDIORegisterInterface::~DSDIORegisterInterface(void)
+	__10TCisReader @ 190 NONAME R3UNUSED ; TCisReader::TCisReader(void)
+	__11DSDIOSocketiP17TMMCPasswordStore @ 191 NONAME R3UNUSED ; DSDIOSocket::DSDIOSocket(int, TMMCPasswordStore *)
+	__13TSDIOFunctionP9TSDIOCardUc @ 192 NONAME R3UNUSED ; TSDIOFunction::TSDIOFunction(TSDIOCard *, unsigned char)
+	__14TSDIOInterruptP24TSDIOInterruptControllerUc @ 193 NONAME R3UNUSED ; TSDIOInterrupt::TSDIOInterrupt(TSDIOInterruptController *, unsigned char)
+	__15TSDIOCardConfig @ 194 NONAME R3UNUSED ; TSDIOCardConfig::TSDIOCardConfig(void)
+	__22DSDIORegisterInterfaceP9TSDIOCardUc @ 195 NONAME R3UNUSED ; DSDIORegisterInterface::DSDIORegisterInterface(TSDIOCard *, unsigned char)
+	__22DSDIORegisterInterfaceP9TSDIOCardUcP6DMutex @ 196 NONAME ; DSDIORegisterInterface::DSDIORegisterInterface(TSDIOCard *, unsigned char, DMutex *)
+	__8DSDIOPsuii @ 197 NONAME R3UNUSED ; DSDIOPsu::DSDIOPsu(int, int)
+	AcquireStackSM__10DSDIOStack @ 198 NONAME R3UNUSED ; DSDIOStack::AcquireStackSM(void)
+	ReadMultiple8__22DSDIORegisterInterfaceUlP6DChunkUlUli @ 199 NONAME ; DSDIORegisterInterface::ReadMultiple8(unsigned long, DChunk *, unsigned long, unsigned long, int)
+	WriteMultiple8__22DSDIORegisterInterfaceUlP6DChunkUlUli @ 200 NONAME ; DSDIORegisterInterface::WriteMultiple8(unsigned long, DChunk *, unsigned long, unsigned long, int)
+	"_._12DSDIOSession" @ 201 NONAME R3UNUSED ; DSDIOSession::~DSDIOSession(void)
+	Dummy1__12DSDIOSession @ 202  NONAME R3UNUSED ; DSDIOSession::Dummy1(void)
+	Dummy1__8DSDIOPsu @ 203  NONAME R3UNUSED ; DSDIOPsu::Dummy1(void)
+	Dummy2__12DSDIOSession @ 204  NONAME R3UNUSED ; DSDIOSession::Dummy2(void)
+	Dummy2__8DSDIOPsu @ 205  NONAME R3UNUSED ; DSDIOPsu::Dummy2(void)
+	Dummy3__12DSDIOSession @ 206  NONAME R3UNUSED ; DSDIOSession::Dummy3(void)
+	Dummy3__8DSDIOPsu @ 207  NONAME R3UNUSED ; DSDIOPsu::Dummy3(void)
+	Dummy4__12DSDIOSession @ 208  NONAME R3UNUSED ; DSDIOSession::Dummy4(void)
+	Dummy4__8DSDIOPsu @ 209  NONAME R3UNUSED ; DSDIOPsu::Dummy4(void)
+	Modify8__22DSDIORegisterInterfaceUlUcUc @ 210  NONAME ; DSDIORegisterInterface::Modify8(unsigned long, unsigned char, unsigned char)
+	ReadMultiple8__22DSDIORegisterInterfaceUlP6DChunkUlUl @ 211  NONAME ; DSDIORegisterInterface::ReadMultiple8(unsigned long, DChunk *, unsigned long, unsigned long)
+	ReadMultiple8__22DSDIORegisterInterfaceUlPUcUl @ 212  NONAME ; DSDIORegisterInterface::ReadMultiple8(unsigned long, unsigned char *, unsigned long)
+	Write8__22DSDIORegisterInterfaceUlUc @ 213  NONAME R3UNUSED ; DSDIORegisterInterface::Write8(unsigned long, unsigned char)
+	WriteMultiple8__22DSDIORegisterInterfaceUlP6DChunkUlUl @ 214  NONAME ; DSDIORegisterInterface::WriteMultiple8(unsigned long, DChunk *, unsigned long, unsigned long)
+	WriteMultiple8__22DSDIORegisterInterfaceUlPUcUl @ 215  NONAME ; DSDIORegisterInterface::WriteMultiple8(unsigned long, unsigned char *, unsigned long)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/bwins/sdcard3c/epbusmu.def	Wed Mar 31 23:38:45 2010 +0300
@@ -0,0 +1,116 @@
+EXPORTS
+	??0DMMCMediaChange@@QAE@H@Z @ 1 NONAME ; public: __thiscall DMMCMediaChange::DMMCMediaChange(int)
+	??0DMMCPsu@@QAE@HH@Z @ 2 NONAME ; public: __thiscall DMMCPsu::DMMCPsu(int,int)
+	??0DMMCSession@@QAE@ABVTMMCCallBack@@@Z @ 3 NONAME ; public: __thiscall DMMCSession::DMMCSession(class TMMCCallBack const &)
+	??0DMMCSocket@@QAE@HPAVTMMCPasswordStore@@@Z @ 4 NONAME ; public: __thiscall DMMCSocket::DMMCSocket(int,class TMMCPasswordStore *)
+	??0DMMCStack@@QAE@HPAVDMMCSocket@@@Z @ 5 NONAME ; public: __thiscall DMMCStack::DMMCStack(int,class DMMCSocket *)
+	??0DMediaChangeBase@@QAE@H@Z @ 6 NONAME ; public: __thiscall DMediaChangeBase::DMediaChangeBase(int)
+	??0TPBusCallBack@@QAE@P6AXPAXH00@Z0@Z @ 7 NONAME ; public: __thiscall TPBusCallBack::TPBusCallBack(void (__cdecl*)(void *,int,void *,void *),void *)
+	??0TPBusCallBack@@QAE@P6AXPAXH@Z0I@Z @ 8 NONAME ; public: __thiscall TPBusCallBack::TPBusCallBack(void (__cdecl*)(void *,int),void *,unsigned int)
+	??0TPBusCallBack@@QAE@XZ @ 9 NONAME ; public: __thiscall TPBusCallBack::TPBusCallBack(void)
+	??1DMMCSession@@UAE@XZ @ 10 NONAME ; public: virtual __thiscall DMMCSession::~DMMCSession(void)
+	?AcquireStackSM@DMMCStack@@MAEKXZ @ 11 NONAME ; protected: virtual unsigned long __thiscall DMMCStack::AcquireStackSM(void)
+	?Add@DPBusSocket@@QAEXPAVTPBusCallBack@@@Z @ 12 NONAME ; public: void __thiscall DPBusSocket::Add(class TPBusCallBack *)
+	?AddNewCard@TMMCardArray@@QAEXPBEPAVTRCA@@@Z @ 13 NONAME ; public: void __thiscall TMMCardArray::AddNewCard(unsigned char const *,class TRCA *)
+	?AllocCards@TMMCardArray@@UAEHXZ @ 14 NONAME ; public: virtual int __thiscall TMMCardArray::AllocCards(void)
+	?AllocSession@DMMCStack@@UBEPAVDMMCSession@@ABVTMMCCallBack@@@Z @ 15 NONAME ; public: virtual class DMMCSession * __thiscall DMMCStack::AllocSession(class TMMCCallBack const &)const 
+	?Block@DMMCStack@@IAEXPAVDMMCSession@@K@Z @ 16 NONAME ; protected: void __thiscall DMMCStack::Block(class DMMCSession *,unsigned long)
+	?CIMReadWriteBlocksSM@DMMCStack@@MAEKXZ @ 17 NONAME ; protected: virtual unsigned long __thiscall DMMCStack::CIMReadWriteBlocksSM(void)
+	?CIMReadWriteBlocksSMST@DMMCStack@@KAKPAX@Z @ 18 NONAME ; protected: static unsigned long __cdecl DMMCStack::CIMReadWriteBlocksSMST(void *)
+	?CSDField@TCSD@@QBEIABI0@Z @ 19 NONAME ; public: unsigned int __thiscall TCSD::CSDField(unsigned int const &,unsigned int const &)const 
+	?CardDetect@DMMCStack@@MAEHI@Z @ 20 NONAME ; protected: virtual int __thiscall DMMCStack::CardDetect(unsigned int)
+	?CardRCA@DMMCSession@@QAE?AVTRCA@@XZ @ 21 NONAME ; public: class TRCA  __thiscall DMMCSession::CardRCA(void)
+	?Create@DMMCMediaChange@@UAEHXZ @ 22 NONAME ; public: virtual int __thiscall DMMCMediaChange::Create(void)
+	?Create@DMediaChangeBase@@UAEHXZ @ 23 NONAME ; public: virtual int __thiscall DMediaChangeBase::Create(void)
+	?Create@TMMCardControllerInterface@@QAEHXZ @ 24 NONAME ; public: int __thiscall TMMCardControllerInterface::Create(void)
+	?DeclareCardAsGone@TMMCardArray@@UAEXI@Z @ 25 NONAME ; public: virtual void __thiscall TMMCardArray::DeclareCardAsGone(unsigned int)
+	?DeltaCurrentConsumption@DPBusSocket@@QAEXH@Z @ 26 NONAME ; public: void __thiscall DPBusSocket::DeltaCurrentConsumption(int)
+	?DeviceSize@TCSD@@QBEIXZ @ 27 NONAME ; public: unsigned int __thiscall TCSD::DeviceSize(void)const 
+	?Direction@TMMCCommandDesc@@QBEHXZ @ 28 NONAME ; public: int __thiscall TMMCCommandDesc::Direction(void)const 
+	?Dispatch@TMMCStateMachine@@QAEKXZ @ 29 NONAME ; public: unsigned long __thiscall TMMCStateMachine::Dispatch(void)
+	?DoCreate@DMMCPsu@@UAEHXZ @ 30 NONAME ; public: virtual int __thiscall DMMCPsu::DoCreate(void)
+	?DoCreate@DPBusPsuBase@@UAEHXZ @ 31 NONAME ; public: virtual int __thiscall DPBusPsuBase::DoCreate(void)
+	?DoTickService@DPBusPsuBase@@UAEXXZ @ 32 NONAME ; public: virtual void __thiscall DPBusPsuBase::DoTickService(void)
+	?DoorClosedService@DMediaChangeBase@@QAEXXZ @ 33 NONAME ; public: void __thiscall DMediaChangeBase::DoorClosedService(void)
+	?DoorOpenService@DMediaChangeBase@@QAEXXZ @ 34 NONAME ; public: void __thiscall DMediaChangeBase::DoorOpenService(void)
+	?EffectiveModes@DMMCStack@@QAEKABVTMMCStackConfig@@@Z @ 35 NONAME ; public: unsigned long __thiscall DMMCStack::EffectiveModes(class TMMCStackConfig const &)
+	?EndInCritical@DPBusSocket@@QAEXXZ @ 36 NONAME ; public: void __thiscall DPBusSocket::EndInCritical(void)
+	?Engage@DMMCSession@@QAEHXZ @ 37 NONAME ; public: int __thiscall DMMCSession::Engage(void)
+	?EpocErrorCode@DMMCSession@@QBEHXZ @ 38 NONAME ; public: int __thiscall DMMCSession::EpocErrorCode(void)const 
+	?EraseGroupSize@TCSD@@QBEIXZ @ 39 NONAME ; public: unsigned int __thiscall TCSD::EraseGroupSize(void)const 
+	?EraseSectorSize@TCSD@@QBEIXZ @ 40 NONAME ; public: unsigned int __thiscall TCSD::EraseSectorSize(void)const 
+	?FillCommandArgs@DMMCSession@@QAEXVTMMCArgument@@KPAEK@Z @ 41 NONAME ; public: void __thiscall DMMCSession::FillCommandArgs(class TMMCArgument,unsigned long,unsigned char *,unsigned long)
+	?FillCommandDesc@DMMCSession@@QAEXW4TMMCCommandEnum@@@Z @ 42 NONAME ; public: void __thiscall DMMCSession::FillCommandDesc(enum TMMCCommandEnum)
+	?FillCommandDesc@DMMCSession@@QAEXW4TMMCCommandEnum@@VTMMCArgument@@@Z @ 43 NONAME ; public: void __thiscall DMMCSession::FillCommandDesc(enum TMMCCommandEnum,class TMMCArgument)
+	?FillCommandDesc@DMMCSession@@QAEXXZ @ 44 NONAME ; public: void __thiscall DMMCSession::FillCommandDesc(void)
+	?ForceMediaChange@DPBusSocket@@QAEXXZ @ 45 NONAME ; public: void __thiscall DPBusSocket::ForceMediaChange(void)
+	?GetMacro@DMMCSession@@MBEP6AKPAX@ZH@Z @ 46 NONAME ; protected: virtual unsigned long (__cdecl*__thiscall DMMCSession::GetMacro(int)const )(void *)
+	?InCritical@DPBusSocket@@QAEHXZ @ 47 NONAME ; public: int __thiscall DPBusSocket::InCritical(void)
+	?Init@DMMCStack@@UAEHXZ @ 48 NONAME ; public: virtual int __thiscall DMMCStack::Init(void)
+	?IsLocked@DPBusPsuBase@@UAEHXZ @ 49 NONAME ; public: virtual int __thiscall DPBusPsuBase::IsLocked(void)
+	?IsLocked@TMMCard@@QBEHXZ @ 50 NONAME ; public: int __thiscall TMMCard::IsLocked(void)const 
+	?IsMappingIncorrect@TMMCPasswordStore@@QAEHABVTCID@@ABV?$TBuf8@$0BA@@@@Z @ 51 NONAME ; public: int __thiscall TMMCPasswordStore::IsMappingIncorrect(class TCID const &,class TBuf8<16> const &)
+	?IsReady@TMMCard@@QBEHXZ @ 52 NONAME ; public: int __thiscall TMMCard::IsReady(void)const 
+	?IssueMMCCommandSMST@DMMCStack@@KAKPAX@Z @ 53 NONAME ; protected: static unsigned long __cdecl DMMCStack::IssueMMCCommandSMST(void *)
+	?Jump@TMMCStateMachine@@QAEKP6AKPAX@ZH@Z @ 54 NONAME ; public: unsigned long __thiscall TMMCStateMachine::Jump(unsigned long (__cdecl*)(void *),int)
+	?MaxReadCurrentInMilliamps@TCSD@@QBEIXZ @ 55 NONAME ; public: unsigned int __thiscall TCSD::MaxReadCurrentInMilliamps(void)const 
+	?MaxTranSpeedInKilohertz@TCSD@@QBEIXZ @ 56 NONAME ; public: unsigned int __thiscall TCSD::MaxTranSpeedInKilohertz(void)const 
+	?MaxWriteCurrentInMilliamps@TCSD@@QBEIXZ @ 57 NONAME ; public: unsigned int __thiscall TCSD::MaxWriteCurrentInMilliamps(void)const 
+	?MediaType@TCSD@@QBE?AW4TMMCMediaTypeEnum@@XZ @ 58 NONAME ; public: enum TMMCMediaTypeEnum  __thiscall TCSD::MediaType(void)const 
+	?MinReadCurrentInMilliamps@TCSD@@QBEIXZ @ 59 NONAME ; public: unsigned int __thiscall TCSD::MinReadCurrentInMilliamps(void)const 
+	?MinWriteCurrentInMilliamps@TCSD@@QBEIXZ @ 60 NONAME ; public: unsigned int __thiscall TCSD::MinWriteCurrentInMilliamps(void)const 
+	?Panic@DMMCSocket@@SAXW4TMMCPanic@1@@Z @ 61 NONAME ; public: static void __cdecl DMMCSocket::Panic(enum DMMCSocket::TMMCPanic)
+	?Panic@DPBusSocket@@SAXW4TPanic@1@@Z @ 62 NONAME ; public: static void __cdecl DPBusSocket::Panic(enum DPBusSocket::TPanic)
+	?PowerDownComplete@DPBusSocket@@QAEXXZ @ 63 NONAME ; public: void __thiscall DPBusSocket::PowerDownComplete(void)
+	?PowerDownStack@DMMCStack@@QAEXXZ @ 64 NONAME ; public: void __thiscall DMMCStack::PowerDownStack(void)
+	?PowerUp@DPBusSocket@@QAEHXZ @ 65 NONAME ; public: int __thiscall DPBusSocket::PowerUp(void)
+	?PowerUpSequenceComplete@DPBusSocket@@QAEXH@Z @ 66 NONAME ; public: void __thiscall DPBusSocket::PowerUpSequenceComplete(int)
+	?PowerUpStack@DMMCStack@@QAEXXZ @ 67 NONAME ; public: void __thiscall DMMCStack::PowerUpStack(void)
+	?Push@TMMCStateMachine@@QAEKP6AKPAX@ZH@Z @ 68 NONAME ; public: unsigned long __thiscall TMMCStateMachine::Push(unsigned long (__cdecl*)(void *),int)
+	?ReadBlockLength@TCSD@@QBEIXZ @ 69 NONAME ; public: unsigned int __thiscall TCSD::ReadBlockLength(void)const 
+	?ReceiveVoltageCheckResult@DPBusPsuBase@@UAEXH@Z @ 70 NONAME ; public: virtual void __thiscall DPBusPsuBase::ReceiveVoltageCheckResult(int)
+	?Remove@TPBusCallBack@@QAEXXZ @ 71 NONAME ; public: void __thiscall TPBusCallBack::Remove(void)
+	?RequestAsyncPowerDown@DPBusSocket@@QAEXXZ @ 72 NONAME ; public: void __thiscall DPBusSocket::RequestAsyncPowerDown(void)
+	?Reset@TMMCStateMachine@@QAEXXZ @ 73 NONAME ; public: void __thiscall TMMCStateMachine::Reset(void)
+	?SetCard@DMMCSession@@QAEXPAVTMMCard@@@Z @ 74 NONAME ; public: void __thiscall DMMCSession::SetCard(class TMMCard *)
+	?SetSocket@TPBusCallBack@@QAEXH@Z @ 75 NONAME ; public: void __thiscall TPBusCallBack::SetSocket(int)
+	?SetState@DPBusPsuBase@@QAEHW4TPBusPsuState@@@Z @ 76 NONAME ; public: int __thiscall DPBusPsuBase::SetState(enum TPBusPsuState)
+	?SetupCIMEraseGroup@DMMCSession@@QAEXVTMMCArgument@@K@Z @ 77 NONAME ; public: void __thiscall DMMCSession::SetupCIMEraseGroup(class TMMCArgument,unsigned long)
+	?SetupCIMEraseSector@DMMCSession@@QAEXVTMMCArgument@@K@Z @ 78 NONAME ; public: void __thiscall DMMCSession::SetupCIMEraseSector(class TMMCArgument,unsigned long)
+	?SetupCIMLockUnlock@DMMCSession@@QAEXKPAE@Z @ 79 NONAME ; public: void __thiscall DMMCSession::SetupCIMLockUnlock(unsigned long,unsigned char *)
+	?SetupCIMReadBlock@DMMCSession@@QAEXVTMMCArgument@@KPAE@Z @ 80 NONAME ; public: void __thiscall DMMCSession::SetupCIMReadBlock(class TMMCArgument,unsigned long,unsigned char *)
+	?SetupCIMReadIO@DMMCSession@@QAEXEKPAE@Z @ 81 NONAME ; public: void __thiscall DMMCSession::SetupCIMReadIO(unsigned char,unsigned long,unsigned char *)
+	?SetupCIMReadMBlock@DMMCSession@@QAEXVTMMCArgument@@KPAEK@Z @ 82 NONAME ; public: void __thiscall DMMCSession::SetupCIMReadMBlock(class TMMCArgument,unsigned long,unsigned char *,unsigned long)
+	?SetupCIMWriteBlock@DMMCSession@@QAEXVTMMCArgument@@KPAE@Z @ 83 NONAME ; public: void __thiscall DMMCSession::SetupCIMWriteBlock(class TMMCArgument,unsigned long,unsigned char *)
+	?SetupCIMWriteIO@DMMCSession@@QAEXEKPAE@Z @ 84 NONAME ; public: void __thiscall DMMCSession::SetupCIMWriteIO(unsigned char,unsigned long,unsigned char *)
+	?SetupCIMWriteMBlock@DMMCSession@@QAEXVTMMCArgument@@KPAEK@Z @ 85 NONAME ; public: void __thiscall DMMCSession::SetupCIMWriteMBlock(class TMMCArgument,unsigned long,unsigned char *,unsigned long)
+	?SetupCommand@DMMCSession@@QAEXW4TMMCCommandEnum@@VTMMCArgument@@@Z @ 86 NONAME ; public: void __thiscall DMMCSession::SetupCommand(enum TMMCCommandEnum,class TMMCArgument)
+	?SetupDTCommand@DMMCSession@@QAEXW4TMMCCommandEnum@@VTMMCArgument@@KPAEKHW4TMMCCmdDirEnum@@K@Z @ 87 NONAME ; public: void __thiscall DMMCSession::SetupDTCommand(enum TMMCCommandEnum,class TMMCArgument,unsigned long,unsigned char *,unsigned long,int,enum TMMCCmdDirEnum,unsigned long)
+	?SetupRSCommand@DMMCSession@@QAEXW4TMMCCommandEnum@@VTMMCArgument@@KW4TMMCCommandTypeEnum@@W4TMMCResponseTypeEnum@@K@Z @ 88 NONAME ; public: void __thiscall DMMCSession::SetupRSCommand(enum TMMCCommandEnum,class TMMCArgument,unsigned long,enum TMMCCommandTypeEnum,enum TMMCResponseTypeEnum,unsigned long)
+	?SocketFromId@DPBusSocket@@SAPAV1@H@Z @ 89 NONAME ; public: static class DPBusSocket * __cdecl DPBusSocket::SocketFromId(int)
+	?Stop@DMMCStack@@QAEHPAVTMMCard@@@Z @ 90 NONAME ; public: int __thiscall DMMCStack::Stop(class TMMCard *)
+	?UnBlock@DMMCStack@@IAEXPAVDMMCSession@@KK@Z @ 91 NONAME ; protected: void __thiscall DMMCStack::UnBlock(class DMMCSession *,unsigned long,unsigned long)
+	?WriteBlockLength@TCSD@@QBEIXZ @ 92 NONAME ; public: unsigned int __thiscall TCSD::WriteBlockLength(void)const 
+	?WriteProtected@DMMCStack@@MAEHI@Z @ 93 NONAME ; protected: virtual int __thiscall DMMCStack::WriteProtected(unsigned int)
+	?InitStackAfterUnlockSM@DMMCStack@@MAEKXZ @ 94 NONAME ; protected: virtual unsigned long __thiscall DMMCStack::InitStackAfterUnlockSM(void)
+	?RegisterMediaDevices@TMMCardControllerInterface@@MAEHH@Z @ 95 NONAME ; protected: virtual int __thiscall TMMCardControllerInterface::RegisterMediaDevices(int)
+	?ModifyCardCapabilitySM@DMMCStack@@MAEKXZ @ 96 NONAME ; unsigned long DMMCStack::ModifyCardCapabilitySM(void)
+	?Dummy1@DMMCStack@@EAEXXZ @ 97 NONAME ; void DMMCStack::Dummy1(void)
+	?GetInterface@DMMCStack@@MAEXW4TInterfaceId@1@AAPAVMInterface@1@@Z @ 98 NONAME ; protected: virtual void __thiscall DMMCStack::GetInterface(enum DMMCStack::TInterfaceId,class DMMCStack::MInterface * &)
+	?MachineInfo@DMMCStack@@UAEXAAVTDes8@@@Z @ 99 NONAME ; public: virtual void __thiscall DMMCStack::MachineInfo(class TDes8 &)
+	?SetBusWidth@DMMCStack@@MAEXK@Z @ 100 NONAME ; protected: virtual void __thiscall DMMCStack::SetBusWidth(unsigned long)
+	?ControlIO@DPBusSocket@@UAEHHPAX0@Z @ 101 NONAME ; public: virtual int __thiscall DPBusSocket::ControlIO(int,void *,void *)
+	?AcquireStackSM@DSDStack@@UAEKXZ @ 102 NONAME ; public: virtual unsigned long __thiscall DSDStack::AcquireStackSM(void)
+	?AllocCards@TSDCardArray@@UAEHXZ @ 103 NONAME ; public: virtual int __thiscall TSDCardArray::AllocCards(void)
+	?AllocSession@DSDStack@@UBEPAVDMMCSession@@ABVTMMCCallBack@@@Z @ 104 NONAME ; public: virtual class DMMCSession * __thiscall DSDStack::AllocSession(class TMMCCallBack const &)const 
+	?CIMReadWriteBlocksSM@DSDStack@@UAEKXZ @ 105 NONAME ; public: virtual unsigned long __thiscall DSDStack::CIMReadWriteBlocksSM(void)
+	?DeclareCardAsGone@TSDCardArray@@UAEXI@Z @ 106 NONAME ; public: virtual void __thiscall TSDCardArray::DeclareCardAsGone(unsigned int)
+	?Dummy1@DSDStack@@EAEXXZ @ 107 NONAME ; private: virtual void __thiscall DSDStack::Dummy1(void)
+	?Dummy2@DSDStack@@EAEXXZ @ 108 NONAME ; private: virtual void __thiscall DSDStack::Dummy2(void)
+	?Dummy3@DSDStack@@EAEXXZ @ 109 NONAME ; private: virtual void __thiscall DSDStack::Dummy3(void)
+	?CardType@DSDStack@@UAE?AW4TSDCardType@1@HH@Z @ 110 NONAME ; public: virtual enum DSDStack::TSDCardType __thiscall DSDStack::CardType(int,int)
+	?Init@DSDStack@@UAEHXZ @ 111 NONAME ; public: virtual int __thiscall DSDStack::Init(void)
+	?InitStackAfterUnlockSM@DSDStack@@MAEKXZ @ 112 NONAME ; protected: virtual unsigned long __thiscall DSDStack::InitStackAfterUnlockSM(void)
+	?ModifyCardCapabilitySM@DSDStack@@MAEKXZ @ 113 NONAME ; protected: virtual unsigned long __thiscall DSDStack::ModifyCardCapabilitySM(void)
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/bwins/sdcard3c/sdio/epbusmu.def	Wed Mar 31 23:38:45 2010 +0300
@@ -0,0 +1,217 @@
+EXPORTS
+	??0DMMCMediaChange@@QAE@H@Z @ 1 NONAME ; public: __thiscall DMMCMediaChange::DMMCMediaChange(int)
+	??0DMMCPsu@@QAE@HH@Z @ 2 NONAME ; public: __thiscall DMMCPsu::DMMCPsu(int,int)
+	??0DMMCSession@@QAE@ABVTMMCCallBack@@@Z @ 3 NONAME ; public: __thiscall DMMCSession::DMMCSession(class TMMCCallBack const &)
+	??0DMMCSocket@@QAE@HPAVTMMCPasswordStore@@@Z @ 4 NONAME ; public: __thiscall DMMCSocket::DMMCSocket(int,class TMMCPasswordStore *)
+	??0DMMCStack@@QAE@HPAVDMMCSocket@@@Z @ 5 NONAME ; public: __thiscall DMMCStack::DMMCStack(int,class DMMCSocket *)
+	??0DMediaChangeBase@@QAE@H@Z @ 6 NONAME ; public: __thiscall DMediaChangeBase::DMediaChangeBase(int)
+	??0TPBusCallBack@@QAE@P6AXPAXH00@Z0@Z @ 7 NONAME ; public: __thiscall TPBusCallBack::TPBusCallBack(void (__cdecl*)(void *,int,void *,void *),void *)
+	??0TPBusCallBack@@QAE@P6AXPAXH@Z0I@Z @ 8 NONAME ; public: __thiscall TPBusCallBack::TPBusCallBack(void (__cdecl*)(void *,int),void *,unsigned int)
+	??0TPBusCallBack@@QAE@XZ @ 9 NONAME ; public: __thiscall TPBusCallBack::TPBusCallBack(void)
+	??1DMMCSession@@UAE@XZ @ 10 NONAME ; public: virtual __thiscall DMMCSession::~DMMCSession(void)
+	?AcquireStackSM@DMMCStack@@MAEKXZ @ 11 NONAME ; protected: virtual unsigned long __thiscall DMMCStack::AcquireStackSM(void)
+	?Add@DPBusSocket@@QAEXPAVTPBusCallBack@@@Z @ 12 NONAME ; public: void __thiscall DPBusSocket::Add(class TPBusCallBack *)
+	?AddNewCard@TMMCardArray@@QAEXPBEPAVTRCA@@@Z @ 13 NONAME ; public: void __thiscall TMMCardArray::AddNewCard(unsigned char const *,class TRCA *)
+	?AllocCards@TMMCardArray@@UAEHXZ @ 14 NONAME ; public: virtual int __thiscall TMMCardArray::AllocCards(void)
+	?AllocSession@DMMCStack@@UBEPAVDMMCSession@@ABVTMMCCallBack@@@Z @ 15 NONAME ; public: virtual class DMMCSession * __thiscall DMMCStack::AllocSession(class TMMCCallBack const &)const 
+	?Block@DMMCStack@@IAEXPAVDMMCSession@@K@Z @ 16 NONAME ; protected: void __thiscall DMMCStack::Block(class DMMCSession *,unsigned long)
+	?CIMReadWriteBlocksSM@DMMCStack@@MAEKXZ @ 17 NONAME ; protected: virtual unsigned long __thiscall DMMCStack::CIMReadWriteBlocksSM(void)
+	?CIMReadWriteBlocksSMST@DMMCStack@@KAKPAX@Z @ 18 NONAME ; protected: static unsigned long __cdecl DMMCStack::CIMReadWriteBlocksSMST(void *)
+	?CSDField@TCSD@@QBEIABI0@Z @ 19 NONAME ; public: unsigned int __thiscall TCSD::CSDField(unsigned int const &,unsigned int const &)const 
+	?CardDetect@DMMCStack@@MAEHI@Z @ 20 NONAME ; protected: virtual int __thiscall DMMCStack::CardDetect(unsigned int)
+	?CardRCA@DMMCSession@@QAE?AVTRCA@@XZ @ 21 NONAME ; public: class TRCA  __thiscall DMMCSession::CardRCA(void)
+	?Create@DMMCMediaChange@@UAEHXZ @ 22 NONAME ; public: virtual int __thiscall DMMCMediaChange::Create(void)
+	?Create@DMediaChangeBase@@UAEHXZ @ 23 NONAME ; public: virtual int __thiscall DMediaChangeBase::Create(void)
+	?Create@TMMCardControllerInterface@@QAEHXZ @ 24 NONAME ; public: int __thiscall TMMCardControllerInterface::Create(void)
+	?DeclareCardAsGone@TMMCardArray@@UAEXI@Z @ 25 NONAME ; public: virtual void __thiscall TMMCardArray::DeclareCardAsGone(unsigned int)
+	?DeltaCurrentConsumption@DPBusSocket@@QAEXH@Z @ 26 NONAME ; public: void __thiscall DPBusSocket::DeltaCurrentConsumption(int)
+	?DeviceSize@TCSD@@QBEIXZ @ 27 NONAME ; public: unsigned int __thiscall TCSD::DeviceSize(void)const 
+	?Direction@TMMCCommandDesc@@QBEHXZ @ 28 NONAME ; public: int __thiscall TMMCCommandDesc::Direction(void)const 
+	?Dispatch@TMMCStateMachine@@QAEKXZ @ 29 NONAME ; public: unsigned long __thiscall TMMCStateMachine::Dispatch(void)
+	?DoCreate@DMMCPsu@@UAEHXZ @ 30 NONAME ; public: virtual int __thiscall DMMCPsu::DoCreate(void)
+	?DoCreate@DPBusPsuBase@@UAEHXZ @ 31 NONAME ; public: virtual int __thiscall DPBusPsuBase::DoCreate(void)
+	?DoTickService@DPBusPsuBase@@UAEXXZ @ 32 NONAME ; public: virtual void __thiscall DPBusPsuBase::DoTickService(void)
+	?DoorClosedService@DMediaChangeBase@@QAEXXZ @ 33 NONAME ; public: void __thiscall DMediaChangeBase::DoorClosedService(void)
+	?DoorOpenService@DMediaChangeBase@@QAEXXZ @ 34 NONAME ; public: void __thiscall DMediaChangeBase::DoorOpenService(void)
+	?EffectiveModes@DMMCStack@@QAEKABVTMMCStackConfig@@@Z @ 35 NONAME ; public: unsigned long __thiscall DMMCStack::EffectiveModes(class TMMCStackConfig const &)
+	?EndInCritical@DPBusSocket@@QAEXXZ @ 36 NONAME ; public: void __thiscall DPBusSocket::EndInCritical(void)
+	?Engage@DMMCSession@@QAEHXZ @ 37 NONAME ; public: int __thiscall DMMCSession::Engage(void)
+	?EpocErrorCode@DMMCSession@@QBEHXZ @ 38 NONAME ; public: int __thiscall DMMCSession::EpocErrorCode(void)const 
+	?EraseGroupSize@TCSD@@QBEIXZ @ 39 NONAME ; public: unsigned int __thiscall TCSD::EraseGroupSize(void)const 
+	?EraseSectorSize@TCSD@@QBEIXZ @ 40 NONAME ; public: unsigned int __thiscall TCSD::EraseSectorSize(void)const 
+	?FillCommandArgs@DMMCSession@@QAEXVTMMCArgument@@KPAEK@Z @ 41 NONAME ; public: void __thiscall DMMCSession::FillCommandArgs(class TMMCArgument,unsigned long,unsigned char *,unsigned long)
+	?FillCommandDesc@DMMCSession@@QAEXW4TMMCCommandEnum@@@Z @ 42 NONAME ; public: void __thiscall DMMCSession::FillCommandDesc(enum TMMCCommandEnum)
+	?FillCommandDesc@DMMCSession@@QAEXW4TMMCCommandEnum@@VTMMCArgument@@@Z @ 43 NONAME ; public: void __thiscall DMMCSession::FillCommandDesc(enum TMMCCommandEnum,class TMMCArgument)
+	?FillCommandDesc@DMMCSession@@QAEXXZ @ 44 NONAME ; public: void __thiscall DMMCSession::FillCommandDesc(void)
+	?ForceMediaChange@DPBusSocket@@QAEXXZ @ 45 NONAME ; public: void __thiscall DPBusSocket::ForceMediaChange(void)
+	?GetMacro@DMMCSession@@MBEP6AKPAX@ZH@Z @ 46 NONAME ; protected: virtual unsigned long (__cdecl*__thiscall DMMCSession::GetMacro(int)const )(void *)
+	?InCritical@DPBusSocket@@QAEHXZ @ 47 NONAME ; public: int __thiscall DPBusSocket::InCritical(void)
+	?Init@DMMCStack@@UAEHXZ @ 48 NONAME ; public: virtual int __thiscall DMMCStack::Init(void)
+	?IsLocked@DPBusPsuBase@@UAEHXZ @ 49 NONAME ; public: virtual int __thiscall DPBusPsuBase::IsLocked(void)
+	?IsLocked@TMMCard@@QBEHXZ @ 50 NONAME ; public: int __thiscall TMMCard::IsLocked(void)const 
+	?IsMappingIncorrect@TMMCPasswordStore@@QAEHABVTCID@@ABV?$TBuf8@$0BA@@@@Z @ 51 NONAME ; public: int __thiscall TMMCPasswordStore::IsMappingIncorrect(class TCID const &,class TBuf8<16> const &)
+	?IsReady@TMMCard@@QBEHXZ @ 52 NONAME ; public: int __thiscall TMMCard::IsReady(void)const 
+	?IssueMMCCommandSMST@DMMCStack@@KAKPAX@Z @ 53 NONAME ; protected: static unsigned long __cdecl DMMCStack::IssueMMCCommandSMST(void *)
+	?Jump@TMMCStateMachine@@QAEKP6AKPAX@ZH@Z @ 54 NONAME ; public: unsigned long __thiscall TMMCStateMachine::Jump(unsigned long (__cdecl*)(void *),int)
+	?MaxReadCurrentInMilliamps@TCSD@@QBEIXZ @ 55 NONAME ; public: unsigned int __thiscall TCSD::MaxReadCurrentInMilliamps(void)const 
+	?MaxTranSpeedInKilohertz@TCSD@@QBEIXZ @ 56 NONAME ; public: unsigned int __thiscall TCSD::MaxTranSpeedInKilohertz(void)const 
+	?MaxWriteCurrentInMilliamps@TCSD@@QBEIXZ @ 57 NONAME ; public: unsigned int __thiscall TCSD::MaxWriteCurrentInMilliamps(void)const 
+	?MediaType@TCSD@@QBE?AW4TMMCMediaTypeEnum@@XZ @ 58 NONAME ; public: enum TMMCMediaTypeEnum  __thiscall TCSD::MediaType(void)const 
+	?MinReadCurrentInMilliamps@TCSD@@QBEIXZ @ 59 NONAME ; public: unsigned int __thiscall TCSD::MinReadCurrentInMilliamps(void)const 
+	?MinWriteCurrentInMilliamps@TCSD@@QBEIXZ @ 60 NONAME ; public: unsigned int __thiscall TCSD::MinWriteCurrentInMilliamps(void)const 
+	?Panic@DMMCSocket@@SAXW4TMMCPanic@1@@Z @ 61 NONAME ; public: static void __cdecl DMMCSocket::Panic(enum DMMCSocket::TMMCPanic)
+	?Panic@DPBusSocket@@SAXW4TPanic@1@@Z @ 62 NONAME ; public: static void __cdecl DPBusSocket::Panic(enum DPBusSocket::TPanic)
+	?PowerDownComplete@DPBusSocket@@QAEXXZ @ 63 NONAME ; public: void __thiscall DPBusSocket::PowerDownComplete(void)
+	?PowerDownStack@DMMCStack@@QAEXXZ @ 64 NONAME ; public: void __thiscall DMMCStack::PowerDownStack(void)
+	?PowerUp@DPBusSocket@@QAEHXZ @ 65 NONAME ; public: int __thiscall DPBusSocket::PowerUp(void)
+	?PowerUpSequenceComplete@DPBusSocket@@QAEXH@Z @ 66 NONAME ; public: void __thiscall DPBusSocket::PowerUpSequenceComplete(int)
+	?PowerUpStack@DMMCStack@@QAEXXZ @ 67 NONAME ; public: void __thiscall DMMCStack::PowerUpStack(void)
+	?Push@TMMCStateMachine@@QAEKP6AKPAX@ZH@Z @ 68 NONAME ; public: unsigned long __thiscall TMMCStateMachine::Push(unsigned long (__cdecl*)(void *),int)
+	?ReadBlockLength@TCSD@@QBEIXZ @ 69 NONAME ; public: unsigned int __thiscall TCSD::ReadBlockLength(void)const 
+	?ReceiveVoltageCheckResult@DPBusPsuBase@@UAEXH@Z @ 70 NONAME ; public: virtual void __thiscall DPBusPsuBase::ReceiveVoltageCheckResult(int)
+	?Remove@TPBusCallBack@@QAEXXZ @ 71 NONAME ; public: void __thiscall TPBusCallBack::Remove(void)
+	?RequestAsyncPowerDown@DPBusSocket@@QAEXXZ @ 72 NONAME ; public: void __thiscall DPBusSocket::RequestAsyncPowerDown(void)
+	?Reset@TMMCStateMachine@@QAEXXZ @ 73 NONAME ; public: void __thiscall TMMCStateMachine::Reset(void)
+	?SetCard@DMMCSession@@QAEXPAVTMMCard@@@Z @ 74 NONAME ; public: void __thiscall DMMCSession::SetCard(class TMMCard *)
+	?SetSocket@TPBusCallBack@@QAEXH@Z @ 75 NONAME ; public: void __thiscall TPBusCallBack::SetSocket(int)
+	?SetState@DPBusPsuBase@@QAEHW4TPBusPsuState@@@Z @ 76 NONAME ; public: int __thiscall DPBusPsuBase::SetState(enum TPBusPsuState)
+	?SetupCIMEraseGroup@DMMCSession@@QAEXVTMMCArgument@@K@Z @ 77 NONAME ; public: void __thiscall DMMCSession::SetupCIMEraseGroup(class TMMCArgument,unsigned long)
+	?SetupCIMEraseSector@DMMCSession@@QAEXVTMMCArgument@@K@Z @ 78 NONAME ; public: void __thiscall DMMCSession::SetupCIMEraseSector(class TMMCArgument,unsigned long)
+	?SetupCIMLockUnlock@DMMCSession@@QAEXKPAE@Z @ 79 NONAME ; public: void __thiscall DMMCSession::SetupCIMLockUnlock(unsigned long,unsigned char *)
+	?SetupCIMReadBlock@DMMCSession@@QAEXVTMMCArgument@@KPAE@Z @ 80 NONAME ; public: void __thiscall DMMCSession::SetupCIMReadBlock(class TMMCArgument,unsigned long,unsigned char *)
+	?SetupCIMReadIO@DMMCSession@@QAEXEKPAE@Z @ 81 NONAME ; public: void __thiscall DMMCSession::SetupCIMReadIO(unsigned char,unsigned long,unsigned char *)
+	?SetupCIMReadMBlock@DMMCSession@@QAEXVTMMCArgument@@KPAEK@Z @ 82 NONAME ; public: void __thiscall DMMCSession::SetupCIMReadMBlock(class TMMCArgument,unsigned long,unsigned char *,unsigned long)
+	?SetupCIMWriteBlock@DMMCSession@@QAEXVTMMCArgument@@KPAE@Z @ 83 NONAME ; public: void __thiscall DMMCSession::SetupCIMWriteBlock(class TMMCArgument,unsigned long,unsigned char *)
+	?SetupCIMWriteIO@DMMCSession@@QAEXEKPAE@Z @ 84 NONAME ; public: void __thiscall DMMCSession::SetupCIMWriteIO(unsigned char,unsigned long,unsigned char *)
+	?SetupCIMWriteMBlock@DMMCSession@@QAEXVTMMCArgument@@KPAEK@Z @ 85 NONAME ; public: void __thiscall DMMCSession::SetupCIMWriteMBlock(class TMMCArgument,unsigned long,unsigned char *,unsigned long)
+	?SetupCommand@DMMCSession@@QAEXW4TMMCCommandEnum@@VTMMCArgument@@@Z @ 86 NONAME ; public: void __thiscall DMMCSession::SetupCommand(enum TMMCCommandEnum,class TMMCArgument)
+	?SetupDTCommand@DMMCSession@@QAEXW4TMMCCommandEnum@@VTMMCArgument@@KPAEKHW4TMMCCmdDirEnum@@K@Z @ 87 NONAME ; public: void __thiscall DMMCSession::SetupDTCommand(enum TMMCCommandEnum,class TMMCArgument,unsigned long,unsigned char *,unsigned long,int,enum TMMCCmdDirEnum,unsigned long)
+	?SetupRSCommand@DMMCSession@@QAEXW4TMMCCommandEnum@@VTMMCArgument@@KW4TMMCCommandTypeEnum@@W4TMMCResponseTypeEnum@@K@Z @ 88 NONAME ; public: void __thiscall DMMCSession::SetupRSCommand(enum TMMCCommandEnum,class TMMCArgument,unsigned long,enum TMMCCommandTypeEnum,enum TMMCResponseTypeEnum,unsigned long)
+	?SocketFromId@DPBusSocket@@SAPAV1@H@Z @ 89 NONAME ; public: static class DPBusSocket * __cdecl DPBusSocket::SocketFromId(int)
+	?Stop@DMMCStack@@QAEHPAVTMMCard@@@Z @ 90 NONAME ; public: int __thiscall DMMCStack::Stop(class TMMCard *)
+	?UnBlock@DMMCStack@@IAEXPAVDMMCSession@@KK@Z @ 91 NONAME ; protected: void __thiscall DMMCStack::UnBlock(class DMMCSession *,unsigned long,unsigned long)
+	?WriteBlockLength@TCSD@@QBEIXZ @ 92 NONAME ; public: unsigned int __thiscall TCSD::WriteBlockLength(void)const 
+	?WriteProtected@DMMCStack@@MAEHI@Z @ 93 NONAME ; protected: virtual int __thiscall DMMCStack::WriteProtected(unsigned int)
+	?InitStackAfterUnlockSM@DMMCStack@@MAEKXZ @ 94 NONAME ; protected: virtual unsigned long __thiscall DMMCStack::InitStackAfterUnlockSM(void)
+	?RegisterMediaDevices@TMMCardControllerInterface@@MAEHH@Z @ 95 NONAME ; protected: virtual int __thiscall TMMCardControllerInterface::RegisterMediaDevices(int)
+	?ModifyCardCapabilitySM@DMMCStack@@MAEKXZ @ 96 NONAME ; unsigned long DMMCStack::ModifyCardCapabilitySM(void)
+	?Dummy1@DMMCStack@@EAEXXZ @ 97 NONAME ; void DMMCStack::Dummy1(void)
+	?GetInterface@DMMCStack@@MAEXW4TInterfaceId@1@AAPAVMInterface@1@@Z @ 98 NONAME ; protected: virtual void __thiscall DMMCStack::GetInterface(enum DMMCStack::TInterfaceId,class DMMCStack::MInterface * &)
+	?MachineInfo@DMMCStack@@UAEXAAVTDes8@@@Z @ 99 NONAME ; public: virtual void __thiscall DMMCStack::MachineInfo(class TDes8 &)
+	?SetBusWidth@DMMCStack@@MAEXK@Z @ 100 NONAME ; protected: virtual void __thiscall DMMCStack::SetBusWidth(unsigned long)
+	?ControlIO@DPBusSocket@@UAEHHPAX0@Z @ 101 NONAME ; public: virtual int __thiscall DPBusSocket::ControlIO(int,void *,void *)
+	?AcquireStackSM@DSDStack@@UAEKXZ @ 102 NONAME ; public: virtual unsigned long __thiscall DSDStack::AcquireStackSM(void)
+	?AllocCards@TSDCardArray@@UAEHXZ @ 103 NONAME ; public: virtual int __thiscall TSDCardArray::AllocCards(void)
+	?AllocSession@DSDStack@@UBEPAVDMMCSession@@ABVTMMCCallBack@@@Z @ 104 NONAME ; public: virtual class DMMCSession * __thiscall DSDStack::AllocSession(class TMMCCallBack const &)const 
+	?CIMReadWriteBlocksSM@DSDStack@@UAEKXZ @ 105 NONAME ; public: virtual unsigned long __thiscall DSDStack::CIMReadWriteBlocksSM(void)
+	?DeclareCardAsGone@TSDCardArray@@UAEXI@Z @ 106 NONAME ; public: virtual void __thiscall TSDCardArray::DeclareCardAsGone(unsigned int)
+	?Dummy1@DSDStack@@EAEXXZ @ 107 NONAME ; private: virtual void __thiscall DSDStack::Dummy1(void)
+	?Dummy2@DSDStack@@EAEXXZ @ 108 NONAME ; private: virtual void __thiscall DSDStack::Dummy2(void)
+	?Dummy3@DSDStack@@EAEXXZ @ 109 NONAME ; private: virtual void __thiscall DSDStack::Dummy3(void)
+	?CardType@DSDStack@@UAE?AW4TSDCardType@1@HH@Z @ 110 NONAME ; public: virtual enum DSDStack::TSDCardType __thiscall DSDStack::CardType(int,int)
+	?Init@DSDStack@@UAEHXZ @ 111 NONAME ; public: virtual int __thiscall DSDStack::Init(void)
+	?InitStackAfterUnlockSM@DSDStack@@MAEKXZ @ 112 NONAME ; protected: virtual unsigned long __thiscall DSDStack::InitStackAfterUnlockSM(void)
+	?ModifyCardCapabilitySM@DSDStack@@MAEKXZ @ 113 NONAME ; protected: virtual unsigned long __thiscall DSDStack::ModifyCardCapabilitySM(void)
+	?DummyExport10@DDummySession@@AAEXXZ @ 114 NONAME ; private: void __thiscall DDummySession::DummyExport10(void)
+	?DummyExport11@DDummySession@@AAEXXZ @ 115 NONAME ; private: void __thiscall DDummySession::DummyExport11(void)
+	?DummyExport12@DDummySession@@AAEXXZ @ 116 NONAME ; private: void __thiscall DDummySession::DummyExport12(void)
+	?DummyExport13@DDummySession@@AAEXXZ @ 117 NONAME ; private: void __thiscall DDummySession::DummyExport13(void)
+	?DummyExport14@DDummySession@@AAEXXZ @ 118 NONAME ; private: void __thiscall DDummySession::DummyExport14(void)
+	?DummyExport15@DDummySession@@AAEXXZ @ 119 NONAME ; private: void __thiscall DDummySession::DummyExport15(void)
+	?DummyExport1@DDummySession@@AAEXXZ @ 120 NONAME ; private: void __thiscall DDummySession::DummyExport1(void)
+	?DummyExport2@DDummySession@@AAEXXZ @ 121 NONAME ; private: void __thiscall DDummySession::DummyExport2(void)
+	?DummyExport3@DDummySession@@AAEXXZ @ 122 NONAME ; private: void __thiscall DDummySession::DummyExport3(void)
+	?DummyExport4@DDummySession@@AAEXXZ @ 123 NONAME ; private: void __thiscall DDummySession::DummyExport4(void)
+	?DummyExport5@DDummySession@@AAEXXZ @ 124 NONAME ; private: void __thiscall DDummySession::DummyExport5(void)
+	?DummyExport6@DDummySession@@AAEXXZ @ 125 NONAME ; private: void __thiscall DDummySession::DummyExport6(void)
+	?DummyExport7@DDummySession@@AAEXXZ @ 126 NONAME ; private: void __thiscall DDummySession::DummyExport7(void)
+	?DummyExport8@DDummySession@@AAEXXZ @ 127 NONAME ; private: void __thiscall DDummySession::DummyExport8(void)
+	?DummyExport9@DDummySession@@AAEXXZ @ 128 NONAME ; private: void __thiscall DDummySession::DummyExport9(void)
+	??0DSDIOPsu@@QAE@HH@Z @ 129 NONAME ; public: __thiscall DSDIOPsu::DSDIOPsu(int,int)
+	??0DSDIORegisterInterface@@QAE@PAVTSDIOCard@@E@Z @ 130 NONAME ; public: __thiscall DSDIORegisterInterface::DSDIORegisterInterface(class TSDIOCard *,unsigned char)
+	??0DSDIORegisterInterface@@QAE@PAVTSDIOCard@@EPAVDMutex@@@Z @ 131 NONAME ; public: __thiscall DSDIORegisterInterface::DSDIORegisterInterface(class TSDIOCard *,unsigned char,class DMutex *)
+	??0DSDIOSocket@@QAE@HPAVTMMCPasswordStore@@@Z @ 132 NONAME ; public: __thiscall DSDIOSocket::DSDIOSocket(int,class TMMCPasswordStore *)
+	??0TCisReader@@QAE@XZ @ 133 NONAME ; public: __thiscall TCisReader::TCisReader(void)
+	??0TSDIOCardConfig@@QAE@XZ @ 134 NONAME ; public: __thiscall TSDIOCardConfig::TSDIOCardConfig(void)
+	??0TSDIOFunction@@QAE@PAVTSDIOCard@@E@Z @ 135 NONAME ; public: __thiscall TSDIOFunction::TSDIOFunction(class TSDIOCard *,unsigned char)
+	??0TSDIOInterrupt@@QAE@PAVTSDIOInterruptController@@E@Z @ 136 NONAME ; public: __thiscall TSDIOInterrupt::TSDIOInterrupt(class TSDIOInterruptController *,unsigned char)
+	??1DSDIORegisterInterface@@UAE@XZ @ 137 NONAME ; public: virtual __thiscall DSDIORegisterInterface::~DSDIORegisterInterface(void)
+	??1TSDIOFunction@@QAE@XZ @ 138 NONAME ; public: __thiscall TSDIOFunction::~TSDIOFunction(void)
+	??1TSDIOInterrupt@@QAE@XZ @ 139 NONAME ; public: __thiscall TSDIOInterrupt::~TSDIOInterrupt(void)
+	?AcquireStackSM@DSDIOStack@@MAEKXZ @ 140 NONAME ; protected: virtual unsigned long __thiscall DSDIOStack::AcquireStackSM(void)
+	?AllocCards@TSDIOCardArray@@UAEHXZ @ 141 NONAME ; public: virtual int __thiscall TSDIOCardArray::AllocCards(void)
+	?AllocSession@DSDIOStack@@UBEPAVDMMCSession@@ABVTMMCCallBack@@@Z @ 142 NONAME ; public: virtual class DMMCSession * __thiscall DSDIOStack::AllocSession(class TMMCCallBack const &)const 
+	?Bind@TSDIOInterrupt@@QAEHP6AXPAX@Z0@Z @ 143 NONAME ; public: int __thiscall TSDIOInterrupt::Bind(void (__cdecl*)(void *),void *)
+	?BlockIOSession@DSDIOStack@@IAEXW4TSDIOBlockingCondition@1@@Z @ 144 NONAME ; protected: void __thiscall DSDIOStack::BlockIOSession(enum DSDIOStack::TSDIOBlockingCondition)
+	?CIMIoModifySM@DSDIOStack@@IAEKXZ @ 145 NONAME ; protected: unsigned long __thiscall DSDIOStack::CIMIoModifySM(void)
+	?CIMIoReadWriteDirectSM@DSDIOStack@@IAEKXZ @ 146 NONAME ; protected: unsigned long __thiscall DSDIOStack::CIMIoReadWriteDirectSM(void)
+	?CIMIoReadWriteExtendedSM@DSDIOStack@@IAEKXZ @ 147 NONAME ; protected: unsigned long __thiscall DSDIOStack::CIMIoReadWriteExtendedSM(void)
+	?CIMReadWriteBlocksSM@DSDIOStack@@MAEKXZ @ 148 NONAME ; protected: virtual unsigned long __thiscall DSDIOStack::CIMReadWriteBlocksSM(void)
+	?CapabilitiesMatch@TSDIOFunctionCaps@@QAEHAAV1@K@Z @ 149 NONAME ; public: int __thiscall TSDIOFunctionCaps::CapabilitiesMatch(class TSDIOFunctionCaps &,unsigned long)
+	?CheckCIS@TSDIOCard@@QAEHXZ @ 150 NONAME ; public: int __thiscall TSDIOCard::CheckCIS(void)
+	?DeclareCardAsGone@TSDIOCardArray@@UAEXI@Z @ 151 NONAME ; public: virtual void __thiscall TSDIOCardArray::DeclareCardAsGone(unsigned int)
+	?DeregisterClient@TSDIOFunction@@QAEHPAVDBase@@@Z @ 152 NONAME ; public: int __thiscall TSDIOFunction::DeregisterClient(class DBase *)
+	?Disable@TSDIOFunction@@QAEHXZ @ 153 NONAME ; public: int __thiscall TSDIOFunction::Disable(void)
+	?Disable@TSDIOInterrupt@@QAEHXZ @ 154 NONAME ; public: int __thiscall TSDIOInterrupt::Disable(void)
+	?DoCreate@DSDIOPsu@@UAEHXZ @ 155 NONAME ; public: virtual int __thiscall DSDIOPsu::DoCreate(void)
+	?DoTickService@DSDIOPsu@@UAEXXZ @ 156 NONAME ; public: virtual void __thiscall DSDIOPsu::DoTickService(void)
+	?Dummy1@DSDIOStack@@EAEXXZ @ 157 NONAME ; private: virtual void __thiscall DSDIOStack::Dummy1(void)
+	?Dummy2@DSDIOStack@@EAEXXZ @ 158 NONAME ; private: virtual void __thiscall DSDIOStack::Dummy2(void)
+	?Dummy3@DSDIOStack@@EAEXXZ @ 159 NONAME ; private: virtual void __thiscall DSDIOStack::Dummy3(void)
+	?Dummy4@DSDIOStack@@EAEXXZ @ 160 NONAME ; private: virtual void __thiscall DSDIOStack::Dummy4(void)
+	?Enable@TSDIOFunction@@QAEHH@Z @ 161 NONAME ; public: int __thiscall TSDIOFunction::Enable(int)
+	?Enable@TSDIOInterrupt@@QAEHXZ @ 162 NONAME ; public: int __thiscall TSDIOInterrupt::Enable(void)
+	?FillAppCommandDesc@DSDIOSession@@CAXAAVTMMCCommandDesc@@@Z @ 163 NONAME ; private: static void __cdecl DSDIOSession::FillAppCommandDesc(class TMMCCommandDesc &)
+	?FillAppCommandDesc@DSDIOSession@@SAXAAVTMMCCommandDesc@@W4TSDIOAppCmd@@@Z @ 164 NONAME ; public: static void __cdecl DSDIOSession::FillAppCommandDesc(class TMMCCommandDesc &,enum TSDIOAppCmd)
+	?FillAppCommandDesc@DSDIOSession@@SAXAAVTMMCCommandDesc@@W4TSDIOAppCmd@@VTMMCArgument@@@Z @ 165 NONAME ; public: static void __cdecl DSDIOSession::FillAppCommandDesc(class TMMCCommandDesc &,enum TSDIOAppCmd,class TMMCArgument)
+	?FindFunction@TSDIOCard@@QBEPAVTSDIOFunction@@AAVTSDIOFunctionCaps@@KPAV2@@Z @ 166 NONAME ; public: class TSDIOFunction * __thiscall TSDIOCard::FindFunction(class TSDIOFunctionCaps &,unsigned long,class TSDIOFunction *)const 
+	?FindReadCommonConfig@TCisReader@@QAEHAAVTSDIOCardConfig@@@Z @ 167 NONAME ; public: int __thiscall TCisReader::FindReadCommonConfig(class TSDIOCardConfig &)
+	?FindReadFunctionConfig@TCisReader@@QAEHAAVTSDIOFunctionCaps@@@Z @ 168 NONAME ; public: int __thiscall TCisReader::FindReadFunctionConfig(class TSDIOFunctionCaps &)
+	?FindReadTuple@TCisReader@@QAEHEAAVTDes8@@I@Z @ 169 NONAME ; public: int __thiscall TCisReader::FindReadTuple(unsigned char,class TDes8 &,unsigned int)
+	?GetMacro@DSDIOSession@@MBEP6AKPAX@ZH@Z @ 170 NONAME ; protected: virtual unsigned long (__cdecl*__thiscall DSDIOSession::GetMacro(int)const )(void *)
+	?HandleSDIOInterrupt@DSDIOStack@@IAEXI@Z @ 171 NONAME ; protected: void __thiscall DSDIOStack::HandleSDIOInterrupt(unsigned int)
+	?Init@DSDIOStack@@UAEHXZ @ 172 NONAME ; public: virtual int __thiscall DSDIOStack::Init(void)
+	?IsLocked@DSDIOPsu@@UAEHXZ @ 173 NONAME ; public: virtual int __thiscall DSDIOPsu::IsLocked(void)
+	?IsReady@TSDIOFunction@@QAEHAAH@Z @ 174 NONAME ; public: int __thiscall TSDIOFunction::IsReady(int &)
+	?Modify8@DSDIORegisterInterface@@QAEHKEEPAE@Z @ 175 NONAME ; public: int __thiscall DSDIORegisterInterface::Modify8(unsigned long,unsigned char,unsigned char,unsigned char *)
+	?ModifyCardCapabilitySM@DSDIOStack@@MAEKXZ @ 176 NONAME ; protected: virtual unsigned long __thiscall DSDIOStack::ModifyCardCapabilitySM(void)
+	?Read8@DSDIORegisterInterface@@QAEHKPAE@Z @ 177 NONAME ; public: int __thiscall DSDIORegisterInterface::Read8(unsigned long,unsigned char *)
+	?ReadMultiple8@DSDIORegisterInterface@@QAEHKPAEKH@Z @ 178 NONAME ; public: int __thiscall DSDIORegisterInterface::ReadMultiple8(unsigned long,unsigned char *,unsigned long,int)
+	?ReadTuple@TCisReader@@QAEHAAVTDes8@@@Z @ 179 NONAME ; public: int __thiscall TCisReader::ReadTuple(class TDes8 &)
+	?Register@TSDIOFunctionCallback@@QAEXPAVDMMCSocket@@@Z @ 180 NONAME ; public: void __thiscall TSDIOFunctionCallback::Register(class DMMCSocket *)
+	?RegisterClient@TSDIOFunction@@QAEHPAVDBase@@PAVDMutex@@@Z @ 181 NONAME ; public: int __thiscall TSDIOFunction::RegisterClient(class DBase *,class DMutex *)
+	?RegisterMediaDevices@TSDIOCardControllerInterface@@MAEHH@Z @ 182 NONAME ; protected: virtual int __thiscall TSDIOCardControllerInterface::RegisterMediaDevices(int)
+	?RequestAsyncSleep@DSDIOSocket@@QAEXXZ @ 183 NONAME ; public: void __thiscall DSDIOSocket::RequestAsyncSleep(void)
+	?Restart@TCisReader@@QAEHXZ @ 184 NONAME ; public: int __thiscall TCisReader::Restart(void)
+	?SelectCis@TCisReader@@QAEHIIIE@Z @ 185 NONAME ; public: int __thiscall TCisReader::SelectCis(unsigned int,unsigned int,unsigned int,unsigned char)
+	?SetAsync@DSDIORegisterInterface@@QAEHAAVTMMCCallBack@@@Z @ 186 NONAME ; public: int __thiscall DSDIORegisterInterface::SetAsync(class TMMCCallBack &)
+	?SetPriority@TSDIOFunction@@QAEHW4TSDIOFunctionPriority@@@Z @ 187 NONAME ; public: int __thiscall TSDIOFunction::SetPriority(enum TSDIOFunctionPriority)
+	?SetSync@DSDIORegisterInterface@@QAEHXZ @ 188 NONAME ; public: int __thiscall DSDIORegisterInterface::SetSync(void)
+	?SetupCIMIoModify@DSDIOSession@@QAEXKEEPAE@Z @ 189 NONAME ; public: void __thiscall DSDIOSession::SetupCIMIoModify(unsigned long,unsigned char,unsigned char,unsigned char *)
+	?SetupCIMIoRead@DSDIOSession@@QAEXKPAE@Z @ 190 NONAME ; public: void __thiscall DSDIOSession::SetupCIMIoRead(unsigned long,unsigned char *)
+	?SetupCIMIoReadMultiple@DSDIOSession@@QAEXKKPAEH@Z @ 191 NONAME ; public: void __thiscall DSDIOSession::SetupCIMIoReadMultiple(unsigned long,unsigned long,unsigned char *,int)
+	?SetupCIMIoWrite@DSDIOSession@@QAEXKEPAE@Z @ 192 NONAME ; public: void __thiscall DSDIOSession::SetupCIMIoWrite(unsigned long,unsigned char,unsigned char *)
+	?SetupCIMIoWriteMultiple@DSDIOSession@@QAEXKKPAEH@Z @ 193 NONAME ; public: void __thiscall DSDIOSession::SetupCIMIoWriteMultiple(unsigned long,unsigned long,unsigned char *,int)
+	?SleepComplete@DSDIOSocket@@QAEXXZ @ 194 NONAME ; public: void __thiscall DSDIOSocket::SleepComplete(void)
+	?Unbind@TSDIOInterrupt@@QAEHXZ @ 195 NONAME ; public: int __thiscall TSDIOInterrupt::Unbind(void)
+	?UnblockIOSession@DSDIOStack@@IAEPAVDSDIOSession@@W4TSDIOBlockingCondition@1@K@Z @ 196  NONAME ; class DSDIOSession * DSDIOStack::UnblockIOSession(enum DSDIOStack::TSDIOBlockingCondition, unsigned long)
+	?Write8@DSDIORegisterInterface@@QAEHKEPAE@Z @ 197 NONAME ; public: int __thiscall DSDIORegisterInterface::Write8(unsigned long,unsigned char,unsigned char *)
+	?WriteMultiple8@DSDIORegisterInterface@@QAEHKPAEKH@Z @ 198 NONAME ; public: int __thiscall DSDIORegisterInterface::WriteMultiple8(unsigned long,unsigned char *,unsigned long,int)
+?ReadMultiple8@DSDIORegisterInterface@@QAEHKPAVDChunk@@KKH@Z @ 199  NONAME ; int DSDIORegisterInterface::ReadMultiple8(unsigned long, class DChunk *, unsigned long, unsigned long, int)
+	?WriteMultiple8@DSDIORegisterInterface@@QAEHKPAEK@Z @ 200  NONAME ; int DSDIORegisterInterface::WriteMultiple8(unsigned long, unsigned char *, unsigned long)
+	?Dummy4@DSDIOPsu@@EAEXXZ @ 201  NONAME ; void DSDIOPsu::Dummy4(void)
+	?WriteMultiple8@DSDIORegisterInterface@@QAEHKPAVDChunk@@KKH@Z @ 202  NONAME ; int DSDIORegisterInterface::WriteMultiple8(unsigned long, class DChunk *, unsigned long, unsigned long, int)
+	?Dummy1@DSDIOPsu@@EAEXXZ @ 203  NONAME ; void DSDIOPsu::Dummy1(void)
+	?MachineInfo@DMMCStack@@UAEXAAVTDes8@@@Z @ 204  NONAME ; void DMMCStack::MachineInfo(class TDes8 &)
+	?WriteMultiple8@DSDIORegisterInterface@@QAEHKPAVDChunk@@KK@Z @ 205  NONAME ; int DSDIORegisterInterface::WriteMultiple8(unsigned long, class DChunk *, unsigned long, unsigned long)
+	?Write8@DSDIORegisterInterface@@QAEHKE@Z @ 206  NONAME ; int DSDIORegisterInterface::Write8(unsigned long, unsigned char)
+	?Dummy2@DSDIOPsu@@EAEXXZ @ 207  NONAME ; void DSDIOPsu::Dummy2(void)
+	??1DSDIOSession@@UAE@XZ @ 208  NONAME ; DSDIOSession::~DSDIOSession(void)
+	?Modify8@DSDIORegisterInterface@@QAEHKEE@Z @ 209  NONAME ; int DSDIORegisterInterface::Modify8(unsigned long, unsigned char, unsigned char)
+	?Dummy4@DSDIOSession@@EAEXXZ @ 210  NONAME ; void DSDIOSession::Dummy4(void)
+	?Dummy3@DSDIOSession@@EAEXXZ @ 211  NONAME ; void DSDIOSession::Dummy3(void)
+	?Dummy3@DSDIOPsu@@EAEXXZ @ 212  NONAME ; void DSDIOPsu::Dummy3(void)
+	?ReadMultiple8@DSDIORegisterInterface@@QAEHKPAEK@Z @ 213  NONAME ; int DSDIORegisterInterface::ReadMultiple8(unsigned long, unsigned char *, unsigned long)
+	?Dummy2@DSDIOSession@@EAEXXZ @ 214  NONAME ; void DSDIOSession::Dummy2(void)
+	?ReadMultiple8@DSDIORegisterInterface@@QAEHKPAVDChunk@@KK@Z @ 215  NONAME ; int DSDIORegisterInterface::ReadMultiple8(unsigned long, class DChunk *, unsigned long, unsigned long)
+	?Dummy1@DSDIOSession@@EAEXXZ @ 216  NONAME ; void DSDIOSession::Dummy1(void)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/bx86/sdcard3c/epbusmu.def	Wed Mar 31 23:38:45 2010 +0300
@@ -0,0 +1,115 @@
+EXPORTS
+	??0DMMCMediaChange@@QAE@H@Z @ 1 NONAME ; public: __thiscall DMMCMediaChange::DMMCMediaChange(int)
+	??0DMMCPsu@@QAE@HH@Z @ 2 NONAME ; public: __thiscall DMMCPsu::DMMCPsu(int,int)
+	??0DMMCSession@@QAE@ABVTMMCCallBack@@@Z @ 3 NONAME ; public: __thiscall DMMCSession::DMMCSession(class TMMCCallBack const &)
+	??0DMMCSocket@@QAE@HPAVTMMCPasswordStore@@@Z @ 4 NONAME ; public: __thiscall DMMCSocket::DMMCSocket(int,class TMMCPasswordStore *)
+	??0DMMCStack@@QAE@HPAVDMMCSocket@@@Z @ 5 NONAME ; public: __thiscall DMMCStack::DMMCStack(int,class DMMCSocket *)
+	??0DMediaChangeBase@@QAE@H@Z @ 6 NONAME ; public: __thiscall DMediaChangeBase::DMediaChangeBase(int)
+	??0TPBusCallBack@@QAE@P6AXPAXH00@Z0@Z @ 7 NONAME ; public: __thiscall TPBusCallBack::TPBusCallBack(void (__cdecl*)(void *,int,void *,void *),void *)
+	??0TPBusCallBack@@QAE@P6AXPAXH@Z0I@Z @ 8 NONAME ; public: __thiscall TPBusCallBack::TPBusCallBack(void (__cdecl*)(void *,int),void *,unsigned int)
+	??0TPBusCallBack@@QAE@XZ @ 9 NONAME ; public: __thiscall TPBusCallBack::TPBusCallBack(void)
+	??1DMMCSession@@UAE@XZ @ 10 NONAME ; public: virtual __thiscall DMMCSession::~DMMCSession(void)
+	?AcquireStackSM@DMMCStack@@MAEKXZ @ 11 NONAME ; protected: virtual unsigned long __thiscall DMMCStack::AcquireStackSM(void)
+	?Add@DPBusSocket@@QAEXPAVTPBusCallBack@@@Z @ 12 NONAME ; public: void __thiscall DPBusSocket::Add(class TPBusCallBack *)
+	?AddNewCard@TMMCardArray@@QAEXPBEPAVTRCA@@@Z @ 13 NONAME ; public: void __thiscall TMMCardArray::AddNewCard(unsigned char const *,class TRCA *)
+	?AllocCards@TMMCardArray@@UAEHXZ @ 14 NONAME ; public: virtual int __thiscall TMMCardArray::AllocCards(void)
+	?Block@DMMCStack@@IAEXPAVDMMCSession@@K@Z @ 15 NONAME ; protected: void __thiscall DMMCStack::Block(class DMMCSession *,unsigned long)
+	?CIMReadWriteBlocksSM@DMMCStack@@MAEKXZ @ 16 NONAME ; protected: virtual unsigned long __thiscall DMMCStack::CIMReadWriteBlocksSM(void)
+	?CSDField@TCSD@@QBEIABI0@Z @ 17 NONAME ; public: unsigned int __thiscall TCSD::CSDField(unsigned int const &,unsigned int const &)const 
+	?CardDetect@DMMCStack@@MAEHI@Z @ 18 NONAME ; protected: virtual int __thiscall DMMCStack::CardDetect(unsigned int)
+	?Create@DMediaChangeBase@@UAEHXZ @ 19 NONAME ; public: virtual int __thiscall DMediaChangeBase::Create(void)
+	?Create@TMMCardControllerInterface@@QAEHXZ @ 20 NONAME ; public: int __thiscall TMMCardControllerInterface::Create(void)
+	?DeclareCardAsGone@TMMCardArray@@UAEXI@Z @ 21 NONAME ; public: virtual void __thiscall TMMCardArray::DeclareCardAsGone(unsigned int)
+	?DeltaCurrentConsumption@DPBusSocket@@QAEXH@Z @ 22 NONAME ; public: void __thiscall DPBusSocket::DeltaCurrentConsumption(int)
+	?DeviceSize@TCSD@@QBEIXZ @ 23 NONAME ; public: unsigned int __thiscall TCSD::DeviceSize(void)const 
+	?Direction@TMMCCommandDesc@@QBEHXZ @ 24 NONAME ; public: int __thiscall TMMCCommandDesc::Direction(void)const 
+	?Dispatch@TMMCStateMachine@@QAEKXZ @ 25 NONAME ; public: unsigned long __thiscall TMMCStateMachine::Dispatch(void)
+	?DoCreate@DMMCPsu@@UAEHXZ @ 26 NONAME ; public: virtual int __thiscall DMMCPsu::DoCreate(void)
+	?DoCreate@DPBusPsuBase@@UAEHXZ @ 27 NONAME ; public: virtual int __thiscall DPBusPsuBase::DoCreate(void)
+	?DoTickService@DPBusPsuBase@@UAEXXZ @ 28 NONAME ; public: virtual void __thiscall DPBusPsuBase::DoTickService(void)
+	?DoorClosedService@DMediaChangeBase@@QAEXXZ @ 29 NONAME ; public: void __thiscall DMediaChangeBase::DoorClosedService(void)
+	?DoorOpenService@DMediaChangeBase@@QAEXXZ @ 30 NONAME ; public: void __thiscall DMediaChangeBase::DoorOpenService(void)
+	?EffectiveModes@DMMCStack@@QAEKABVTMMCStackConfig@@@Z @ 31 NONAME ; public: unsigned long __thiscall DMMCStack::EffectiveModes(class TMMCStackConfig const &)
+	?EndInCritical@DPBusSocket@@QAEXXZ @ 32 NONAME ; public: void __thiscall DPBusSocket::EndInCritical(void)
+	?Engage@DMMCSession@@QAEHXZ @ 33 NONAME ; public: int __thiscall DMMCSession::Engage(void)
+	?EpocErrorCode@DMMCSession@@QBEHXZ @ 34 NONAME ; public: int __thiscall DMMCSession::EpocErrorCode(void)const 
+	?EraseGroupSize@TCSD@@QBEIXZ @ 35 NONAME ; public: unsigned int __thiscall TCSD::EraseGroupSize(void)const 
+	?EraseSectorSize@TCSD@@QBEIXZ @ 36 NONAME ; public: unsigned int __thiscall TCSD::EraseSectorSize(void)const 
+	?ForceMediaChange@DPBusSocket@@QAEXXZ @ 37 NONAME ; public: void __thiscall DPBusSocket::ForceMediaChange(void)
+	?InCritical@DPBusSocket@@QAEHXZ @ 38 NONAME ; public: int __thiscall DPBusSocket::InCritical(void)
+	?Init@DMMCStack@@UAEHXZ @ 39 NONAME ; public: virtual int __thiscall DMMCStack::Init(void)
+	?IsLocked@DPBusPsuBase@@UAEHXZ @ 40 NONAME ; public: virtual int __thiscall DPBusPsuBase::IsLocked(void)
+	?IsLocked@TMMCard@@QBEHXZ @ 41 NONAME ; public: int __thiscall TMMCard::IsLocked(void)const 
+	?IsMappingIncorrect@TMMCPasswordStore@@QAEHABVTCID@@ABV?$TBuf8@$0BA@@@@Z @ 42 NONAME ; public: int __thiscall TMMCPasswordStore::IsMappingIncorrect(class TCID const &,class TBuf8<16> const &)
+	?IsReady@TMMCard@@QBEHXZ @ 43 NONAME ; public: int __thiscall TMMCard::IsReady(void)const 
+	?Jump@TMMCStateMachine@@QAEKP6AKPAX@ZH@Z @ 44 NONAME ; public: unsigned long __thiscall TMMCStateMachine::Jump(unsigned long (__cdecl*)(void *),int)
+	?MaxReadCurrentInMilliamps@TCSD@@QBEIXZ @ 45 NONAME ; public: unsigned int __thiscall TCSD::MaxReadCurrentInMilliamps(void)const 
+	?MaxTranSpeedInKilohertz@TCSD@@QBEIXZ @ 46 NONAME ; public: unsigned int __thiscall TCSD::MaxTranSpeedInKilohertz(void)const 
+	?MaxWriteCurrentInMilliamps@TCSD@@QBEIXZ @ 47 NONAME ; public: unsigned int __thiscall TCSD::MaxWriteCurrentInMilliamps(void)const 
+	?MediaType@TCSD@@QBE?AW4TMMCMediaTypeEnum@@XZ @ 48 NONAME ; public: enum TMMCMediaTypeEnum  __thiscall TCSD::MediaType(void)const 
+	?MinReadCurrentInMilliamps@TCSD@@QBEIXZ @ 49 NONAME ; public: unsigned int __thiscall TCSD::MinReadCurrentInMilliamps(void)const 
+	?MinWriteCurrentInMilliamps@TCSD@@QBEIXZ @ 50 NONAME ; public: unsigned int __thiscall TCSD::MinWriteCurrentInMilliamps(void)const 
+	?Panic@DMMCSocket@@SAXW4TMMCPanic@1@@Z @ 51 NONAME ; public: static void __cdecl DMMCSocket::Panic(enum DMMCSocket::TMMCPanic)
+	?Panic@DPBusSocket@@SAXW4TPanic@1@@Z @ 52 NONAME ; public: static void __cdecl DPBusSocket::Panic(enum DPBusSocket::TPanic)
+	?PowerDownStack@DMMCStack@@QAEXXZ @ 53 NONAME ; public: void __thiscall DMMCStack::PowerDownStack(void)
+	?PowerUp@DPBusSocket@@QAEHXZ @ 54 NONAME ; public: int __thiscall DPBusSocket::PowerUp(void)
+	?PowerUpSequenceComplete@DPBusSocket@@QAEXH@Z @ 55 NONAME ; public: void __thiscall DPBusSocket::PowerUpSequenceComplete(int)
+	?PowerUpStack@DMMCStack@@QAEXXZ @ 56 NONAME ; public: void __thiscall DMMCStack::PowerUpStack(void)
+	?Push@TMMCStateMachine@@QAEKP6AKPAX@ZH@Z @ 57 NONAME ; public: unsigned long __thiscall TMMCStateMachine::Push(unsigned long (__cdecl*)(void *),int)
+	?ReadBlockLength@TCSD@@QBEIXZ @ 58 NONAME ; public: unsigned int __thiscall TCSD::ReadBlockLength(void)const 
+	?ReceiveVoltageCheckResult@DPBusPsuBase@@UAEXH@Z @ 59 NONAME ; public: virtual void __thiscall DPBusPsuBase::ReceiveVoltageCheckResult(int)
+	?Remove@TPBusCallBack@@QAEXXZ @ 60 NONAME ; public: void __thiscall TPBusCallBack::Remove(void)
+	?Reset@TMMCStateMachine@@QAEXXZ @ 61 NONAME ; public: void __thiscall TMMCStateMachine::Reset(void)
+	?SetCard@DMMCSession@@QAEXPAVTMMCard@@@Z @ 62 NONAME ; public: void __thiscall DMMCSession::SetCard(class TMMCard *)
+	?SetSocket@TPBusCallBack@@QAEXH@Z @ 63 NONAME ; public: void __thiscall TPBusCallBack::SetSocket(int)
+	?SetState@DPBusPsuBase@@QAEHW4TPBusPsuState@@@Z @ 64 NONAME ; public: int __thiscall DPBusPsuBase::SetState(enum TPBusPsuState)
+	?SetupCIMEraseGroup@DMMCSession@@QAEXVTMMCArgument@@K@Z @ 65 NONAME ; public: void __thiscall DMMCSession::SetupCIMEraseGroup(class TMMCArgument,unsigned long)
+	?SetupCIMEraseSector@DMMCSession@@QAEXVTMMCArgument@@K@Z @ 66 NONAME ; public: void __thiscall DMMCSession::SetupCIMEraseSector(class TMMCArgument,unsigned long)
+	?SetupCIMLockUnlock@DMMCSession@@QAEXKPAE@Z @ 67 NONAME ; public: void __thiscall DMMCSession::SetupCIMLockUnlock(unsigned long,unsigned char *)
+	?SetupCIMReadBlock@DMMCSession@@QAEXVTMMCArgument@@KPAE@Z @ 68 NONAME ; public: void __thiscall DMMCSession::SetupCIMReadBlock(class TMMCArgument,unsigned long,unsigned char *)
+	?SetupCIMReadIO@DMMCSession@@QAEXEKPAE@Z @ 69 NONAME ; public: void __thiscall DMMCSession::SetupCIMReadIO(unsigned char,unsigned long,unsigned char *)
+	?SetupCIMReadMBlock@DMMCSession@@QAEXVTMMCArgument@@KPAEK@Z @ 70 NONAME ; public: void __thiscall DMMCSession::SetupCIMReadMBlock(class TMMCArgument,unsigned long,unsigned char *,unsigned long)
+	?SetupCIMWriteBlock@DMMCSession@@QAEXVTMMCArgument@@KPAE@Z @ 71 NONAME ; public: void __thiscall DMMCSession::SetupCIMWriteBlock(class TMMCArgument,unsigned long,unsigned char *)
+	?SetupCIMWriteIO@DMMCSession@@QAEXEKPAE@Z @ 72 NONAME ; public: void __thiscall DMMCSession::SetupCIMWriteIO(unsigned char,unsigned long,unsigned char *)
+	?SetupCIMWriteMBlock@DMMCSession@@QAEXVTMMCArgument@@KPAEK@Z @ 73 NONAME ; public: void __thiscall DMMCSession::SetupCIMWriteMBlock(class TMMCArgument,unsigned long,unsigned char *,unsigned long)
+	?SetupCommand@DMMCSession@@QAEXW4TMMCCommandEnum@@VTMMCArgument@@@Z @ 74 NONAME ; public: void __thiscall DMMCSession::SetupCommand(enum TMMCCommandEnum,class TMMCArgument)
+	?SetupDTCommand@DMMCSession@@QAEXW4TMMCCommandEnum@@VTMMCArgument@@KPAEKHW4TMMCCmdDirEnum@@K@Z @ 75 NONAME ; public: void __thiscall DMMCSession::SetupDTCommand(enum TMMCCommandEnum,class TMMCArgument,unsigned long,unsigned char *,unsigned long,int,enum TMMCCmdDirEnum,unsigned long)
+	?SetupRSCommand@DMMCSession@@QAEXW4TMMCCommandEnum@@VTMMCArgument@@KW4TMMCCommandTypeEnum@@W4TMMCResponseTypeEnum@@K@Z @ 76 NONAME ; public: void __thiscall DMMCSession::SetupRSCommand(enum TMMCCommandEnum,class TMMCArgument,unsigned long,enum TMMCCommandTypeEnum,enum TMMCResponseTypeEnum,unsigned long)
+	?SocketFromId@DPBusSocket@@SAPAV1@H@Z @ 77 NONAME ; public: static class DPBusSocket * __cdecl DPBusSocket::SocketFromId(int)
+	?Stop@DMMCStack@@QAEHPAVTMMCard@@@Z @ 78 NONAME ; public: int __thiscall DMMCStack::Stop(class TMMCard *)
+	?UnBlock@DMMCStack@@IAEXPAVDMMCSession@@KK@Z @ 79 NONAME ; protected: void __thiscall DMMCStack::UnBlock(class DMMCSession *,unsigned long,unsigned long)
+	?WriteBlockLength@TCSD@@QBEIXZ @ 80 NONAME ; public: unsigned int __thiscall TCSD::WriteBlockLength(void)const 
+	?WriteProtected@DMMCStack@@MAEHI@Z @ 81 NONAME ; protected: virtual int __thiscall DMMCStack::WriteProtected(unsigned int)
+	?Create@DMMCMediaChange@@UAEHXZ @ 82 NONAME ; public: virtual int __thiscall DMMCMediaChange::Create(void)
+	?AllocSession@DMMCStack@@UBEPAVDMMCSession@@ABVTMMCCallBack@@@Z @ 83 NONAME ; public: virtual class DMMCSession * __thiscall DMMCStack::AllocSession(class TMMCCallBack const &)const 
+	?CIMReadWriteBlocksSMST@DMMCStack@@KAKPAX@Z @ 84 NONAME ; protected: static unsigned long __cdecl DMMCStack::CIMReadWriteBlocksSMST(void *)
+	?CardRCA@DMMCSession@@QAE?AVTRCA@@XZ @ 85 NONAME ; public: class TRCA  __thiscall DMMCSession::CardRCA(void)
+	?FillCommandArgs@DMMCSession@@QAEXVTMMCArgument@@KPAEK@Z @ 86 NONAME ; public: void __thiscall DMMCSession::FillCommandArgs(class TMMCArgument,unsigned long,unsigned char *,unsigned long)
+	?FillCommandDesc@DMMCSession@@QAEXW4TMMCCommandEnum@@@Z @ 87 NONAME ; public: void __thiscall DMMCSession::FillCommandDesc(enum TMMCCommandEnum)
+	?FillCommandDesc@DMMCSession@@QAEXW4TMMCCommandEnum@@VTMMCArgument@@@Z @ 88 NONAME ; public: void __thiscall DMMCSession::FillCommandDesc(enum TMMCCommandEnum,class TMMCArgument)
+	?FillCommandDesc@DMMCSession@@QAEXXZ @ 89 NONAME ; public: void __thiscall DMMCSession::FillCommandDesc(void)
+	?GetMacro@DMMCSession@@MBEP6AKPAX@ZH@Z @ 90 NONAME ; protected: virtual unsigned long (__cdecl*__thiscall DMMCSession::GetMacro(int)const )(void *)
+	?IssueMMCCommandSMST@DMMCStack@@KAKPAX@Z @ 91 NONAME ; protected: static unsigned long __cdecl DMMCStack::IssueMMCCommandSMST(void *)
+	?InitStackAfterUnlockSM@DMMCStack@@MAEKXZ @ 92 NONAME ; protected: virtual unsigned long __thiscall DMMCStack::InitStackAfterUnlockSM(void)
+	?PowerDownComplete@DPBusSocket@@QAEXXZ @ 93 NONAME ; public: void __thiscall DPBusSocket::PowerDownComplete(void)
+	?RegisterMediaDevices@TMMCardControllerInterface@@MAEHH@Z @ 94 NONAME ; protected: virtual int __thiscall TMMCardControllerInterface::RegisterMediaDevices(int)
+	?RequestAsyncPowerDown@DPBusSocket@@QAEXXZ @ 95 NONAME ; public: void __thiscall DPBusSocket::RequestAsyncPowerDown(void)
+	?ControlIO@DPBusSocket@@UAEHHPAX0@Z @ 96 NONAME ; public: virtual int __thiscall DPBusSocket::ControlIO(int,void *,void *)
+	?Dummy1@DMMCStack@@EAEXXZ @ 97 NONAME ; private: virtual void __thiscall DMMCStack::Dummy1(void)
+	?GetInterface@DMMCStack@@MAEXW4TInterfaceId@1@AAPAVMInterface@1@@Z @ 98 NONAME ; protected: virtual void __thiscall DMMCStack::GetInterface(enum DMMCStack::TInterfaceId,class DMMCStack::MInterface * &)
+	?MachineInfo@DMMCStack@@UAEXAAVTDes8@@@Z @ 99 NONAME ; public: virtual void __thiscall DMMCStack::MachineInfo(class TDes8 &)
+	?SetBusWidth@DMMCStack@@MAEXK@Z @ 100 NONAME ; protected: virtual void __thiscall DMMCStack::SetBusWidth(unsigned long)
+	?ModifyCardCapabilitySM@DMMCStack@@MAEKXZ @ 101 NONAME ; protected: virtual unsigned long __thiscall DMMCStack::ModifyCardCapabilitySM(void)
+	?AcquireStackSM@DSDStack@@UAEKXZ @ 102 NONAME ; public: virtual unsigned long __thiscall DSDStack::AcquireStackSM(void)
+	?AllocCards@TSDCardArray@@UAEHXZ @ 103 NONAME ; public: virtual int __thiscall TSDCardArray::AllocCards(void)
+	?AllocSession@DSDStack@@UBEPAVDMMCSession@@ABVTMMCCallBack@@@Z @ 104 NONAME ; public: virtual class DMMCSession * __thiscall DSDStack::AllocSession(class TMMCCallBack const &)const 
+	?CIMReadWriteBlocksSM@DSDStack@@UAEKXZ @ 105 NONAME ; public: virtual unsigned long __thiscall DSDStack::CIMReadWriteBlocksSM(void)
+	?DeclareCardAsGone@TSDCardArray@@UAEXI@Z @ 106 NONAME ; public: virtual void __thiscall TSDCardArray::DeclareCardAsGone(unsigned int)
+	?Dummy1@DSDStack@@EAEXXZ @ 107 NONAME ; private: virtual void __thiscall DSDStack::Dummy1(void)
+	?Dummy2@DSDStack@@EAEXXZ @ 108 NONAME ; private: virtual void __thiscall DSDStack::Dummy2(void)
+	?Dummy3@DSDStack@@EAEXXZ @ 109 NONAME ; private: virtual void __thiscall DSDStack::Dummy3(void)
+	?CardType@DSDStack@@UAE?AW4TSDCardType@1@HH@Z @ 110 NONAME ; public: virtual enum DSDStack::TSDCardType __thiscall DSDStack::CardType(int,int)
+	?Init@DSDStack@@UAEHXZ @ 111 NONAME ; public: virtual int __thiscall DSDStack::Init(void)
+	?InitStackAfterUnlockSM@DSDStack@@MAEKXZ @ 112 NONAME ; protected: virtual unsigned long __thiscall DSDStack::InitStackAfterUnlockSM(void)
+	?ModifyCardCapabilitySM@DSDStack@@MAEKXZ @ 113 NONAME ; protected: virtual unsigned long __thiscall DSDStack::ModifyCardCapabilitySM(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/bx86/sdcard3c/sdio/epbusmu.def	Wed Mar 31 23:38:45 2010 +0300
@@ -0,0 +1,219 @@
+EXPORTS
+	??0DMMCMediaChange@@QAE@H@Z @ 1 NONAME ; public: __thiscall DMMCMediaChange::DMMCMediaChange(int)
+	??0DMMCPsu@@QAE@HH@Z @ 2 NONAME ; public: __thiscall DMMCPsu::DMMCPsu(int,int)
+	??0DMMCSession@@QAE@ABVTMMCCallBack@@@Z @ 3 NONAME ; public: __thiscall DMMCSession::DMMCSession(class TMMCCallBack const &)
+	??0DMMCSocket@@QAE@HPAVTMMCPasswordStore@@@Z @ 4 NONAME ; public: __thiscall DMMCSocket::DMMCSocket(int,class TMMCPasswordStore *)
+	??0DMMCStack@@QAE@HPAVDMMCSocket@@@Z @ 5 NONAME ; public: __thiscall DMMCStack::DMMCStack(int,class DMMCSocket *)
+	??0DMediaChangeBase@@QAE@H@Z @ 6 NONAME ; public: __thiscall DMediaChangeBase::DMediaChangeBase(int)
+	??0TPBusCallBack@@QAE@P6AXPAXH00@Z0@Z @ 7 NONAME ; public: __thiscall TPBusCallBack::TPBusCallBack(void (__cdecl*)(void *,int,void *,void *),void *)
+	??0TPBusCallBack@@QAE@P6AXPAXH@Z0I@Z @ 8 NONAME ; public: __thiscall TPBusCallBack::TPBusCallBack(void (__cdecl*)(void *,int),void *,unsigned int)
+	??0TPBusCallBack@@QAE@XZ @ 9 NONAME ; public: __thiscall TPBusCallBack::TPBusCallBack(void)
+	??1DMMCSession@@UAE@XZ @ 10 NONAME ; public: virtual __thiscall DMMCSession::~DMMCSession(void)
+	?AcquireStackSM@DMMCStack@@MAEKXZ @ 11 NONAME ; protected: virtual unsigned long __thiscall DMMCStack::AcquireStackSM(void)
+	?Add@DPBusSocket@@QAEXPAVTPBusCallBack@@@Z @ 12 NONAME ; public: void __thiscall DPBusSocket::Add(class TPBusCallBack *)
+	?AddNewCard@TMMCardArray@@QAEXPBEPAVTRCA@@@Z @ 13 NONAME ; public: void __thiscall TMMCardArray::AddNewCard(unsigned char const *,class TRCA *)
+	?AllocCards@TMMCardArray@@UAEHXZ @ 14 NONAME ; public: virtual int __thiscall TMMCardArray::AllocCards(void)
+	?Block@DMMCStack@@IAEXPAVDMMCSession@@K@Z @ 15 NONAME ; protected: void __thiscall DMMCStack::Block(class DMMCSession *,unsigned long)
+	?CIMReadWriteBlocksSM@DMMCStack@@MAEKXZ @ 16 NONAME ; protected: virtual unsigned long __thiscall DMMCStack::CIMReadWriteBlocksSM(void)
+	?CSDField@TCSD@@QBEIABI0@Z @ 17 NONAME ; public: unsigned int __thiscall TCSD::CSDField(unsigned int const &,unsigned int const &)const 
+	?CardDetect@DMMCStack@@MAEHI@Z @ 18 NONAME ; protected: virtual int __thiscall DMMCStack::CardDetect(unsigned int)
+	?Create@DMediaChangeBase@@UAEHXZ @ 19 NONAME ; public: virtual int __thiscall DMediaChangeBase::Create(void)
+	?Create@TMMCardControllerInterface@@QAEHXZ @ 20 NONAME ; public: int __thiscall TMMCardControllerInterface::Create(void)
+	?DeclareCardAsGone@TMMCardArray@@UAEXI@Z @ 21 NONAME ; public: virtual void __thiscall TMMCardArray::DeclareCardAsGone(unsigned int)
+	?DeltaCurrentConsumption@DPBusSocket@@QAEXH@Z @ 22 NONAME ; public: void __thiscall DPBusSocket::DeltaCurrentConsumption(int)
+	?DeviceSize@TCSD@@QBEIXZ @ 23 NONAME ; public: unsigned int __thiscall TCSD::DeviceSize(void)const 
+	?Direction@TMMCCommandDesc@@QBEHXZ @ 24 NONAME ; public: int __thiscall TMMCCommandDesc::Direction(void)const 
+	?Dispatch@TMMCStateMachine@@QAEKXZ @ 25 NONAME ; public: unsigned long __thiscall TMMCStateMachine::Dispatch(void)
+	?DoCreate@DMMCPsu@@UAEHXZ @ 26 NONAME ; public: virtual int __thiscall DMMCPsu::DoCreate(void)
+	?DoCreate@DPBusPsuBase@@UAEHXZ @ 27 NONAME ; public: virtual int __thiscall DPBusPsuBase::DoCreate(void)
+	?DoTickService@DPBusPsuBase@@UAEXXZ @ 28 NONAME ; public: virtual void __thiscall DPBusPsuBase::DoTickService(void)
+	?DoorClosedService@DMediaChangeBase@@QAEXXZ @ 29 NONAME ; public: void __thiscall DMediaChangeBase::DoorClosedService(void)
+	?DoorOpenService@DMediaChangeBase@@QAEXXZ @ 30 NONAME ; public: void __thiscall DMediaChangeBase::DoorOpenService(void)
+	?EffectiveModes@DMMCStack@@QAEKABVTMMCStackConfig@@@Z @ 31 NONAME ; public: unsigned long __thiscall DMMCStack::EffectiveModes(class TMMCStackConfig const &)
+	?EndInCritical@DPBusSocket@@QAEXXZ @ 32 NONAME ; public: void __thiscall DPBusSocket::EndInCritical(void)
+	?Engage@DMMCSession@@QAEHXZ @ 33 NONAME ; public: int __thiscall DMMCSession::Engage(void)
+	?EpocErrorCode@DMMCSession@@QBEHXZ @ 34 NONAME ; public: int __thiscall DMMCSession::EpocErrorCode(void)const 
+	?EraseGroupSize@TCSD@@QBEIXZ @ 35 NONAME ; public: unsigned int __thiscall TCSD::EraseGroupSize(void)const 
+	?EraseSectorSize@TCSD@@QBEIXZ @ 36 NONAME ; public: unsigned int __thiscall TCSD::EraseSectorSize(void)const 
+	?ForceMediaChange@DPBusSocket@@QAEXXZ @ 37 NONAME ; public: void __thiscall DPBusSocket::ForceMediaChange(void)
+	?InCritical@DPBusSocket@@QAEHXZ @ 38 NONAME ; public: int __thiscall DPBusSocket::InCritical(void)
+	?Init@DMMCStack@@UAEHXZ @ 39 NONAME ; public: virtual int __thiscall DMMCStack::Init(void)
+	?IsLocked@DPBusPsuBase@@UAEHXZ @ 40 NONAME ; public: virtual int __thiscall DPBusPsuBase::IsLocked(void)
+	?IsLocked@TMMCard@@QBEHXZ @ 41 NONAME ; public: int __thiscall TMMCard::IsLocked(void)const 
+	?IsMappingIncorrect@TMMCPasswordStore@@QAEHABVTCID@@ABV?$TBuf8@$0BA@@@@Z @ 42 NONAME ; public: int __thiscall TMMCPasswordStore::IsMappingIncorrect(class TCID const &,class TBuf8<16> const &)
+	?IsReady@TMMCard@@QBEHXZ @ 43 NONAME ; public: int __thiscall TMMCard::IsReady(void)const 
+	?Jump@TMMCStateMachine@@QAEKP6AKPAX@ZH@Z @ 44 NONAME ; public: unsigned long __thiscall TMMCStateMachine::Jump(unsigned long (__cdecl*)(void *),int)
+	?MaxReadCurrentInMilliamps@TCSD@@QBEIXZ @ 45 NONAME ; public: unsigned int __thiscall TCSD::MaxReadCurrentInMilliamps(void)const 
+	?MaxTranSpeedInKilohertz@TCSD@@QBEIXZ @ 46 NONAME ; public: unsigned int __thiscall TCSD::MaxTranSpeedInKilohertz(void)const 
+	?MaxWriteCurrentInMilliamps@TCSD@@QBEIXZ @ 47 NONAME ; public: unsigned int __thiscall TCSD::MaxWriteCurrentInMilliamps(void)const 
+	?MediaType@TCSD@@QBE?AW4TMMCMediaTypeEnum@@XZ @ 48 NONAME ; public: enum TMMCMediaTypeEnum  __thiscall TCSD::MediaType(void)const 
+	?MinReadCurrentInMilliamps@TCSD@@QBEIXZ @ 49 NONAME ; public: unsigned int __thiscall TCSD::MinReadCurrentInMilliamps(void)const 
+	?MinWriteCurrentInMilliamps@TCSD@@QBEIXZ @ 50 NONAME ; public: unsigned int __thiscall TCSD::MinWriteCurrentInMilliamps(void)const 
+	?Panic@DMMCSocket@@SAXW4TMMCPanic@1@@Z @ 51 NONAME ; public: static void __cdecl DMMCSocket::Panic(enum DMMCSocket::TMMCPanic)
+	?Panic@DPBusSocket@@SAXW4TPanic@1@@Z @ 52 NONAME ; public: static void __cdecl DPBusSocket::Panic(enum DPBusSocket::TPanic)
+	?PowerDownStack@DMMCStack@@QAEXXZ @ 53 NONAME ; public: void __thiscall DMMCStack::PowerDownStack(void)
+	?PowerUp@DPBusSocket@@QAEHXZ @ 54 NONAME ; public: int __thiscall DPBusSocket::PowerUp(void)
+	?PowerUpSequenceComplete@DPBusSocket@@QAEXH@Z @ 55 NONAME ; public: void __thiscall DPBusSocket::PowerUpSequenceComplete(int)
+	?PowerUpStack@DMMCStack@@QAEXXZ @ 56 NONAME ; public: void __thiscall DMMCStack::PowerUpStack(void)
+	?Push@TMMCStateMachine@@QAEKP6AKPAX@ZH@Z @ 57 NONAME ; public: unsigned long __thiscall TMMCStateMachine::Push(unsigned long (__cdecl*)(void *),int)
+	?ReadBlockLength@TCSD@@QBEIXZ @ 58 NONAME ; public: unsigned int __thiscall TCSD::ReadBlockLength(void)const 
+	?ReceiveVoltageCheckResult@DPBusPsuBase@@UAEXH@Z @ 59 NONAME ; public: virtual void __thiscall DPBusPsuBase::ReceiveVoltageCheckResult(int)
+	?Remove@TPBusCallBack@@QAEXXZ @ 60 NONAME ; public: void __thiscall TPBusCallBack::Remove(void)
+	?Reset@TMMCStateMachine@@QAEXXZ @ 61 NONAME ; public: void __thiscall TMMCStateMachine::Reset(void)
+	?SetCard@DMMCSession@@QAEXPAVTMMCard@@@Z @ 62 NONAME ; public: void __thiscall DMMCSession::SetCard(class TMMCard *)
+	?SetSocket@TPBusCallBack@@QAEXH@Z @ 63 NONAME ; public: void __thiscall TPBusCallBack::SetSocket(int)
+	?SetState@DPBusPsuBase@@QAEHW4TPBusPsuState@@@Z @ 64 NONAME ; public: int __thiscall DPBusPsuBase::SetState(enum TPBusPsuState)
+	?SetupCIMEraseGroup@DMMCSession@@QAEXVTMMCArgument@@K@Z @ 65 NONAME ; public: void __thiscall DMMCSession::SetupCIMEraseGroup(class TMMCArgument,unsigned long)
+	?SetupCIMEraseSector@DMMCSession@@QAEXVTMMCArgument@@K@Z @ 66 NONAME ; public: void __thiscall DMMCSession::SetupCIMEraseSector(class TMMCArgument,unsigned long)
+	?SetupCIMLockUnlock@DMMCSession@@QAEXKPAE@Z @ 67 NONAME ; public: void __thiscall DMMCSession::SetupCIMLockUnlock(unsigned long,unsigned char *)
+	?SetupCIMReadBlock@DMMCSession@@QAEXVTMMCArgument@@KPAE@Z @ 68 NONAME ; public: void __thiscall DMMCSession::SetupCIMReadBlock(class TMMCArgument,unsigned long,unsigned char *)
+	?SetupCIMReadIO@DMMCSession@@QAEXEKPAE@Z @ 69 NONAME ; public: void __thiscall DMMCSession::SetupCIMReadIO(unsigned char,unsigned long,unsigned char *)
+	?SetupCIMReadMBlock@DMMCSession@@QAEXVTMMCArgument@@KPAEK@Z @ 70 NONAME ; public: void __thiscall DMMCSession::SetupCIMReadMBlock(class TMMCArgument,unsigned long,unsigned char *,unsigned long)
+	?SetupCIMWriteBlock@DMMCSession@@QAEXVTMMCArgument@@KPAE@Z @ 71 NONAME ; public: void __thiscall DMMCSession::SetupCIMWriteBlock(class TMMCArgument,unsigned long,unsigned char *)
+	?SetupCIMWriteIO@DMMCSession@@QAEXEKPAE@Z @ 72 NONAME ; public: void __thiscall DMMCSession::SetupCIMWriteIO(unsigned char,unsigned long,unsigned char *)
+	?SetupCIMWriteMBlock@DMMCSession@@QAEXVTMMCArgument@@KPAEK@Z @ 73 NONAME ; public: void __thiscall DMMCSession::SetupCIMWriteMBlock(class TMMCArgument,unsigned long,unsigned char *,unsigned long)
+	?SetupCommand@DMMCSession@@QAEXW4TMMCCommandEnum@@VTMMCArgument@@@Z @ 74 NONAME ; public: void __thiscall DMMCSession::SetupCommand(enum TMMCCommandEnum,class TMMCArgument)
+	?SetupDTCommand@DMMCSession@@QAEXW4TMMCCommandEnum@@VTMMCArgument@@KPAEKHW4TMMCCmdDirEnum@@K@Z @ 75 NONAME ; public: void __thiscall DMMCSession::SetupDTCommand(enum TMMCCommandEnum,class TMMCArgument,unsigned long,unsigned char *,unsigned long,int,enum TMMCCmdDirEnum,unsigned long)
+	?SetupRSCommand@DMMCSession@@QAEXW4TMMCCommandEnum@@VTMMCArgument@@KW4TMMCCommandTypeEnum@@W4TMMCResponseTypeEnum@@K@Z @ 76 NONAME ; public: void __thiscall DMMCSession::SetupRSCommand(enum TMMCCommandEnum,class TMMCArgument,unsigned long,enum TMMCCommandTypeEnum,enum TMMCResponseTypeEnum,unsigned long)
+	?SocketFromId@DPBusSocket@@SAPAV1@H@Z @ 77 NONAME ; public: static class DPBusSocket * __cdecl DPBusSocket::SocketFromId(int)
+	?Stop@DMMCStack@@QAEHPAVTMMCard@@@Z @ 78 NONAME ; public: int __thiscall DMMCStack::Stop(class TMMCard *)
+	?UnBlock@DMMCStack@@IAEXPAVDMMCSession@@KK@Z @ 79 NONAME ; protected: void __thiscall DMMCStack::UnBlock(class DMMCSession *,unsigned long,unsigned long)
+	?WriteBlockLength@TCSD@@QBEIXZ @ 80 NONAME ; public: unsigned int __thiscall TCSD::WriteBlockLength(void)const 
+	?WriteProtected@DMMCStack@@MAEHI@Z @ 81 NONAME ; protected: virtual int __thiscall DMMCStack::WriteProtected(unsigned int)
+	?Create@DMMCMediaChange@@UAEHXZ @ 82 NONAME ; public: virtual int __thiscall DMMCMediaChange::Create(void)
+	?AllocSession@DMMCStack@@UBEPAVDMMCSession@@ABVTMMCCallBack@@@Z @ 83 NONAME ; public: virtual class DMMCSession * __thiscall DMMCStack::AllocSession(class TMMCCallBack const &)const 
+	?CIMReadWriteBlocksSMST@DMMCStack@@KAKPAX@Z @ 84 NONAME ; protected: static unsigned long __cdecl DMMCStack::CIMReadWriteBlocksSMST(void *)
+	?CardRCA@DMMCSession@@QAE?AVTRCA@@XZ @ 85 NONAME ; public: class TRCA  __thiscall DMMCSession::CardRCA(void)
+	?FillCommandArgs@DMMCSession@@QAEXVTMMCArgument@@KPAEK@Z @ 86 NONAME ; public: void __thiscall DMMCSession::FillCommandArgs(class TMMCArgument,unsigned long,unsigned char *,unsigned long)
+	?FillCommandDesc@DMMCSession@@QAEXW4TMMCCommandEnum@@@Z @ 87 NONAME ; public: void __thiscall DMMCSession::FillCommandDesc(enum TMMCCommandEnum)
+	?FillCommandDesc@DMMCSession@@QAEXW4TMMCCommandEnum@@VTMMCArgument@@@Z @ 88 NONAME ; public: void __thiscall DMMCSession::FillCommandDesc(enum TMMCCommandEnum,class TMMCArgument)
+	?FillCommandDesc@DMMCSession@@QAEXXZ @ 89 NONAME ; public: void __thiscall DMMCSession::FillCommandDesc(void)
+	?GetMacro@DMMCSession@@MBEP6AKPAX@ZH@Z @ 90 NONAME ; protected: virtual unsigned long (__cdecl*__thiscall DMMCSession::GetMacro(int)const )(void *)
+	?IssueMMCCommandSMST@DMMCStack@@KAKPAX@Z @ 91 NONAME ; protected: static unsigned long __cdecl DMMCStack::IssueMMCCommandSMST(void *)
+	?InitStackAfterUnlockSM@DMMCStack@@MAEKXZ @ 92 NONAME ; protected: virtual unsigned long __thiscall DMMCStack::InitStackAfterUnlockSM(void)
+	?PowerDownComplete@DPBusSocket@@QAEXXZ @ 93 NONAME ; public: void __thiscall DPBusSocket::PowerDownComplete(void)
+	?RegisterMediaDevices@TMMCardControllerInterface@@MAEHH@Z @ 94 NONAME ; protected: virtual int __thiscall TMMCardControllerInterface::RegisterMediaDevices(int)
+	?RequestAsyncPowerDown@DPBusSocket@@QAEXXZ @ 95 NONAME ; public: void __thiscall DPBusSocket::RequestAsyncPowerDown(void)
+	?ControlIO@DPBusSocket@@UAEHHPAX0@Z @ 96 NONAME ; public: virtual int __thiscall DPBusSocket::ControlIO(int,void *,void *)
+	?Dummy1@DMMCStack@@EAEXXZ @ 97 NONAME ; private: virtual void __thiscall DMMCStack::Dummy1(void)
+	?GetInterface@DMMCStack@@MAEXW4TInterfaceId@1@AAPAVMInterface@1@@Z @ 98 NONAME ; protected: virtual void __thiscall DMMCStack::GetInterface(enum DMMCStack::TInterfaceId,class DMMCStack::MInterface * &)
+	?MachineInfo@DMMCStack@@UAEXAAVTDes8@@@Z @ 99 NONAME ; public: virtual void __thiscall DMMCStack::MachineInfo(class TDes8 &)
+	?SetBusWidth@DMMCStack@@MAEXK@Z @ 100 NONAME ; protected: virtual void __thiscall DMMCStack::SetBusWidth(unsigned long)
+	?ModifyCardCapabilitySM@DMMCStack@@MAEKXZ @ 101 NONAME ; protected: virtual unsigned long __thiscall DMMCStack::ModifyCardCapabilitySM(void)
+	?AcquireStackSM@DSDStack@@UAEKXZ @ 102 NONAME ; public: virtual unsigned long __thiscall DSDStack::AcquireStackSM(void)
+	?AllocCards@TSDCardArray@@UAEHXZ @ 103 NONAME ; public: virtual int __thiscall TSDCardArray::AllocCards(void)
+	?AllocSession@DSDStack@@UBEPAVDMMCSession@@ABVTMMCCallBack@@@Z @ 104 NONAME ; public: virtual class DMMCSession * __thiscall DSDStack::AllocSession(class TMMCCallBack const &)const 
+	?CIMReadWriteBlocksSM@DSDStack@@UAEKXZ @ 105 NONAME ; public: virtual unsigned long __thiscall DSDStack::CIMReadWriteBlocksSM(void)
+	?DeclareCardAsGone@TSDCardArray@@UAEXI@Z @ 106 NONAME ; public: virtual void __thiscall TSDCardArray::DeclareCardAsGone(unsigned int)
+	?Dummy1@DSDStack@@EAEXXZ @ 107 NONAME ; private: virtual void __thiscall DSDStack::Dummy1(void)
+	?Dummy2@DSDStack@@EAEXXZ @ 108 NONAME ; private: virtual void __thiscall DSDStack::Dummy2(void)
+	?Dummy3@DSDStack@@EAEXXZ @ 109 NONAME ; private: virtual void __thiscall DSDStack::Dummy3(void)
+	?CardType@DSDStack@@UAE?AW4TSDCardType@1@HH@Z @ 110 NONAME ; public: virtual enum DSDStack::TSDCardType __thiscall DSDStack::CardType(int,int)
+	?Init@DSDStack@@UAEHXZ @ 111 NONAME ; public: virtual int __thiscall DSDStack::Init(void)
+	?InitStackAfterUnlockSM@DSDStack@@MAEKXZ @ 112 NONAME ; protected: virtual unsigned long __thiscall DSDStack::InitStackAfterUnlockSM(void)
+	?ModifyCardCapabilitySM@DSDStack@@MAEKXZ @ 113 NONAME ; protected: virtual unsigned long __thiscall DSDStack::ModifyCardCapabilitySM(void)
+	?DummyExport10@DDummySession@@AAEXXZ @ 114 NONAME ; private: void __thiscall DDummySession::DummyExport10(void)
+	?DummyExport11@DDummySession@@AAEXXZ @ 115 NONAME ; private: void __thiscall DDummySession::DummyExport11(void)
+	?DummyExport12@DDummySession@@AAEXXZ @ 116 NONAME ; private: void __thiscall DDummySession::DummyExport12(void)
+	?DummyExport13@DDummySession@@AAEXXZ @ 117 NONAME ; private: void __thiscall DDummySession::DummyExport13(void)
+	?DummyExport14@DDummySession@@AAEXXZ @ 118 NONAME ; private: void __thiscall DDummySession::DummyExport14(void)
+	?DummyExport15@DDummySession@@AAEXXZ @ 119 NONAME ; private: void __thiscall DDummySession::DummyExport15(void)
+	?DummyExport1@DDummySession@@AAEXXZ @ 120 NONAME ; private: void __thiscall DDummySession::DummyExport1(void)
+	?DummyExport2@DDummySession@@AAEXXZ @ 121 NONAME ; private: void __thiscall DDummySession::DummyExport2(void)
+	?DummyExport3@DDummySession@@AAEXXZ @ 122 NONAME ; private: void __thiscall DDummySession::DummyExport3(void)
+	?DummyExport4@DDummySession@@AAEXXZ @ 123 NONAME ; private: void __thiscall DDummySession::DummyExport4(void)
+	?DummyExport5@DDummySession@@AAEXXZ @ 124 NONAME ; private: void __thiscall DDummySession::DummyExport5(void)
+	?DummyExport6@DDummySession@@AAEXXZ @ 125 NONAME ; private: void __thiscall DDummySession::DummyExport6(void)
+	?DummyExport7@DDummySession@@AAEXXZ @ 126 NONAME ; private: void __thiscall DDummySession::DummyExport7(void)
+	?DummyExport8@DDummySession@@AAEXXZ @ 127 NONAME ; private: void __thiscall DDummySession::DummyExport8(void)
+	?DummyExport9@DDummySession@@AAEXXZ @ 128 NONAME ; private: void __thiscall DDummySession::DummyExport9(void)
+	??0DSDIOPsu@@QAE@HH@Z @ 129 NONAME ; public: __thiscall DSDIOPsu::DSDIOPsu(int,int)
+	??0DSDIORegisterInterface@@QAE@PAVTSDIOCard@@E@Z @ 130 NONAME ; public: __thiscall DSDIORegisterInterface::DSDIORegisterInterface(class TSDIOCard *,unsigned char)
+	??0DSDIORegisterInterface@@QAE@PAVTSDIOCard@@EPAVDMutex@@@Z @ 131 NONAME ; public: __thiscall DSDIORegisterInterface::DSDIORegisterInterface(class TSDIOCard *,unsigned char,class DMutex *)
+	??0DSDIOSocket@@QAE@HPAVTMMCPasswordStore@@@Z @ 132 NONAME ; public: __thiscall DSDIOSocket::DSDIOSocket(int,class TMMCPasswordStore *)
+	??0TCisReader@@QAE@XZ @ 133 NONAME ; public: __thiscall TCisReader::TCisReader(void)
+	??0TSDIOCardConfig@@QAE@XZ @ 134 NONAME ; public: __thiscall TSDIOCardConfig::TSDIOCardConfig(void)
+	??0TSDIOFunction@@QAE@PAVTSDIOCard@@E@Z @ 135 NONAME ; public: __thiscall TSDIOFunction::TSDIOFunction(class TSDIOCard *,unsigned char)
+	??0TSDIOInterrupt@@QAE@PAVTSDIOInterruptController@@E@Z @ 136 NONAME ; public: __thiscall TSDIOInterrupt::TSDIOInterrupt(class TSDIOInterruptController *,unsigned char)
+	??1DSDIORegisterInterface@@UAE@XZ @ 137 NONAME ; public: virtual __thiscall DSDIORegisterInterface::~DSDIORegisterInterface(void)
+	??1TSDIOFunction@@QAE@XZ @ 138 NONAME ; public: __thiscall TSDIOFunction::~TSDIOFunction(void)
+	??1TSDIOInterrupt@@QAE@XZ @ 139 NONAME ; public: __thiscall TSDIOInterrupt::~TSDIOInterrupt(void)
+	?AcquireStackSM@DSDIOStack@@MAEKXZ @ 140 NONAME ; protected: virtual unsigned long __thiscall DSDIOStack::AcquireStackSM(void)
+	?AllocCards@TSDIOCardArray@@UAEHXZ @ 141 NONAME ; public: virtual int __thiscall TSDIOCardArray::AllocCards(void)
+	?AllocSession@DSDIOStack@@UBEPAVDMMCSession@@ABVTMMCCallBack@@@Z @ 142 NONAME ; public: virtual class DMMCSession * __thiscall DSDIOStack::AllocSession(class TMMCCallBack const &)const 
+	?Bind@TSDIOInterrupt@@QAEHP6AXPAX@Z0@Z @ 143 NONAME ; public: int __thiscall TSDIOInterrupt::Bind(void (__cdecl*)(void *),void *)
+	?BlockIOSession@DSDIOStack@@IAEXW4TSDIOBlockingCondition@1@@Z @ 144 NONAME ; protected: void __thiscall DSDIOStack::BlockIOSession(enum DSDIOStack::TSDIOBlockingCondition)
+	?CIMIoModifySM@DSDIOStack@@IAEKXZ @ 145 NONAME ; protected: unsigned long __thiscall DSDIOStack::CIMIoModifySM(void)
+	?CIMIoReadWriteDirectSM@DSDIOStack@@IAEKXZ @ 146 NONAME ; protected: unsigned long __thiscall DSDIOStack::CIMIoReadWriteDirectSM(void)
+	?CIMIoReadWriteExtendedSM@DSDIOStack@@IAEKXZ @ 147 NONAME ; protected: unsigned long __thiscall DSDIOStack::CIMIoReadWriteExtendedSM(void)
+	?CIMReadWriteBlocksSM@DSDIOStack@@MAEKXZ @ 148 NONAME ; protected: virtual unsigned long __thiscall DSDIOStack::CIMReadWriteBlocksSM(void)
+	?CapabilitiesMatch@TSDIOFunctionCaps@@QAEHAAV1@K@Z @ 149 NONAME ; public: int __thiscall TSDIOFunctionCaps::CapabilitiesMatch(class TSDIOFunctionCaps &,unsigned long)
+	?CheckCIS@TSDIOCard@@QAEHXZ @ 150 NONAME ; public: int __thiscall TSDIOCard::CheckCIS(void)
+	?DeclareCardAsGone@TSDIOCardArray@@UAEXI@Z @ 151 NONAME ; public: virtual void __thiscall TSDIOCardArray::DeclareCardAsGone(unsigned int)
+	?DeregisterClient@TSDIOFunction@@QAEHPAVDBase@@@Z @ 152 NONAME ; public: int __thiscall TSDIOFunction::DeregisterClient(class DBase *)
+	?Disable@TSDIOFunction@@QAEHXZ @ 153 NONAME ; public: int __thiscall TSDIOFunction::Disable(void)
+	?Disable@TSDIOInterrupt@@QAEHXZ @ 154 NONAME ; public: int __thiscall TSDIOInterrupt::Disable(void)
+	?DoCreate@DSDIOPsu@@UAEHXZ @ 155 NONAME ; public: virtual int __thiscall DSDIOPsu::DoCreate(void)
+	?DoTickService@DSDIOPsu@@UAEXXZ @ 156 NONAME ; public: virtual void __thiscall DSDIOPsu::DoTickService(void)
+	?Dummy1@DSDIOStack@@EAEXXZ @ 157 NONAME ; private: virtual void __thiscall DSDIOStack::Dummy1(void)
+	?Dummy2@DSDIOStack@@EAEXXZ @ 158 NONAME ; private: virtual void __thiscall DSDIOStack::Dummy2(void)
+	?Dummy3@DSDIOStack@@EAEXXZ @ 159 NONAME ; private: virtual void __thiscall DSDIOStack::Dummy3(void)
+	?Dummy4@DSDIOStack@@EAEXXZ @ 160 NONAME ; private: virtual void __thiscall DSDIOStack::Dummy4(void)
+	?Enable@TSDIOFunction@@QAEHH@Z @ 161 NONAME ; public: int __thiscall TSDIOFunction::Enable(int)
+	?Enable@TSDIOInterrupt@@QAEHXZ @ 162 NONAME ; public: int __thiscall TSDIOInterrupt::Enable(void)
+	?FillAppCommandDesc@DSDIOSession@@CAXAAVTMMCCommandDesc@@@Z @ 163 NONAME ; private: static void __cdecl DSDIOSession::FillAppCommandDesc(class TMMCCommandDesc &)
+	?FillAppCommandDesc@DSDIOSession@@SAXAAVTMMCCommandDesc@@W4TSDIOAppCmd@@@Z @ 164 NONAME ; public: static void __cdecl DSDIOSession::FillAppCommandDesc(class TMMCCommandDesc &,enum TSDIOAppCmd)
+	?FillAppCommandDesc@DSDIOSession@@SAXAAVTMMCCommandDesc@@W4TSDIOAppCmd@@VTMMCArgument@@@Z @ 165 NONAME ; public: static void __cdecl DSDIOSession::FillAppCommandDesc(class TMMCCommandDesc &,enum TSDIOAppCmd,class TMMCArgument)
+	?FindFunction@TSDIOCard@@QBEPAVTSDIOFunction@@AAVTSDIOFunctionCaps@@KPAV2@@Z @ 166 NONAME ; public: class TSDIOFunction * __thiscall TSDIOCard::FindFunction(class TSDIOFunctionCaps &,unsigned long,class TSDIOFunction *)const 
+	?FindReadCommonConfig@TCisReader@@QAEHAAVTSDIOCardConfig@@@Z @ 167 NONAME ; public: int __thiscall TCisReader::FindReadCommonConfig(class TSDIOCardConfig &)
+	?FindReadFunctionConfig@TCisReader@@QAEHAAVTSDIOFunctionCaps@@@Z @ 168 NONAME ; public: int __thiscall TCisReader::FindReadFunctionConfig(class TSDIOFunctionCaps &)
+	?FindReadTuple@TCisReader@@QAEHEAAVTDes8@@I@Z @ 169 NONAME ; public: int __thiscall TCisReader::FindReadTuple(unsigned char,class TDes8 &,unsigned int)
+	?GetMacro@DSDIOSession@@MBEP6AKPAX@ZH@Z @ 170 NONAME ; protected: virtual unsigned long (__cdecl*__thiscall DSDIOSession::GetMacro(int)const )(void *)
+	?HandleSDIOInterrupt@DSDIOStack@@IAEXI@Z @ 171 NONAME ; protected: void __thiscall DSDIOStack::HandleSDIOInterrupt(unsigned int)
+	?Init@DSDIOStack@@UAEHXZ @ 172 NONAME ; public: virtual int __thiscall DSDIOStack::Init(void)
+	?IsLocked@DSDIOPsu@@UAEHXZ @ 173 NONAME ; public: virtual int __thiscall DSDIOPsu::IsLocked(void)
+	?IsReady@TSDIOFunction@@QAEHAAH@Z @ 174 NONAME ; public: int __thiscall TSDIOFunction::IsReady(int &)
+	?Modify8@DSDIORegisterInterface@@QAEHKEEPAE@Z @ 175 NONAME ; public: int __thiscall DSDIORegisterInterface::Modify8(unsigned long,unsigned char,unsigned char,unsigned char *)
+	?ModifyCardCapabilitySM@DSDIOStack@@MAEKXZ @ 176 NONAME ; protected: virtual unsigned long __thiscall DSDIOStack::ModifyCardCapabilitySM(void)
+	?Read8@DSDIORegisterInterface@@QAEHKPAE@Z @ 177 NONAME ; public: int __thiscall DSDIORegisterInterface::Read8(unsigned long,unsigned char *)
+	?ReadMultiple8@DSDIORegisterInterface@@QAEHKPAEKH@Z @ 178 NONAME ; public: int __thiscall DSDIORegisterInterface::ReadMultiple8(unsigned long,unsigned char *,unsigned long,int)
+	?ReadTuple@TCisReader@@QAEHAAVTDes8@@@Z @ 179 NONAME ; public: int __thiscall TCisReader::ReadTuple(class TDes8 &)
+	?Register@TSDIOFunctionCallback@@QAEXPAVDMMCSocket@@@Z @ 180 NONAME ; public: void __thiscall TSDIOFunctionCallback::Register(class DMMCSocket *)
+	?RegisterClient@TSDIOFunction@@QAEHPAVDBase@@PAVDMutex@@@Z @ 181 NONAME ; public: int __thiscall TSDIOFunction::RegisterClient(class DBase *,class DMutex *)
+	?RegisterMediaDevices@TSDIOCardControllerInterface@@MAEHH@Z @ 182 NONAME ; protected: virtual int __thiscall TSDIOCardControllerInterface::RegisterMediaDevices(int)
+	?RequestAsyncSleep@DSDIOSocket@@QAEXXZ @ 183 NONAME ; public: void __thiscall DSDIOSocket::RequestAsyncSleep(void)
+	?Restart@TCisReader@@QAEHXZ @ 184 NONAME ; public: int __thiscall TCisReader::Restart(void)
+	?SelectCis@TCisReader@@QAEHIIIE@Z @ 185 NONAME ; public: int __thiscall TCisReader::SelectCis(unsigned int,unsigned int,unsigned int,unsigned char)
+	?SetAsync@DSDIORegisterInterface@@QAEHAAVTMMCCallBack@@@Z @ 186 NONAME ; public: int __thiscall DSDIORegisterInterface::SetAsync(class TMMCCallBack &)
+	?SetPriority@TSDIOFunction@@QAEHW4TSDIOFunctionPriority@@@Z @ 187 NONAME ; public: int __thiscall TSDIOFunction::SetPriority(enum TSDIOFunctionPriority)
+	?SetSync@DSDIORegisterInterface@@QAEHXZ @ 188 NONAME ; public: int __thiscall DSDIORegisterInterface::SetSync(void)
+	?SetupCIMIoModify@DSDIOSession@@QAEXKEEPAE@Z @ 189 NONAME ; public: void __thiscall DSDIOSession::SetupCIMIoModify(unsigned long,unsigned char,unsigned char,unsigned char *)
+	?SetupCIMIoRead@DSDIOSession@@QAEXKPAE@Z @ 190 NONAME ; public: void __thiscall DSDIOSession::SetupCIMIoRead(unsigned long,unsigned char *)
+	?SetupCIMIoReadMultiple@DSDIOSession@@QAEXKKPAEH@Z @ 191 NONAME ; public: void __thiscall DSDIOSession::SetupCIMIoReadMultiple(unsigned long,unsigned long,unsigned char *,int)
+	?SetupCIMIoWrite@DSDIOSession@@QAEXKEPAE@Z @ 192 NONAME ; public: void __thiscall DSDIOSession::SetupCIMIoWrite(unsigned long,unsigned char,unsigned char *)
+	?SetupCIMIoWriteMultiple@DSDIOSession@@QAEXKKPAEH@Z @ 193 NONAME ; public: void __thiscall DSDIOSession::SetupCIMIoWriteMultiple(unsigned long,unsigned long,unsigned char *,int)
+	?SleepComplete@DSDIOSocket@@QAEXXZ @ 194 NONAME ; public: void __thiscall DSDIOSocket::SleepComplete(void)
+	?Unbind@TSDIOInterrupt@@QAEHXZ @ 195 NONAME ; public: int __thiscall TSDIOInterrupt::Unbind(void)
+	?UnblockIOSession@DSDIOStack@@IAEPAVDSDIOSession@@W4TSDIOBlockingCondition@1@K@Z @ 196  NONAME ; protected: class DSDIOSession * __thiscall DSDIOStack::UnblockIOSession(enum DSDIOStack::TSDIOBlockingCondition,unsigned long)
+	?Write8@DSDIORegisterInterface@@QAEHKEPAE@Z @ 197 NONAME ; public: int __thiscall DSDIORegisterInterface::Write8(unsigned long,unsigned char,unsigned char *)
+	?WriteMultiple8@DSDIORegisterInterface@@QAEHKPAEKH@Z @ 198 NONAME ; public: int __thiscall DSDIORegisterInterface::WriteMultiple8(unsigned long,unsigned char *,unsigned long,int)
+	??1DSDIOSession@@UAE@XZ @ 199  NONAME ; public: virtual __thiscall DSDIOSession::~DSDIOSession(void)
+	?Dummy1@DSDIOPsu@@EAEXXZ @ 200  NONAME ; private: virtual void __thiscall DSDIOPsu::Dummy1(void)
+	?Dummy1@DSDIOSession@@EAEXXZ @ 201  NONAME ; private: virtual void __thiscall DSDIOSession::Dummy1(void)
+	?Dummy2@DSDIOPsu@@EAEXXZ @ 202  NONAME ; private: virtual void __thiscall DSDIOPsu::Dummy2(void)
+	?Dummy2@DSDIOSession@@EAEXXZ @ 203  NONAME ; private: virtual void __thiscall DSDIOSession::Dummy2(void)
+	?Dummy3@DSDIOPsu@@EAEXXZ @ 204  NONAME ; private: virtual void __thiscall DSDIOPsu::Dummy3(void)
+	?Dummy3@DSDIOSession@@EAEXXZ @ 205  NONAME ; private: virtual void __thiscall DSDIOSession::Dummy3(void)
+	?Dummy4@DSDIOPsu@@EAEXXZ @ 206  NONAME ; private: virtual void __thiscall DSDIOPsu::Dummy4(void)
+	?Dummy4@DSDIOSession@@EAEXXZ @ 207  NONAME ; private: virtual void __thiscall DSDIOSession::Dummy4(void)
+	?MachineInfo@DMMCStack@@UAEXAAVTDes8@@@Z @ 208  NONAME ; public: virtual void __thiscall DMMCStack::MachineInfo(class TDes8 &)
+	?Modify8@DSDIORegisterInterface@@QAEHKEE@Z @ 209  NONAME ; public: int __thiscall DSDIORegisterInterface::Modify8(unsigned long,unsigned char,unsigned char)
+	?ReadMultiple8@DSDIORegisterInterface@@QAEHKPAEK@Z @ 210  NONAME ; public: int __thiscall DSDIORegisterInterface::ReadMultiple8(unsigned long,unsigned char *,unsigned long)
+	?ReadMultiple8@DSDIORegisterInterface@@QAEHKPAVDChunk@@KK@Z @ 211  NONAME ; public: int __thiscall DSDIORegisterInterface::ReadMultiple8(unsigned long,class DChunk *,unsigned long,unsigned long)
+	?ReadMultiple8@DSDIORegisterInterface@@QAEHKPAVDChunk@@KKH@Z @ 212  NONAME ; public: int __thiscall DSDIORegisterInterface::ReadMultiple8(unsigned long,class DChunk *,unsigned long,unsigned long,int)
+	?Write8@DSDIORegisterInterface@@QAEHKE@Z @ 213  NONAME ; public: int __thiscall DSDIORegisterInterface::Write8(unsigned long,unsigned char)
+	?WriteMultiple8@DSDIORegisterInterface@@QAEHKPAEK@Z @ 214  NONAME ; public: int __thiscall DSDIORegisterInterface::WriteMultiple8(unsigned long,unsigned char *,unsigned long)
+	?WriteMultiple8@DSDIORegisterInterface@@QAEHKPAVDChunk@@KK@Z @ 215  NONAME ; public: int __thiscall DSDIORegisterInterface::WriteMultiple8(unsigned long,class DChunk *,unsigned long,unsigned long)
+	?WriteMultiple8@DSDIORegisterInterface@@QAEHKPAVDChunk@@KKH@Z @ 216  NONAME ; public: int __thiscall DSDIORegisterInterface::WriteMultiple8(unsigned long,class DChunk *,unsigned long,unsigned long,int)
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/eabi/sdcard3c/epbusmu.def	Wed Mar 31 23:38:45 2010 +0300
@@ -0,0 +1,147 @@
+EXPORTS
+	_ZN10DMMCSocket5PanicENS_9TMMCPanicE @ 1 NONAME ; DMMCSocket::Panic(DMMCSocket::TMMCPanic)
+	_ZN10DMMCSocketC1EiP17TMMCPasswordStore @ 2 NONAME ; DMMCSocket::DMMCSocket(int, TMMCPasswordStore*)
+	_ZN10DMMCSocketC2EiP17TMMCPasswordStore @ 3 NONAME ; DMMCSocket::DMMCSocket(int, TMMCPasswordStore*)
+	_ZN11DMMCSession12SetupCommandE15TMMCCommandEnum12TMMCArgument @ 4 NONAME ; DMMCSession::SetupCommand(TMMCCommandEnum, TMMCArgument)
+	_ZN11DMMCSession14SetupCIMReadIOEhmPh @ 5 NONAME ; DMMCSession::SetupCIMReadIO(unsigned char, unsigned long, unsigned char*)
+	_ZN11DMMCSession14SetupDTCommandE15TMMCCommandEnum12TMMCArgumentmPhmi14TMMCCmdDirEnumm @ 6 NONAME ; DMMCSession::SetupDTCommand(TMMCCommandEnum, TMMCArgument, unsigned long, unsigned char*, unsigned long, int, TMMCCmdDirEnum, unsigned long)
+	_ZN11DMMCSession14SetupRSCommandE15TMMCCommandEnum12TMMCArgumentm19TMMCCommandTypeEnum20TMMCResponseTypeEnumm @ 7 NONAME ; DMMCSession::SetupRSCommand(TMMCCommandEnum, TMMCArgument, unsigned long, TMMCCommandTypeEnum, TMMCResponseTypeEnum, unsigned long)
+	_ZN11DMMCSession15FillCommandArgsE12TMMCArgumentmPhm @ 8 NONAME ; DMMCSession::FillCommandArgs(TMMCArgument, unsigned long, unsigned char*, unsigned long)
+	_ZN11DMMCSession15FillCommandDescE15TMMCCommandEnum @ 9 NONAME ; DMMCSession::FillCommandDesc(TMMCCommandEnum)
+	_ZN11DMMCSession15FillCommandDescE15TMMCCommandEnum12TMMCArgument @ 10 NONAME ; DMMCSession::FillCommandDesc(TMMCCommandEnum, TMMCArgument)
+	_ZN11DMMCSession15FillCommandDescEv @ 11 NONAME ; DMMCSession::FillCommandDesc()
+	_ZN11DMMCSession15SetupCIMWriteIOEhmPh @ 12 NONAME ; DMMCSession::SetupCIMWriteIO(unsigned char, unsigned long, unsigned char*)
+	_ZN11DMMCSession17SetupCIMReadBlockE12TMMCArgumentmPh @ 13 NONAME ; DMMCSession::SetupCIMReadBlock(TMMCArgument, unsigned long, unsigned char*)
+	_ZN11DMMCSession18SetupCIMEraseGroupE12TMMCArgumentm @ 14 NONAME ; DMMCSession::SetupCIMEraseGroup(TMMCArgument, unsigned long)
+	_ZN11DMMCSession18SetupCIMLockUnlockEmPh @ 15 NONAME ; DMMCSession::SetupCIMLockUnlock(unsigned long, unsigned char*)
+	_ZN11DMMCSession18SetupCIMReadMBlockE12TMMCArgumentmPhm @ 16 NONAME ; DMMCSession::SetupCIMReadMBlock(TMMCArgument, unsigned long, unsigned char*, unsigned long)
+	_ZN11DMMCSession18SetupCIMWriteBlockE12TMMCArgumentmPh @ 17 NONAME ; DMMCSession::SetupCIMWriteBlock(TMMCArgument, unsigned long, unsigned char*)
+	_ZN11DMMCSession19SetupCIMEraseSectorE12TMMCArgumentm @ 18 NONAME ; DMMCSession::SetupCIMEraseSector(TMMCArgument, unsigned long)
+	_ZN11DMMCSession19SetupCIMWriteMBlockE12TMMCArgumentmPhm @ 19 NONAME ; DMMCSession::SetupCIMWriteMBlock(TMMCArgument, unsigned long, unsigned char*, unsigned long)
+	_ZN11DMMCSession6EngageEv @ 20 NONAME ; DMMCSession::Engage()
+	_ZN11DMMCSession7CardRCAEv @ 21 NONAME ; DMMCSession::CardRCA()
+	_ZN11DMMCSession7SetCardEP7TMMCard @ 22 NONAME ; DMMCSession::SetCard(TMMCard*)
+	_ZN11DMMCSessionC1ERK12TMMCCallBack @ 23 NONAME ; DMMCSession::DMMCSession(TMMCCallBack const&)
+	_ZN11DMMCSessionC2ERK12TMMCCallBack @ 24 NONAME ; DMMCSession::DMMCSession(TMMCCallBack const&)
+	_ZN11DMMCSessionD0Ev @ 25 NONAME ; DMMCSession::~DMMCSession()
+	_ZN11DMMCSessionD1Ev @ 26 NONAME ; DMMCSession::~DMMCSession()
+	_ZN11DMMCSessionD2Ev @ 27 NONAME ; DMMCSession::~DMMCSession()
+	_ZN11DPBusSocket10InCriticalEv @ 28 NONAME ; DPBusSocket::InCritical()
+	_ZN11DPBusSocket12SocketFromIdEi @ 29 NONAME ; DPBusSocket::SocketFromId(int)
+	_ZN11DPBusSocket13EndInCriticalEv @ 30 NONAME ; DPBusSocket::EndInCritical()
+	_ZN11DPBusSocket16ForceMediaChangeEv @ 31 NONAME ; DPBusSocket::ForceMediaChange()
+	_ZN11DPBusSocket17PowerDownCompleteEv @ 32 NONAME ; DPBusSocket::PowerDownComplete()
+	_ZN11DPBusSocket21RequestAsyncPowerDownEv @ 33 NONAME ; DPBusSocket::RequestAsyncPowerDown()
+	_ZN11DPBusSocket23DeltaCurrentConsumptionEi @ 34 NONAME ; DPBusSocket::DeltaCurrentConsumption(int)
+	_ZN11DPBusSocket23PowerUpSequenceCompleteEi @ 35 NONAME ; DPBusSocket::PowerUpSequenceComplete(int)
+	_ZN11DPBusSocket3AddEP13TPBusCallBack @ 36 NONAME ; DPBusSocket::Add(TPBusCallBack*)
+	_ZN11DPBusSocket5PanicENS_6TPanicE @ 37 NONAME ; DPBusSocket::Panic(DPBusSocket::TPanic)
+	_ZN11DPBusSocket7PowerUpEv @ 38 NONAME ; DPBusSocket::PowerUp()
+	_ZN12DPBusPsuBase13DoTickServiceEv @ 39 NONAME ; DPBusPsuBase::DoTickService()
+	_ZN12DPBusPsuBase25ReceiveVoltageCheckResultEi @ 40 NONAME ; DPBusPsuBase::ReceiveVoltageCheckResult(int)
+	_ZN12DPBusPsuBase8DoCreateEv @ 41 NONAME ; DPBusPsuBase::DoCreate()
+	_ZN12DPBusPsuBase8IsLockedEv @ 42 NONAME ; DPBusPsuBase::IsLocked()
+	_ZN12DPBusPsuBase8SetStateE13TPBusPsuState @ 43 NONAME ; DPBusPsuBase::SetState(TPBusPsuState)
+	_ZN12TMMCardArray10AddNewCardEPKhP4TRCA @ 44 NONAME ; TMMCardArray::AddNewCard(unsigned char const*, TRCA*)
+	_ZN12TMMCardArray10AllocCardsEv @ 45 NONAME ; TMMCardArray::AllocCards()
+	_ZN12TMMCardArray17DeclareCardAsGoneEj @ 46 NONAME ; TMMCardArray::DeclareCardAsGone(unsigned int)
+	_ZN13TPBusCallBack6RemoveEv @ 47 NONAME ; TPBusCallBack::Remove()
+	_ZN13TPBusCallBack9SetSocketEi @ 48 NONAME ; TPBusCallBack::SetSocket(int)
+	_ZN13TPBusCallBackC1EPFvPviES0_j @ 49 NONAME ; TPBusCallBack::TPBusCallBack(void (*)(void*, int), void*, unsigned int)
+	_ZN13TPBusCallBackC1EPFvPviS0_S0_ES0_ @ 50 NONAME ; TPBusCallBack::TPBusCallBack(void (*)(void*, int, void*, void*), void*)
+	_ZN13TPBusCallBackC1Ev @ 51 NONAME ; TPBusCallBack::TPBusCallBack()
+	_ZN13TPBusCallBackC2EPFvPviES0_j @ 52 NONAME ; TPBusCallBack::TPBusCallBack(void (*)(void*, int), void*, unsigned int)
+	_ZN13TPBusCallBackC2EPFvPviS0_S0_ES0_ @ 53 NONAME ; TPBusCallBack::TPBusCallBack(void (*)(void*, int, void*, void*), void*)
+	_ZN13TPBusCallBackC2Ev @ 54 NONAME ; TPBusCallBack::TPBusCallBack()
+	_ZN15DMMCMediaChange6CreateEv @ 55 NONAME ; DMMCMediaChange::Create()
+	_ZN15DMMCMediaChangeC2Ei @ 56 NONAME ; DMMCMediaChange::DMMCMediaChange(int)
+	_ZN16DMediaChangeBase15DoorOpenServiceEv @ 57 NONAME ; DMediaChangeBase::DoorOpenService()
+	_ZN16DMediaChangeBase17DoorClosedServiceEv @ 58 NONAME ; DMediaChangeBase::DoorClosedService()
+	_ZN16DMediaChangeBase6CreateEv @ 59 NONAME ; DMediaChangeBase::Create()
+	_ZN16DMediaChangeBaseC2Ei @ 60 NONAME ; DMediaChangeBase::DMediaChangeBase(int)
+	_ZN16TMMCStateMachine4JumpEPFmPvEi @ 61 NONAME ; TMMCStateMachine::Jump(unsigned long (*)(void*), int)
+	_ZN16TMMCStateMachine4PushEPFmPvEi @ 62 NONAME ; TMMCStateMachine::Push(unsigned long (*)(void*), int)
+	_ZN16TMMCStateMachine5ResetEv @ 63 NONAME ; TMMCStateMachine::Reset()
+	_ZN16TMMCStateMachine8DispatchEv @ 64 NONAME ; TMMCStateMachine::Dispatch()
+	_ZN17TMMCPasswordStore18IsMappingIncorrectERK4TCIDRK5TBuf8ILi16EE @ 65 NONAME ; TMMCPasswordStore::IsMappingIncorrect(TCID const&, TBuf8<16> const&)
+	_ZN26TMMCardControllerInterface20RegisterMediaDevicesEi @ 66 NONAME ; TMMCardControllerInterface::RegisterMediaDevices(int)
+	_ZN26TMMCardControllerInterface6CreateEv @ 67 NONAME ; TMMCardControllerInterface::Create()
+	_ZN7DMMCPsu8DoCreateEv @ 68 NONAME ; DMMCPsu::DoCreate()
+	_ZN7DMMCPsuC2Eii @ 69 NONAME ; DMMCPsu::DMMCPsu(int, int)
+	_ZN9DMMCStack10CardDetectEj @ 70 NONAME ; DMMCStack::CardDetect(unsigned int)
+	_ZN9DMMCStack12PowerUpStackEv @ 71 NONAME ; DMMCStack::PowerUpStack()
+	_ZN9DMMCStack14AcquireStackSMEv @ 72 NONAME ; DMMCStack::AcquireStackSM()
+	_ZN9DMMCStack14EffectiveModesERK15TMMCStackConfig @ 73 NONAME ; DMMCStack::EffectiveModes(TMMCStackConfig const&)
+	_ZN9DMMCStack14PowerDownStackEv @ 74 NONAME ; DMMCStack::PowerDownStack()
+	_ZN9DMMCStack14WriteProtectedEj @ 75 NONAME ; DMMCStack::WriteProtected(unsigned int)
+	_ZN9DMMCStack19IssueMMCCommandSMSTEPv @ 76 NONAME ; DMMCStack::IssueMMCCommandSMST(void*)
+	_ZN9DMMCStack20CIMReadWriteBlocksSMEv @ 77 NONAME ; DMMCStack::CIMReadWriteBlocksSM()
+	_ZN9DMMCStack22CIMReadWriteBlocksSMSTEPv @ 78 NONAME ; DMMCStack::CIMReadWriteBlocksSMST(void*)
+	_ZN9DMMCStack22InitStackAfterUnlockSMEv @ 79 NONAME ; DMMCStack::InitStackAfterUnlockSM()
+	_ZN9DMMCStack4InitEv @ 80 NONAME ; DMMCStack::Init()
+	_ZN9DMMCStack4StopEP7TMMCard @ 81 NONAME ; DMMCStack::Stop(TMMCard*)
+	_ZN9DMMCStack5BlockEP11DMMCSessionm @ 82 NONAME ; DMMCStack::Block(DMMCSession*, unsigned long)
+	_ZN9DMMCStack7UnBlockEP11DMMCSessionmm @ 83 NONAME ; DMMCStack::UnBlock(DMMCSession*, unsigned long, unsigned long)
+	_ZN9DMMCStackC2EiP10DMMCSocket @ 84 NONAME ; DMMCStack::DMMCStack(int, DMMCSocket*)
+	_ZNK11DMMCSession13EpocErrorCodeEv @ 85 NONAME ; DMMCSession::EpocErrorCode() const
+	_ZNK11DMMCSession8GetMacroEi @ 86 NONAME ; DMMCSession::GetMacro(int) const
+	_ZNK15TMMCCommandDesc9DirectionEv @ 87 NONAME ; TMMCCommandDesc::Direction() const
+	_ZNK4TCSD10DeviceSizeEv @ 88 NONAME ; TCSD::DeviceSize() const
+	_ZNK4TCSD14EraseGroupSizeEv @ 89 NONAME ; TCSD::EraseGroupSize() const
+	_ZNK4TCSD15EraseSectorSizeEv @ 90 NONAME ; TCSD::EraseSectorSize() const
+	_ZNK4TCSD15ReadBlockLengthEv @ 91 NONAME ; TCSD::ReadBlockLength() const
+	_ZNK4TCSD16WriteBlockLengthEv @ 92 NONAME ; TCSD::WriteBlockLength() const
+	_ZNK4TCSD23MaxTranSpeedInKilohertzEv @ 93 NONAME ; TCSD::MaxTranSpeedInKilohertz() const
+	_ZNK4TCSD25MaxReadCurrentInMilliampsEv @ 94 NONAME ; TCSD::MaxReadCurrentInMilliamps() const
+	_ZNK4TCSD25MinReadCurrentInMilliampsEv @ 95 NONAME ; TCSD::MinReadCurrentInMilliamps() const
+	_ZNK4TCSD26MaxWriteCurrentInMilliampsEv @ 96 NONAME ; TCSD::MaxWriteCurrentInMilliamps() const
+	_ZNK4TCSD26MinWriteCurrentInMilliampsEv @ 97 NONAME ; TCSD::MinWriteCurrentInMilliamps() const
+	_ZNK4TCSD8CSDFieldERKjS1_ @ 98 NONAME ; TCSD::CSDField(unsigned int const&, unsigned int const&) const
+	_ZNK4TCSD9MediaTypeEv @ 99 NONAME ; TCSD::MediaType() const
+	_ZNK7TMMCard7IsReadyEv @ 100 NONAME ; TMMCard::IsReady() const
+	_ZNK7TMMCard8IsLockedEv @ 101 NONAME ; TMMCard::IsLocked() const
+	_ZNK9DMMCStack12AllocSessionERK12TMMCCallBack @ 102 NONAME ; DMMCStack::AllocSession(TMMCCallBack const&) const
+	_ZTI10DMMCSocket @ 103 NONAME ; typeinfo for DMMCSocket
+	_ZTI11DMMCSession @ 104 NONAME ; typeinfo for DMMCSession
+	_ZTI12DPBusPsuBase @ 105 NONAME ; typeinfo for DPBusPsuBase
+	_ZTI12TMMCardArray @ 106 NONAME ; typeinfo for TMMCardArray
+	_ZTI15DMMCMediaChange @ 107 NONAME ; typeinfo for DMMCMediaChange
+	_ZTI16DMediaChangeBase @ 108 NONAME ; typeinfo for DMediaChangeBase
+	_ZTI26TMMCardControllerInterface @ 109 NONAME ; typeinfo for TMMCardControllerInterface
+	_ZTI7DMMCPsu @ 110 NONAME ; typeinfo for DMMCPsu
+	_ZTI9DMMCStack @ 111 NONAME ; typeinfo for DMMCStack
+	_ZTV10DMMCSocket @ 112 NONAME ; vtable for DMMCSocket
+	_ZTV11DMMCSession @ 113 NONAME ; vtable for DMMCSession
+	_ZTV12DPBusPsuBase @ 114 NONAME ; vtable for DPBusPsuBase
+	_ZTV12TMMCardArray @ 115 NONAME ; vtable for TMMCardArray
+	_ZTV15DMMCMediaChange @ 116 NONAME ; vtable for DMMCMediaChange
+	_ZTV16DMediaChangeBase @ 117 NONAME ; vtable for DMediaChangeBase
+	_ZTV26TMMCardControllerInterface @ 118 NONAME ; vtable for TMMCardControllerInterface
+	_ZTV7DMMCPsu @ 119 NONAME ; vtable for DMMCPsu
+	_ZTV9DMMCStack @ 120 NONAME ; vtable for DMMCStack
+	_ZN9DMMCStack22ModifyCardCapabilitySMEv @ 121 NONAME ; DMMCStack::ModifyCardCapabilitySM()
+	_ZN9DMMCStack6Dummy1Ev @ 122 NONAME
+	_ZN9DMMCStack12GetInterfaceENS_12TInterfaceIdERPNS_10MInterfaceE @ 123 NONAME
+	_ZN9DMMCStack11MachineInfoER5TDes8 @ 124 NONAME
+	_ZN9DMMCStack11SetBusWidthEm @ 125 NONAME
+	_ZN11DPBusSocket9ControlIOEiPvS0_ @ 126 NONAME
+	_ZN12TSDCardArray10AllocCardsEv @ 127 NONAME
+	_ZN12TSDCardArray17DeclareCardAsGoneEj @ 128 NONAME
+	_ZN8DSDStack14AcquireStackSMEv @ 129 NONAME
+	_ZN8DSDStack20CIMReadWriteBlocksSMEv @ 130 NONAME
+	_ZN8DSDStack22InitStackAfterUnlockSMEv @ 131 NONAME
+	_ZN8DSDStack22ModifyCardCapabilitySMEv @ 132 NONAME
+	_ZN8DSDStack4InitEv @ 133 NONAME
+	_ZN8DSDStack6Dummy1Ev @ 134 NONAME
+	_ZN8DSDStack6Dummy2Ev @ 135 NONAME
+	_ZN8DSDStack6Dummy3Ev @ 136 NONAME
+	_ZN8DSDStack8CardTypeEii @ 137 NONAME
+	_ZNK8DSDStack12AllocSessionERK12TMMCCallBack @ 138 NONAME
+	_ZTI12TSDCardArray @ 139 NONAME ; #<TI>#
+	_ZTI7TSDCard @ 140 NONAME ; #<TI>#
+	_ZTI8DSDStack @ 141 NONAME ; #<TI>#
+	_ZTV12TSDCardArray @ 142 NONAME ; #<VT>#
+	_ZTV7TSDCard @ 143 NONAME ; #<VT>#
+	_ZTV8DSDStack @ 144 NONAME ; #<VT>#
+
+ 
\ No newline at end of file
--- a/kernel/eka/drivers/pbus/mmc/sdcard/sdcard3c/sdcard.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/drivers/pbus/mmc/sdcard/sdcard3c/sdcard.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -481,6 +481,12 @@
 		// Before issueing commands, see if there's actually a card present
 		if (!CardDetect(iCxCardCount))
 			SMF_GOTOS(EStMoreCardsCheck)
+		
+		// Card Previously Marked as Corrupt do not re-initialise	
+		if ((CardArray().CardP(iCxCardCount)->iFlags)& KSDCardIsCorrupt)
+		    {
+            SMF_GOTOS(EStMoreCardsCheck)
+		    }
 
 		m.SetTraps(KMMCErrResponseTimeOut);
 		SMF_INVOKES(InitialiseMemoryCardSMST, EStSendCIDIssued)
@@ -814,6 +820,7 @@
 					{
 					__KTRACE_OPT2(KPBUS1, KPANIC, Kern::Printf("-sd:ocr busy timed out"));
 					OstTraceFunctionExitExt( DSDSTACK_INITIALISEMEMORYCARDSM_EXIT2, this, (TInt) KMMCErrBusTimeOut );
+					(CardArray().CardP(iCxCardCount)->iFlags)|=KSDCardIsCorrupt;
 					return KMMCErrBusTimeOut;
 					}
 					
--- a/kernel/eka/drivers/usbcc/chapter9.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/drivers/usbcc/chapter9.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -306,7 +306,7 @@
 	else
 		{
 		// Type mask != KUsbRequestType_TypeStd => class- or vendor-specific request
-		iEp0ReceivedNonStdRequest = ETrue;
+        iEp0ReceivedNonStdRequest = ETrue;
 		const DBase* client = NULL;
 		switch (packet.iRequestType & KUsbRequestType_DestMask)
 			{ // Recipient
@@ -314,6 +314,11 @@
 			client = iEp0DeviceControl;
 			break;
 		case KUsbRequestType_DestIfc:
+		    //Add this mutex to protect the interface set data structure
+		    if (NKern::CurrentContext() == EThread)
+		        {
+		        NKern::FMWait(&iMutex);
+		        }
 			if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateConfigured)
 				{
 				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
@@ -322,7 +327,10 @@
 				{
 				const TUsbcInterfaceSet* const ifcset_ptr =
 					InterfaceNumber2InterfacePointer(packet.iIndex);
-				if (ifcset_ptr)
+				//In some rare case, ifcset_ptr is not NULL but the ifcset_ptr->iInterfaces.Count() is 0,
+				//so panic will happen when excute the following line. so I add the conditon
+				//0 != ifcset_ptr->iInterfaces.Count() here.
+				if (ifcset_ptr && 0 != ifcset_ptr->iInterfaces.Count())
 					{
 					if (ifcset_ptr->CurrentInterface()->iNoEp0Requests)
 						{
@@ -339,8 +347,17 @@
 													  packet.iIndex));
 					}
 				}
+	        if (NKern::CurrentContext() == EThread)
+	            {
+                NKern::FMSignal(&iMutex);
+	            }
 			break;
 		case KUsbRequestType_DestEp:
+		    //Add this mutex to protect the interface set data structure
+	        if (NKern::CurrentContext() == EThread)
+	            {
+                NKern::FMWait(&iMutex);
+	            }
 			if (iTrackDeviceState && iDeviceState < EUsbcDeviceStateConfigured)
 				{
 				__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Invalid device state"));
@@ -364,6 +381,10 @@
 					client = ifcset_ptr->iClientId;
 					}
 				}
+            if (NKern::CurrentContext() == EThread)
+                {
+                NKern::FMSignal(&iMutex);
+                }
 			break;
 		default:
 			__KTRACE_OPT(KPANIC, Kern::Printf("  Error: Other or Unknown recipient"));
@@ -1231,7 +1252,17 @@
 	if (aIfcSet->CurrentInterface() != 0)
 		{
 		__KTRACE_OPT(KUSB, Kern::Printf("  Resetting alternate interface setting to 0"));
+		//Add this mutex to protect the interface set data structure
+		if (NKern::CurrentContext() == EThread)
+		    {
+            NKern::FMWait(&iMutex);
+		    }
+        
 		aIfcSet->iCurrentInterface = 0;
+	    if (NKern::CurrentContext() == EThread)
+	        {
+            NKern::FMSignal(&iMutex);
+	        }		
 		}
 	return;
 	}
--- a/kernel/eka/drivers/usbcc/ps_usbc.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/drivers/usbcc/ps_usbc.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -3714,7 +3714,17 @@
 		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: interface not found in array"));
 		return;
 		}
+	//Add this mutex to protect the interface set data structure
+	if (NKern::CurrentContext() == EThread)
+	    {
+        NKern::FMWait(&iMutex);
+	    }
+	
 	iConfigs[0]->iInterfaceSets.Remove(idx);
+	if (NKern::CurrentContext() == EThread)
+	    {
+        NKern::FMSignal(&iMutex);	
+	    }
 	delete ifcset_ptr;
 	}
 
@@ -3733,15 +3743,25 @@
 		__KTRACE_OPT(KPANIC, Kern::Printf("  Error: invalid interface setting: %d", aIfc));
 		return;
 		}
+	//Add this mutex to protect the interface set data structure
+	if (NKern::CurrentContext() == EThread)
+	    {
+        NKern::FMWait(&iMutex);
+	    }	
 	TUsbcInterface* const ifc_ptr = ifcset_ptr->iInterfaces[aIfc];
 	// Always first remove, then delete (see ~TUsbcLogicalEndpoint() for the reason why)
 	ifcset_ptr->iInterfaces.Remove(aIfc);
-	delete ifc_ptr;
+
 	if (aIfc == ifcset_ptr->iCurrentInterface)
 		{
 		__KTRACE_OPT(KUSB, Kern::Printf(" > Warning: deleting current interface setting"));
 		ifcset_ptr->iCurrentInterface = 0;
 		}
+	if (NKern::CurrentContext() == EThread)
+	    {
+        NKern::FMSignal(&iMutex);
+	    }	
+	delete ifc_ptr;
 	}
 
 
--- a/kernel/eka/euser/us_ksvr.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/euser/us_ksvr.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -3469,16 +3469,17 @@
 be invoked on this TThreadCreateInfo to set the type of the thread to be created
 before being passed as a paramter to RThread::Create().
 
-@param aName        The name to be assigned to the thread.
+@param aName		The name to be assigned to the thread.
 					KNullDesC, to create an anonymous thread.
-@param aFunction    A pointer to a function. Control passes to this function
-                    when the thread is first resumed, i.e. when the thread
-                    is initially scheduled to run.
-@param aStackSize   The size of the new thread's stack.
-@param aPtr         A pointer to data to be passed as a parameter to
-                    the thread function when the thread is initially scheduled
-                    to run. If the thread function does not need any data then
-                    this pointer can be NULL.
+@param aFunction	A pointer to a function. Control passes to this function
+					when the thread is first resumed, i.e. when the thread
+					is initially scheduled to run.
+@param aStackSize	The size of the new thread's stack.  This must be at least
+					512 bytes, otherwise RThread::Create() will fail with KErrArgument.
+@param aPtr			A pointer to data to be passed as a parameter to
+					the thread function when the thread is initially scheduled
+					to run. If the thread function does not need any data then
+					this pointer can be NULL.
 */
 EXPORT_C TThreadCreateInfo::TThreadCreateInfo(const TDesC &aName, TThreadFunction aFunction, 
 											TInt aStackSize, TAny* aPtr) :
@@ -3604,25 +3605,27 @@
 If KNullDesC is specified for the name, then an anonymous thread will be created.
 Anonymous threads are not global, and cannot be opened by other processes.
 
-@param aName        The name to be assigned to this thread.
+@param aName		The name to be assigned to this thread.
 					KNullDesC, to create an anonymous thread.
-@param aFunction    A pointer to a function.. Control passes to this function
-                    when the thread is first resumed, i.e. when the thread
-                    is initially scheduled to run.
-@param aStackSize   The size of the new thread's stack.
+@param aFunction	A pointer to a function.. Control passes to this function
+					when the thread is first resumed, i.e. when the thread
+					is initially scheduled to run.
+@param aStackSize	The size of the new thread's stack.  This must be at least
+					512 bytes, otherwise this method will fail with KErrArgument.
 @param aHeapMinSize The minimum size for the new thread's heap.
 @param aHeapMaxSize The maximum size for the new thread's heap.
-@param aPtr         A pointer to data to be passed as a parameter to
-                    the thread function when the thread is initially scheduled
-                    to run. If the thread function does not need any data then
-                    this pointer can be NULL. It must be ensured that the memory 
-                    pointed to by this pointer is still valid when accessed by 
-                    the new thread, e.g. if aPtr points to data on the stack.
-@param aType        An enumeration whose enumerators define the ownership of
-                    this thread handle. If not explicitly specified,
-                    EOwnerProcess is taken as default.
+@param aPtr			A pointer to data to be passed as a parameter to
+					the thread function when the thread is initially scheduled
+					to run. If the thread function does not need any data then
+					this pointer can be NULL. It must be ensured that the memory 
+					pointed to by this pointer is still valid when accessed by 
+					the new thread, e.g. if aPtr points to data on the stack.
+@param aType		An enumeration whose enumerators define the ownership of
+					this thread handle. If not explicitly specified,
+					EOwnerProcess is taken as default.
 
 @return KErrNone if successful, otherwise one of the other system-wide error codes.
+		KErrArgument if aStackSize is less than 512 bytes.
         KErrAlreadyExists will be returned if there is another thread in this process with the
         specified name.
 
@@ -3630,7 +3633,10 @@
 @panic USER 110 if aHeapMinSize is less than KMinHeapSize.
 @panic USER 111 if aHeapMaxSize is less than aHeapMinSize.
 */
-	{
+	{// This must be true otherwise the comment on aStackSize will be incorrect and BC 
+	// break will occur.  See ExecHandler::ThreadCreate() for details.
+	__ASSERT_COMPILE(KMaxThreadCreateInfo == 256);
+
 	TThreadCreateInfo createInfo(aName, aFunction, aStackSize, aPtr);
 	createInfo.SetOwner(aType);
 	createInfo.SetCreateHeap(aHeapMinSize, aHeapMaxSize);
@@ -3655,25 +3661,27 @@
 If KNullDesC is specified for the name, then an anonymous thread will be created.
 Anonymous threads are not global, and cannot be opened by other processes.
 
-@param aName      The name to be assigned to this thread.
-				  KNullDesC, to create an anonymous thread.
-@param aFunction  A pointer to a function. Control passes to this function when 
-	              the thread is first resumed, i.e. when the thread is
-	              initially scheduled to run.
-@param aStackSize The size of the new thread's stack.
-@param aAllocator A pointer to the handle of the heap belonging to another thread 
-                  which this thread is to use.
-@param aPtr       A pointer to data to be passed as a parameter to the thread
-                  function when the thread is initially scheduled to run.
-                  If the thread function does not need any data,
-                  then this pointer can be NULL. It must be ensured that the 
-                  memory pointed to by this pointer is still valid when accessed 
-                  by the new thread, e.g. if aPtr points to data on the stack.
-@param aType      An enumeration whose enumerators define the ownership of this 
-                  thread handle. If not explicitly specified, EOwnerProcess is
-                  taken as default.
+@param aName		The name to be assigned to this thread.
+					KNullDesC, to create an anonymous thread.
+@param aFunction	A pointer to a function. Control passes to this function when 
+					the thread is first resumed, i.e. when the thread is
+					initially scheduled to run.
+@param aStackSize	The size of the new thread's stack.  This must be at least
+					512 bytes, otherwise this method will fail with KErrArgument.
+@param aAllocator	A pointer to the handle of the heap belonging to another thread 
+					which this thread is to use.
+@param aPtr			A pointer to data to be passed as a parameter to the thread
+					function when the thread is initially scheduled to run.
+					If the thread function does not need any data,
+					then this pointer can be NULL. It must be ensured that the 
+					memory pointed to by this pointer is still valid when accessed 
+					by the new thread, e.g. if aPtr points to data on the stack.
+@param aType		An enumeration whose enumerators define the ownership of this 
+					thread handle. If not explicitly specified, EOwnerProcess is
+					taken as default.
 
 @return KErrNone if successful otherwise one of the other system-wide error codes.
+		KErrArgument if aStackSize is less than 512 bytes.
         KErrAlreadyExists will be returned if there is another thread in this process with the
         specified name.
 
--- a/kernel/eka/euser/us_test.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/euser/us_test.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -549,6 +549,14 @@
 		User::AfterHighRes(period);
 		}
 	User::WaitForRequest(s);
+
+	// There is a potential race condition, if the calling thread runs on a different CPU
+	// than the Supervisor thread, which can result in this thread being signaled
+	// before the RHandleBase gets fully closed (see DChangeNotifier::Complete()).
+	// For that reason, wait until Supervisor thread gets to idle, which is the indication
+	// that Complete() function has returned (DThread::Close() was called releasing memory),
+	// in the case that Kernel heap was checked just after current method returns.
+	UserSvr::HalFunction(EHalGroupKernel, EKernelHalSupervisorBarrier, (TAny*)timeout, NULL);
 	return r;
 	}
 
--- a/kernel/eka/include/d32otgdi.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/include/d32otgdi.h	Wed Mar 31 23:38:45 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -348,7 +348,13 @@
 		EMessageVbusPowerDownNotPermitted	= KErrUsbOtgVbusPowerDownNotPermitted,
 		EMessageVbusClearErrorNotPermitted	= KErrUsbOtgVbusClearErrorNotPermitted,
 		EMessageHnpNotResponding			= KErrUsbOtgHnpNotResponding,
-		EMessageHnpBusDrop					= KErrUsbOtgHnpBusDrop
+		EMessageHnpBusDrop					= KErrUsbOtgHnpBusDrop,
+		
+		/**
+		Bad device attach/detach message
+		*/
+		EMessageBadDeviceAttached 			= KErrUsbOtgBadDeviceAttached,
+		EMessageBadDeviceDetached 			= KEventUsbOtgBadDeviceDetached
 		};
 
 public:
--- a/kernel/eka/include/d32otgdi_errors.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/include/d32otgdi_errors.h	Wed Mar 31 23:38:45 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -36,6 +36,9 @@
 const TInt KErrUsbOtgStateQueueOverflow			= -6671;
 const TInt KErrUsbOtgMessageQueueOverflow		= -6672;
 
+const TInt KErrUsbOtgBadDeviceAttached 			= -6673;
+const TInt KEventUsbOtgBadDeviceDetached 		= -6674;
+
 const TInt KErrUsbOtgBadState					= -6675;
 
 const TInt KErrUsbOtgStackNotStarted			= -6680;
--- a/kernel/eka/include/d32usbdi.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/include/d32usbdi.h	Wed Mar 31 23:38:45 2010 +0300
@@ -180,7 +180,7 @@
 	// Some utility functions
 	//
 	inline TInt GetBusId(TUsbBusId& aBusId);
-	inline TInt HcdPageSize();
+	inline TInt GetHcdPageSize(TInt& aHcdPageSize);
 	inline TInt GetDeviceSpeed(TDeviceSpeed& aDeviceSpeed);
 
 private:
--- a/kernel/eka/include/d32usbdi.inl	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/include/d32usbdi.inl	Wed Mar 31 23:38:45 2010 +0300
@@ -414,11 +414,12 @@
 /**
 Returns the size of pages used by the HCD.
 @internalComponent
-@return The HCD's page size.
+@param aHcdPageSize on success provides the HCD's page size.
+@return KErrNone on success, otherwise a system-wide error code.
 */
-TInt RUsbInterface::HcdPageSize()
+TInt RUsbInterface::GetHcdPageSize(TInt& aHcdPageSize)
 	{
-	return DoControl(EHcdPageSize);
+	return DoControl(EHcdPageSize, &aHcdPageSize);
 	}
 
 /**
--- a/kernel/eka/include/drivers/dma_hai.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/include/drivers/dma_hai.h	Wed Mar 31 23:38:45 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -863,6 +863,32 @@
 
 //////////////////////////////////////////////////////////////////////////////
 
+// Trace macros intended for use by the DMA PSL
+#define DMA_PRINTF(MSG) __KTRACE_OPT(KDMA, Kern::Printf((MSG)))
+#define DMA_PRINTF1(MSG, ARG1) __KTRACE_OPT(KDMA, Kern::Printf((MSG), (ARG1)))
+#define DMA_PRINTF2(MSG, ARG1, ARG2) __KTRACE_OPT(KDMA, Kern::Printf((MSG), (ARG1), (ARG2)))
+
+#define DMA_PSL_MESG "DMA PSL: "
+
+// General PSL tracing
+#define DMA_PSL_TRACE(MSG) DMA_PRINTF(DMA_PSL_MESG MSG)
+#define DMA_PSL_TRACE1(MSG, ARG1) DMA_PRINTF1(DMA_PSL_MESG MSG, (ARG1))
+#define DMA_PSL_TRACE2(MSG, ARG1, ARG2) DMA_PRINTF2(DMA_PSL_MESG MSG, (ARG1), (ARG2))
+
+
+#define DMA_PSL_CHAN_MESG DMA_PSL_MESG "ChanId %d: "
+#define DMA_PSL_CHAN_ARGS(CHAN) ((CHAN).PslId())
+
+// For channel specific tracing (where CHAN is a TDmaChannel)
+#define DMA_PSL_CHAN_TRACE_STATIC(CHAN, MSG) DMA_PRINTF1(DMA_PSL_CHAN_MESG MSG, DMA_PSL_CHAN_ARGS(CHAN))
+#define DMA_PSL_CHAN_TRACE_STATIC1(CHAN, MSG, ARG1) DMA_PRINTF2(DMA_PSL_CHAN_MESG MSG, DMA_PSL_CHAN_ARGS(CHAN), (ARG1))
+
+// For channel specific tracing, for use within methods of TDmaChannel derived
+// class
+#define DMA_PSL_CHAN_TRACE(MSG) DMA_PSL_CHAN_TRACE_STATIC(*this, MSG)
+#define DMA_PSL_CHAN_TRACE1(MSG, ARG1) DMA_PSL_CHAN_TRACE_STATIC1(*this, MSG, (ARG1))
+
+
 
 #include <drivers/dma_hai.inl>
 
--- a/kernel/eka/include/drivers/dma_v1.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/include/drivers/dma_v1.h	Wed Mar 31 23:38:45 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0""
@@ -398,6 +398,32 @@
 // PIL-PSL INTERFACE
 //////////////////////////////////////////////////////////////////////////////
 
+// Trace macros intended for use by the DMA PSL
+#define DMA_PRINTF(MSG) __KTRACE_OPT(KDMA, Kern::Printf((MSG)))
+#define DMA_PRINTF1(MSG, ARG1) __KTRACE_OPT(KDMA, Kern::Printf((MSG), (ARG1)))
+#define DMA_PRINTF2(MSG, ARG1, ARG2) __KTRACE_OPT(KDMA, Kern::Printf((MSG), (ARG1), (ARG2)))
+
+#define DMA_PSL_MESG "DMA PSL: "
+
+// General PSL tracing
+#define DMA_PSL_TRACE(MSG) DMA_PRINTF(DMA_PSL_MESG MSG)
+#define DMA_PSL_TRACE1(MSG, ARG1) DMA_PRINTF1(DMA_PSL_MESG MSG, (ARG1))
+#define DMA_PSL_TRACE2(MSG, ARG1, ARG2) DMA_PRINTF2(DMA_PSL_MESG MSG, (ARG1), (ARG2))
+
+
+#define DMA_PSL_CHAN_MESG DMA_PSL_MESG "ChanId %d: "
+#define DMA_PSL_CHAN_ARGS(CHAN) ((CHAN).PslId())
+
+// For channel specific tracing (where CHAN is a TDmaChannel)
+#define DMA_PSL_CHAN_TRACE_STATIC(CHAN, MSG) DMA_PRINTF1(DMA_PSL_CHAN_MESG MSG, DMA_PSL_CHAN_ARGS(CHAN))
+#define DMA_PSL_CHAN_TRACE_STATIC1(CHAN, MSG, ARG1) DMA_PRINTF2(DMA_PSL_CHAN_MESG MSG, DMA_PSL_CHAN_ARGS(CHAN), (ARG1))
+
+// For channel specific tracing, for use within methods of TDmaChannel derived
+// class
+#define DMA_PSL_CHAN_TRACE(MSG) DMA_PSL_CHAN_TRACE_STATIC(*this, MSG)
+#define DMA_PSL_CHAN_TRACE1(MSG, ARG1) DMA_PSL_CHAN_TRACE_STATIC1(*this, MSG, (ARG1))
+
+
 /**
 Generic DMA descriptor used if the DMAC does not have support for hardware
 descriptor.
--- a/kernel/eka/include/drivers/sdcard.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/include/drivers/sdcard.h	Wed Mar 31 23:38:45 2010 +0300
@@ -44,6 +44,7 @@
 const TUint32 KSDSwitchFunctionHighSpeed = 0x80FFFF01;
 
 const TUint32 KSDCardIsSDCard			 = KBit16;	// KMMCardFirstCustomFlag
+const TUint32 KSDCardIsCorrupt           = KBit17;
 const TUint32 KSDCardFirstCustomFlag	 = KBit24;
 
 const TUint   KSDDTClk25MHz				 = 25000; //25000KHz
--- a/kernel/eka/include/drivers/usbcshared.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/include/drivers/usbcshared.h	Wed Mar 31 23:38:45 2010 +0300
@@ -1599,6 +1599,7 @@
 	NTimer iCableStatusTimer;								// implements USB cable status detection delay
 	DUsbcPowerHandler* iPowerHandler;						// pointer to USB power handler object
 	TSpinLock iUsbLock;                                     // implement SMP for USB PDD and LDD
+	NFastMutex iMutex;										// To pretect interface set with NFastMutex
 
 protected:
 	TDfc iPowerUpDfc;										// queued by power handler upon power-up
--- a/kernel/eka/include/e32ver.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/include/e32ver.h	Wed Mar 31 23:38:45 2010 +0300
@@ -28,7 +28,7 @@
 
 const TInt KE32MajorVersionNumber=2;
 const TInt KE32MinorVersionNumber=0;
-const TInt KE32BuildVersionNumber=2091;
+const TInt KE32BuildVersionNumber=2102;
 
 const TInt KMachineConfigurationMajorVersionNumber=1;
 const TInt KMachineConfigurationMinorVersionNumber=0;
--- a/kernel/eka/include/memmodel/epoc/mmubase/ramalloc.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/include/memmodel/epoc/mmubase/ramalloc.h	Wed Mar 31 23:38:45 2010 +0300
@@ -153,7 +153,7 @@
 	TInt GetZonePageCount(TUint aId, SRamZonePageCount& aPageData);
 	void ChangePageType(SPageInfo* aPageInfo, TZonePageType aOldType, TZonePageType aNewType);
 #ifdef BTRACE_RAM_ALLOCATOR
-	void SendInitialBtraceLogs(void);
+	void DoBTracePrime(void);
 #endif
 	TInt GetZoneAddress(TUint aZoneId, TPhysAddr& aPhysBase, TUint& aNumPages);
 	TInt HalFunction(TInt aFunction, TAny* a1, TAny* a2);
--- a/kernel/eka/kernel/sexec.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/kernel/sexec.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -758,7 +758,7 @@
 
 	__KTRACE_OPT(KEXEC,Kern::Printf("Exec::ThreadRequestSignal"));
 	if(aThread->iOwningProcess!=TheCurrentThread->iOwningProcess)
-		K::ProcessIsolationFailure(__PLATSEC_DIAGNOSTIC_STRING("Attempt to use RThread::RequestComplete on a thread in another process"));
+		K::ProcessIsolationFailure(__PLATSEC_DIAGNOSTIC_STRING("Attempt to use RThread::RequestComplete or RThread::RequestSignal on a thread in another process"));
 	NKern::ThreadRequestSignal(&aThread->iNThread, SYSTEM_LOCK);
 	}
 
--- a/kernel/eka/kernel/skernel.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/kernel/skernel.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -1750,7 +1750,7 @@
 @see Kern::ReleaseMemoryFromDMA
 
 @param aThread          The thread in whose process the given address lies. If zero, the current thread is used.
-@param aAddress         An address in the given threads process.
+@param aAddress         An address in the given thread's process.
 @param aSize            The size of the region.
 @param aPageList        Points to an array of TUint32 (or TPhysAddr) objects. The length of the array must
 						be at least aSize/MMU_page_size+1, where MMU_page_size = Kern::RoundToPageSize(1).
@@ -1759,7 +1759,7 @@
                         (they are a multiple of the physical page size), therefore the byte corresponding
                         to aOffset is at physical address aPageList[0]+aOffset%MMU_page_size.
 
-@return 0 				 if successful.
+@return KErrNone		 if successful.
         KErrAccessDenied if any part of region doesn't belong to "trusted" chunk.
         Other			 if memory region is invalid, or mapped in 1MB sections or large pages.
 
@@ -1779,16 +1779,16 @@
 
 /**
 Unlocks the physical pages that have been locked by PrepareMemoryForDMA.
-All input paramemers are the same as those in PrepareMemoryForDMA.
+All input parameters are the same as those in PrepareMemoryForDMA.
 
 @see Kern::PrepareMemoryForDMA
 
 @param aThread          The thread in whose process the given address lies. If zero, the current thread is used.
-@param aAddress         An address in the given threads process.
+@param aAddress         An address in the given thread's process.
 @param aSize            The size of the region.
 @param aPageList        Points to the list of pages returned by PrepareMemoryForDMA.
 
-@return 0 				if successful.
+@return KErrNone		if successful.
         KErrArgument	if the list of physical pages is invalid.
         
 @pre	Calling thread must be in critical section.
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mcodepaging.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mcodepaging.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -64,7 +64,7 @@
 	*/
 	static DCodePagedMemoryManager TheManager;
 
-	friend DPagingDevice* CodePagingDevice(TInt aDiveNum);
+	friend DPagingDevice* CodePagingDevice(TInt aDriveNum);
 	};
 
 
@@ -207,11 +207,11 @@
 
 TInt DCodePagedMemoryManager::CleanPage(DMemoryObject* aMemory, SPageInfo* aPageInfo, TPhysAddr*& aPageArrayEntry)
 	{
-	if(aPageInfo->IsDirty()==false)
+	if(!aPageInfo->IsDirty())
 		return KErrNone;
 
 	// shouldn't be asked to clean a page which is writable...
-	__NK_ASSERT_DEBUG(aPageInfo->IsWritable()==false);
+	__NK_ASSERT_DEBUG(!aPageInfo->IsWritable());
 
 	// Note, memory may have been modified by the CodeModifier class.
 
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mcodepaging.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mcodepaging.h	Wed Mar 31 23:38:45 2010 +0300
@@ -21,6 +21,6 @@
 #ifndef MCODEPAGING_H
 #define MCODEPAGING_H
 
-extern DPagingDevice* CodePagingDevice(TInt aDiveNum);
+extern DPagingDevice* CodePagingDevice(TInt aDriveNum);
 
 #endif
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mdatapaging.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mdatapaging.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -618,11 +618,11 @@
 
 TInt DDataPagedMemoryManager::CleanPage(DMemoryObject* aMemory, SPageInfo* aPageInfo, TPhysAddr*& aPageArrayEntry)
 	{
-	if(aPageInfo->IsDirty()==false)
+	if(!aPageInfo->IsDirty())
 		return KErrNone;
 
 	// shouldn't be asked to clean a page which is writable...
-	__NK_ASSERT_DEBUG(aPageInfo->IsWritable()==false);
+	__NK_ASSERT_DEBUG(!aPageInfo->IsWritable());
 
 	// mark page as being modified by us...
 	TUint modifierInstance; // dummy variable used only for it's storage address on the stack
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mexport.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mexport.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -16,7 +16,7 @@
 #include "memmodel.h"
 #include "mm.h"
 #include "mmu.h"
-
+#include "mpager.h"
 #include "mrom.h"
 
 /**	Returns the amount of free RAM currently available.
@@ -607,13 +607,29 @@
 	}
 
 
-#ifdef BTRACE_KERNEL_MEMORY
 void M::BTracePrime(TUint aCategory)
 	{
-	// TODO:
+	(void)aCategory;
+
+#ifdef BTRACE_KERNEL_MEMORY
+	// Must check for -1 as that is the default value of aCategory for
+	// BTrace::Prime() which is intended to prime all categories that are 
+	// currently enabled via a single invocation of BTrace::Prime().
+	if(aCategory == BTrace::EKernelMemory || (TInt)aCategory == -1)
+		{
+		NKern::ThreadEnterCS();
+		RamAllocLock::Lock();
+		BTrace4(BTrace::EKernelMemory, BTrace::EKernelMemoryInitialFree, TheSuperPage().iTotalRamSize);
+		BTrace4(BTrace::EKernelMemory, BTrace::EKernelMemoryCurrentFree, Kern::FreeRamInBytes());
+		BTrace4(BTrace::EKernelMemory, BTrace::EKernelMemoryMiscAlloc, Epoc::KernelMiscPages << KPageShift);
+		BTrace4(BTrace::EKernelMemory, BTrace::EKernelMemoryDemandPagingCache, ThePager.MinimumPageCount() << KPageShift);
+		BTrace8(BTrace::EKernelMemory, BTrace::EKernelMemoryDrvPhysAlloc, Epoc::DriverAllocdPhysRam, -1);
+		RamAllocLock::Unlock();
+		NKern::ThreadLeaveCS();
+		}
+#endif
+	TheMmu.BTracePrime(aCategory);
 	}
-#endif
-
 
 
 //
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mm.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mm.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -394,7 +394,7 @@
 	}
 
 
-TInt MM::MemoryAddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages)
+TInt MM::MemoryAddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, const TPhysAddr* aPages)
 	{
 	TRACE(("MM::MemoryAddPages(0x%08x,0x%08x,0x%08x,?)",aMemory,aIndex,aCount));
 	MemoryObjectLock::Lock(aMemory);
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mm.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mm.h	Wed Mar 31 23:38:45 2010 +0300
@@ -84,6 +84,9 @@
 	EMemoryObjectMovable but with the additional option of marking pages as
 	'discardable'. Discardable pages may be reclaimed (remove) by the system at
 	any time, this state is controlled using the functions:
+	- MM::MemoryAlloc
+	- MM::MemoryAllocContiguous
+	- MM::MemoryFree
 	- MM::MemoryAllowDiscard
 	- MM::MemoryDisallowDiscard
 	*/
@@ -485,7 +488,7 @@
 			KErrNotSupported, if the memory object doesn't support this operation;
 			otherwise another of the system wide error codes.
 	*/
-	static TInt MemoryAddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages);
+	static TInt MemoryAddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, const TPhysAddr* aPages);
 
 	/**
 	Add a contiguous range of pages to a region in a memory object.
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mmanager.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mmanager.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -66,7 +66,7 @@
 	}
 
 
-TInt DMemoryManager::AddPages(DMemoryObject* /*aMemory*/, TUint /*aIndex*/, TUint /*aCount*/, TPhysAddr* /*aPages*/)
+TInt DMemoryManager::AddPages(DMemoryObject* /*aMemory*/, TUint /*aIndex*/, TUint /*aCount*/, const TPhysAddr* /*aPages*/)
 	{
 	return KErrNotSupported;
 	}
@@ -1162,7 +1162,7 @@
 public:
 	// from DMemoryManager...
 	virtual void Destruct(DMemoryObject* aMemory);
-	virtual TInt AddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages);
+	virtual TInt AddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, const TPhysAddr* aPages);
 	virtual TInt AddContiguous(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr aPhysAddr);
 	virtual TInt RemovePages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages);
 	virtual TInt Pin(DMemoryObject* aMemory, DMemoryMappingBase* aMapping, TPinArgs& aPinArgs);
@@ -1227,14 +1227,14 @@
 	}
 
 
-TInt DHardwareMemoryManager::AddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages)
+TInt DHardwareMemoryManager::AddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, const TPhysAddr* aPages)
 	{
 	TRACE2(("DHardwareMemoryManager::AddPages(0x%08x,0x%x,0x%x,?)",aMemory, aIndex, aCount));
 	__NK_ASSERT_DEBUG(MemoryObjectLock::IsHeld(aMemory));
 
 	// validate arguments...
-	TPhysAddr* pages = aPages;
-	TPhysAddr* pagesEnd = aPages+aCount;
+	const TPhysAddr* pages = aPages;
+	const TPhysAddr* pagesEnd = aPages+aCount;
 	TPhysAddr checkMask = 0;
 	do checkMask |= *pages++;
 	while(pages<pagesEnd);
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mmanager.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mmanager.h	Wed Mar 31 23:38:45 2010 +0300
@@ -153,7 +153,7 @@
 			KErrNotSupported if the manager doesn't support this function,
 			otherwise one of the system wide error codes.
 	*/
-	virtual TInt AddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, TPhysAddr* aPages);
+	virtual TInt AddPages(DMemoryObject* aMemory, TUint aIndex, TUint aCount, const TPhysAddr* aPages);
 
 	/**
 	Add a contiguous range of physical memory pages to a region of a memory object.
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mmapping.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mmapping.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -1307,7 +1307,7 @@
 											EMappingCreateDefault, 
 											KKernelOsAsid, 
 											0, 
-											aCount, 
+											aCount << KPageShift, 
 											0);
 		if (r != KErrNone)
 			return r;
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mmappinglist.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mmappinglist.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -153,6 +153,7 @@
 			iPrev = prev;
 			// flash lock...
 			__SPIN_FLASH_IRQ(iSpinLock);
+			flash = 0;
 			// remove iterator again...
 			next = iNext;
 			prev = iPrev;
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mmappinglist.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mmappinglist.h	Wed Mar 31 23:38:45 2010 +0300
@@ -206,23 +206,15 @@
 	/**
 	Update the page table entry for a specified page in all mappings in the list that contain it.
 
-	@param aPages				The page array entry of the page in a memory object. 
+	@param aPageArray			The page array entry of the page in a memory object. 
 								Only array entries which have a target state of 
 								RPageArray::ECommitted should be mapped into the 
 								mapping's page tables.
-
 	@param aIndex				The index of the page in the memory object.
-
-	@param aMapInstanceCount	The instance of this mapping which is to be updated.
-								Whenever this no longer matches the current #MapInstanceCount
-								the function must not update any more of the mapping's
-								page table entries, (but must still return KErrNone).
-
-	@param	aInvalidateTLB		Set to ETrue when the TLB entries associated with this page
+	@param aInvalidateTLB		Set to ETrue when the TLB entries associated with this page
 								should be invalidated.  This must be done when there is 
 								already a valid pte for this page, i.e. if the page is still 
 								mapped.
-
 	@see #DMemoryMappingBase::RemapPage
 	*/
 	void RemapPage(TPhysAddr& aPageArray, TUint aIndex, TBool aInvalidateTLB);	
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mmu.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mmu.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -312,7 +312,8 @@
 	}
 
 
-#if 0
+#ifdef FMM_VERIFY_RAM
+// Attempt to write to each unused RAM page and verify the contents.
 void Mmu::VerifyRam()
 	{
 	Kern::Printf("Mmu::VerifyRam() pass 1");
@@ -474,6 +475,10 @@
 					__ASSERT_ALWAYS(r==KErrNone || r==KErrAlreadyExists, Panic(EBadMappedPageAfterBoot));
 					if(pi->Type()==SPageInfo::EUnused)
 						pi->SetFixed();
+#ifdef BTRACE_KERNEL_MEMORY
+					if(r == KErrNone)
+						++Epoc::KernelMiscPages;
+#endif
 					}
 				}
 			}
@@ -500,21 +505,24 @@
 	r = K::MutexCreate(iPhysMemSyncMutex, KLitPhysMemSync, NULL, EFalse, KMutexOrdSyncPhysMem);
 	if(r!=KErrNone)
 		Panic(EPhysMemSyncMutexCreateFailed);
-//	VerifyRam();
+
+#ifdef FMM_VERIFY_RAM
+	VerifyRam();
+#endif
 	}
 
 
 void Mmu::Init2FinalCommon()
 	{
 	__KTRACE_OPT2(KBOOT,KMMU,Kern::Printf("Mmu::Init2FinalCommon"));
-	// hack, reduce free memory to <2GB...
+	// Reduce free memory to <2GB...
 	while(FreeRamInPages()>=0x80000000/KPageSize)
 		{
 		TPhysAddr dummyPage;
 		TInt r = iRamPageAllocator->AllocRamPages(&dummyPage,1, EPageFixed);
 		__NK_ASSERT_ALWAYS(r==KErrNone);
 		}
-	// hack, reduce total RAM to <2GB...
+	// Reduce total RAM to <2GB...
 	if(TheSuperPage().iTotalRamSize<0)
 		TheSuperPage().iTotalRamSize = 0x80000000-KPageSize;
 
@@ -540,6 +548,27 @@
 	iDefrag->Init3(TheMmu.iRamPageAllocator);
 	}
 
+
+void Mmu::BTracePrime(TUint aCategory)
+	{
+	(void)aCategory;
+
+#ifdef BTRACE_RAM_ALLOCATOR
+	// Must check for -1 as that is the default value of aCategory for
+	// BTrace::Prime() which is intended to prime all categories that are 
+	// currently enabled via a single invocation of BTrace::Prime().
+	if(aCategory==BTrace::ERamAllocator || (TInt)aCategory == -1)
+		{
+		NKern::ThreadEnterCS();
+		RamAllocLock::Lock();
+		iRamPageAllocator->DoBTracePrime();
+		RamAllocLock::Unlock();
+		NKern::ThreadLeaveCS();
+		}
+#endif
+	}
+
+
 //
 // Utils
 //
@@ -619,18 +648,7 @@
 		PagesAllocated(aPageList, aNumPages, (Mmu::TRamAllocFlags)EMemAttStronglyOrdered);
 
 		// update page infos...
-		TUint flash = 0;
-		TPhysAddr* pageEnd = aPageList + aNumPages;
-		MmuLock::Lock();
-		TPhysAddr* page = aPageList;
-		while (page < pageEnd)
-			{
-			MmuLock::Flash(flash,KMaxPageInfoUpdatesInOneGo/2);
-			TPhysAddr pagePhys = *page++;
-			__NK_ASSERT_DEBUG(pagePhys != KPhysAddrInvalid);
-			SPageInfo::FromPhysAddr(pagePhys)->SetPhysAlloc();
-			}
-		MmuLock::Unlock();
+		SetAllocPhysRam(aPageList, aNumPages);
 		}
 	__KTRACE_OPT(KMMU,Kern::Printf("Mmu::ZoneAllocPhysicalRam returns %d",r));
 	return r;
@@ -963,19 +981,7 @@
 		return r;
 
 	// update page infos...
-	TPhysAddr* pages = aPages;
-	TPhysAddr* pagesEnd = pages+aCount;
-	MmuLock::Lock();
-	TUint flash = 0;
-	while(pages<pagesEnd)
-		{
-		MmuLock::Flash(flash,KMaxPageInfoUpdatesInOneGo/2);
-		TPhysAddr pagePhys = *pages++;
-		__NK_ASSERT_DEBUG(pagePhys!=KPhysAddrInvalid);
-		SPageInfo* pi = SPageInfo::FromPhysAddr(pagePhys);
-		pi->SetPhysAlloc();
-		}
-	MmuLock::Unlock();
+	SetAllocPhysRam(aPages, aCount);
 
 	return KErrNone;
 	}
@@ -1004,6 +1010,19 @@
 	MmuLock::Unlock();
 
 	iRamPageAllocator->FreeRamPages(aPages,aCount, EPageFixed);
+
+#ifdef BTRACE_KERNEL_MEMORY
+	if (BTrace::CheckFilter(BTrace::EKernelMemory))
+		{// Only loop round each page if EKernelMemory tracing is enabled
+		pages = aPages;
+		pagesEnd = aPages + aCount;
+		while (pages < pagesEnd)
+			{
+			BTrace8(BTrace::EKernelMemory, BTrace::EKernelMemoryDrvPhysFree, KPageSize, *pages++);
+			Epoc::DriverAllocdPhysRam -= KPageSize;
+			}
+		}
+#endif
 	}
 
 
@@ -1015,17 +1034,7 @@
 		return r;
 
 	// update page infos...
-	SPageInfo* pi = SPageInfo::FromPhysAddr(aPhysAddr);
-	SPageInfo* piEnd = pi+aCount;
-	TUint flash = 0;
-	MmuLock::Lock();
-	while(pi<piEnd)
-		{
-		MmuLock::Flash(flash,KMaxPageInfoUpdatesInOneGo);
-		pi->SetPhysAlloc();
-		++pi;
-		}
-	MmuLock::Unlock();
+	SetAllocPhysRam(aPhysAddr, aCount);
 
 	return KErrNone;
 	}
@@ -1050,7 +1059,13 @@
 		}
 	MmuLock::Unlock();
 
-	iRamPageAllocator->FreePhysicalRam(aPhysAddr, aCount << KPageShift);
+	TUint bytes = aCount << KPageShift;
+	iRamPageAllocator->FreePhysicalRam(aPhysAddr, bytes);
+
+#ifdef BTRACE_KERNEL_MEMORY
+	BTrace8(BTrace::EKernelMemory, BTrace::EKernelMemoryDrvPhysFree, bytes, aPhysAddr);
+	Epoc::DriverAllocdPhysRam -= bytes;
+#endif
 	}
 
 
@@ -1058,25 +1073,11 @@
 	{
 	__KTRACE_OPT(KMMU,Kern::Printf("Mmu::ClaimPhysicalRam(0x%08x,0x%x,0x%08x)",aPhysAddr,aCount,aFlags));
 	aPhysAddr &= ~KPageMask;
-	TInt r = iRamPageAllocator->ClaimPhysicalRam(aPhysAddr,(aCount << KPageShift));
-	if(r!=KErrNone)
+	TInt r = iRamPageAllocator->ClaimPhysicalRam(aPhysAddr, aCount << KPageShift);
+	if(r != KErrNone)
 		return r;
 
-	PagesAllocated((TPhysAddr*)(aPhysAddr|1), aCount, aFlags);
-
-	// update page infos...
-	SPageInfo* pi = SPageInfo::FromPhysAddr(aPhysAddr);
-	SPageInfo* piEnd = pi+aCount;
-	TUint flash = 0;
-	MmuLock::Lock();
-	while(pi<piEnd)
-		{
-		MmuLock::Flash(flash,KMaxPageInfoUpdatesInOneGo);
-		pi->SetPhysAlloc();
-		++pi;
-		}
-	MmuLock::Unlock();
-
+	AllocatedPhysicalRam(aPhysAddr, aCount, aFlags);
 	return KErrNone;
 	}
 
@@ -1088,17 +1089,59 @@
 	PagesAllocated((TPhysAddr*)(aPhysAddr|1), aCount, aFlags);
 
 	// update page infos...
+	SetAllocPhysRam(aPhysAddr, aCount);
+	}
+
+
+void Mmu::SetAllocPhysRam(TPhysAddr aPhysAddr, TUint aCount)
+	{
 	SPageInfo* pi = SPageInfo::FromPhysAddr(aPhysAddr);
 	SPageInfo* piEnd = pi+aCount;
 	TUint flash = 0;
 	MmuLock::Lock();
 	while(pi<piEnd)
 		{
-		MmuLock::Flash(flash,KMaxPageInfoUpdatesInOneGo);
+		MmuLock::Flash(flash, KMaxPageInfoUpdatesInOneGo);
 		pi->SetPhysAlloc();
 		++pi;
 		}
 	MmuLock::Unlock();
+
+#ifdef BTRACE_KERNEL_MEMORY
+	TUint bytes = aCount << KPageShift;
+	BTrace8(BTrace::EKernelMemory, BTrace::EKernelMemoryDrvPhysAlloc, bytes, aPhysAddr);
+	Epoc::DriverAllocdPhysRam += bytes;
+#endif
+	}
+
+
+void Mmu::SetAllocPhysRam(TPhysAddr* aPageList, TUint aNumPages)
+	{
+	TPhysAddr* page = aPageList;
+	TPhysAddr* pageEnd = aPageList + aNumPages;
+	TUint flash = 0;
+	MmuLock::Lock();
+	while (page < pageEnd)
+		{
+		MmuLock::Flash(flash, KMaxPageInfoUpdatesInOneGo / 2);
+		TPhysAddr pagePhys = *page++;
+		__NK_ASSERT_DEBUG(pagePhys != KPhysAddrInvalid);
+		SPageInfo::FromPhysAddr(pagePhys)->SetPhysAlloc();
+		}
+	MmuLock::Unlock();
+
+#ifdef BTRACE_KERNEL_MEMORY
+	if (BTrace::CheckFilter(BTrace::EKernelMemory))
+		{// Only loop round each page if EKernelMemory tracing is enabled
+		TPhysAddr* pAddr = aPageList;
+		TPhysAddr* pAddrEnd = aPageList + aNumPages;
+		while (pAddr < pAddrEnd)
+			{
+			BTrace8(BTrace::EKernelMemory, BTrace::EKernelMemoryDrvPhysAlloc, KPageSize, *pAddr++);
+			Epoc::DriverAllocdPhysRam += KPageSize;
+			}
+		}
+#endif
 	}
 
 
@@ -1187,20 +1230,10 @@
 	__NK_ASSERT_DEBUG(iSize>=1);
 	__NK_ASSERT_DEBUG(iCount==0);
 
-	TUint colour = aColour&KPageColourMask;
-	TLinAddr addr = iLinAddr+(colour<<KPageShift);
-	TPte* pPte = iPtePtr+colour;
-	iColour = colour;
-
-	__ASSERT_DEBUG(*pPte==KPteUnallocatedEntry,MM::Panic(MM::ETempMappingAlreadyInUse));
-	*pPte = (aPage&~KPageMask) | iBlankPte;
-	CacheMaintenance::SinglePteUpdated((TLinAddr)pPte);
-	InvalidateTLBForPage(addr|KKernelOsAsid);
-
-	iCount = 1;
-	return addr;
+	return Map(aPage, aColour, iBlankPte);
 	}
 
+
 /**
 Map a single physical page into this temporary mapping using the given page table entry (PTE) value.
 
@@ -1215,16 +1248,17 @@
 	{
 	__NK_ASSERT_DEBUG(iSize>=1);
 	__NK_ASSERT_DEBUG(iCount==0);
-
-	TUint colour = aColour&KPageColourMask;
-	TLinAddr addr = iLinAddr+(colour<<KPageShift);
-	TPte* pPte = iPtePtr+colour;
+	__NK_ASSERT_DEBUG(!(aBlankPte & ~KPageMask));
+
+	TUint colour = aColour & KPageColourMask;
+	TLinAddr addr = iLinAddr + (colour << KPageShift);
+	TPte* pPte = iPtePtr + colour;
 	iColour = colour;
 
-	__ASSERT_DEBUG(*pPte==KPteUnallocatedEntry,MM::Panic(MM::ETempMappingAlreadyInUse));
-	*pPte = (aPage&~KPageMask) | aBlankPte;
+	__ASSERT_DEBUG(*pPte == KPteUnallocatedEntry, MM::Panic(MM::ETempMappingAlreadyInUse));
+	*pPte = (aPage & ~KPageMask) | aBlankPte;
 	CacheMaintenance::SinglePteUpdated((TLinAddr)pPte);
-	InvalidateTLBForPage(addr|KKernelOsAsid);
+	InvalidateTLBForPage(addr | KKernelOsAsid);
 
 	iCount = 1;
 	return addr;
@@ -1290,19 +1324,16 @@
 	TUint colour = iColour;
 	TLinAddr addr = iLinAddr+(colour<<KPageShift);
 	TPte* pPte = iPtePtr+colour;
-	TUint count = iCount;
-
-	while(count)
+
+	while(iCount)
 		{
 		*pPte = KPteUnallocatedEntry;
 		CacheMaintenance::SinglePteUpdated((TLinAddr)pPte);
 		InvalidateTLBForPage(addr|KKernelOsAsid);
 		addr += KPageSize;
 		++pPte;
-		--count;
+		--iCount;
 		}
-
-	iCount = 0;
 	}
 
 #ifdef __SMP__
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mmu.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mmu.h	Wed Mar 31 23:38:45 2010 +0300
@@ -86,7 +86,8 @@
 		Page is in an indeterminate state.
 
 		A page is placed into this state by Mmu::PagesAllocated when it is
-		allocated (ceases to be #EUnused). Once the page
+		allocated (ceases to be #EUnused). Once the page has been assigned to 
+		its new use its type will be updated.
 		*/
 		EUnknown,
 
@@ -222,7 +223,7 @@
 		{
 		/**
 		The memory object which owns this page.
-		Used for always set for #EManaged pages and can be set for #PhysAlloc pages.
+		Always set for #EManaged pages and can be set for #PhysAlloc pages.
 		*/
 		DMemoryObject* iOwner;
 
@@ -301,7 +302,7 @@
 	*/
 	FORCE_INLINE static SPageInfo* FromLink(SDblQueLink* aLink)
 		{
-		return (SPageInfo*)((TInt)aLink-_FOFF(SPageInfo,iLink));
+		return _LOFF(aLink, SPageInfo, iLink);
 		}
 
 	//
@@ -487,7 +488,7 @@
 		}
 
 	/**
-	Reutrns a pointer to the SPageInfo of the page that this page is shadowing.
+	Returns a pointer to the SPageInfo of the page that this page is shadowing.
 
 	@return	A pointer to the SPageInfo that this page is shadowing
 
@@ -574,7 +575,7 @@
 		}
 
 	/**
-	The the pages #iModifier value.
+	Set the page's #iModifier value.
 
 	#iModifier is cleared to zero whenever the usage or paging state of the page
 	changes. So if a thread sets this to a suitable unique value (e.g. the address
@@ -1435,7 +1436,7 @@
 	*/
 	FORCE_INLINE static SPageTableInfo* FromFreeLink(SDblQueLink* aLink)
 		{
-		return (SPageTableInfo*)((TInt)aLink-_FOFF(SPageTableInfo,iUnused));
+		return _LOFF(aLink, SPageTableInfo, iUnused);
 		}
 
 	/**
@@ -1712,9 +1713,9 @@
 	*/
 	static FORCE_INLINE void UnlockGuardStart()
 		{
-		#ifdef _DEBUG
-			++UnlockGuardNest;
-		#endif
+#ifdef _DEBUG
+		++UnlockGuardNest;
+#endif
 		}
 
 	/**
@@ -1723,18 +1724,18 @@
 
 	@see UnlockGuardStart
 
-	@return True if the MmuLock was released between a previous #UnlockGuardStart
+	@return EFalse if the MmuLock was released between a previous #UnlockGuardStart
 			and the call this function.
 	*/
 	static FORCE_INLINE TBool UnlockGuardEnd()
 		{
-		#ifdef _DEBUG
-			__NK_ASSERT_DEBUG(UnlockGuardNest);
-			--UnlockGuardNest;
-			return UnlockGuardFail==0;
-		#else
-			return true;
-		#endif
+#ifdef _DEBUG
+		__NK_ASSERT_DEBUG(UnlockGuardNest);
+		--UnlockGuardNest;
+		return UnlockGuardFail==0;
+#else
+		return ETrue;
+#endif
 		}
 
 private:
@@ -1744,10 +1745,10 @@
 	*/
 	static FORCE_INLINE void UnlockGuardCheck()
 		{
-		#ifdef _DEBUG
-			if(UnlockGuardNest)
-				UnlockGuardFail = true;
-		#endif
+#ifdef _DEBUG
+		if(UnlockGuardNest)
+			UnlockGuardFail = ETrue;
+#endif
 		}
 
 private:
@@ -1951,6 +1952,8 @@
 	void Init2FinalCommon();
 	void Init3();
 
+	void BTracePrime(TUint aCategory);
+
 	static void Panic(TPanic aPanic);
 
 	static TInt HandlePageFault(TLinAddr aPc, TLinAddr aFaultAddress, TUint aAccessPermissions, TAny* aExceptionInfo);
@@ -1979,7 +1982,11 @@
 	void FreePhysicalRam(TPhysAddr aPhysAddr, TUint aCount);
 	TInt ClaimPhysicalRam(TPhysAddr aPhysAddr, TUint aCount, TRamAllocFlags aFlags);
 	void AllocatedPhysicalRam(TPhysAddr aPhysAddr, TUint aCount, TRamAllocFlags aFlags);
+private:
+	void SetAllocPhysRam(TPhysAddr aPhysAddr, TUint aCount);
+	void SetAllocPhysRam(TPhysAddr* aPageList, TUint aNumPages);
 
+public:
 	TLinAddr MapTemp(TPhysAddr aPage, TUint aColour, TUint aSlot=0);
 	void UnmapTemp(TUint aSlot=0);
 	void RemoveAliasesForPageTable(TPhysAddr aPageTable);
@@ -2132,8 +2139,11 @@
 	TUint iRamAllocInitialFreePages;
 
 	friend class RamAllocLock;
+
+#ifdef FMM_VERIFY_RAM
 private:
 	void VerifyRam();
+#endif
 	};
 
 /**
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mpagearray.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mpagearray.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -258,7 +258,7 @@
 	}
 
 
-void RPageArray::TIter::Add(TUint aCount, TPhysAddr* aPages)
+void RPageArray::TIter::Add(TUint aCount, const TPhysAddr* aPages)
 	{
 	// MmuLock NOT required because...
 	// 1. AddStart has ensured all segments are allocated and locked (so they can't be deleted)
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mpagearray.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mpagearray.h	Wed Mar 31 23:38:45 2010 +0300
@@ -543,7 +543,7 @@
 		@param aCount		The number of pages to add.
 		@param aPages		Pointer to list of \a aCount physical page addresses to add.
 		*/
-		void Add(TUint aCount, TPhysAddr* aPages);
+		void Add(TUint aCount, const TPhysAddr* aPages);
 
 		/**
 		Add contiguous pages to the array, setting each entry state as ECommitted.
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mpager.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mpager.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -86,7 +86,7 @@
 
 #elif defined(__CPU_X86)
 
-/*	Need at least 6 mapped pages to guarantee to be able to execute all ARM instructions,
+/*	Need at least 6 mapped pages to guarantee to be able to execute all X86 instructions,
 	plus enough pages for 6 page tables to map those pages, plus enough pages for the
 	page table info structures of those page tables.
 	(Worst case is (?) a MOV [X],[Y] instruction with instruction, 'X' and 'Y' all
@@ -208,8 +208,7 @@
 		TInt r = m.AllocRam(&pagePhys, 1, 
 							(Mmu::TRamAllocFlags)(EMemAttNormalCached|Mmu::EAllocNoWipe|Mmu::EAllocNoPagerReclaim), 
 							EPageDiscard);
-		if(r!=KErrNone)
-			__NK_ASSERT_ALWAYS(0);
+		__NK_ASSERT_ALWAYS(r == KErrNone);
 		MmuLock::Lock();
 		AddAsFreePage(SPageInfo::FromPhysAddr(pagePhys));
 		MmuLock::Unlock();
@@ -226,50 +225,61 @@
 
 
 #ifdef _DEBUG
-TBool DPager::CheckLists()
+#ifdef FMM_PAGER_CHECK_LISTS
+TBool CheckList(SDblQueLink* aHead, TUint aCount)
 	{
-#if 0
-	__NK_ASSERT_DEBUG(MmuLock::IsHeld());
-	SDblQueLink* head = &iOldList.iA;
-	TInt n = iOldCount;
-	SDblQueLink* link = head;
-	while(n--)
+	SDblQueLink* link = aHead;
+	while(aCount--)
 		{
 		link = link->iNext;
-		if(link==head)
-			return false;
+		if(link == aHead)
+			return EFalse;
 		}
 	link = link->iNext;
-	if(link!=head)
-		return false;
-
-	head = &iYoungList.iA;
-	n = iYoungCount;
-	link = head;
-	while(n--)
-		{
-		link = link->iNext;
-		if(link==head)
-			return false;
-		}
-	link = link->iNext;
-	if(link!=head)
-		return false;
-
-//	TRACEP(("DP: y=%d o=%d f=%d",iYoungCount,iOldCount,iNumberOfFreePages));
-#endif
-//	TraceCounts();
+	if(link != aHead)
+		return EFalse;
+	return ETrue;
+	}
+#endif // #ifdef FMM_PAGER_CHECK_LISTS
+
+TBool DPager::CheckLists()
+	{
+#ifdef FMM_PAGER_CHECK_LISTS
+	__NK_ASSERT_DEBUG(MmuLock::IsHeld());
+	if (!CheckList(&iOldList.iA, iOldCount))
+		return EFalse;
+	if (!CheckList(&iYoungList.iA, iYoungCount))
+		return EFalse;
+
+#ifdef _USE_OLDEST_LISTS
+	if (!CheckList(&iOldestCleanList.iA, iOldestCleanCount))
+		return EFalse;
+	if (!CheckList(&iOldestDirtyList.iA, iOldestDirtyCount))
+		return EFalse;
+	TRACEP(("DP: y=%d o=%d oc=%d od=%d f=%d", iYoungCount, iOldCount, 
+			iOldestCleanCount, iOldestDirtyCount, iNumberOfFreePages));
+#else
+	TRACEP(("DP: y=%d o=%d f=%d", iYoungCount, iOldCount, iNumberOfFreePages));
+#endif //#ifdef _USE_OLDEST_LISTS
+	TraceCounts();
+#endif // #ifdef FMM_PAGER_CHECK_LISTS
 	return true;
 	}
 
 void DPager::TraceCounts()
 	{
+#ifdef _USE_OLDEST_LISTS
+	TRACEP(("DP: y=%d o=%d oc=%d od=%d f=%d min=%d max=%d ml=%d res=%d",
+		iYoungCount, iOldCount, iOldestCleanCount, iOldestDirtyCount, 
+		iNumberOfFreePages, iMinimumPageCount, iMaximumPageCount,
+		iMinimumPageLimit, iReservePageCount));
+#else
 	TRACEP(("DP: y=%d o=%d f=%d min=%d max=%d ml=%d res=%d",
-		iYoungCount,iOldCount,iNumberOfFreePages,iMinimumPageCount,
-		iMaximumPageCount,iMinimumPageLimit,iReservePageCount));
+		iYoungCount, iOldCount, iNumberOfFreePages, iMinimumPageCount,
+		iMaximumPageCount, iMinimumPageLimit, iReservePageCount));
+#endif //#ifdef _USE_OLDEST_LISTS
 	}
-
-#endif
+#endif //#ifdef _DEBUG
 
 
 TBool DPager::HaveTooManyPages()
@@ -1740,9 +1750,8 @@
 		aMaximumPageCount=aMinimumPageCount;
 
 	// Increase iMaximumPageCount?
-	TInt extra = aMaximumPageCount-iMaximumPageCount;
-	if(extra>0)
-		iMaximumPageCount += extra;
+	if(aMaximumPageCount > iMaximumPageCount)
+		iMaximumPageCount = aMaximumPageCount;
 
 	// Reduce iMinimumPageCount?
 	TInt spare = iMinimumPageCount-aMinimumPageCount;
@@ -2158,7 +2167,7 @@
 	TUint count = iUseRegionCount;
 	// note, this comparison would fail if either region includes page number KMaxTUint,
 	// but it isn't possible to create a memory object which is > KMaxTUint pages...
-	return memory == aMemory && index+count > aIndex && index < aIndex+aCount;
+	return (memory == aMemory) && ((index + count) > aIndex) && (index < (aIndex + aCount));
 	}
 
 
@@ -2524,15 +2533,15 @@
 EXPORT_C TInt DDemandPagingLock::Lock(DThread* aThread, TLinAddr aStart, TInt aSize)
 	{
 //	TRACEP(("DDemandPagingLock[0x%08x]::Lock(0x%08x,0x%08x,0x%08x)",this,aThread,aStart,aSize));
-	if(iLockedPageCount)
-		__NK_ASSERT_ALWAYS(0); // lock already used
+	__NK_ASSERT_ALWAYS(!iLockedPageCount); // lock already used
 
 	// calculate the number of pages that need to be locked...
 	TUint mask=KPageMask;
 	TUint offset=aStart&mask;
 	TInt numPages = (aSize+offset+mask)>>KPageShift;
-	if(numPages>iMaxPageCount)
-		__NK_ASSERT_ALWAYS(0);
+
+	// Should never be asked to lock more pages than are allocated to this object.
+	__NK_ASSERT_ALWAYS(numPages <= iMaxPageCount);
 
 	NKern::ThreadEnterCS();
 
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mpager.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mpager.h	Wed Mar 31 23:38:45 2010 +0300
@@ -50,6 +50,11 @@
 		MmuLock::Unlock();
 		return ret;
 		}
+
+	FORCE_INLINE TUint MinimumPageCount()
+		{
+		return iMinimumPageCount;
+		}
 	
 	FORCE_INLINE void SetWritable(SPageInfo& aPageInfo)
 		{
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mpdalloc.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mpdalloc.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -134,7 +134,14 @@
 	RamAllocLock::Lock();
 	TInt r = m.AllocContiguousRam(pdPhys, KLocalPdPages, KLocalPdShift-KPageShift, iPageDirectoryMemory->RamAllocFlags());
 	if(r==KErrNone)
+		{
 		AssignPages(offset>>KPageShift,KLocalPdPages,pdPhys);
+
+#ifdef BTRACE_KERNEL_MEMORY
+		BTrace4(BTrace::EKernelMemory, BTrace::EKernelMemoryMiscAlloc, KLocalPdPages << KPageShift);
+		Epoc::KernelMiscPages += KLocalPdPages;
+#endif
+		}
 	RamAllocLock::Unlock();
 
 	if(r==KErrNone)
@@ -147,6 +154,11 @@
 			{
 			RamAllocLock::Lock();
 			m.FreeContiguousRam(pdPhys,KLocalPdPages);
+
+#ifdef BTRACE_KERNEL_MEMORY
+			BTrace4(BTrace::EKernelMemory, BTrace::EKernelMemoryMiscFree, KLocalPdPages << KPageShift);
+			Epoc::KernelMiscPages -= KLocalPdPages;
+#endif
 			RamAllocLock::Unlock();
 			}
 		else
@@ -206,6 +218,11 @@
 	Mmu& m = TheMmu;
 	// Page directories are fixed.
 	m.FreeRam(pages, KLocalPdPages, EPageFixed);
+
+#ifdef BTRACE_KERNEL_MEMORY
+	BTrace4(BTrace::EKernelMemory, BTrace::EKernelMemoryMiscFree, KLocalPdPages << KPageShift);
+	Epoc::KernelMiscPages -= KLocalPdPages;
+#endif
 	RamAllocLock::Unlock();
 	}
 
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mptalloc.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mptalloc.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -177,6 +177,14 @@
 	else
 		{// Allocate fixed paged as page tables aren't movable.
 		r = TheMmu.AllocRam(&pagePhys, 1, aMemory->RamAllocFlags(), EPageFixed);
+
+#ifdef BTRACE_KERNEL_MEMORY
+		if (r == KErrNone)
+			{
+			BTrace4(BTrace::EKernelMemory, BTrace::EKernelMemoryMiscAlloc, KPageSize);
+			++Epoc::KernelMiscPages;
+			}
+#endif
 		}
 	RamAllocLock::Unlock();
 
@@ -241,7 +249,14 @@
 		if(aDemandPaged)
 			ThePager.PageInFreePages(&pagePhys,1);
 		else
+			{
 			TheMmu.FreeRam(&pagePhys, 1, EPageFixed);
+
+#ifdef BTRACE_KERNEL_MEMORY
+			BTrace4(BTrace::EKernelMemory, BTrace::EKernelMemoryMiscFree, KPageSize);
+			--Epoc::KernelMiscPages;
+#endif
+			}
 		r = 1;
 		}
 
@@ -362,11 +377,8 @@
 	{
 	iReserveCount = aReserveCount;
 	iDemandPaged = aDemandPaged;
-	while(iFreeCount<aReserveCount)
-		if(!aAllocator->AllocReserve(*this))
-			{
-			__NK_ASSERT_ALWAYS(0);
-			}
+	while(iFreeCount < aReserveCount)
+		__NK_ASSERT_ALWAYS(aAllocator->AllocReserve(*this));
 	}
 
 
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mrom.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mrom.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -967,6 +967,11 @@
 		MmuLock::Lock();
 		SPageInfo::FromPhysAddr(iNewPage)->SetShadow(aIndex,aMemory->PageInfoFlags());
 		MmuLock::Unlock();
+
+#ifdef BTRACE_KERNEL_MEMORY
+		BTrace4(BTrace::EKernelMemory, BTrace::EKernelMemoryMiscAlloc, KPageSize);
+		++Epoc::KernelMiscPages;
+#endif
 		}
 
 	RamAllocLock::Unlock();
@@ -990,6 +995,11 @@
 		{
 		RamAllocLock::Lock();
 		TheMmu.FreeRam(&iNewPage, 1, EPageFixed);
+
+#ifdef BTRACE_KERNEL_MEMORY
+		BTrace4(BTrace::EKernelMemory, BTrace::EKernelMemoryMiscFree, KPageSize);
+		--Epoc::KernelMiscPages;
+#endif
 		RamAllocLock::Unlock();
 		}
 	if(IsAttached())
--- a/kernel/eka/memmodel/epoc/flexible/mmu/mvalloc.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mvalloc.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -688,7 +688,7 @@
 
 RVirtualAllocSlabSet* RVirtualAllocSlabSet::New(RVirtualAllocator* aAllocator, TUint aNumSlabTypes, DMutex*& aWriteLock)
 	{
-	TUint size = sizeof(RVirtualAllocSlabSet)+sizeof(((RVirtualAllocSlabSet*)0x100)->iSlabs)*(aNumSlabTypes-1);
+	TUint size = sizeof(RVirtualAllocSlabSet) + sizeof(SDblQue) * (aNumSlabTypes - 1);
 	RVirtualAllocSlabSet* set = (RVirtualAllocSlabSet*)Kern::AllocZ(size);
 	if(set)
 		new (set) RVirtualAllocSlabSet(aAllocator,aNumSlabTypes,aWriteLock);
@@ -764,8 +764,9 @@
 		if(!slab)
 			return KErrNoMemory;
 		TLinAddr addr = slab->Alloc(aSizeShift);
-		if(!addr)
-			return KErrNoMemory;
+		// Shouldn't ever fail as we've just allocated an empty slab and we can't 
+		// attempt to allocate more than a whole slab.
+		__NK_ASSERT_DEBUG(addr);
 		aAddr = addr;
 		return KErrNone;
 		}
@@ -830,8 +831,8 @@
 RVirtualAllocator::~RVirtualAllocator()
 	{
 	__NK_ASSERT_DEBUG(iAllocator==0 || iAllocator->iAvail==iAllocator->iSize); // should be empty
-	Kern::Free(iAllocator);
-	Kern::Free(iSlabSet);
+	delete iAllocator;
+	delete iSlabSet;
 	}
 
 
--- a/kernel/eka/memmodel/epoc/mmubase/defragbase.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/mmubase/defragbase.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -405,7 +405,7 @@
 		BTrace4(BTrace::ERamAllocator, BTrace::ERamAllocClaimZone, zone->iId);
 #endif
 
-#ifdef BTRACE_KERNEL_MEMORY
+#if defined(BTRACE_KERNEL_MEMORY) && !defined(__MEMMODEL_FLEXIBLE__)
 		TUint size = zone->iPhysPages << M::PageShift();
 		BTrace8(BTrace::EKernelMemory, BTrace::EKernelMemoryDrvPhysAlloc, size, zone->iPhysBase);
 		Epoc::DriverAllocdPhysRam += size;
--- a/kernel/eka/memmodel/epoc/mmubase/mmubase.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/mmubase/mmubase.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -1263,14 +1263,14 @@
 #endif
 
 #ifdef BTRACE_RAM_ALLOCATOR
-	// Must check for -1 as that is the default value of aCategroy for
+	// Must check for -1 as that is the default value of aCategory for
 	// BTrace::Prime() which is intended to prime all categories that are 
 	// currently enabled via a single invocation of BTrace::Prime().
 	if(aCategory==BTrace::ERamAllocator || (TInt)aCategory == -1)
 		{
 		NKern::ThreadEnterCS();
 		Mmu::Wait();
-		Mmu::Get().iRamPageAllocator->SendInitialBtraceLogs();
+		Mmu::Get().iRamPageAllocator->DoBTracePrime();
 		Mmu::Signal();
 		NKern::ThreadLeaveCS();
 		}
@@ -2683,8 +2683,8 @@
 	SPageInfo::TType type = aPageInfo->Type();
 	if(type==SPageInfo::EChunk)
 		{
-		//Must not donate locked page. An example is DMA trasferred memory.
-		__NK_ASSERT_DEBUG(0 == aPageInfo->LockCount());
+		// Must not donate locked page. An example is DMA transferred memory.
+		__NK_ASSERT_DEBUG(!aPageInfo->LockCount());
 
 		aPageInfo->Change(SPageInfo::EPagedCache,SPageInfo::EStatePagedYoung);
 		iPageList.Add(&aPageInfo->iLink);
@@ -3698,8 +3698,8 @@
 	SPageInfo::TType type = aPageInfo->Type();
 	if(type==SPageInfo::EChunk)
 		{
-		//Must not donate locked page. An example is DMA trasferred memory.
-		__NK_ASSERT_DEBUG(0 == aPageInfo->LockCount());
+		// Must not donate locked page. An example is DMA transferred memory.
+		__NK_ASSERT_DEBUG(!aPageInfo->LockCount());
 		
 		aPageInfo->Change(SPageInfo::EPagedCache,SPageInfo::EStatePagedYoung);
 
--- a/kernel/eka/memmodel/epoc/mmubase/ramalloc.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/mmubase/ramalloc.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -2852,7 +2852,7 @@
 It outputs the zone configuration and the base addresses of any contiguous block
 of allocated pages.
 */
-void DRamAllocator::SendInitialBtraceLogs(void)
+void DRamAllocator::DoBTracePrime(void)
 	{
 	M::RamAllocIsLocked();
 	CHECK_PRECONDITIONS(MASK_THREAD_CRITICAL, "DRamAllocator::SendInitialBtraceLogs");
--- a/kernel/eka/memmodel/epoc/moving/arm/xmmu.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/moving/arm/xmmu.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -444,14 +444,18 @@
 	return phys;
 	}
 
+
 TInt ArmMmu::PreparePagesForDMA(TLinAddr aLinAddr, TInt aSize, TPhysAddr* aPhysicalPageList)
 //Returns the list of physical pages belonging to the specified memory space.
 //Checks these pages belong to a chunk marked as being trusted. 
-//Locks these pages so they can not be moved by e.g. ram defragmenation.
+//Locks these pages so they can not be moved by e.g. ram defragmentation.
 	{
 	SPageInfo* pi = NULL;
 	DChunk* chunk = NULL;
 	TInt err = KErrNone;
+
+	__NK_ASSERT_DEBUG(MM::MaxPagesInOneGo == 32);	// Needs to be a power of 2.
+	TUint flashMask = MM::MaxPagesInOneGo - 1;
 	
 	__KTRACE_OPT(KMMU2,Kern::Printf("ArmMmu::PreparePagesForDMA %08x+%08x, asid=%d",aLinAddr,aSize));
 
@@ -474,41 +478,64 @@
 		
 		pagesLeft -= pagesLeftInChunk;
 
-		TPte* pt = SafePageTableFromPde(*pdePtr++);
-		if(!pt) { err = KErrNotFound; goto fail; }// Cannot get page table.
-
-		pt += pageIndex;
+		TPte* pPte = SafePageTableFromPde(*pdePtr++);
+		if(!pPte) 
+			{// Cannot get page table. 
+			err = KErrNotFound; 
+			goto fail; 
+			}
+		
+		pPte += pageIndex;
 
 		for(;pagesLeftInChunk--;)
 			{
-			TPhysAddr phys = (*pt++ & KPteSmallPageAddrMask);
+			TPhysAddr phys = (*pPte++ & KPteSmallPageAddrMask);
 			pi =  SPageInfo::SafeFromPhysAddr(phys);
-			if(!pi)	{ err = KErrNotFound; goto fail; }// Invalid address
-
+			if(!pi)	
+				{// Invalid address
+				err = KErrNotFound; 
+				goto fail; 
+				}
+			
 			__KTRACE_OPT(KMMU2,Kern::Printf("PageInfo: PA:%x T:%x S:%x O:%x C:%x",phys, pi->Type(), pi->State(), pi->Owner(), pi->LockCount()));
-			if (chunk==NULL)
+			if (chunk == NULL)
 				{//This is the first page. Check 'trusted' bit.
 				if (pi->Type()!= SPageInfo::EChunk)
-					{ err = KErrAccessDenied; goto fail; }// The first page do not belong to chunk.	
+					{// The first page does not belong to a chunk.
+					err = KErrAccessDenied;
+					goto fail;
+					}
 
 				chunk = (DChunk*)pi->Owner();
-				if ( (chunk == NULL) || ((chunk->iAttributes & DChunk::ETrustedChunk)== 0) )
-					{ err = KErrAccessDenied; goto fail; } // Not a trusted chunk
+				if ((chunk == NULL) || ((chunk->iAttributes & DChunk::ETrustedChunk) == 0))
+					{// Not a trusted chunk
+					err = KErrAccessDenied;
+					goto fail;
+					}
 				}
 			pi->Lock();
 
 			*pageList++ = phys;
-			if ( (++pagesInList&127) == 0) //release system lock temporarily on every 512K
+
+			if(!(++pagesInList & flashMask))
+				{
 				NKern::FlashSystem();
+				}
 			}
 		pageIndex = 0;
 		}
 
-	if (pi->Type()!= SPageInfo::EChunk)
-		{ err = KErrAccessDenied; goto fail; }// The last page do not belong to chunk.	
+	if (pi->Type() != SPageInfo::EChunk)
+		{// The last page does not belong to a chunk.
+		err = KErrAccessDenied;
+		goto fail;
+		}
 
 	if (chunk && (chunk != (DChunk*)pi->Owner()))
-		{ err = KErrArgument; goto fail; }//The first & the last page do not belong to the same chunk.
+		{//The first & the last page do not belong to the same chunk.
+		err = KErrArgument;
+		goto fail;
+		}
 
 	NKern::UnlockSystem();
 	MmuBase::Signal();
@@ -522,6 +549,7 @@
 	return err;
 	}
 
+
 TInt ArmMmu::ReleasePagesFromDMA(TPhysAddr* aPhysicalPageList, TInt aPageCount)
 // Unlocks physical pages.
 // @param aPhysicalPageList - points to the list of physical pages that should be released.
@@ -530,6 +558,7 @@
 	NKern::LockSystem();
 	__KTRACE_OPT(KMMU2,Kern::Printf("ArmMmu::ReleasePagesFromDMA count:%d",aPageCount));
 
+	TUint flashMask = MM::MaxPagesInOneGo - 1;
 	while (aPageCount--)
 		{
 		SPageInfo* pi =  SPageInfo::SafeFromPhysAddr(*aPhysicalPageList++);
@@ -540,12 +569,18 @@
 			}
 		__KTRACE_OPT(KMMU2,Kern::Printf("PageInfo: T:%x S:%x O:%x C:%x",pi->Type(), pi->State(), pi->Owner(), pi->LockCount()));
 		pi->Unlock();
+
+		if(!(aPageCount & flashMask))
+			{
+			NKern::FlashSystem();
+			}
 		}
 	NKern::UnlockSystem();
 	return KErrNone;
 	}
 
 
+
 void ArmMmu::Init1()
 	{
 	__KTRACE_OPT2(KBOOT,KMMU,Kern::Printf("ArmMmu::Init1"));
--- a/kernel/eka/memmodel/epoc/multiple/arm/xmmu.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/memmodel/epoc/multiple/arm/xmmu.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -365,14 +365,18 @@
 		}
 	}
 
+
 TInt ArmMmu::PreparePagesForDMA(TLinAddr aLinAddr, TInt aSize, TInt aOsAsid, TPhysAddr* aPhysicalPageList)
 //Returns the list of physical pages belonging to the specified memory space.
 //Checks these pages belong to a chunk marked as being trusted. 
-//Locks these pages so they can not be moved by e.g. ram defragmenation.
+//Locks these pages so they can not be moved by e.g. ram defragmentation.
 	{
 	SPageInfo* pi = NULL;
 	DChunk* chunk = NULL;
 	TInt err = KErrNone;
+
+	__NK_ASSERT_DEBUG(MM::MaxPagesInOneGo == 32);	// Needs to be a power of 2.
+	TUint flashMask = MM::MaxPagesInOneGo - 1;
 	
 	__KTRACE_OPT(KMMU2,Kern::Printf("ArmMmu::PreparePagesForDMA %08x+%08x, asid=%d",aLinAddr,aSize,aOsAsid));
 
@@ -388,6 +392,10 @@
 	MmuBase::Wait(); 	// RamAlloc Mutex for accessing page/directory tables.
 	NKern::LockSystem();// SystemlLock for accessing SPageInfo objects.
 
+	// Get the page directory entry that maps aLinAddr.
+	// If the address is in the global region check whether this asid maps
+	// global pdes (i.e. the LSB of iAsidInfo is set), if not find the pde from 
+	// the kernel's initial page directory.
 	TPde* pdePtr = (pdeIndex<(iLocalPdSize>>2) || (iAsidInfo[aOsAsid]&1)) ? PageDirectory(aOsAsid) : ::InitPageDirectory;
 	pdePtr += pdeIndex;//This points to the first pde 
 
@@ -399,41 +407,66 @@
 		
 		pagesLeft -= pagesLeftInChunk;
 
-		TPte* pt = SafePageTableFromPde(*pdePtr++);
-		if(!pt) { err = KErrNotFound; goto fail; }// Cannot get page table.
+		TPte* pPte = SafePageTableFromPde(*pdePtr++);
+		if(!pPte) 
+			{// Cannot get page table. 
+			err = KErrNotFound; 
+			goto fail; 
+			}
 		
-		pt += pageIndex;
+		pPte += pageIndex;
 
 		for(;pagesLeftInChunk--;)
-			{
-			TPhysAddr phys = (*pt++ & KPteSmallPageAddrMask);
+			{// This pte must be of type ArmV6 small page, the pde type will 
+			// have already been checked by SafePageTableFromPde().
+			__NK_ASSERT_DEBUG((*pPte & KArmV6PteTypeMask) >= KArmV6PteSmallPage);
+			TPhysAddr phys = (*pPte++ & KPteSmallPageAddrMask);
 			pi =  SPageInfo::SafeFromPhysAddr(phys);
-			if(!pi)	{ err = KErrNotFound; goto fail; }// Invalid address
+			if(!pi)	
+				{// Invalid address
+				err = KErrNotFound; 
+				goto fail; 
+				}
 			
 			__KTRACE_OPT(KMMU2,Kern::Printf("PageInfo: PA:%x T:%x S:%x O:%x C:%x",phys, pi->Type(), pi->State(), pi->Owner(), pi->LockCount()));
-			if (chunk==NULL)
+			if (chunk == NULL)
 				{//This is the first page. Check 'trusted' bit.
 				if (pi->Type()!= SPageInfo::EChunk)
-					{ err = KErrAccessDenied; goto fail; }// The first page do not belong to chunk.	
+					{// The first page does not belong to a chunk.
+					err = KErrAccessDenied;
+					goto fail;
+					}
 
 				chunk = (DChunk*)pi->Owner();
-				if ( (chunk == NULL) || ((chunk->iAttributes & DChunk::ETrustedChunk)== 0) )
-					{ err = KErrAccessDenied; goto fail; }// Not a trusted chunk
+				if ((chunk == NULL) || ((chunk->iAttributes & DChunk::ETrustedChunk) == 0))
+					{// Not a trusted chunk
+					err = KErrAccessDenied;
+					goto fail;
+					}
 				}
 			pi->Lock();
 
 			*pageList++ = phys;
-			if ( (++pagesInList&127) == 0) //release system lock temporarily on every 512K
+
+			if(!(++pagesInList & flashMask))
+				{
 				NKern::FlashSystem();
+				}
 			}
 		pageIndex = 0;
 		}
 
-	if (pi->Type()!= SPageInfo::EChunk)
-		{ err = KErrAccessDenied; goto fail; }// The last page do not belong to chunk.	
+	if (pi->Type() != SPageInfo::EChunk)
+		{// The last page does not belong to a chunk.
+		err = KErrAccessDenied;
+		goto fail;
+		}
 
 	if (chunk && (chunk != (DChunk*)pi->Owner()))
-		{ err = KErrArgument; goto fail; }//The first & the last page do not belong to the same chunk.
+		{//The first & the last page do not belong to the same chunk.
+		err = KErrArgument;
+		goto fail;
+		}
 
 	NKern::UnlockSystem();
 	MmuBase::Signal();
@@ -447,6 +480,7 @@
 	return err;
 	}
 
+
 TInt ArmMmu::ReleasePagesFromDMA(TPhysAddr* aPhysicalPageList, TInt aPageCount)
 // Unlocks physical pages.
 // @param aPhysicalPageList - points to the list of physical pages that should be released.
@@ -455,6 +489,7 @@
 	NKern::LockSystem();
 	__KTRACE_OPT(KMMU2,Kern::Printf("ArmMmu::ReleasePagesFromDMA count:%d",aPageCount));
 
+	TUint flashMask = MM::MaxPagesInOneGo - 1;
 	while (aPageCount--)
 		{
 		SPageInfo* pi =  SPageInfo::SafeFromPhysAddr(*aPhysicalPageList++);
@@ -465,11 +500,17 @@
 			}
 		__KTRACE_OPT(KMMU2,Kern::Printf("PageInfo: T:%x S:%x O:%x C:%x",pi->Type(), pi->State(), pi->Owner(), pi->LockCount()));
 		pi->Unlock();
+
+		if(!(aPageCount & flashMask))
+			{
+			NKern::FlashSystem();
+			}
 		}
 	NKern::UnlockSystem();
 	return KErrNone;
 	}
 
+
 TPhysAddr ArmMmu::LinearToPhysical(TLinAddr aLinAddr, TInt aOsAsid)
 //
 // Find the physical address corresponding to a given linear address in a specified OS
--- a/kernel/eka/release.txt	Mon Mar 15 12:45:50 2010 +0200
+++ b/kernel/eka/release.txt	Wed Mar 31 23:38:45 2010 +0300
@@ -1,3 +1,126 @@
+Version 2.00.2102
+=================
+(Made by vfebvre 17/03/2010)
+
+1.	sattiyap
+	1.	DEF144982 Support rapu variant specific e32tests
+
+
+Version 2.00.2101
+=================
+(Made by vfebvre 12/03/2010)
+
+1.	jimmzhou
+	1.	ou1cimx1#293062 A malfunctioning peripheral still cannot be reported to the UI, breaking the "no silent failures" policy of USB OTG
+		TSW: TKEA-836MEU
+
+2.	necliffo
+	1.	DEF144967 EMOL-83CGYT: SPB 10.1: Device freeze when corrupted memory card is used.
+
+
+Version 2.00.2100
+=================
+(Made by vfebvre 11/03/2010)
+
+1.	jimmzhou
+	1.	DEF144628: for submission: TSW defect TSW YXIO-82ZBPL
+
+2.	martai
+	1.	DEF144914: FMM - BTrace messages EKernelMemory are missing from the flexible memory model
+
+3.	gcochran
+	1.	DEF144931 MMEG-83F9A8 - Misleading error message in ExecHandler::ThreadRequestSignal
+
+
+Version 2.00.2099
+=================
+(Made by vfebvre 11/03/2010)
+
+1.	vfebvre
+	1.	DEF144925 base_ubootldr component CBR stage failed in TB92SF_1073
+
+
+Version 2.00.2098
+=================
+(Made by vfebvre 09/03/2010)
+
+1.	lanerobe
+	1.	DEF144710 bootloader component not built in KHS package
+
+2.	martai
+	1.	DEF144800: FMM - The virtual address space manager allocates incorrect size heap cells
+
+
+Version 2.00.2097
+=================
+(Made by vfebvre 08/03/2010)
+
+1.	seolney
+	1.	DEF140598 Assertion failure in DMA PIL 
+		Improved t_dma. Missed interrupt cleanup is cofigurable (with macro
+		DISABLE_MISSED_IRQ_RECOVERY) in DMA PIL v1 and is removed from PIL v2
+
+2.	jimmzhou
+	1.	DEF144618: ARAN-82PGM3: Connecting empty cable causes error, after connecting/disconnecting
+
+
+Version 2.00.2096
+=================
+(Made by vfebvre 04/03/2010)
+
+1.	martai
+	1.	DEF144781: MMEG-8369AQ RThread::Create documentation doesn't mention the minimum stack size 
+
+2.	s40li
+	1.	DEF144533 USB PIL Crash after MTP server panic
+
+
+Version 2.00.2095
+=================
+(Made by vfebvre 03/03/2010)
+
+1	paconway
+	1.	PDEF144746 Coverity defect in onbl2.cpp (UNINIT) 
+
+2.	y153liu
+	1.	DEF144620: Extra KErrUsbOtgPeriphNotSupported Event for Peripheral Requires More power
+
+
+Version 2.00.2094
+=================
+(Made by vfebvre 02/03/2010)
+
+1.	jimhofe
+	1.	MINOR_CHANGE: Changing kernelhwsrv/kernel/eka/drivers/pbus/mmc/sdcard/eabi/sdcard3c policyid to 7
+	2.	MINOR_CHANGE: Changing policyId from 1 to 7 for kernelhwsrv\kernel\eka\drivers\pbus\mmc\sdcard\XXXX\sdcard3c
+
+2.	gayarama
+	1.	DEF144267 t_tbus_datapaging test fails on Vasco/TB9.2 due to fileserver api issue
+
+3.	martai
+	1.	DEF144639: ArmMmu::ReleasePagesFromDMA() may hold system lock for unbounded time periods 
+
+
+Version 2.00.2093
+=================
+(Made by vfebvre 01/03/2010)
+
+1.	vfebvre
+	1.	PDEF144682 E32TEST T_PIN test failures on x86gcc.fmm (t_pin.cpp:688)
+
+2.	ferporta
+	1.	DEF142018 Debug Sec Srv crashes if asked for an incompat srv version
+	2.	DEF143491 Breakpoints in looping code can be missed when inserting/deleting and stepping
+
+
+Version 2.00.2092
+=================
+(Made by vfebvre 26/02/2010)
+
+1.	lforynsk
+	1.	PDEF144647:Occasional T_CHNOT failures on SMP configurations 
+
+
 Version 2.00.2091
 =================
 (Made by vfebvre 25/02/2010)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/benchmark/bm_rapu_pdd.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -0,0 +1,262 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+/*
+Change History:
+VERSION     : 2     26-01-2010     Ruixing Yang
+REASON      : 
+REFERENCE   : 
+DESCRIPTION : The timer resolution is modified for better interrupt latency calculation
+
+Change History:
+VERSION     : 1     25-01-2010     Ruixing Yang
+REASON      : 
+REFERENCE   : 
+DESCRIPTION : Initial implementation of BM_SUITE PDD for Rapu platform
+
+*/
+
+
+#include <kernel/kernel.h>
+#include <internal/rap_hw.h>
+#include <internal/rap.h>
+#include "k32bm.h"
+
+
+
+
+	
+
+class DBMRapuDevice : public DPhysicalDevice
+	{
+public:
+	DBMRapuDevice();
+	virtual TInt Install();
+	virtual void GetCaps(TDes8& aDes) const;
+	virtual TInt Create(DBase*& aChannel, TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
+	virtual TInt Validate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
+	};
+
+class DBMRapuChannel : public DBMPChannel
+	{
+public:
+	DBMRapuChannel();
+	~DBMRapuChannel();
+	virtual TBMTicks TimerPeriod();
+	virtual TBMTicks TimerStamp();
+	virtual TBMNs TimerTicksToNs(TBMTicks);
+	virtual TBMTicks TimerNsToTicks(TBMNs);
+	virtual TInt BindInterrupt(MBMIsr*);
+	virtual TInt BindInterrupt(MBMInterruptLatencyIsr*);
+	virtual void RequestInterrupt();
+	virtual void CancelInterrupt();
+
+private:
+	
+	static const TBMTicks	KBMRapuPeriod = (((TBMTicks) 1) << 32);
+	// Ticks at 1000Hz, input clock to timer @ 32.768 MHz.
+	static const TInt KHighResTimerFrequency = 32768000;   // 32.768 MHz
+	
+	static const TBMNs		KBMRapuNsPerTick = (1000*1000*1000) / KHighResTimerFrequency;	
+	static const TInt KRTC_Freq = 32768;
+	static const TInt KRTC_Ratio = 1172;
+	
+
+		
+	static void Isr(TAny*);
+	
+	MBMIsr*								iIsr;
+	MBMInterruptLatencyIsr*		iInterruptLatencyIsr;	
+	TUint									iTmpStartCount;
+	TUint									iTmpLongCount;	
+	NTimer								iTimer;
+	volatile TUint				iStartCount;
+	volatile TUint				iRunCount;
+	volatile TUint				iCancelCount;
+	};
+	
+	RTC001_STR& RTC001 = *reinterpret_cast<RTC001_STR*>(KRapRegRTC001);
+	GPT003_STR& GPT003 = *reinterpret_cast<GPT003_STR*>(KRapRegGPT003A0);
+	
+	
+DECLARE_STANDARD_PDD()
+//
+// Create a new device
+//
+	{
+	__ASSERT_CRITICAL;
+	return new DBMRapuDevice;
+	}
+	
+DBMRapuDevice::DBMRapuDevice()
+//
+// Constructor
+//
+	{
+	
+	iVersion = TVersion(1,0,1);
+	}
+	
+TInt DBMRapuDevice::Install()
+//
+// Install the device driver.
+//
+	{
+		
+	TInt r = SetName(&KBMPdName);
+	return r;
+	}
+	
+void DBMRapuDevice::GetCaps(TDes8& aDes) const
+//
+// Return the Comm capabilities.
+//
+	{
+	
+	}
+	
+TInt DBMRapuDevice::Create(DBase*& aChannel, TInt /*aUnit*/, const TDesC8* /*aInfo*/, const TVersion& /*aVer*/)
+//
+// Create a channel on the device.
+//
+	{
+		
+	__ASSERT_CRITICAL;
+	aChannel = new DBMRapuChannel;
+	return aChannel?KErrNone:KErrNoMemory;
+	}
+
+TInt DBMRapuDevice::Validate(TInt /*aUnit*/, const TDesC8* /*anInfo*/, const TVersion& aVer)
+	{
+		
+	if (!Kern::QueryVersionSupported(iVersion,aVer))
+		{
+		return KErrNotSupported;
+		}
+	return KErrNone;
+	}
+	
+DBMRapuChannel::DBMRapuChannel()
+	: iTimer(&Isr, this)
+	{
+	iTmpStartCount = 0;
+	iTmpLongCount = 0;
+	}
+	
+DBMRapuChannel::~DBMRapuChannel()
+	{
+	//Kern::Printf(("DBMRapuChannel::~DBMRapuChannel()"));	
+	CancelInterrupt();
+	}
+
+TBMTicks DBMRapuChannel::TimerPeriod()
+	{
+		//Kern::Printf(("DBMRapuChannel::TimerPeriod()"));
+	return KBMRapuPeriod;
+	}
+
+TBMTicks DBMRapuChannel::TimerStamp()
+	{
+	//Kern::Printf(("DBMRapuChannel::TimerStamp(), iTimerCount = %u"), RPTimer1::Timer().iTimerCount);	
+	TUint tmpTimeStamp;
+	RTC001.TRIGGER = 0;	
+	tmpTimeStamp = RTC001.LONGCOUNT;
+	tmpTimeStamp *= KRTC_Ratio;
+	tmpTimeStamp += RTC001.SHORTCOUNT;		
+	return tmpTimeStamp;	
+	}	
+
+
+TBMNs DBMRapuChannel::TimerTicksToNs(TBMTicks ticks)
+	{
+	//Kern::Printf(("DBMRapuChannel::TimerTIcksToNs(), iNsPerTick = %u"), (TBMTicks)iNsPerTick);
+	return ticks * KBMRapuNsPerTick;
+	}
+
+TBMTicks DBMRapuChannel::TimerNsToTicks(TBMNs ns)
+	{
+	//Kern::Printf(("DBMRapuChannel::TimerNsToTicks()"));
+	return ns / KBMRapuNsPerTick;	
+	}
+	
+void DBMRapuChannel::Isr(TAny* ptr)
+	{
+	//Kern::Printf(("DBMRapuChannel::Isr()"));
+	// Read RTC001	
+	RTC001.TRIGGER = 0;
+	TUint x = RTC001.LONGCOUNT;
+	x *= KRTC_Ratio;
+	x += RTC001.SHORTCOUNT;
+	TUint wasteTime = 1000000/KBMRapuNsPerTick; //NTimer's resolution is 1 ms = 1000000 ns	
+			
+	DBMRapuChannel* mCh = (DBMRapuChannel*) ptr;
+	BM_ASSERT(mCh->iIsr || mCh->iInterruptLatencyIsr);
+	if (mCh->iIsr)
+		{				
+		mCh->iIsr->Isr( x);	
+		}
+	else
+		{				
+		TUint y = (TUint)( x - mCh->iTmpLongCount - wasteTime);
+		//Kern::Printf(("DBMRapuChannel::Isr(), latency = %u"), y);	
+		mCh->iInterruptLatencyIsr->InterruptLatencyIsr(y);
+		}
+	__e32_atomic_add_ord32(&mCh->iRunCount, 1);
+	}	
+
+TInt DBMRapuChannel::BindInterrupt(MBMIsr* aIsr)
+	{
+	//Kern::Printf(("DBMRapuChannel::BindInterrupt(MBMIsr* aIsr)"));
+	BM_ASSERT(!iIsr);
+	BM_ASSERT(!iInterruptLatencyIsr);
+	iIsr = aIsr;
+	return KErrNone;
+	}
+
+TInt DBMRapuChannel::BindInterrupt(MBMInterruptLatencyIsr* aIsr)
+	{
+	//Kern::Printf(("DBMRapuChannel::BindInterrupt(MBMInterruptLatencyIsr* aIsr)"));
+	BM_ASSERT(!iIsr);
+	BM_ASSERT(!iInterruptLatencyIsr);
+	iInterruptLatencyIsr = aIsr;
+	return KErrNone;
+	}
+
+
+void DBMRapuChannel::RequestInterrupt()
+	{
+	//Kern::Printf(("DBMRapuChannel::RequestInterrupt()"));	
+	BM_ASSERT(iIsr || iInterruptLatencyIsr);		
+	// Read RTC001
+	RTC001.TRIGGER = 0;	
+	iTmpLongCount = RTC001.LONGCOUNT;
+	iTmpLongCount *= KRTC_Ratio;
+	iTmpLongCount += RTC001.SHORTCOUNT;					
+	if (iTimer.OneShot(1)==KErrNone)
+		__e32_atomic_add_ord32(&iStartCount, 1);
+	
+	}
+
+void DBMRapuChannel::CancelInterrupt()
+	{
+	iTmpStartCount = 0;
+	//Kern::Printf(("DBMRapuChannel::CancelInterrupt()"));		
+	if (iTimer.Cancel())
+		__e32_atomic_add_ord32(&iCancelCount, 1);
+	while (iStartCount != iCancelCount + iRunCount)
+		{}
+	}
+	
+	
+		
\ No newline at end of file
--- a/kerneltest/e32test/demandpaging/t_tbus_datapaging.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/e32test/demandpaging/t_tbus_datapaging.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -79,6 +79,7 @@
 
 LOCAL_D RFs TheFs;
 TInt gFsDriveNumber	= -1;
+TBool gMediaIsRam = EFalse;
 	
 RTest test(_L("T_TBUS_DATAPAGING"));
 _LIT(KChunkName, "t_datapaging chunk");
@@ -698,6 +699,8 @@
 			continue;
 
 		TPtrC mediaType = GetMediaType(di.iType);
+		if (di.iType == EMediaRam)
+			gMediaIsRam = ETrue;
 		test.Printf(_L("Drive %C Type %S DriveAtt 0x%x MediaAtt 0x%x FileSysId %S SerialNum %S\n"), 
 			'A' + n, &mediaType, di.iDriveAtt, di.iMediaAtt, &fsName, &GetSerialNumber(serialNum));
 
@@ -794,11 +797,13 @@
 	__DECLARE_VAR_IN_CHUNK(TBusLocalDrive, &drive)
 	TInt driveSize = TestDriveConnectAndCaps(drive, fatDriveNumber);
 	
-	TestDriveSizeRelatedMethods(drive, 0x00001000, driveSize);
+	if (!gMediaIsRam) // If media is RAM then the tests are invalid
+		TestDriveSizeRelatedMethods(drive, 0x00001000, driveSize);
 	
 	TestWriteReadRelatedMethods(drive);
 	
-	TestFormatRelatedMethods(drive, driveSize);
+	if (!gMediaIsRam)
+		TestFormatRelatedMethods(drive, driveSize);
 	
 	if(callPasswordRelated)
 		{
--- a/kerneltest/e32test/dma/d_dma.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/e32test/dma/d_dma.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -440,8 +440,15 @@
 			break;
 			}
 		case 'C':
+			{
 			iChannel->CancelAll();
+			for(TInt i=0; i<KMaxRequests; ++i)
+				{
+				if(iClientRequests[i]->IsReady())
+					iClientRequests[i]->Reset();
+				}
 			break;
+			}
 		default:
 			Kern::PanicCurrentThread(KClientPanicCat, __LINE__);
 			}
--- a/kerneltest/e32test/dma/dmasim.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/e32test/dma/dmasim.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -371,7 +371,13 @@
 
 void DmacSim::StopEmulation()
 	{
-	Timer.Cancel();
+	// Ensure that timer really is cancelled.
+	TBool cancelled = EFalse;
+	do
+		{
+		cancelled = Timer.Cancel();
+		}
+	while(!cancelled);
 	}
 
 void DmacSim::TickCB(TAny*)
--- a/kerneltest/e32test/dma/t_dma.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/e32test/dma/t_dma.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -69,7 +69,7 @@
 _LIT(KTestFailure, "XTEST");
 static void TestPanic(TInt aLine, TUint32 a1, TUint32 a2, TUint32 a3)
 	{
-	RDebug::Printf("Line %d test failed a1=%08x a2=%08x a3=%08x", aLine, a1, a2, a3);
+	RDebug::Printf("Line %d test failed a1=%08x (%d) a2=%08x (%d) a3=%08x (%d)", aLine, a1, a1, a2, a2, a3, a3);
 	RThread().Panic(KTestFailure, aLine);
 	}
 #define XTEST(e)				if (!(e)) TestPanic(__LINE__, 0, 0, 0)
@@ -218,6 +218,47 @@
 
 	};
 
+/**
+Perform multiple transfers with different fragment counts and with smaller
+and smaller fragment size
+
+This checks that the PSL's ISR(s) are properly written, and do not miss interrupts
+or notify the PIL spuriously.
+*/
+class CFragSizeRange : public CTest
+	{
+public:
+	CFragSizeRange(TInt aMaxIter, TInt aFragCount, TInt aInitialFragmentSize, TInt aInnerIteraions)
+		: CTest(NULL, aMaxIter), iMaxFragCount(aFragCount), iFragCount(1), iInitialFragmentSize(aInitialFragmentSize),
+		iInnerIterations(aInnerIteraions)
+		{}
+
+	TInt virtual DoRunTest();
+
+	virtual void AnnounceTest(TDes& aDes)
+		{
+		aDes.AppendFormat(_L("CFragSizeRange: Fragments %d, intital frag size %d, inner iters %d "), iFragCount, iInitialFragmentSize, iInnerIterations);
+		CTest::AnnounceTest(aDes);
+		}
+
+	CTest* Clone() const
+		{return new CFragSizeRange(*this);}
+
+private:
+	/**
+	Run the transfer
+	*/
+	TInt Transfer(TInt aFragSize);
+
+
+	TInt iMaxFragCount;
+	TInt iFragCount;
+	const TInt iInitialFragmentSize;
+	const TInt iInnerIterations;
+
+	RTimer iTimer;
+	};
+
 //
 // Active object used to create a tester thread, log on to it and
 // interpret its exit status.
@@ -409,6 +450,102 @@
 	return KErrNone;
 	}
 
+TInt CFragSizeRange::DoRunTest()
+	{
+	const TInt initialFragmentSize = Min(iInitialFragmentSize, Info.iMaxTransferSize);
+
+	TInt r = KErrNone;
+	RTest test(_L("CFragSizeRange test"));
+
+	r = iTimer.CreateLocal();
+	test_KErrNone(r);
+
+
+	TInt fragSize = initialFragmentSize;
+	TInt step = 0;
+	do
+		{
+		fragSize -= step;
+		// make sure size is aligned
+		fragSize = fragSize & ~Info.iMemAlignMask;
+
+		r = OpenChannel(iMaxFragCount, fragSize);
+		test_KErrNone(r);
+
+		for(iFragCount=1; iFragCount <= iMaxFragCount; iFragCount++)
+			{
+			test.Printf(_L("Fragment size %d bytes, %d fragments\nIter: "), fragSize, iFragCount);
+			for(TInt i=0; i<iInnerIterations; i++)
+				{
+
+				test.Printf(_L("%d "), i);
+				r = Transfer(fragSize);
+				test_KErrNone(r);
+
+				}
+			test.Printf(_L("\n"));
+			}
+		iChannel.Close();
+		// Reduce frag size by an eigth each iteration
+		step = (fragSize/8);
+		} while (step > 0);
+
+	iTimer.Close();
+
+	test.Close();
+	return r;
+	}
+
+TInt CFragSizeRange::Transfer(TInt aFragmentSize)
+	{
+	const TInt KRequest = 0;
+	const TInt KSrcBuf = 0;
+	const TInt KDestBuf = 1;
+
+	const TInt size = aFragmentSize * iFragCount;
+
+	TInt r = iChannel.AllocBuffer(KSrcBuf, size);
+	test_KErrNone(r);
+	iChannel.FillBuffer(KSrcBuf, 'A');
+	r = iChannel.AllocBuffer(KDestBuf, size);
+	XTEST2(r == KErrNone, r, size);
+	iChannel.FillBuffer(KDestBuf, '\0');
+
+	// Test simple transfer
+	TRequestStatus rs = KRequestPending;
+	r = iChannel.Fragment(KRequest, KSrcBuf, KDestBuf, size, &rs);
+	test_KErrNone(r);
+
+	test(iChannel.FragmentCheck(KRequest, iFragCount));
+	r = iChannel.Execute(_L8("Q0"));
+	test_KErrNone(r);
+
+	const TInt microSecTimeout = 1000000; // 1s
+	TRequestStatus timerStatus;
+	iTimer.After(timerStatus, microSecTimeout);
+
+	User::WaitForRequest(rs, timerStatus);
+	if(rs.Int() == KRequestPending)
+		{
+		RDebug::Print(_L("Transfer timed out!"));
+		// timed out
+		test(EFalse);
+		}
+	iTimer.Cancel();
+	test_KErrNone(rs.Int());
+	test(iChannel.CheckBuffer(KDestBuf, 'A'));
+
+	// Queue, then cancel request - Checks
+	// that there there is no spurious callback
+	// to the PIL
+	r = iChannel.Execute(_L8("Q0C"));
+	test_KErrNone(r);
+
+	iChannel.FreeAllBuffers();
+	return KErrNone;
+	}
+
+
 // Called when thread completed.
 void CTesterThread::RunL()
 	{
@@ -476,7 +613,6 @@
 
 	if (aMaxThread == 0)
 		{
-		delete aTest;
 		test.Printf(_L("transfer mode not supported - skipped\n"));
 		return;
 		}
@@ -506,9 +642,6 @@
 		test(new CTesterThread(i, dmaTest) != NULL);
 		dmaTest = NULL; //ownership transferred to CTesterThread
 		}
-	//the orginal isn't needed
-	delete aTest;
-	aTest = NULL;
 
 	const TTimeIntervalMicroSeconds32 KPeriod = 1000000;	// 1s
 	Bipper->Start(KPeriod, KPeriod, Bip);
@@ -521,17 +654,29 @@
 
 inline void RunSbTest(TInt aMaxThread, CTest* aTest)
 	{
+	RunTest(Info.iSbChannels, Min(1,Info.iMaxSbChannels), aTest);
 	RunTest(Info.iSbChannels, Min(aMaxThread,Info.iMaxSbChannels), aTest);
+
+	//the orginal isn't needed
+	delete aTest;
 	}
 
 inline void RunDbTest(TInt aMaxThread, CTest* aTest)
 	{
+	RunTest(Info.iDbChannels, Min(1,Info.iMaxDbChannels), aTest);
 	RunTest(Info.iDbChannels, Min(aMaxThread,Info.iMaxDbChannels), aTest);
+
+	//the orginal isn't needed
+	delete aTest;
 	}
 
 inline void RunSgTest(TInt aMaxThread, CTest* aTest)
 	{
+	RunTest(Info.iSgChannels, Min(1,Info.iMaxSgChannels), aTest);
 	RunTest(Info.iSgChannels, Min(aMaxThread,Info.iMaxSgChannels), aTest);
+
+	//the orginal isn't needed
+	delete aTest;
 	}
 //////////////////////////////////////////////////////////////////////////////
 
@@ -1033,6 +1178,28 @@
 	RunDbTest(maxchannel, new CCloseInCb() );
 	test.Next(_L("sg"));
 	RunSgTest(maxchannel, new CCloseInCb() );
+
+	test.Next(_L("Testing different fragment sizes"));
+
+	const TInt rangeFragSize = 4096;
+#ifdef __DMASIM__
+	// Use fewer iterations on the emulator
+	// since it is slower. Also this test is really
+	// intended to find errors in PSL implmentations
+	const TInt iterPerFragSize = 1;
+#else
+	const TInt iterPerFragSize = 30;
+#endif
+	const TInt rangeMaxFragCount = 8;
+
+	test.Next(_L("sb"));
+	RunSbTest(maxchannel, new CFragSizeRange(1, rangeMaxFragCount, rangeFragSize, iterPerFragSize));
+	test.Next(_L("db"));
+	RunDbTest(maxchannel, new CFragSizeRange(1, rangeMaxFragCount, rangeFragSize, iterPerFragSize));
+	test.Next(_L("sg"));
+	RunSgTest(maxchannel, new CFragSizeRange(1, rangeMaxFragCount, rangeFragSize, iterPerFragSize));
+
+
 	// Size for the single transfer test
 	TInt totalTransferSize = 64 * KKilo;
 
--- a/kerneltest/e32test/dmav2/test_cases.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/e32test/dmav2/test_cases.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -325,7 +325,7 @@
 	//will only have one fragment
 	const TInt size = 0x40000;
 	TDmaTransferArgs dfcTransfer(0, size, size, KDmaMemAddr);
-	TDmaTransferArgs isrTransfer(size, 2 * size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr);
+	TDmaTransferArgs isrTransfer(2*size, 3*size, size, KDmaMemAddr, KDmaSyncAuto, KDmaRequestCallbackFromIsr);
 
 	const TResultSet success = TResultSet();
 	TResultSet queueFailure = TResultSet().
--- a/kerneltest/e32test/group/bm_pdd.mmp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/e32test/group/bm_pdd.mmp	Wed Mar 31 23:38:45 2010 +0300
@@ -68,6 +68,10 @@
 source			bm_ne1_pdd.cpp
 #endif
 
+#if defined(NCP_COMMON_RAPU_FAMILY)
+SYMBIAN_BASE_SYSTEMINCLUDE(assp/rapu)
+source			bm_rapu_pdd.cpp
+#endif
 start wins
 win32_library	kernel32.lib
 end
--- a/kerneltest/e32test/group/d_cache.mmp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/e32test/group/d_cache.mmp	Wed Mar 31 23:38:45 2010 +0300
@@ -15,7 +15,9 @@
 // 
 //
 
-#include            <../variant.mmh>
+#include		<variant_test.mmh>
+
+
 #include            "kernel/kern_ext.mmh"
 
 target              VariantTarget(d_cache,ldd)
--- a/kerneltest/e32test/group/t_crashmonitor_lib.mmp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test/group/t_crashmonitor_lib.mmp
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-targettype     exe
- 
-SYMBIAN_BASE_SYSTEMINCLUDE(nkern)
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-userinclude    ../../../kernel/eka/debug/crashMonitor/inc
-sourcepath	   	../rm_debug/crashmonitor
-
-source        	t_crashmonitor.cpp
-
-library	euser.lib
-library hal.lib
-staticlibrary scmusr_lib.lib
-
-target         t_crashmonitor_lib.exe
-
-UID            0x0 0x4321bbbc
-SECUREID       0x2000B26F
-
-capability		none
-
-VENDORID       0x70000001
-
-DEBUGGABLE
-
-SMPSAFE
--- a/kerneltest/e32test/group/t_rmdebug.mmp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test/group/t_rmdebug.mmp
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-target         t_rmdebug.exe
-targettype     exe
-
-sourcepath	   	../rm_debug
-source        	d_rmdebugserver.cpp 
-source        	d_rmdebugthread.cpp 
-source        	t_rmdebug.cpp 
-source			d_rmdebugthreadasm.cia
-
-library		euser.lib
-               
-SYMBIAN_BASE_SYSTEMINCLUDE(nkern)
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-UID            0x100039CE 0x101F7159
-SECUREID       0x101F7159
-VENDORID       0x70000001
-
-CAPABILITY 	ALL -TCB
-
-SMPSAFE
--- a/kerneltest/e32test/group/t_rmdebug2.mmh	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test\group\t_rmdebug2.mmh
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-targettype     exe
-
-sourcepath	   	..\rm_debug
-
-source        	d_rmdebugthread2.cpp 
-source        	t_rmdebug2.cpp 
-source			d_rmdebugthreadasm2.cia
-source		r_low_memory_security_svr_session.cpp
-source		r_kernel_low_memory_security_svr_session.cpp
-source		r_user_low_memory_security_svr_session.cpp
-
-#if defined(MARM_ARMV5)
-source			d_rmdebug_step_test.s
-#endif
-
-#if defined(MARM_ARMV4)
-source			d_rmdebug_step_test_armv4.s
-#endif
-
-source			d_demand_paging.cia
-
-library		euser.lib
-library         hal.lib
-library         efsrv.lib
-library         t_rmdebug_dll.lib
-
-userinclude    ..\..\..\kernel\eka\include\drivers
-userinclude    ..\..\..\kernel\eka\debug\securityserver\inc
-#ifdef SYMBIAN_OLD_EXPORT_LOCATION
-SYMBIAN_BASE_SYSTEMINCLUDE(drivers)
-SYMBIAN_BASE_SYSTEMINCLUDE(kernel)
-#endif
-SYMBIAN_BASE_SYSTEMINCLUDE(nkern)
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-PAGED
-
-// To test heap allocation failure uncomment one or other of the following macros.
-// NOTE: Do not uncomment both, the tests will panic if both are defined!
-
-// To test heap allocation failure in the Debug Device Driver uncomment this macro
-//macro KERNEL_OOM_TESTING
-
-// To test heap allocation failure in the Debug Security Server uncomment this macro
-//macro USER_OOM_TESTING
-
-
-SMPSAFE
--- a/kerneltest/e32test/group/t_rmdebug2.mmp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test/group/t_rmdebug2.mmp
-// 
-//
-
-#include "t_rmdebug2.mmh"
-
-target         t_rmdebug2.exe
-
-UID            0x0 0x4321bbbb
-SECUREID       0x1234aaaa
-VENDORID       0x70000001
-
-CAPABILITY 	READUSERDATA POWERMGMT ALLFILES
-
-DEBUGGABLE
-
-macro SYMBIAN_STANDARDDEBUG
--- a/kerneltest/e32test/group/t_rmdebug2_oem.mmp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test/group/t_rmdebug2_oem.mmp
-// Same tests as t_rmdebug2.mmp but with OEM rights conferred
-// by the OEMDebug_F123ABCD.exe token file.
-// 
-//
-
-#include "t_rmdebug2.mmh"
-
-target         t_rmdebug2_oem.exe
-
-UID            0x0 0x4321bbbb
-SECUREID       0xF123abcd
-VENDORID       0x70000001
-
-CAPABILITY 	READUSERDATA POWERMGMT ALLFILES
-
-// Used when compiling tests to work in the presence of an
-// OEM Debug Token
-macro SYMBIAN_OEMDEBUG
-
--- a/kerneltest/e32test/group/t_rmdebug2_oem2.mmp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test/group/t_rmdebug2_oem2.mmp
-// Same tests as t_rmdebug2.mmp but with some OEM rights conferred
-// by the OEMDebug_F1234567.exe token file.
-// 
-//
-
-#include "t_rmdebug2.mmh"
-
-target         t_rmdebug2_oem2.exe
-
-UID            0x0 0x4321bbbb
-SECUREID       0xF1234567
-VENDORID       0x70000001
-
-CAPABILITY 	READUSERDATA POWERMGMT
-
-// Used when compiling tests to work in the presence of an
-// OEM Debug Token with AllFiles only capability
-macro SYMBIAN_OEM2DEBUG
-
--- a/kerneltest/e32test/group/t_rmdebug2_oemtoken.mmp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test/group/t_rmdebug2_oemtoken.mmp
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-target         OEMDebug_F123ABCD.exe
-targettype     exe
-
-sourcepath	   	../rm_debug
-
-source        	t_rmdebug2_oemtoken.cpp 
-
-library		euser.lib
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-capability PowerMgmt AllFiles Tcb ReadUserData WriteUserData
-
-UID            0x0 0x0
-SECUREID       0x0
-VENDORID       0x70000001
-
-SMPSAFE
--- a/kerneltest/e32test/group/t_rmdebug2_oemtoken2.mmp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test/group/t_rmdebug2_oemtoken2.mmp
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-target         OEMDebug_F1234567.exe
-targettype     exe
-
-sourcepath	   	../rm_debug
-
-source        	t_rmdebug2_oemtoken.cpp 
-
-library		euser.lib
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-// Token requires AllFiles
-capability AllFiles ReadUserData PowerMgmt
-
-UID            0x0 0x0
-SECUREID       0x0
-VENDORID       0x70000001
-
-SMPSAFE
--- a/kerneltest/e32test/group/t_rmdebug_app.mmp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test/group/t_rmdebug_app.mmp
-// 
-//
-
-target             t_rmdebug_app.exe
-targettype         exe
-
-sourcepath         ../rm_debug
-source             t_rmdebug_app.cpp 
-source			   d_rmdebugthreadasm2.cia
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-library            euser.lib
-
-uid                0x0 0x0
-capability         none
-
-always_build_as_arm
-pagedcode
-
-DEBUGGABLE
-
-SMPSAFE
--- a/kerneltest/e32test/group/t_rmdebug_dll.mmp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test/group/t_rmdebug_dll.mmp
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-target         t_rmdebug_dll.dll
-targettype     dll
-
-sourcepath	   	../rm_debug
-
-source        	t_rmdebug_dll.cpp 
-
-library		euser.lib
-
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-capability PowerMgmt AllFiles ReadUserData
-
-UID            0x0 0x0
-SECUREID       0x0
-VENDORID       0x70000001
-
-SMPSAFE
--- a/kerneltest/e32test/group/t_rmdebug_security0.mmp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test/group/t_rmdebug_security0.mmp
-// All-TCB
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-target         t_rmdebug_security0.exe
-targettype     exe
-
-sourcepath	   	../rm_debug
-source        	t_rmdebug_security.cpp 
-
-library		euser.lib hal.lib
-               
-SYMBIAN_BASE_SYSTEMINCLUDE(nkern)
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-UID            0x100039CE 0xbaaaf00d
-SECUREID       0x101F7159
-VENDORID       0x70000001
-
-DEBUGGABLE
-
-SMPSAFE
--- a/kerneltest/e32test/group/t_rmdebug_security1.mmp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test/group/t_rmdebug_security1.mmp
-// All-TCB
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-target         t_rmdebug_security1.exe
-targettype     exe
-
-sourcepath	   	../rm_debug
-source        	t_rmdebug_security.cpp 
-
-library		euser.lib hal.lib
-               
-SYMBIAN_BASE_SYSTEMINCLUDE(nkern)
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-UID            0x100039CE 0xdeadbaaa
-SECUREID       0x101F7159
-VENDORID       0x70000001
-
-
-SMPSAFE
--- a/kerneltest/e32test/group/t_rmdebug_security2.mmp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test/group/t_rmdebug_security2.mmp
-// All-TCB
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-target         t_rmdebug_security2.exe
-targettype     exe
-
-sourcepath	   	../rm_debug
-source        	t_rmdebug_security.cpp 
-
-library		euser.lib hal.lib
-               
-SYMBIAN_BASE_SYSTEMINCLUDE(nkern)
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-capability AllFiles
-
-UID            0x100039CE 0xdeadbaaa
-SECUREID       0x101F7159
-VENDORID       0x70000001
-
-
-SMPSAFE
--- a/kerneltest/e32test/group/t_rmdebug_security3.mmp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test/group/t_rmdebug_security3.mmp
-// All-TCB
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-target         t_rmdebug_security3.exe
-targettype     exe
-
-sourcepath	   	../rm_debug
-source        	t_rmdebug_security.cpp 
-
-library		euser.lib hal.lib
-               
-SYMBIAN_BASE_SYSTEMINCLUDE(nkern)
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-capability TCB AllFiles NetworkControl
-
-UID            0x100039CE 0xdeadbaaa
-SECUREID       0x101F7159
-VENDORID       0x70000001
-
-
-SMPSAFE
--- a/kerneltest/e32test/group/t_suser.mmp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/e32test/group/t_suser.mmp	Wed Mar 31 23:38:45 2010 +0300
@@ -19,7 +19,7 @@
 targettype		exe
 sourcepath		../secure
 source			t_suser.cpp
-library			euser.lib
+library			euser.lib hal.lib
 OS_LAYER_SYSTEMINCLUDE_SYMBIAN
 ROMTARGET
 RAMTARGET 	    \sys\bin\	//
--- a/kerneltest/e32test/group/t_trkdummyapp.mmp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// e32test/group/t_trkdummyapp.mmp
-// 
-//
-
-ALWAYS_BUILD_AS_ARM
-
-target         t_trkdummyapp.exe
-targettype     exe
-
-sourcepath	   	../rm_debug
-
-source        	t_trkdummyapp.cpp 
-
-library		euser.lib
-library         hal.lib
-library         efsrv.lib
-library         t_rmdebug_dll.lib
-
-SYMBIAN_BASE_SYSTEMINCLUDE(nkern)
-OS_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-UID            0x0 0x0
-SECUREID       0x0
-VENDORID       0x70000001
-
-CAPABILITY 	none
-
-
-
-
-SMPSAFE
--- a/kerneltest/e32test/mmu/d_memorytest.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/e32test/mmu/d_memorytest.h	Wed Mar 31 23:38:45 2010 +0300
@@ -25,7 +25,7 @@
 
 _LIT(KMemoryTestLddName,"d_memorytest");
 
-const TInt KUCPageCount = 4;//Page count of user chunk used in physical pinning tests.
+const TInt KUCPageCount = 16;//Page count of user chunk used in physical pinning tests.
 
 class RMemoryTestLdd : public RBusLogicalChannel
 	{
--- a/kerneltest/e32test/prime/t_timer.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/e32test/prime/t_timer.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -605,7 +605,7 @@
 #if !(defined(__EPOC32__) && defined(__X86__))
 	TInt muid = 0;
 	HAL::Get(HAL::EMachineUid, muid);
-	if(muid!=HAL::EMachineUid_Lubbock && muid!=HAL::EMachineUid_NE1_TB && muid!=HAL::EMachineUid_STE8500)
+	if(muid==HAL::EMachineUid_OmapH2 || muid==HAL::EMachineUid_OmapH4 || muid==HAL::EMachineUid_OmapH6)
 		{
 		test.Next(_L("Test sequential locks fail over on/off"));
 		RTimer tat;
--- a/kerneltest/e32test/realtime/d_latncy.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/e32test/realtime/d_latncy.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -87,6 +87,9 @@
 #elif defined(__NE1_TB__)
 const TInt KTickPeriodMs=1;
 const TInt KTicksPerMillisecond=66667;
+#elif defined(__MRAP__)
+const TInt KTickPeriodMs=1;
+const TInt KTicksPerMillisecond=1000;
 #endif
 
 #ifdef _DEBUG
--- a/kerneltest/e32test/rm_debug/basic_tests/t_rmdebug2.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/e32test/rm_debug/basic_tests/t_rmdebug2.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -41,6 +41,7 @@
 
 #ifdef __MARM_ARMV5__
 #include "d_rmdebug_step_test.h"
+#include "d_rmdebug_bkpt_test.h"
 #endif
 
 #include "d_demand_paging.h"
@@ -1613,6 +1614,142 @@
 	test(KErrNone == iServSession.DetachExecutable(iFileName));
 	}
 
+//---------------------------------------------
+//! @SYMTestCaseID KBASE-rmdebug2-2704
+//! @SYMTestType
+//! @SYMPREQ PREQ1426
+//! @SYMTestCaseDesc Test breakpoints in a loop
+//! @SYMTestActions Several calls to register to verify breakpoints are stopping at correct address
+//! @SYMTestExpectedResults All tests should pass and the target thread should be left unaffected
+//! @SYMTestPriority High
+//! @SYMTestStatus Implemented
+//---------------------------------------------
+void CRunModeAgent::TestBreakPointsInLoop()
+	{
+	test.Next(_L("TestBreakPointsInLoop\n"));
+
+	DoTestBreakPointsInLoop(ETrue);
+	DoTestBreakPointsInLoop(EFalse);
+	}
+
+void CRunModeAgent::DoTestBreakPointsInLoop(TBool aThreadSpecific)
+	{
+	test.Printf(_L("DoTestBreakPointsInLoop: aThreadSpecific: %d\n"), aThreadSpecific?1:0);
+
+	TInt err = KErrNone;
+	TProcessId processId = RProcess().Id(); 
+
+	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
+	
+	// We should suspend the thread first, then set the breakpoint
+	err = iServSession.SuspendThread(iThreadID);
+	test (err == KErrNone);
+
+	// 2 breakpoints are sufficient to find issues with hitting breakpoints in a loop
+	const TInt numOfBreakPointsInLoop = 2;
+
+	TBreakId armBreakId[numOfBreakPointsInLoop];
+	TUint32 address[numOfBreakPointsInLoop];
+   	
+	TUint32 entryAddress = (TUint32)(&RMDebug_Bkpt_Test_Entry);
+	TBreakId entryArmBreakId;
+
+	// Copy breakpoint address's in array
+	address[0] = (TUint32)(&RMDebug_Bkpt_Test_Loop_Break_1);
+	address[1] = (TUint32)(&RMDebug_Bkpt_Test_Loop_Break_2);
+
+	err = aThreadSpecific
+		? iServSession.SetBreak(entryArmBreakId,iThreadID,entryAddress,EArmMode)
+		: iServSession.SetProcessBreak(entryArmBreakId, processId, entryAddress, EArmMode);
+	test(err == KErrNone);
+
+	// Try to set the breakpoints inside loop
+	for (TInt i = 0; i < numOfBreakPointsInLoop; i++)
+		{
+		err = aThreadSpecific
+			? iServSession.SetBreak(armBreakId[i],iThreadID,address[i],EArmMode)
+			: iServSession.SetProcessBreak(armBreakId[i], processId, address[i], EArmMode);
+		test(err == KErrNone);
+		}
+
+	err = aThreadSpecific
+		? iServSession.SetEventAction(iFileName,EEventsBreakPoint, EActionContinue)
+		: iServSession.SetEventAction(iFileName,EEventsProcessBreakPoint, EActionContinue);
+	test (err == KErrNone);
+
+	// Continue the thread
+	err = iServSession.ResumeThread(iThreadID);
+	test (err == KErrNone);
+
+	// Wait for the breakpoint to be hit
+	TEventInfo info;
+	TRequestStatus status;
+
+	TPtr8 infoPtr((TUint8*)&info,0,sizeof(TEventInfo));
+	iServSession.GetEvent(iFileName,status,infoPtr);
+
+	// Wait for notification of breakpoint event
+	User::WaitForRequest(status);
+	test(status==KErrNone);
+
+	// Info should now be filled with the details
+	test(info.iEventType == (aThreadSpecific ? EEventsBreakPoint : EEventsProcessBreakPoint));
+
+	// Have we stopped at the correct breakpoint?
+	test(info.iThreadBreakPointInfo.iRmdArmExcInfo.iR15 == entryAddress);
+	test(info.iProcessIdValid);
+	test(info.iThreadIdValid);
+
+	// Don't require the entry breakpoint anymore
+	err = iServSession.ClearBreak(entryArmBreakId);
+	test(err == KErrNone);
+	
+	// Stress the system by setting loop count to 100
+	const TUint32 loopCount = 100;
+
+	for (TInt i = 0; i < loopCount; i++)
+		{
+		// Continue the thread
+		err = iServSession.ResumeThread(iThreadID);
+		test (err == KErrNone);
+
+		// Wait for the breakpoint to be hit
+		iServSession.GetEvent(iFileName,status,infoPtr);
+		
+		// Wait for notification of the breakpoint hit event
+		User::WaitForRequest(status);
+		test(status==KErrNone);
+		
+		// Info should now be filled with the details
+		test(info.iEventType == (aThreadSpecific ? EEventsBreakPoint : EEventsProcessBreakPoint));
+		
+		// Have we stopped at the correct breakpoint?
+		test(info.iThreadBreakPointInfo.iRmdArmExcInfo.iR15 == address[i%numOfBreakPointsInLoop]);
+		
+		// Check process and thread id too
+		test(info.iProcessIdValid);
+		test(info.iThreadIdValid);
+		}
+
+	// Not interested in breakpoint events any more
+	err = aThreadSpecific
+		? iServSession.SetEventAction(iFileName,EEventsBreakPoint, EActionIgnore)
+		: iServSession.SetEventAction(iFileName, EEventsProcessBreakPoint, EActionIgnore);
+	test (err == KErrNone);
+
+	// Clear breakpoints
+	for (TInt i = 0; i < numOfBreakPointsInLoop; i++)
+		{
+		err = iServSession.ClearBreak(armBreakId[i]);
+		test(err == KErrNone);
+		}
+	
+	// Continue the thread again
+	err = iServSession.ResumeThread(iThreadID);
+	test (err == KErrNone);
+	test(KErrNone == iServSession.DetachExecutable(iFileName));
+	}
+
 //----------------------------------------------------------------------------------------------
 //! @SYMTestCaseID      KBase-T-RMDEBUG2-0440
 //! @SYMTestType
@@ -2790,7 +2927,8 @@
 //! @SYMTestCaseDesc    Tests Debug driver can only be access via the DSS. Also tests DSS cannot
 //!						be subverted. Tests functionality of two representative OEM Debug Tokens.
 //! @SYMTestActions     Tries to open rm_debug.ldd (should fail). Tries to debug various processes
-//!						(only debuggable one should succeed).
+//!						(only debuggable one should succeed). Checks that DSS behaves correctly
+//!						when different versions are passed in to Connect().
 //!
 //! @SYMTestExpectedResults KErrPermissionDenied.
 //! @SYMTestPriority        High
@@ -2820,6 +2958,17 @@
 	err = kernelDriver.Open(driverInfo);
 	test(err == KErrInUse);
 
+	// Try requesting an unsupported version of DSS
+	test.Next(_L("TestSecurity - requesting unsupported versions of DSS\n"));
+	RSecuritySvrSession dss;
+	err = dss.Connect(TVersion(999999, 0, 0));
+	test(err == KErrNotSupported); // Prior to DEF142018 this would crash, causing a KErrServerTerminated
+	err = dss.Connect(TVersion(KDebugServMajorVersionNumber, 999999, 0));
+	test(err == KErrNotSupported); // Explicitly asking for a minor version should give KErrNotSupported too if it's newer than what's running.
+	err = dss.Connect(TVersion(KDebugServMajorVersionNumber, 0, 0));
+	test(err == KErrNone); // But the correct major version and no explicit minor version should always succeed
+	dss.Close();
+	
 	//
 	// Attach to the Debug Security Server (passive)
 	//
@@ -4184,28 +4333,30 @@
 	iTestArray[15].iFunctionName = _L("TestBreakInfo");
 	iTestArray[16].iFunctionPtr = &CRunModeAgent::TestRunToBreak;
 	iTestArray[16].iFunctionName = _L("TestRunToBreak");
-	iTestArray[17].iFunctionPtr = &CRunModeAgent::TestRegisterAccess;
-	iTestArray[17].iFunctionName = _L("TestRegisterAccess");
-	iTestArray[18].iFunctionPtr = &CRunModeAgent::TestStep;
-	iTestArray[18].iFunctionName = _L("TestStep");
-	iTestArray[19].iFunctionPtr = &CRunModeAgent::TestDemandPaging;
-	iTestArray[19].iFunctionName = _L("TestDemandPaging");
-	iTestArray[20].iFunctionPtr = &CRunModeAgent::TestEventsForExternalProcess;
-	iTestArray[20].iFunctionName = _L("TestEventsForExternalProcess");
-	iTestArray[21].iFunctionPtr = &CRunModeAgent::TestEvents;
-	iTestArray[21].iFunctionName = _L("TestEvents");
-	iTestArray[22].iFunctionPtr = &CRunModeAgent::TestKillProcess;
-	iTestArray[22].iFunctionName = _L("TestKillProcess");
-	iTestArray[23].iFunctionPtr = &CRunModeAgent::TestProcessBreakPoints;
-	iTestArray[23].iFunctionName = _L("TestProcessBreakPoints");
-	iTestArray[24].iFunctionPtr = &CRunModeAgent::TestMultipleTraceEvents;
-	iTestArray[24].iFunctionName = _L("TestMultipleTraceEvents");
-	iTestArray[25].iFunctionPtr = &CRunModeAgent::TestAddRemoveProcessEvents;
-	iTestArray[25].iFunctionName = _L("TestAddRemoveProcessEvents");
-	iTestArray[26].iFunctionPtr = &CRunModeAgent::TestCrashFlash;
-	iTestArray[26].iFunctionName = _L("TestCrashFlash");
-	iTestArray[27].iFunctionPtr = &CRunModeAgent::TestProcessKillBreakpoint;
-	iTestArray[27].iFunctionName = _L("TestProcessKillBreakpoint");
+	iTestArray[17].iFunctionPtr = &CRunModeAgent::TestBreakPointsInLoop;
+	iTestArray[17].iFunctionName = _L("TestBreakPointsInLoop");
+	iTestArray[18].iFunctionPtr = &CRunModeAgent::TestRegisterAccess;
+	iTestArray[18].iFunctionName = _L("TestRegisterAccess");
+	iTestArray[19].iFunctionPtr = &CRunModeAgent::TestStep;
+	iTestArray[19].iFunctionName = _L("TestStep");
+	iTestArray[20].iFunctionPtr = &CRunModeAgent::TestDemandPaging;
+	iTestArray[20].iFunctionName = _L("TestDemandPaging");
+	iTestArray[21].iFunctionPtr = &CRunModeAgent::TestEventsForExternalProcess;
+	iTestArray[21].iFunctionName = _L("TestEventsForExternalProcess");
+	iTestArray[22].iFunctionPtr = &CRunModeAgent::TestEvents;
+	iTestArray[22].iFunctionName = _L("TestEvents");
+	iTestArray[23].iFunctionPtr = &CRunModeAgent::TestKillProcess;
+	iTestArray[23].iFunctionName = _L("TestKillProcess");
+	iTestArray[24].iFunctionPtr = &CRunModeAgent::TestProcessBreakPoints;
+	iTestArray[24].iFunctionName = _L("TestProcessBreakPoints");
+	iTestArray[25].iFunctionPtr = &CRunModeAgent::TestMultipleTraceEvents;
+	iTestArray[25].iFunctionName = _L("TestMultipleTraceEvents");
+	iTestArray[26].iFunctionPtr = &CRunModeAgent::TestAddRemoveProcessEvents;
+	iTestArray[26].iFunctionName = _L("TestAddRemoveProcessEvents");
+	iTestArray[27].iFunctionPtr = &CRunModeAgent::TestCrashFlash;
+	iTestArray[27].iFunctionName = _L("TestCrashFlash");
+	iTestArray[28].iFunctionPtr = &CRunModeAgent::TestProcessKillBreakpoint;
+	iTestArray[28].iFunctionName = _L("TestProcessKillBreakpoint");
 	};
 
 GLDEF_C TInt E32Main()
--- a/kerneltest/e32test/rm_debug/basic_tests/t_rmdebug2.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/e32test/rm_debug/basic_tests/t_rmdebug2.h	Wed Mar 31 23:38:45 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -42,7 +42,7 @@
 	};
 
 //number of test functions that we have
-const TInt KMaxTests = 28;
+const TInt KMaxTests = 29; 
 
 //
 // class CRunModeAgent
@@ -86,6 +86,8 @@
 	void DoTestBreakInfo(TBool aThreadSpecific);
 	void TestRunToBreak();
 	void DoTestRunToBreak(TBool aThreadSpecific);
+	void TestBreakPointsInLoop();
+	void DoTestBreakPointsInLoop(TBool aThreadSpecific);
 	void TestRegisterAccess();
 	void TestAttachExecutable();
 	void TestDebugFunctionality();
--- a/kerneltest/e32test/rm_debug/d_demand_paging.cia	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include <u32std.h>
-
-// unused function that contains enough padding that the test function
-// RMDebugDemandPagingTest starts in a new page.
-__NAKED__ TInt RMDebugDemandPagingPaddingBefore()
-	{
-	asm("movs       r2,r0");
-	asm("adds       r0,r2,r1");
-	asm("bx         lr");
-	// add padding to make this function 4kb in size.
-	// The 4084 corresponds to 2^12 (=4096) - 12,
-	// the 12 being the total size of the movs, adds and bx instructions.
-	asm(".space     4084");
-	}
-
-// test function which is in a page by itself
-__NAKED__ TInt RMDebugDemandPagingTest()
-	{
-	asm("movs       r2,r0");
-	asm("adds       r0,r2,r1");
-	asm("bx         lr");
-	// add padding to make this function 4kb in size.
-	// The 4084 corresponds to 2^12 (=4096) - 12,
-	// the 12 being the total size of the movs, adds and bx instructions.
-	asm(".space     4084");
-	}
-
-// unused function that contains enough padding to ensure that no used code
-// is in the same page as RMDebugDemandPagingTest
-__NAKED__ TInt RMDebugDemandPagingPaddingAfter()
-	{
-	asm("movs       r2,r0");
-	asm("adds       r0,r2,r1");
-	asm("bx         lr");
-	// add padding to make this function 4kb in size.
-	// The 4084 corresponds to 2^12 (=4096) - 12,
-	// the 12 being the total size of the movs, adds and bx instructions.
-	asm(".space     4084");
-	}
-
--- a/kerneltest/e32test/rm_debug/d_demand_paging.h	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Definitions of functions in d_demand_paging.cia
-//
-
-#ifndef D_DEMAND_PAGING_H
-#define D_DEMAND_PAGING_H
-
-TInt RMDebugDemandPagingTest();
-
-#endif // D_DEMAND_PAGING_H
--- a/kerneltest/e32test/rm_debug/d_rmdebug_step_test.h	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Definitions of functions in d_rmdebug_step_tests.s
-//
-
-#ifndef D_RMDEBUG_STEP_TESTS_H
-#define D_RMDEBUG_STEP_TESTS_H
-
-extern "C"
-{
-	// ARM tests
-	unsigned int RMDebug_StepTest_Non_PC_Modifying(void);
-	unsigned int RMDebug_StepTest_Non_PC_Modifying_OK(void);
-	
-	unsigned int RMDebug_StepTest_Branch(void);
-	unsigned int RMDebug_StepTest_Branch_1(void);
-
-	unsigned int RMDebug_StepTest_Branch_And_Link(void);
-	unsigned int RMDebug_StepTest_Branch_And_Link_1(void);
-	unsigned int RMDebug_StepTest_Branch_And_Link_2(void);
-	
-	unsigned int RMDebug_StepTest_MOV_PC(void);
-	unsigned int RMDebug_StepTest_MOV_PC_1(void);
-	unsigned int RMDebug_StepTest_MOV_PC_2(void);
-	
-	unsigned int RMDebug_StepTest_LDR_PC(void);
-	unsigned int RMDebug_StepTest_LDR_PC_1(void);
-
-	// Thumb tests
-	unsigned int RMDebug_StepTest_Thumb_Non_PC_Modifying(void);
-	unsigned int RMDebug_StepTest_Thumb_Non_PC_Modifying_1(void);
-	unsigned int RMDebug_StepTest_Thumb_Non_PC_Modifying_2(void);
-
-	unsigned int RMDebug_StepTest_Thumb_Branch(void);
-	unsigned int RMDebug_StepTest_Thumb_Branch_1(void);
-	unsigned int RMDebug_StepTest_Thumb_Branch_2(void);
-	
-	unsigned int RMDebug_StepTest_Thumb_Branch_And_Link(void);
-	unsigned int RMDebug_StepTest_Thumb_Branch_And_Link_1(void);
-	unsigned int RMDebug_StepTest_Thumb_Branch_And_Link_2(void);
-	unsigned int RMDebug_StepTest_Thumb_Branch_And_Link_3(void);
-
-	unsigned int RMDebug_StepTest_Thumb_Back_Branch_And_Link(void);
-	unsigned int RMDebug_StepTest_Thumb_Back_Branch_And_Link_1(void);
-	unsigned int RMDebug_StepTest_Thumb_Back_Branch_And_Link_2(void);
-	unsigned int RMDebug_StepTest_Thumb_Back_Branch_And_Link_3(void);
-
-	unsigned int RMDebug_StepTest_Thumb_AddPC(void);
-	unsigned int RMDebug_StepTest_Thumb_AddPC_1(void);
-	unsigned int RMDebug_StepTest_Thumb_AddPC_2(void);
-	unsigned int RMDebug_StepTest_Thumb_AddPC_3(void);
-
-	// ARM<->Thumb interworking tests
-	unsigned int RMDebug_StepTest_Interwork(void);
-	unsigned int RMDebug_StepTest_Interwork_1(void);
-	unsigned int RMDebug_StepTest_Interwork_2(void);
-	unsigned int RMDebug_StepTest_Interwork_3(void);
-
-	// Stepping performance test
-	unsigned int RMDebug_StepTest_Count(void);
-	unsigned int RMDebug_StepTest_Count_1(void);
-	unsigned int RMDebug_StepTest_Count_2(void);
-
-	// Multiple step test
-	unsigned int RMDebug_StepTest_ARM_Step_Multiple(void);
-	unsigned int RMDebug_StepTest_ARM_Step_Multiple_1(void);
-
-}
-#endif // D_RMDEBUG_STEP_TESTS_H
--- a/kerneltest/e32test/rm_debug/d_rmdebug_step_test.s	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,266 +0,0 @@
-; Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of the License "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:
-;
-
-        AREA |d-rmdebug-bkpt$$Code|, CODE, READONLY, ALIGN=6
-
-	CODE32
-
-	; ARM tests
-	
-; 
-; Non-PC modifying
-;
-	EXPORT RMDebug_StepTest_Non_PC_Modifying
-	EXPORT RMDebug_StepTest_Non_PC_Modifying_OK
- 
-RMDebug_StepTest_Non_PC_Modifying
-	mov		r0,r0		; nop
-RMDebug_StepTest_Non_PC_Modifying_OK
-	bx		lr			; should return to normal execution of the test thread
-
-;
-; Branch
-;
-	EXPORT RMDebug_StepTest_Branch
-	EXPORT RMDebug_StepTest_Branch_1
-
-RMDebug_StepTest_Branch
-	b		RMDebug_StepTest_Branch_1		
-	mov		r0, #2		; if the pc ends up here, we know its gone wrong
-RMDebug_StepTest_Branch_1
-	bx		lr			; return
-
-;
-; Branch and Link
-;
-	EXPORT RMDebug_StepTest_Branch_And_Link
-	EXPORT RMDebug_StepTest_Branch_And_Link_1
-	EXPORT RMDebug_StepTest_Branch_And_Link_2
-
-RMDebug_StepTest_Branch_And_Link		
-	mov		r0, lr		; preserve lr for the moment
-RMDebug_StepTest_Branch_And_Link_1
-	bl		RMDebug_StepTest_Branch_And_Link_2
-	mov		r1, #1		; insert a gap in the instruction stream so we know we branched.
-RMDebug_StepTest_Branch_And_Link_2
-	mov		lr, r0		; restore lr			
-	bx		lr			; should return to normal execution of the test thread
-
-;
-; MOV PC
-;
-	EXPORT RMDebug_StepTest_MOV_PC
-	EXPORT RMDebug_StepTest_MOV_PC_1
-	EXPORT RMDebug_StepTest_MOV_PC_2
-
-RMDebug_StepTest_MOV_PC
-	mov		r0, #4
-RMDebug_StepTest_MOV_PC_1
-	add		pc, pc, r0	; should be a jump (bear in mind reading pc = current inst + 8bytes for arm)
-	mov		r0, #1		; Simple instructions which allow us to test where the PC really is
-	mov		r0, #2		; just by reading r0.
-RMDebug_StepTest_MOV_PC_2
-	mov		r0, #3		; 
-	mov		r0, #4		; 
-	bx		lr			; should return to normal execution of the test thread
-
-; 
-; LDR PC
-;
-	EXPORT RMDebug_StepTest_LDR_PC
-	EXPORT RMDebug_StepTest_LDR_PC_1
-
-RMDebug_StepTest_LDR_PC
-	ldr		pc, =RMDebug_StepTest_LDR_PC_1
-	mov		r0, #1		;  separate the branch target so we can prove it works
-RMDebug_StepTest_LDR_PC_1
-	bx		lr			; should return to normal execution of the test thread
-	
-;
-; ARM -> Thumb -> ARM interworking test
-;
-; Note: We always start and finish this test
-; in ARM mode.
-	EXPORT RMDebug_StepTest_Interwork
-	EXPORT RMDebug_StepTest_Interwork_1
-	EXPORT RMDebug_StepTest_Interwork_2
-	EXPORT RMDebug_StepTest_Interwork_3	
-RMDebug_StepTest_Interwork
-	mov		r0, lr	; preserve lr
-RMDebug_StepTest_Interwork_1
-	blx		RMDebug_StepTest_Interwork_2
-
-	CODE16
-RMDebug_StepTest_Interwork_2
-	blx		RMDebug_StepTest_Interwork_3
-
-	CODE32
-
-RMDebug_StepTest_Interwork_3
-	bx		r0
-
-;
-; Stepping performance tests
-;
-; This counts down from 100000 to 0
-; This means that for all practical purposes
-; we can single-step as much as we like
-; in less than one second and have some likelyhood
-; that we will not step too far from our loop
-
-	EXPORT RMDebug_StepTest_Count
-	EXPORT RMDebug_StepTest_Count_1
-	EXPORT RMDebug_StepTest_Count_2
-
-RMDebug_StepTest_Count
-	ldr		r2, =100000
-RMDebug_StepTest_Count_1
-	subs	r2, r2, #1
-RMDebug_StepTest_Count_2
-	bne		RMDebug_StepTest_Count_1
-	bx		lr
-
-; Thumb tests
-
-; Thumb non-pc modifying
-;
-;
-RMDebug_StepTest_Thumb_Non_PC_Modifying
-	mov		r0, lr	; preserve lr
-	blx		RMDebug_StepTest_Thumb_Non_PC_Modifying_1
-	bx		r0
-
-;
-; Thumb Branch
-;
-RMDebug_StepTest_Thumb_Branch
-	mov		r0, lr	; preserve lr
-	blx		RMDebug_StepTest_Thumb_Branch_1
-	bx		r0		
-
-;
-; Thumb Branch and link
-;
-RMDebug_StepTest_Thumb_Branch_And_Link
-	mov		r0, lr	; preserve lr
-	blx		RMDebug_StepTest_Thumb_Branch_And_Link_1
-	bx		r0 
-
-;
-; Thumb Back Branch and link
-;
-RMDebug_StepTest_Thumb_Back_Branch_And_Link
-	mov		r0, lr	; preserve lr
-	blx		RMDebug_StepTest_Thumb_Back_Branch_And_Link_1
-	bx		r0 
-
-;
-; Thumb ADD PC,PC, #0
-;
-RMDebug_StepTest_Thumb_AddPC
-	mov		r0, lr	; preserve lr
-	blx		RMDebug_StepTest_Thumb_AddPC_1
-	bx		r0 
-
-	CODE16
-
-	; Thumb tests
-	EXPORT RMDebug_StepTest_Thumb_Non_PC_Modifying
-	EXPORT RMDebug_StepTest_Thumb_Non_PC_Modifying_1
-	EXPORT RMDebug_StepTest_Thumb_Non_PC_Modifying_2
-
-	EXPORT RMDebug_StepTest_Thumb_Branch
-	EXPORT RMDebug_StepTest_Thumb_Branch_1
-	EXPORT RMDebug_StepTest_Thumb_Branch_2
-
-	EXPORT RMDebug_StepTest_Thumb_Branch_And_Link
-	EXPORT RMDebug_StepTest_Thumb_Branch_And_Link_1
-	EXPORT RMDebug_StepTest_Thumb_Branch_And_Link_2
-	EXPORT RMDebug_StepTest_Thumb_Branch_And_Link_3
-
-	EXPORT RMDebug_StepTest_Thumb_Back_Branch_And_Link
-	EXPORT RMDebug_StepTest_Thumb_Back_Branch_And_Link_1
-	EXPORT RMDebug_StepTest_Thumb_Back_Branch_And_Link_2
-	EXPORT RMDebug_StepTest_Thumb_Back_Branch_And_Link_3
-
-RMDebug_StepTest_Thumb_Non_PC_Modifying_1
-	mov		r0, r0	; nop
-RMDebug_StepTest_Thumb_Non_PC_Modifying_2
-	bx		lr	
-
-RMDebug_StepTest_Thumb_Branch_1
-	b		RMDebug_StepTest_Thumb_Branch_2
-	mov		r0, r0
-RMDebug_StepTest_Thumb_Branch_2
-	bx		lr
-
-RMDebug_StepTest_Thumb_Branch_And_Link_1
-	mov		r1, lr
-RMDebug_StepTest_Thumb_Branch_And_Link_2
-	bl		RMDebug_StepTest_Thumb_Branch_And_Link_3
-	mov		r0, r0
-RMDebug_StepTest_Thumb_Branch_And_Link_3
-	bx		r1
-
-RMDebug_StepTest_Thumb_Back_Branch_And_Link_3
-	bx		r1
-
-RMDebug_StepTest_Thumb_Back_Branch_And_Link_1
-	mov		r1, lr
-RMDebug_StepTest_Thumb_Back_Branch_And_Link_2
-	bl		RMDebug_StepTest_Thumb_Back_Branch_And_Link_3
-	bx		r1
-
-;
-; ADD PC
-;
-	EXPORT RMDebug_StepTest_Thumb_AddPC
-	EXPORT RMDebug_StepTest_Thumb_AddPC_1
-	EXPORT RMDebug_StepTest_Thumb_AddPC_2
-	EXPORT RMDebug_StepTest_Thumb_AddPC_3
-
-RMDebug_StepTest_Thumb_AddPC_1
-	mov		r1, lr
-	mov		r2, #4
-RMDebug_StepTest_Thumb_AddPC_2
-	add		pc, pc, r2	; should arrive at RMDebug_StepTest_Thumb_AddPC_3
-	mov		r0, r0
-	mov		r0, r0
-	mov		r0, r0
-RMDebug_StepTest_Thumb_AddPC_3
-	bx		r1
-
-	ALIGN 4
-
-	CODE32
-
-;
-; ARM multiple-step ( 5 steps )
-;
-	EXPORT RMDebug_StepTest_ARM_Step_Multiple
-	EXPORT RMDebug_StepTest_ARM_Step_Multiple_1
-
-RMDebug_StepTest_ARM_Step_Multiple
-	mov		r0,r0		; nop
-	mov		r0,r0		; nop
-	mov		r0,r0		; nop
-	mov		r0,r0		; nop
-	mov		r0,r0		; nop
-RMDebug_StepTest_ARM_Step_Multiple_1
-	bx		lr
-
-	END
-
-; End of file - d_rmdebug_bkpt.s
--- a/kerneltest/e32test/rm_debug/d_rmdebug_step_test_armv4.h	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Definitions of functions in d_rmdebug_step_tests_armv4.s
-//
-
-#ifndef D_RMDEBUG_STEP_TESTS_H
-#define D_RMDEBUG_STEP_TESTS_H
-
-extern "C"
-{
-	// ARM tests
-	unsigned int RMDebug_StepTest_Non_PC_Modifying(void);
-	unsigned int RMDebug_StepTest_Non_PC_Modifying_OK(void);
-	
-	unsigned int RMDebug_StepTest_Branch(void);
-	unsigned int RMDebug_StepTest_Branch_1(void);
-
-	unsigned int RMDebug_StepTest_Branch_And_Link(void);
-	unsigned int RMDebug_StepTest_Branch_And_Link_1(void);
-	unsigned int RMDebug_StepTest_Branch_And_Link_2(void);
-	
-	unsigned int RMDebug_StepTest_MOV_PC(void);
-	unsigned int RMDebug_StepTest_MOV_PC_1(void);
-	unsigned int RMDebug_StepTest_MOV_PC_2(void);
-	
-	unsigned int RMDebug_StepTest_LDR_PC(void);
-	unsigned int RMDebug_StepTest_LDR_PC_1(void);
-
-	// Stepping performance test
-	unsigned int RMDebug_StepTest_Count(void);
-	unsigned int RMDebug_StepTest_Count_1(void);
-	unsigned int RMDebug_StepTest_Count_2(void);
-
-	// Multiple step test
-	unsigned int RMDebug_StepTest_ARM_Step_Multiple(void);
-	unsigned int RMDebug_StepTest_ARM_Step_Multiple_1(void);
-
-}
-#endif // D_RMDEBUG_STEP_TESTS_H
--- a/kerneltest/e32test/rm_debug/d_rmdebug_step_test_armv4.s	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +0,0 @@
-; Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of the License "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description:
-;
-
-        AREA |d-rmdebug-bkpt$$Code|, CODE, READONLY, ALIGN=6
-
-	CODE32
-
-	; ARM tests
-	
-; 
-; Non-PC modifying
-;
-	EXPORT RMDebug_StepTest_Non_PC_Modifying
-	EXPORT RMDebug_StepTest_Non_PC_Modifying_OK
- 
-RMDebug_StepTest_Non_PC_Modifying
-	mov		r0,r0		; nop
-RMDebug_StepTest_Non_PC_Modifying_OK
-	bx		lr			; should return to normal execution of the test thread
-
-;
-; Branch
-;
-	EXPORT RMDebug_StepTest_Branch
-	EXPORT RMDebug_StepTest_Branch_1
-
-RMDebug_StepTest_Branch
-	b		RMDebug_StepTest_Branch_1		
-	mov		r0, #2		; if the pc ends up here, we know its gone wrong
-RMDebug_StepTest_Branch_1
-	bx		lr			; return
-
-;
-; Branch and Link
-;
-	EXPORT RMDebug_StepTest_Branch_And_Link
-	EXPORT RMDebug_StepTest_Branch_And_Link_1
-	EXPORT RMDebug_StepTest_Branch_And_Link_2
-
-RMDebug_StepTest_Branch_And_Link		
-	mov		r0, lr		; preserve lr for the moment
-RMDebug_StepTest_Branch_And_Link_1
-	bl		RMDebug_StepTest_Branch_And_Link_2
-	mov		r1, #1		; insert a gap in the instruction stream so we know we branched.
-RMDebug_StepTest_Branch_And_Link_2
-	mov		lr, r0		; restore lr			
-	bx		lr			; should return to normal execution of the test thread
-
-;
-; MOV PC
-;
-	EXPORT RMDebug_StepTest_MOV_PC
-	EXPORT RMDebug_StepTest_MOV_PC_1
-	EXPORT RMDebug_StepTest_MOV_PC_2
-
-RMDebug_StepTest_MOV_PC
-	mov		r0, #4
-RMDebug_StepTest_MOV_PC_1
-	add		pc, pc, r0	; should be a jump (bear in mind reading pc = current inst + 8bytes for arm)
-	mov		r0, #1		; Simple instructions which allow us to test where the PC really is
-	mov		r0, #2		; just by reading r0.
-RMDebug_StepTest_MOV_PC_2
-	mov		r0, #3		; 
-	mov		r0, #4		; 
-	bx		lr			; should return to normal execution of the test thread
-
-; 
-; LDR PC
-;
-	EXPORT RMDebug_StepTest_LDR_PC
-	EXPORT RMDebug_StepTest_LDR_PC_1
-
-RMDebug_StepTest_LDR_PC
-	ldr		pc, =RMDebug_StepTest_LDR_PC_1
-	mov		r0, #1		;  separate the branch target so we can prove it works
-RMDebug_StepTest_LDR_PC_1
-	bx		lr			; should return to normal execution of the test thread
-	
-;
-; Stepping performance tests
-;
-; This counts down from 100000 to 0
-; This means that for all practical purposes
-; we can single-step as much as we like
-; in less than one second and have some likelyhood
-; that we will not step too far from our loop
-
-	EXPORT RMDebug_StepTest_Count
-	EXPORT RMDebug_StepTest_Count_1
-	EXPORT RMDebug_StepTest_Count_2
-
-RMDebug_StepTest_Count
-	ldr		r2, =100000
-RMDebug_StepTest_Count_1
-	subs	r2, r2, #1
-RMDebug_StepTest_Count_2
-	bne		RMDebug_StepTest_Count_1
-	bx		lr
-
-;
-; ARM multiple-step ( 5 steps )
-;
-	EXPORT RMDebug_StepTest_ARM_Step_Multiple
-	EXPORT RMDebug_StepTest_ARM_Step_Multiple_1
-
-RMDebug_StepTest_ARM_Step_Multiple
-	mov		r0,r0		; nop
-	mov		r0,r0		; nop
-	mov		r0,r0		; nop
-	mov		r0,r0		; nop
-	mov		r0,r0		; nop
-RMDebug_StepTest_ARM_Step_Multiple_1
-	bx		lr
-
-	END
-
-; End of file - d_rmdebug_step_test_armv4.s
--- a/kerneltest/e32test/rm_debug/d_rmdebugclient.h	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// t_rmdebugclient.h
-// Definitions for the run mode debug agent client side sessions.
-// 
-//
-
-#ifndef RMDEBUGCLIENT_H
-#define RMDEBUGCLIENT_H
-
-class TProcessInfo
-	{
-	public:
-		TUint           iProcessID;
-		TInt            iAttributes;
-		TUint32         iPriority;
-		TBuf<KMaxName> 	iName;    
-	};
-
-class TThreadInfo
-	{
-	public:
-		TUint           iThreadID;
-		TUint8          iPriority;
-		TUint8          iThreadType;
-		TBuf<KMaxName>  iName;
-		TUint           iOwningProcessID;
-
-	// Probably would want a state element here, under debug control, stopped etc
-	// such that additional information could be provided which was only valid for
-	// stopped threads.
-
-	};
-
-class TExecReq
-	{
-	public:
-		TUint32 iRequest;       // Step, Step into, step threads
-		TUint32 iStartAddress;
-		TUint32 iStopAddress;
-
-	};
-
-class TMemoryInfo
-	{
-	public:
-		TUint32 iAddress;
-		TUint32	iSize;
-		TPtr8*	iDataPtr;
-	};
-
-
-// Client Side session
-class RDebugServSession : public RSessionBase
-	{
-	public:
-		RDebugServSession();
-		TVersion Version() const;
-
-		TInt Open();
-		TInt Close();
-
-		TInt ReadMemory(const TUint32 aThreadId, TMemoryInfo* aInfo);
-		TInt WriteMemory(const TUint32 aThreadId, TMemoryInfo* aInfo);
-
-//		TInt ReadThreadInfo(const TInt aIndex, const TInt aOwningProc, TThreadInfo* aInfo);
-//		TInt ReadProcessInfo(const TInt aIndex, TProcessInfo* aInfo);
-		TInt SuspendThread(const TInt ThreadID);
-		TInt ResumeThread(const TInt ThreadID);
-
-	private:
-		RThread iServerThread;       
-	};
-
-// Function codes (opcodes) used in message passing between client and server
-enum TDebugServRqst
-	{
-	EDebugServOpen = 1,
-	EDebugServClose,
-
-	EDebugServSuspendThread,
-	EDebugServResumeThread,
-//	EDebugServReadProcessInfo,
-//	EDebugServReadThreadInfo,
-	EDebugServReadMemory,
-	EDebugServWriteMemory,
-	};
-
-#endif // RMDEBUGCLIENT_H
--- a/kerneltest/e32test/rm_debug/d_rmdebugserver.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,453 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Provides the debug agent server implementation.
-// 
-//
-
-#include <e32base.h>
-#include <e32base_private.h>
-#include <e32cons.h>
-#include <trkkerneldriver.h>
-#include "d_rmdebugserver.h"
-#include "d_rmdebugclient.h"
-#include "t_rmdebug.h"
-
-
-CDebugServServer::CDebugServServer(CActive::TPriority aActiveObjectPriority)
-   : CServer2(aActiveObjectPriority)
-//
-// Server constructor
-//
-	{
-	}
-
-CSession2* CDebugServServer::NewSessionL(const TVersion& /*aVersion*/, const RMessage2& /*aMessage*/) const
-//
-// Session constructor
-//
-	{
-	// make sure the kernel side device driver is not already loaded
-   TInt err;
-	err = User::LoadLogicalDevice(KDebugDriverFileName);
-	if ((KErrNone == err) || (KErrAlreadyExists == err))
-       {
-       return new(ELeave) CDebugServSession();
-       }
-   else
-       {
-       return (NULL);
-       }
-	}   
-
-CDebugServSession::CDebugServSession()
-// Session implementation
-	{
-   TInt err;
-	TMetroTrkDriverInfo info;
-   info.iUserLibraryEnd = 0;
-   err = iKernelDriver.Open(info);
-   if (KErrNone != err)
-		{
- 		User::Leave(err);
-		}          
-	}
-
-CDebugServSession::~CDebugServSession()
-//
-// Session destructor
-//
-	{
-	// stop the kernel side driver
-	iKernelDriver.Close();
-
-	User::FreeLogicalDevice(KDebugDriverName);
-	}
-
-
-void CDebugServSession::ServiceL(const RMessage2& aMessage)
-//
-// Session service handler
-//
-	{
-	TInt res = KErrNone;
-
-	switch(aMessage.Function())
-		{
-		case EDebugServResumeThread:
-			res = ResumeThread(aMessage);
-			break;
-
-		case EDebugServSuspendThread:
-			res = SuspendThread(aMessage);
-			break;          
-
-//		case EDebugServReadProcessInfo:
-//			res = ReadProcessInfo(aMessage);
-//			break;        
-//
-//		case EDebugServReadThreadInfo:
-//			res = ReadThreadInfo(aMessage);
-//			break;
-
-		case EDebugServReadMemory:
-			res = ReadMemory(aMessage);
-			break;        
-
-		case EDebugServWriteMemory:
-			res = WriteMemory(aMessage);
-			break;        
-
-		default:
-			User::Leave(KErrNotSupported);
-			break;
-		}
-
-	aMessage.Complete(res);
-	}
-
-
-
-TInt CDebugServSession::SuspendThread(const RMessage2& aMessage)
-//
-// Session suspend thread
-//
-	{
-	TInt err;
-
-	err = iKernelDriver.SuspendThread(aMessage.Int0());
-
-	return err;
-	}
-
-TInt CDebugServSession::ResumeThread(const RMessage2& aMessage)
-//
-// Server resume thread
-//
-	{
-	TInt err;
-
-	err = iKernelDriver.ResumeThread(aMessage.Int0());
-
-	return err;
-	}
-
-//TInt CDebugServSession::ReadProcessInfo(const RMessage2& aMessage)
-////
-//// Server read process information
-////
-//	{
-//	TInt err;
-//	TProcessInfo procinfo;
-//	TMetroTrkTaskInfo processInfo(0);
-//
-//	err = iKernelDriver.GetProcessInfo(aMessage.Int0(), processInfo);
-//
-//	if (KErrNone == err)
-//		{
-//		procinfo.iProcessID = processInfo.iId;
-//		procinfo.iPriority = processInfo.iPriority;
-//		procinfo.iName.Copy(processInfo.iName);
-//
-//		TPckgBuf<TProcessInfo> p(procinfo);
-//		aMessage.WriteL(1,p);        
-//		}
-//
-//	return err;
-//	}
-//
-//TInt CDebugServSession::ReadThreadInfo(const RMessage2& aMessage)
-////
-//// Server read thread information
-////
-//	{
-//	TInt err;
-//	TThreadInfo thrdinfo;
-//	TMetroTrkTaskInfo threadInfo(aMessage.Int1()); // Sets OtherID to the second input parameter in aMessage
-//
-//	// aMessage.Int0 is the index into the thread list for the process
-//	err = iKernelDriver.GetThreadInfo(aMessage.Int0(), threadInfo);	   
-//
-//	if (KErrNone == err)
-//		{
-//		thrdinfo.iThreadID = threadInfo.iId;
-//		thrdinfo.iPriority = threadInfo.iPriority;
-//		thrdinfo.iName.Copy(threadInfo.iName);
-//		thrdinfo.iOwningProcessID = threadInfo.iOtherId;
-//
-//		TPckgBuf<TThreadInfo> p(thrdinfo);
-//
-//		// Write out the results to the third argument passed in (pointer to the threadinfo structure)
-//		aMessage.WriteL(2,p);           
-//		}
-//
-//	return err;
-//	}
-
-TInt CDebugServSession::ReadMemory(const RMessage2& aMessage)
-//
-// Server read process memory
-//
-	{   
-	TInt err;
-	TUint32 threadId = aMessage.Int0();
-	TPckgBuf<TMemoryInfo> pckg = *(TPckgBuf<TMemoryInfo> *)(aMessage.Ptr1());
-	TMemoryInfo* InputMemoryInfo = &pckg();
-
-	TPtr8 *ptrtst = InputMemoryInfo->iDataPtr;
-
-	err = iKernelDriver.ReadMemory(threadId, InputMemoryInfo->iAddress, InputMemoryInfo->iSize, *ptrtst);
-
-	return err;
-	}
-
-TInt CDebugServSession::WriteMemory(const RMessage2& aMessage)
-//
-// Server write process memory
-//
-	{
-	TInt err;
-	TUint32 threadId = aMessage.Int0();
-	TPckgBuf<TMemoryInfo> pckg = *(TPckgBuf<TMemoryInfo> *)(aMessage.Ptr1());
-	TMemoryInfo* InputMemoryInfo = &pckg();
-
-	TPtr8 *ptrtst = InputMemoryInfo->iDataPtr;
-
-	err = iKernelDriver.WriteMemory(threadId, InputMemoryInfo->iAddress, InputMemoryInfo->iSize, *ptrtst);
-
-	return err;
-	}
-
-
-GLDEF_C TInt CDebugServServer::ThreadFunction(TAny*)
-//
-// Server thread function, continues until active scheduler stops
-//
-	{
-	CTrapCleanup* cleanup=CTrapCleanup::New();
-	if (cleanup == NULL)
-		{
-		User::Leave(KErrNoMemory);
-		}
-
-	CActiveScheduler *pA=new CActiveScheduler;
-	CDebugServServer *pS=new CDebugServServer(EPriorityStandard);
-
-	CActiveScheduler::Install(pA);
-
-	TInt err = pS->Start(KDebugServerName);
-	if (err != KErrNone)
-		{
-		User::Leave(KErrNone);
-		}
-
-	RThread::Rendezvous(KErrNone);
-
-	CActiveScheduler::Start();
-
-	delete pS;
-	delete pA;
-	delete cleanup;
-
-	return (KErrNone);
-	}
-
-
-
-EXPORT_C TInt StartThread(RThread& aServerThread)
-//
-// Start the server thread
-//
-	{
-	TInt res=KErrNone;
-
-	TFindServer finddebugserver(KDebugServerName);
-	TFullName name;
-
-	if (finddebugserver.Next(name) != KErrNone)
-		{
-		res = aServerThread.Create( KDebugServerName,
-									CDebugServServer::ThreadFunction,
-									KDefaultStackSize,
-									KDefaultHeapSize,
-									KDefaultHeapSize,
-									NULL
-									);
-
-		if (res == KErrNone)
-			{
-			TRequestStatus rendezvousStatus;
-
-			aServerThread.SetPriority(EPriorityNormal);
-			aServerThread.Rendezvous(rendezvousStatus);
-			aServerThread.Resume();
-			User::WaitForRequest(rendezvousStatus);
-			}                                 
-		else
-			{
-			aServerThread.Close();
-			}
-		}
-
-	return res;
-	}
-
-
-
-RDebugServSession::RDebugServSession()
-//
-// Server session constructor
-//
-	{
-	}
-
-TInt RDebugServSession::Open()
-//
-// Session open
-//
-	{
-	TInt r = StartThread(iServerThread);
-	if (r == KErrNone)
-		{
-		r=CreateSession(KDebugServerName, Version(), KDefaultMessageSlots);
-		}
-
-	return r;
-	}
-
-
-TVersion RDebugServSession::Version(void) const
-//
-// Session version
-//
-	{
-	return (TVersion(KDebugServMajorVersionNumber, KDebugServMinorVersionNumber, KDebugServBuildVersionNumber));
-	}
-
-TInt RDebugServSession::SuspendThread(const TInt aThreadID)
-//
-// Session suspend thread request
-//
-	{
-	TIpcArgs args(aThreadID);
-	TInt res;
-	res = SendReceive(EDebugServSuspendThread, args);
-
-	return res;
-	}
-
-TInt RDebugServSession::ResumeThread(const TInt aThreadID)
-//
-// Session resume thread request
-//
-	{
-	TIpcArgs args(aThreadID);
-	TInt res;
-	res = SendReceive(EDebugServResumeThread, args);
-
-	return res;
-	}
-
-
-//TInt RDebugServSession::ReadProcessInfo(const TInt aIndex, TProcessInfo* aInfo)
-////
-//// Session read process information request
-////
-//	{
-//	TPckgBuf<TProcessInfo> pckg;
-//	pckg = *aInfo;
-//
-//	TIpcArgs args(aIndex, &pckg);
-//
-//	TInt res;
-//
-//	res = SendReceive(EDebugServReadProcessInfo, args);
-//
-//	*aInfo = pckg();
-//
-//	return res;
-//
-//	}
-//
-//TInt RDebugServSession::ReadThreadInfo(const TInt aIndex, const TInt aProc, TThreadInfo* aInfo)
-////
-//// Session read thread information request
-////
-//	{
-//	TPckgBuf<TThreadInfo> pckg;
-//	pckg = *aInfo;
-//
-//	TIpcArgs args(aIndex, aProc, &pckg);
-//
-//	TInt res;
-//
-//	res = SendReceive(EDebugServReadThreadInfo, args);
-//
-//	*aInfo = pckg();
-//
-//	return res;
-//
-//	}
-
-
-TInt RDebugServSession::ReadMemory(const TUint32 aThreadID, TMemoryInfo* aInfo)
-//
-// Session read thread memory request
-//
-	{
-	TPckgBuf<TMemoryInfo> pckg;
-	pckg = *aInfo;
-
-	TIpcArgs args(aThreadID, &pckg);
-
-	TInt res;
-
-	res = SendReceive(EDebugServReadMemory, args);
-
-	*aInfo = pckg();
-
-	return res;
-
-	}
-
-
-TInt RDebugServSession::WriteMemory(const TUint32 aThreadID, TMemoryInfo* aInfo)
-//
-// Session write thread memory request
-//
-	{
-	TPckgBuf<TMemoryInfo> pckg;
-	pckg = *aInfo;
-
-	TIpcArgs args(aThreadID, &pckg);
-
-	TInt res;
-
-	res = SendReceive(EDebugServWriteMemory, args);
-
-	return res;
-	}
-
-
-
-TInt RDebugServSession::Close()
-//
-// Session close the session and thread
-//
-	{
-	RSessionBase::Close();
-	iServerThread.Close();
-
-	return KErrNone;
-	}
-
--- a/kerneltest/e32test/rm_debug/d_rmdebugserver.h	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// t_rmdebugserver.h
-// Definitions for the run mode debug agent server side session.
-// 
-//
-
-#ifndef RMDEBUGSVR_H
-#define RMDEBUGSVR_H
-
-// Server name
-_LIT(KDebugServerName,"DebugServer");
-_LIT(KDebugDriverName,"MetroTrk Driver");
-_LIT(KDebugDriverFileName,"trkdriver.ldd");
-
-// A version must be specifyed when creating a session with the server
-const TUint KDebugServMajorVersionNumber=0;
-const TUint KDebugServMinorVersionNumber=1;
-const TUint KDebugServBuildVersionNumber=1;
-const TUint KDefaultMessageSlots=4;
-const TUint KDefaultHeapSize=0x10000;
-
-class CDebugServSession;
-
-
-// Server
-class CDebugServServer : public CServer2
-	{
-	public:
-		CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const;
-	public:
-		static TInt ThreadFunction(TAny* aStarted);
-	protected:
-		CDebugServServer(CActive::TPriority aActiveObjectPriority);
-	};
-
-// Server side session
-class CDebugServSession : public CSession2
-	{
-	public:
-		CDebugServSession();
-		~CDebugServSession();
-		void ConstructL ( void );
-		void ServiceL(const RMessage2& aMessage);
-
-		TInt ReadMemory(const RMessage2& aMessage);
-		TInt WriteMemory(const RMessage2& aMessage);
-
-//		TInt ReadProcessInfo(const RMessage2& aMessage);
-//		TInt ReadThreadInfo(const RMessage2& aMessage);
-
-		TInt ResumeThread(const RMessage2& aMessage);
-		TInt SuspendThread(const RMessage2& aMessage);
-
-	public:
-		RMetroTrkDriver iKernelDriver;	
-
-	private:
-	};
-
-
-#endif // RMDEBUGSVR_H
--- a/kerneltest/e32test/rm_debug/d_rmdebugthread.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Implements a debug thread for testing.
-// 
-//
-
-#include <e32base.h>
-#include <e32base_private.h>
-#include <e32cons.h>
-#include "d_rmdebugthread.h"
-
-EXPORT_C TBuf8<SYMBIAN_RMDBG_MEMORYSIZE> gMemoryAccessBytes;
-extern void RMDebug_BranchTst1();
-
-EXPORT_C TInt TestData;
-
-CDebugServThread::CDebugServThread()
-//
-// Empty constructor
-//
-	{
-	}
-
-GLDEF_C TInt CDebugServThread::ThreadFunction(TAny*)
-//
-// Generic thread function for testing
-//
-	{
-	CTrapCleanup* cleanup=CTrapCleanup::New();
-	if (cleanup == NULL)
-		{
-		User::Leave(KErrNoMemory);
-		}
-
-	RThread::Rendezvous(KErrNone);
-
-	TestData = 1;
-
-	while(1)
-		{
-		RMDebug_BranchTst1();
-
-		TestData++;                   
-
-		// Wait half a second (suspends this thread)
-		User::After(500000);
-
-		if (TestData == 0xFFFFFFFF)
-			{
-			break;
-			}
-		}
-
-	delete cleanup;
-
-	return (KErrNone);
-	}
-
-EXPORT_C TInt StartDebugThread(RThread& aDebugThread)
-//
-// Starts the test thread
-//
-{
-	TInt res=KErrNone;
-
-	// Create the thread
-	res = aDebugThread.Create(	KDebugThreadName,
-								CDebugServThread::ThreadFunction,
-								KDefaultStackSize,
-								KDebugThreadDefaultHeapSize,
-								KDebugThreadDefaultHeapSize,
-								NULL
-								);
-
-	// Check that the creation worked
-	if (res == KErrNone)
-		{
-		TRequestStatus rendezvousStatus;
-
-		aDebugThread.SetPriority(EPriorityNormal);
-		// Make a request for a rendezvous
-		aDebugThread.Rendezvous(rendezvousStatus);
-		// Set the thread as ready for execution
-		aDebugThread.Resume();
-		// Wait for the resumption
-		User::WaitForRequest(rendezvousStatus);
-		}                                 
-	else
-		{
-		// Close the handle.
-		aDebugThread.Close();
-		}
-
-	return res;
-	}
--- a/kerneltest/e32test/rm_debug/d_rmdebugthread.h	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// t_rmdebugthread.h
-// Definitions for the run mode debug test thread.
-// 
-//
-
-#ifndef RMDEBUGSVRTHRD_H
-#define RMDEBUGSVRTHRD_H
-
-#define SYMBIAN_RMDBG_MEMORYSIZE    1024*4
-
-// Thread name
-_LIT(KDebugThreadName,"DebugThread");
-
-const TUint KDebugThreadDefaultHeapSize=0x10000;
-
-class CDebugServThread : public CBase
-	{
-	public:
-		CDebugServThread();
-		static TInt ThreadFunction(TAny* aStarted);    
-
-	public:
-	};
-
-#endif // RMDEBUGSVRTHRD_H
--- a/kerneltest/e32test/rm_debug/d_rmdebugthread2.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,205 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Implements a debug thread for testing.
-// 
-//
-
-#include <e32base.h>
-#include <e32base_private.h>
-#include <e32cons.h>
-#include <e32debug.h>
-#include "d_rmdebugthread2.h"
-
-#include "d_rmdebug_step_test.h"
-#include "d_demand_paging.h"
-
-EXPORT_C TBuf8<SYMBIAN_RMDBG_MEMORYSIZE> gMemoryAccessBytes;
-IMPORT_C extern void RMDebug_BranchTst1();
-IMPORT_C extern TInt RMDebugDemandPagingTest();
-
-EXPORT_C TInt TestData;
-EXPORT_C TTestFunction FunctionChooser;
-
-const TInt NUMBER_TRACE_CALLS = 200;
-
-EXPORT_C TInt TestFunction()
-	{
-	//set TestData to an arbitrary value which we check for in t_rmdebug 
-	TestData = 0xffeeddcc;
-
-	User::After(3000000);	// pause three seconds.
-
-	return 0;
-	}
-
-/**
-  Wrapper around RMDebugDemandPagingTest, need to pause for a short time to
-  allow time in t_rmdebug.cpp to issue a User::WaitForRequest to catch the break point
-  */
-EXPORT_C void TestPagedCode()
-	{
-	User::After(100000);
-
-	// call the function in paged code
-	RMDebugDemandPagingTest();
-	}
-
-EXPORT_C void TestMultipleTraceCalls()
-	{
-	//arbitrary function to set a BP on
-	RMDebug_BranchTst1();
-	
-	for(TInt cnt = NUMBER_TRACE_CALLS; cnt>0; cnt--)
-		{
-		RDebug::Printf("Trace event");
-		}
-	
-	//another arbitrary function to set a BP on
-	RMDebug_StepTest_Non_PC_Modifying();
-	}
-
-CDebugServThread::CDebugServThread()
-//
-// Empty constructor
-//
-	{
-	}
-
-GLDEF_C TInt CDebugServThread::ThreadFunction(TAny*)
-//
-// Generic thread function for testing
-//
-	{
-	// set FunctionChooser to run the default function
-	FunctionChooser = EDefaultFunction;
-
-	CTrapCleanup* cleanup=CTrapCleanup::New();
-	if (cleanup == NULL)
-		{
-		User::Leave(KErrNoMemory);
-		}
-
-	RThread::Rendezvous(KErrNone);
-
-	TestData = 1;
-
-	while(TestData != 0xFFFFFFFF)
-		{
-		switch(FunctionChooser)
-			{
-			case EDemandPagingFunction:
-				TestPagedCode();
-				break;
-			case EDefaultFunction:
-				// the default function is the stepping test functions
-			case EStepFunction:
-				{
-				RMDebug_BranchTst1();
-
-				// Single stepping test support code
-
-				// ARM tests
-				RMDebug_StepTest_Non_PC_Modifying();
-
-				RMDebug_StepTest_Branch();
-
-				RMDebug_StepTest_Branch_And_Link();
-
-				RMDebug_StepTest_MOV_PC();
-
-				RMDebug_StepTest_LDR_PC();
- 
-// thumb/interworking tests not supported on armv4
-#ifdef __MARM_ARMV5__
-
-				// Thumb tests
-				RMDebug_StepTest_Thumb_Non_PC_Modifying();
-
-				RMDebug_StepTest_Thumb_Branch();
-
-				RMDebug_StepTest_Thumb_Branch_And_Link();
-
-				RMDebug_StepTest_Thumb_Back_Branch_And_Link();
-
-				// ARM <-> Thumb interworking tests
-				RMDebug_StepTest_Interwork();
-
-				RMDebug_StepTest_Thumb_AddPC();
-
-#endif	// __MARM_ARMV5__
-				
-				// Single-stepping performance
-				RMDebug_StepTest_Count();
-
-				// multiple step test
-				RMDebug_StepTest_ARM_Step_Multiple();
-
-				TestData++;
-
-				// Wait 50mSecs. // (suspends this thread)
-				User::After(50000);
-
-				break;
-				}
-			case EMultipleTraceCalls:
-				TestMultipleTraceCalls();
-				break;
-			default:
-				//do nothing
-				break;
-			}
-		}
-
-	delete cleanup;
-
-	return (KErrNone);
-	}
-
-EXPORT_C TInt StartDebugThread(RThread& aDebugThread, const TDesC& aDebugThreadName)
-//
-// Starts a test thread
-//
-{
-	TInt res=KErrNone;
-
-	// Create the thread
-	res = aDebugThread.Create(	aDebugThreadName,
-								CDebugServThread::ThreadFunction,
-								KDefaultStackSize,
-								KDebugThreadDefaultHeapSize,
-								KDebugThreadDefaultHeapSize,
-								NULL
-								);
-
-	// Check that the creation worked
-	if (res == KErrNone)
-		{
-		TRequestStatus rendezvousStatus;
-
-		aDebugThread.SetPriority(EPriorityNormal);
-		// Make a request for a rendezvous
-		aDebugThread.Rendezvous(rendezvousStatus);
-		// Set the thread as ready for execution
-		aDebugThread.Resume();
-		// Wait for the resumption
-		User::WaitForRequest(rendezvousStatus);
-		}                                 
-	else
-		{
-		// Close the handle.
-		aDebugThread.Close();
-		}
-
-	return res;
-	}
--- a/kerneltest/e32test/rm_debug/d_rmdebugthread2.h	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Definitions for the run mode debug test thread.
-// 
-//
-
-#ifndef RMDEBUGSVRTHRD_H
-#define RMDEBUGSVRTHRD_H
-
-#define SYMBIAN_RMDBG_MEMORYSIZE    1024*4
-
-// Thread name
-_LIT(KDebugThreadName,"DebugThread");
-
-const TUint KDebugThreadDefaultHeapSize=0x10000;
-
-// enumeration of functions which the target debug thread can call, the
-// debugger can choose to switch the thread to a different function by
-// writing the appropriate enumeration value into FunctionChooser, the
-// target thread will finish executing the function it is currently running
-// then execute the chosen function.
-enum TTestFunction
-	{
-	EDefaultFunction = 0,
-	EStepFunction = 1,
-	EDemandPagingFunction = 2,
-	EMultipleTraceCalls = 3,
-	};
-
-class CDebugServThread : public CBase
-	{
-	public:
-		CDebugServThread();
-		static TInt ThreadFunction(TAny* aStarted);    
-
-	public:
-	};
-
-#endif // RMDEBUGSVRTHRD_H
--- a/kerneltest/e32test/rm_debug/d_rmdebugthreadasm.cia	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// d_rmdebugthreadasm.h
-// Assembler file for debug thread testing.
-// 
-//
-
-//#include <e32cia.h>
-//#include <e32base.h>
-//#include <e32cons.h>
-//#include "d_rmdebugthread.h"
-
-EXPORT_C __NAKED__ void RMDebug_BranchTst1( void )
-//
-// 
-//
-{
-	asm("mov r0, #0 ");			// aResult==KErrNone
-	asm("bx  lr ");             // Return
-}
-
--- a/kerneltest/e32test/rm_debug/d_rmdebugthreadasm2.cia	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// d_rmdebugthreadasm2.h
-// Assembler file for debug thread testing.
-// 
-//
-
-EXPORT_C __NAKED__ void RMDebug_BranchTst1( void )
-//
-// 
-//
-{
-	asm("mov r0, #0 ");			// aResult==KErrNone
-	asm("bx  lr ");             // Return
-}
-
-EXPORT_C __NAKED__ void RMDebug_BranchTst2( void )
-//
-// 
-//
-{
-	asm("mov r0, #0 ");			// aResult==KErrNone
-	asm("bx  lr ");             // Return
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_bkpt_test.h	Wed Mar 31 23:38:45 2010 +0300
@@ -0,0 +1,28 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+// definitions of functions in d_rmdebug_bkpt_test.s
+
+#ifndef D_RMDEBUG_BKPT_TESTS_H
+#define D_RMDEBUG_BKPT_TESTS_H
+
+extern "C"
+{
+	// Breakpoints in loop test
+	unsigned int RMDebug_Bkpt_Test_Entry(void);
+	unsigned int RMDebug_Bkpt_Test_Loop_Break_1(void);
+	unsigned int RMDebug_Bkpt_Test_Loop_Break_2(void);
+}
+#endif // D_RMDEBUG_BKPT_TESTS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_bkpt_test.s	Wed Mar 31 23:38:45 2010 +0300
@@ -0,0 +1,52 @@
+; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of the License "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:
+;
+
+        AREA |d-rmdebug-bkpt$$Code|, CODE, READONLY, ALIGN=6
+
+	CODE32
+
+;
+; Breakpoints in loop test
+; 
+; This function initialises some variables and then performs some basic operations 
+; within the for loop. This allows us to set multiple breakpoints within the loop 
+; to test and see whether they are being hit. 
+;
+
+	EXPORT RMDebug_Bkpt_Test_Entry
+	EXPORT RMDebug_Bkpt_Test_Loop_Break_1
+	EXPORT RMDebug_Bkpt_Test_Loop_Break_2
+	
+RMDebug_Bkpt_Test_Entry
+    mov r2,#10
+    mov r0,#20    
+    mov r3,#0
+    mov r1,#1
+    b COMPARE
+LOOP      
+    add r3,r2,r0   
+RMDebug_Bkpt_Test_Loop_Break_1    
+    mov r2,r0
+RMDebug_Bkpt_Test_Loop_Break_2  
+    mov r0,r3 
+    add r1,r1,#1
+COMPARE
+    cmp r1,#30
+    ble LOOP 
+    bx lr
+ 
+	END
+
+; End of file - d_rmdebug_bkpt_test.s
--- a/kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_step_test.s	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/e32test/rm_debug/debug_targets/d_rmdebug_step_test.s	Wed Mar 31 23:38:45 2010 +0300
@@ -14,7 +14,8 @@
 ; 
 ;
 
-        AREA |d-rmdebug-bkpt$$Code|, CODE, READONLY, ALIGN=6
+        
+		AREA |d-rmdebug-step$$Code|, CODE, READONLY, ALIGN=6
 
 	CODE32
 
@@ -264,4 +265,4 @@
 
 	END
 
-; End of file - d_rmdebug_bkpt.s
+; End of file - d_rmdebug_step_test.s
--- a/kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthread2.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/e32test/rm_debug/debug_targets/d_rmdebugthread2.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -22,6 +22,7 @@
 #include "d_rmdebugthread2.h"
 
 #include "d_rmdebug_step_test.h"
+#include "d_rmdebug_bkpt_test.h"
 #include "d_demand_paging.h"
 
 EXPORT_C TBuf8<SYMBIAN_RMDBG_MEMORYSIZE> gMemoryAccessBytes;
@@ -154,6 +155,9 @@
 				// multiple step test
 				RMDebug_StepTest_ARM_Step_Multiple();
 
+				// Breakpoints in loop test
+				RMDebug_Bkpt_Test_Entry();
+
 				TestData++;
 
 				// Wait 50mSecs. // (suspends this thread)
--- a/kerneltest/e32test/rm_debug/group/t_rmdebug2.mmh	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/e32test/rm_debug/group/t_rmdebug2.mmh	Wed Mar 31 23:38:45 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -25,6 +25,7 @@
 
 #if defined(MARM_ARMV5)
 source			d_rmdebug_step_test.s
+source			d_rmdebug_bkpt_test.s
 #endif
 
 #if defined(MARM_ARMV4)
--- a/kerneltest/e32test/rm_debug/r_kernel_low_memory_security_svr_session.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Implementation of RKernelLowMemorySecuritySvrSession
-// 
-//
-
-#include "r_kernel_low_memory_security_svr_session.h"
-
-void RKernelLowMemorySecuritySvrSession::FailAlloc(const TInt aCount)
-	{
-	__KHEAP_FAILNEXT(aCount);
-	}
-
-void RKernelLowMemorySecuritySvrSession::HeapReset()
-	{
-	__KHEAP_RESET;
-	}
-
-void RKernelLowMemorySecuritySvrSession::MarkHeap()
-	{
-	__KHEAP_MARK;
-	}
-
-void RKernelLowMemorySecuritySvrSession::MarkHeapEnd()
-	{
-	__KHEAP_MARKEND;
-	}
-
--- a/kerneltest/e32test/rm_debug/r_kernel_low_memory_security_svr_session.h	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Version of security server session to enable testing of low memory conditions on kernel side
-// 
-//
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#ifndef R_KERNEL_LOW_MEMORY_SECURITY_SVR_SESSION_H
-#define R_KERNEL_LOW_MEMORY_SECURITY_SVR_SESSION_H
-
-#include "r_low_memory_security_svr_session.h"
-
-class RKernelLowMemorySecuritySvrSession : public RLowMemorySecuritySvrSession
-	{
-protected:
-	void FailAlloc(const TInt aCount);
-	void HeapReset();
-	void MarkHeap();
-	void MarkHeapEnd();
-	};
-
-#endif //R_KERNEL_LOW_MEMORY_SECURITY_SVR_SESSION_H
-
--- a/kerneltest/e32test/rm_debug/r_low_memory_security_svr_session.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Implementation of RLowMemorySecuritySvrSession
-// 
-//
-
-#include "r_low_memory_security_svr_session.h"
-#include <e32debug.h>
-
-// test the effects of heap failure on global RSecuritySvrSession::GetList() in debug mode,
-// in release mode normal call is made (heap checking not applicable)
-TInt RLowMemorySecuritySvrSession::GetList(const Debug::TListId aListId, TDes8& aListData, TUint32& aDataSize)
-	{
-	TInt failAt = 0;
-	TInt err = KErrNoMemory;
-	while(err == KErrNoMemory)
-		{
-		failAt++;
-		FailAlloc(failAt);
-		MarkHeap();
-		err = this->RSecuritySvrSession::GetList(aListId, aListData, aDataSize);
-		if(KErrNoMemory == err)
-			{
-			MarkHeapEnd();
-			}
-		HeapReset();
-		//RDebug::Printf("Debug::RLowMemorySecuritySvrSession::GetList(): failAt: %d, err: %d", failAt, err);
-		}
-	return err;
-	}
-
-// test the effects of heap failure on thread-specific RSecuritySvrSession::GetList() in debug mode,
-// in release mode normal call is made (heap checking not applicable)
-TInt RLowMemorySecuritySvrSession::GetList(const TThreadId aThreadId, const Debug::TListId aListId, TDes8& aListData, TUint32& aDataSize)
-	{
-	TInt failAt = 0;
-	TInt err = KErrNoMemory;
-	while(err == KErrNoMemory)
-		{
-		failAt++;
-		FailAlloc(failAt);
-		MarkHeap();
-		err = this->RSecuritySvrSession::GetList(aThreadId, aListId, aListData, aDataSize);
-		if(KErrNoMemory == err)
-			{
-			MarkHeapEnd();
-			}
-		HeapReset();
-		//RDebug::Printf("Debug::RLowMemorySecuritySvrSession::GetList(TThreadId): failAt: %d, err: %d", failAt, err);
-		}
-	return err;
-	}
-
-// test the effects of heap failure on process-specific RSecuritySvrSession::GetList() in debug mode,
-// in release mode normal call is made (heap checking not applicable)
-TInt RLowMemorySecuritySvrSession::GetList(const TProcessId aProcessId, const Debug::TListId aListId, TDes8& aListData, TUint32& aDataSize)
-	{
-	TInt failAt = 0;
-	TInt err = KErrNoMemory;
-	while(err == KErrNoMemory)
-		{
-		failAt++;
-		FailAlloc(failAt);
-		MarkHeap();
-		err = this->RSecuritySvrSession::GetList(aProcessId, aListId, aListData, aDataSize);
-		if(KErrNoMemory == err)
-			{
-			MarkHeapEnd();
-			}
-		HeapReset();
-		//RDebug::Printf("Debug::RLowMemorySecuritySvrSession::GetList(TProcessId): failAt: %d, err: %d", failAt, err);
-		}
-	return err;
-	}
-
--- a/kerneltest/e32test/rm_debug/r_low_memory_security_svr_session.h	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Version of security server session to enable testing of low memory conditions
-// 
-//
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#ifndef R_LOW_MEMORY_SECURITY_SVR_SESSION_H
-#define R_LOW_MEMORY_SECURITY_SVR_SESSION_H
-
-#include <rm_debug_api.h>
-
-class RLowMemorySecuritySvrSession : public Debug::RSecuritySvrSession
-	{
-public:
-	TInt GetList(const Debug::TListId aListId, TDes8& aListData, TUint32& aDataSize);
-	TInt GetList(const TThreadId aThreadId, const Debug::TListId aListId, TDes8& aListData, TUint32& aDataSize);
-	TInt GetList(const TProcessId aProcessId, const Debug::TListId aListId, TDes8& aListData, TUint32& aDataSize);
-protected:
-	virtual void FailAlloc(const TInt aCount) = 0;
-	virtual void HeapReset() = 0;
-	virtual void MarkHeap() = 0;
-	virtual void MarkHeapEnd() = 0;
-	};
-
-#endif //R_LOW_MEMORY_SECURITY_SVR_SESSION_H
-
--- a/kerneltest/e32test/rm_debug/r_user_low_memory_security_svr_session.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// r_kernel_low_memory_security_svr_session.cpp
-// Implementation of RUserLowMemorySecuritySvrSession
-// 
-//
-
-#include "r_user_low_memory_security_svr_session.h"
-#include <rm_debug_api.h>
-#ifdef _DEBUG
-#include "low_mem_requests.h"
-#endif
-
-void RUserLowMemorySecuritySvrSession::FailAlloc(const TInt aCount)
-	{
-#ifdef _DEBUG
-	TIpcArgs args(aCount);
-	SendReceive(EDebugServFailAlloc, args);
-#endif
-	}
-
-void RUserLowMemorySecuritySvrSession::HeapReset()
-	{
-#ifdef _DEBUG
-	TIpcArgs args(0);
-	SendReceive(EDebugServFailAlloc, args);
-#endif
-	}
-
-void RUserLowMemorySecuritySvrSession::MarkHeap()
-	{
-#ifdef _DEBUG
-	SendReceive(EDebugServMarkHeap);
-#endif
-	}
-
-void RUserLowMemorySecuritySvrSession::MarkHeapEnd()
-	{
-#ifdef _DEBUG
-	SendReceive(EDebugServMarkEnd);
-#endif
-	}
-
--- a/kerneltest/e32test/rm_debug/r_user_low_memory_security_svr_session.h	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Version of security server session to enable testing of low memory conditions on user side
-// 
-//
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#ifndef R_USER_LOW_MEMORY_SECURITY_SVR_SESSION_H
-#define R_USER_LOW_MEMORY_SECURITY_SVR_SESSION_H
-
-#include "r_low_memory_security_svr_session.h"
-
-class RUserLowMemorySecuritySvrSession : public RLowMemorySecuritySvrSession
-	{
-protected:
-	void FailAlloc(const TInt aCount);
-	void HeapReset();
-	void MarkHeap();
-	void MarkHeapEnd();
-	};
-
-#endif //R_USER_LOW_MEMORY_SECURITY_SVR_SESSION_H
-
--- a/kerneltest/e32test/rm_debug/t_rmdebug.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,347 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Tests the functionality of the run mode debug device driver.
-// 
-//
-
-#include <e32base.h>
-#include <e32base_private.h>
-#include <e32cons.h>
-#include <e32test.h>
-#include <e32ldr.h>
-#include <f32dbg.h>
-#include "d_rmdebugclient.h"
-#include "d_rmdebugthread.h"
-#include "t_rmdebug.h"
-
-IMPORT_C TInt StartDebugThread(RThread& aServerThread);
-IMPORT_D extern TInt TestData;
-IMPORT_D extern TBuf8<SYMBIAN_RMDBG_MEMORYSIZE> gMemoryAccessBytes;
-
-LOCAL_D RTest test(_L("T_RMDEBUG"));
-
-CRunModeAgent::CRunModeAgent()
-//
-// CRunModeAgent constructor
-//
-	{
-	}
-
-CRunModeAgent* CRunModeAgent::NewL()
-//
-// CRunModeAgent::NewL
-//
-	{
-	CRunModeAgent* self = new(ELeave) CRunModeAgent();
-
-  	self->ConstructL();
-
-   if (self->iState != ERunModeAgentRunning)
-       {
-       delete self;
-       self = NULL;
-       }       
-	return self;
-	}
-
-CRunModeAgent::~CRunModeAgent()
-//
-// CRunModeAgent destructor
-//
-	{
-	iServSession.Close();
-	iDebugThread.Close();
-   iState = ERunModeAgentUnInit;
-	}
-
-void CRunModeAgent::ConstructL()
-//
-// CRunModeAgent::ConstructL
-//
-	{
-	TInt err;
-	err = StartDebugThread(iDebugThread);
-
-	if (err == KErrNone)
-		{
-		if (iServSession.Open() == KErrNone)
-           {
-           iState = ERunModeAgentRunning;
-           }
-       else
-           {
-           iState = ERunModeAgentUnInit;
-           }
-		}
-	else
-		{
-		User::Panic(_L("Can't start debug thread"), err);
-		}
-}
-
-
-
-CRunModeAgent *RunModeAgent;
-
-// Test process names
-_LIT(ProcessName1,"T_RMDEBUG");
-_LIT(ProcessName1a,"t_rmdebug");
-//_LIT(ProcessName2,"ekern");
-//_LIT(ProcessName3,"efile");
-_LIT(KWildCard,"*");
-
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-0185
-//! @SYMTestType 
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test reading process list
-//! @SYMTestActions Several calls to read the process list
-//! @SYMTestExpectedResults KErrNone and the owning process ID set
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestProcessList()
-	{
-	TInt    err=KErrNone;
-	TBool	found = FALSE;
-
-	test.Next(_L("TestProcessList - Read Process List\n"));
-
-	TFindProcess find(KWildCard);
-	TFullName name;
-	while(find.Next(name)==KErrNone)
-		{
-		RProcess process;
-		err = process.Open(find);
-		if (err == KErrNone)
-			{
-			if ((name.Find(ProcessName1) != KErrNotFound) ||
-				(name.Find(ProcessName1a) != KErrNotFound))
-				{				
-					iProcessID = process.Id();
-					found = TRUE;				
-				}
-			process.Close();				
-			}
-	   }   
-	test(found== TRUE);   
-	}
-
-// Test thread name
-_LIT(ThreadName1,"DebugThread");
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-0186
-//! @SYMTestType 
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test reading thread list
-//! @SYMTestActions Several calls to read the thread list
-//! @SYMTestExpectedResults KErrNone and the debug thread ID set
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestThreadList()
-	{
-	TInt        err=KErrNone;
-	TBool       found = FALSE;
-
-	test.Next(_L("TestThreadList - Read Thread List\n"));
-
-   	TFindThread find(KWildCard);
-	TFullName name;
-	while(find.Next(name)==KErrNone)
-		{
-		RThread thread;
-		err = thread.Open(find);
-       	if (err == KErrNone)
-			{
-			RProcess process;
-			thread.Process(process);
-			if (((TUint32)process.Id() == iProcessID) &&
-				(name.Find(ThreadName1) != KErrNotFound))
-				{
-				found = TRUE;           
-				iThreadID = thread.Id();
-				}
-			}
-			thread.Close();
-   		}   
-
-	test(found==TRUE);   
-	}
-
-   
-//---------------------------------------------
-//! @SYMTestCaseID KBase-0187
-//! @SYMTestType 
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test reading and writing thread memory
-//! @SYMTestActions Several call to read and write blocks of thread memory
-//! @SYMTestExpectedResults KErrNone
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestMemoryAccess()
-{
-	TInt err=KErrNone;
-	TMemoryInfo MemoryInfo;
-	TInt i;
-
-	test.Next(_L("TestMemoryAccess - Read Memory\n"));     
-
-	for (i = 0; i < SYMBIAN_RMDBG_MEMORYSIZE; i++)
-		{
-		gMemoryAccessBytes.Append(i);
-		}
-
-	MemoryInfo.iAddress = (TUint32)(&gMemoryAccessBytes[0]);
-	MemoryInfo.iSize = SYMBIAN_RMDBG_MEMORYSIZE;
-
-	HBufC8 *data = HBufC8::NewLC(SYMBIAN_RMDBG_MEMORYSIZE);
-	TPtr8 ptr_memread(data->Des());   
-	MemoryInfo.iDataPtr = &ptr_memread;
-
-//	test.Printf(_L("Read address = 0x%x Read size = 0x%x\n"),MemoryInfo.iAddress,MemoryInfo.iSize);
-
-	err = iServSession.ReadMemory(iThreadID, &MemoryInfo);
-
-	for (i = 0; i < MemoryInfo.iSize; i++)
-		{
-		if (ptr_memread.Ptr()[i] != gMemoryAccessBytes[i])
-			{
-			err = KErrCorrupt;       		
-			}
-		}
-
-
-	// Test out writing memory.   
-	test.Next(_L("TestMemoryAccess - Write Memory\n"));
-//	test.Printf(_L("Write address = 0x%x Write size = 0x%x\n"),MemoryInfo.iAddress,MemoryInfo.iSize);
-	if (err== KErrNone)
-		{
-		// Now reset the buffer
-		for (i = 0; i < SYMBIAN_RMDBG_MEMORYSIZE; i++)
-			{
-			gMemoryAccessBytes[i] = 0;
-			}      
-
-		// Write our data into the buffer
-		err = iServSession.WriteMemory(iThreadID, &MemoryInfo);
-
-		for (i = 0; i < MemoryInfo.iSize; i++)
-			{
-			if (ptr_memread.Ptr()[i] != gMemoryAccessBytes[i])
-				{
-				err = KErrCorrupt;       		
-				}
-			}
-
-		}
-
-	if (gMemoryAccessBytes[5] == 0)
-		{
-		err = KErrCorrupt;
-		}
-
-	CleanupStack::PopAndDestroy(data);       
-	test(err==KErrNone);   
-	}
-
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-0188
-//! @SYMTestType 
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test suspending and resuming a task
-//! @SYMTestActions Suspends a thread checks the contents of a variable then waits and tests it hasnt changed
-//! @SYMTestExpectedResults KErrNone
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestSuspendResume()
-	{
-	TInt err;
-
-	test.Next(_L("TestSuspendResume - Suspend\n"));
-	// Suspend the thread
-	err = iServSession.SuspendThread(iThreadID);
-	test(err==KErrNone);
-	TInt localtestdata;
-	localtestdata = TestData;
-
-	// Wait 3 seconds (suspends this thread) and hopefully resumes the
-	// thread we are controlling via the iServSession.SuspendThread request
-	User::After(3000000);
-
-	// Now check data hasnt changed
-	test(localtestdata==TestData);
-
-	// Resume the thread
-	test.Next(_L("TestSuspendResume - Resume\n"));
-	err = iServSession.ResumeThread(iThreadID);
-	test(err==KErrNone);
-
-	// Wait 3 seconds (suspends this thread) and hopefully resumes the
-	// thread we are controlling via the iServSession.SuspendThread request
-	User::After(3000000);
-
-	// Now check that the thread being controlled has resumed and is
-	// updating the variable
-	test(localtestdata!=TestData);
-	}
-   
-void CRunModeAgent::ClientAppL()
-//
-// Performs each test in turn
-//
-	{
-	test.Start(_L("ClientAppL"));
-
-	TestProcessList();
-	TestThreadList();
-	TestMemoryAccess();
-	TestSuspendResume();
-	test.End();   
-	}
-
-GLDEF_C TInt E32Main()
-//
-// Entry point for run mode debug driver test
-//
-	{
-   TInt ret = KErrNone;
-   
-	// client
-	CTrapCleanup* trap = CTrapCleanup::New();
-	if (!trap)
-		return KErrNoMemory;
-
-   RunModeAgent = CRunModeAgent::NewL();
-   if (RunModeAgent != NULL)
-       {
-   	test.Title();
-
-        __UHEAP_MARK;
-	    TRAPD(r,RunModeAgent->ClientAppL());
-       ret = r;
-	    __UHEAP_MARKEND;
-
-	    delete RunModeAgent;
-       }
-       
-	delete trap;
-
-	return ret;
-	}
--- a/kerneltest/e32test/rm_debug/t_rmdebug.h	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Definitions for the run mode debug tests
-// 
-//
-
-#ifndef RMDEBUG_H
-#define RMDEBUG_H
-
-// Function codes (opcodes) used in message passing between client and server
-enum TRunModeAgentState
-	{
-	ERunModeAgentUnInit,
-    ERunModeAgentRunning,
-	};
-
-
-//
-// class CRunModeAgent
-//
-// The basic run mode agent.
-//
-class CRunModeAgent : public CBase
-	{
-	public:
-		static CRunModeAgent* NewL();
-		~CRunModeAgent();
-		void ClientAppL();
-
-	private:
-		CRunModeAgent();
-		void ConstructL();
-
-		TInt TestStartup();
-		TInt TestShutdown();
-
-		void TestProcessList();
-		void TestThreadList();
-		void TestMemoryAccess();
-		void TestSuspendResume();
-
-	private:
-		RDebugServSession	iServSession;
-		RThread				iDebugThread;
-		TInt				iProcessID;
-		TInt				iThreadID;
-        TInt                iState;
-	};
-
-#endif // RMDEBUG_H
--- a/kerneltest/e32test/rm_debug/t_rmdebug2.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4432 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Tests the functionality of the run mode debug device driver.
-//
-//
-
-#include <e32base.h>
-#include <e32base_private.h>
-#include <e32cons.h>
-#include <e32test.h>
-#include <e32ldr.h>
-#include <e32svr.h>
-#include <e32cmn.h>
-#include <e32cmn_private.h>
-#include <f32dbg.h>
-#include <f32file.h>
-#include <hal.h>
-#include <u32hal.h>
-#include <e32property.h>
-
-#include "t_rmdebug_dll.h"
-
-#include <rm_debug_api.h>
-#include "d_rmdebugthread2.h"
-#include "t_rmdebug2.h"
-#include "t_rmdebug_app.h"
-
-#ifdef __MARM_ARMV4__
-#include "d_rmdebug_step_test_armv4.h"
-#endif
-
-#ifdef __MARM_ARMV5__
-#include "d_rmdebug_step_test.h"
-#endif
-
-#include "d_demand_paging.h"
-
-#ifdef KERNEL_OOM_TESTING
-	#ifdef USER_OOM_TESTING
-		#error "Cannot define both KERNEL_OOM_TESTING and USER_OOM_TESTING"
-	#endif
-#endif
-
-_LIT8(KCrashDummyData, "This is a sample write");
-
-using namespace Debug;
-
-const TVersion securityServerVersion(0,1,1);
-
-const TVersion testVersion(2,1,0);
-
-IMPORT_C TInt StartDebugThread(RThread& aServerThread, const TDesC& aDebugThreadName);
-IMPORT_D extern TInt TestData;
-IMPORT_D extern TTestFunction FunctionChooser;
-IMPORT_D extern TBuf8<SYMBIAN_RMDBG_MEMORYSIZE> gMemoryAccessBytes;
-IMPORT_C TInt TestFunction();
-IMPORT_C void TestPagedCode();
-IMPORT_C extern TInt RMDebugDemandPagingTest();
-
-// Device driver name
-_LIT(KDebugDriverFileName,"rm_debug.ldd");
-
-#ifdef SYMBIAN_STANDARDDEBUG
-LOCAL_D RTest test(_L("T_RMDEBUG2"));
-#endif
-
-#ifdef SYMBIAN_OEMDEBUG
-LOCAL_D RTest test(_L("T_RMDEBUG2_OEM"));
-#endif
-
-#ifdef SYMBIAN_OEM2DEBUG
-LOCAL_D RTest test(_L("T_RMDEBUG2_OEM2"));
-#endif
-
-CRunModeAgent::CRunModeAgent()
-//
-// CRunModeAgent constructor
-//
-	{
-	FillArray();
-	RProcess thisProcess;
-	iFileName = thisProcess.FileName();
-	thisProcess.Close();
-	}
-
-CRunModeAgent* CRunModeAgent::NewL()
-//
-// CRunModeAgent::NewL
-//
-	{
-	CRunModeAgent* self = new(ELeave) CRunModeAgent();
-
-  	self->ConstructL();
-
-	return self;
-	}
-
-CRunModeAgent::~CRunModeAgent()
-//
-// CRunModeAgent destructor
-//
-	{
-	User::FreeLogicalDevice(KDebugDriverFileName);
-	iServSession.Close();
-	iDebugThread.Close();
-	}
-
-void CRunModeAgent::ConstructL()
-//
-// CRunModeAgent::ConstructL
-//
-	{
-	// nothing to do here
-	}
-
-void CRunModeAgent::SetupAndAttachToDSS()
-//
-// CRunModeAgent::SetupAndAttachToDSS
-//
-	{
-	TInt err = StartDebugThread(iDebugThread, KDebugThreadName);
-
-	// get the thread id for use in the tests
-	iThreadID = iDebugThread.Id();
-
-	if (err != KErrNone)
-		{
-		User::Panic(_L("Can't start debug thread"), err);
-		}
-
-	err = iServSession.Connect(securityServerVersion);
-	if (err != KErrNone)
-		{
-		User::Panic(_L("Can't open server session"), err);
-		}
-	}
-
-CRunModeAgent *RunModeAgent;
-
-// helper function to check whether the listing of type aListId is supported for a scope of aListScope
-TBool CRunModeAgent::ListingSupported(const TListId aListId, const TListScope aListScope)
-	{
-	TTag tag = GetTag(ETagHeaderList, aListId);
-
-	return (tag.iValue) & aListScope;
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0426
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test getting the list of XIP libraries
-//! @SYMTestActions The XIP library list should be successfully obtained
-//! @SYMTestExpectedResults The specified ldd file should be present in the obtained listing
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestGetXipLibrariesList()
-	{
-	test.Next(_L("TestGetXipLibrariesList\n"));
-
-	test(ListingSupported(EXipLibraries, EScopeGlobal));
-	test(!ListingSupported(EXipLibraries, EScopeProcessSpecific));
-	test(!ListingSupported(EXipLibraries, EScopeThreadSpecific));
-
-	//allocate a very small buffer so the GetList call initially fails
-	RBuf8 buffer;
-	test(KErrNone == buffer.Create(1));
-	TUint32 size = 0;
-
-	//get the list data
-	DoGetList(EXipLibraries, EScopeGlobal, buffer, size);
-
-	//search the buffer for entry corresponding to the debug kernel driver
-	//which should be in the rom
-	_LIT(KRmDebugLddName, "z:\\sys\\bin\\rm_debug.ldd");
-
-	//iterate through the buffer and set found to ETrue if we find the driver
-	TBool found = EFalse;
-	TUint8* ptr = (TUint8*)buffer.Ptr();
-	const TUint8* ptrEnd = ptr + size;
-	while(ptr < ptrEnd)
-		{
-		TXipLibraryListEntry& xipLibrary = *(TXipLibraryListEntry*)ptr;
-
-		//get the name of the library
-		TPtr name(&xipLibrary.iName[0], xipLibrary.iNameLength, xipLibrary.iNameLength);
-		if(name.CompareF(KRmDebugLddName()) == 0)
-			{
-			//found the library but continue reading the rest of the buffer to
-			//check nothing bad happens towards the end
-			found = ETrue;
-			}
-		//move pointer on to next library
-		ptr += Align4(xipLibrary.GetSize());
-		}
-	test(found);
-
-	//do cleanup
-	buffer.Close();
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0427
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test getting the list of executables
-//! @SYMTestActions The list of debuggable executable files should be obtained
-//! @SYMTestExpectedResults The client exe should appear in the list
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestGetExecutablesList()
-	{
-	test.Next(_L("TestGetExecutablesList\n"));
-
-	test(ListingSupported(EExecutables, EScopeGlobal));
-	test(!ListingSupported(EExecutables, EScopeProcessSpecific));
-	test(!ListingSupported(EExecutables, EScopeThreadSpecific));
-
-	//allocate a very small buffer so the GetList call initially fails
-	RBuf8 buffer;
-	test(KErrNone == buffer.Create(1));
-	TUint32 size = 0;
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-
-	//get the list data
-	DoGetList(EExecutables, EScopeGlobal, buffer, size);
-
-	//get this process' name
-	RProcess thisProcess;
-	TFileName thisProcessName = thisProcess.FileName();
-
-	//look through the buffer and check if the target debug thread is there
-	TBool found = EFalse;
-	TUint8* ptr = (TUint8*)buffer.Ptr();
-	const TUint8* ptrEnd = ptr + size;
-	while(ptr < ptrEnd)
-		{
-		TExecutablesListEntry& entry = *(TExecutablesListEntry*)ptr;
-		//get name
-		TPtr name(&entry.iName[0], entry.iNameLength, entry.iNameLength);
-		if( (entry.iIsActivelyDebugged != 0) && (0 == thisProcessName.CompareF(name)) )
-			{
-			//found this process and asserted it is being actively debugged
-			found = ETrue;
-			}
-		//move pointer on to next entry
-		ptr += Align4(entry.GetSize());
-		}
-	test(found);
-
-	//clean up
-	buffer.Close();
-
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0428
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test error conditions for the GetList calls
-//! @SYMTestActions Multiple calls to test calling GetList with bad arguments
-//! @SYMTestExpectedResults All tests should fail with the appropriate error codes
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestGetListInvalidData()
-	{
-	test.Next(_L("TestGetListInvalidData\n"));
-
-	//allocate a buffer, the size should not matter as expecting all calls to fail
-	RBuf8 buffer;
-	test(KErrNone == buffer.Create(1));
-	TUint32 size = 0;
-
-	//test what happens if we ask for an unsupported list type globally
-	test(KErrNotSupported == iServSession.GetList((TListId)1234, buffer, size));
-
-	//test what happens if we ask for an unsupported list type
-	test(KErrNotSupported == iServSession.GetList(RThread().Id(), (TListId)1234, buffer, size));
-
-	//test what happens if we try to get a non-global libraries list
-	test(KErrArgument == iServSession.GetList(RThread().Id(), EXipLibraries, buffer, size));
-
-	//test what happens if we try to get a non-global executables list
-	test(KErrArgument == iServSession.GetList(RThread().Id(), EExecutables, buffer, size));
-
-	//test what happens if we try to get a non-global process list
-	test(KErrArgument == iServSession.GetList(RThread().Id(), EProcesses, buffer, size));
-
-	//check that using a process id fails
-	test(KErrArgument == iServSession.GetList(RProcess().Id(), EProcesses, buffer, size));
-
-	//check that specifying a non-existant thread id fails
-	test(KErrArgument == iServSession.GetList((TThreadId)0x12345678, EThreads, buffer, size));
-
-	//check that specifying a non-existant process id fails
-	test(KErrArgument == iServSession.GetList((TProcessId)0x12345678, EThreads, buffer, size));
-
-	//check that specifying a non-existant thread id fails
-	test(KErrArgument == iServSession.GetList((TThreadId)0x12345678, ECodeSegs, buffer, size));
-
-	//check that specifying a non-existant process id fails
-	test(KErrArgument == iServSession.GetList((TProcessId)0x12345678, ECodeSegs, buffer, size));
-
-	//cleanup
-	buffer.Close();
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0429
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test getting the process list
-//! @SYMTestActions Get the process listing
-//! @SYMTestExpectedResults The process listing should be successfully obtained and the current process should be present in the list
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestGetProcessList()
-	{
-	test.Next(_L("TestGetProcessList\n"));
-
-	test(ListingSupported(EProcesses, EScopeGlobal));
-	test(!ListingSupported(EProcesses, EScopeProcessSpecific));
-	test(!ListingSupported(EProcesses, EScopeThreadSpecific));
-
-	//allocate a very small buffer so the GetList call fails
-	RBuf8 buffer;
-	test(KErrNone == buffer.Create(1));
-	TUint32 size = 0;
-
-	//get the list data
-	DoGetList(EProcesses, EScopeGlobal, buffer, size);
-
-	//initialise data about the target debug thread to compare the kernel's data against
-	RProcess thisProcess;
-	TFileName thisProcessName = thisProcess.FileName();
-	TUint32 processId = thisProcess.Id().Id();
-
-	//look through the buffer and check if the target debug thread is there
-	TBool found = EFalse;
-	TUint8* ptr = (TUint8*)buffer.Ptr();
-	const TUint8* ptrEnd = ptr + size;
-	while(ptr < ptrEnd)
-		{
-		TProcessListEntry& entry = *(TProcessListEntry*)ptr;
-		if( (RProcess().Id().Id() == entry.iProcessId) &&
-			(0 == thisProcessName.CompareF(TPtr(&(entry.iNames[0]), entry.iFileNameLength, entry.iFileNameLength))) &&
-		 	(0 == thisProcess.FullName().CompareF(TPtr(&(entry.iNames[0]) + entry.iFileNameLength, entry.iDynamicNameLength, entry.iDynamicNameLength))) &&
-			0x4321bbbb /* Magic */ == entry.iUid3)
-			{
-			//if all match then we've found it
-			found = ETrue;
-			}
-		ptr += Align4(entry.GetSize());
-		}
-
-	//check whether the expected result happened
-	test(found);
-
-	//clean up
-	buffer.Close();
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0430
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test getting the thread list
-//! @SYMTestActions Get the thread listing globally and for a specified thread or process
-//! @SYMTestExpectedResults The thread listings should all be successfully obtained and the current thread should be present in all listings
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestGetThreadList()
-	{
-	test.Next(_L("TestGetThreadList\n"));
-
-	test(ListingSupported(EThreads, EScopeGlobal));
-	test(ListingSupported(EThreads, EScopeProcessSpecific));
-	test(ListingSupported(EThreads, EScopeThreadSpecific));
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-
-	//test getting the global list, ETrue as should find the target debug thread
-	DoTestGetThreadList(ETrue, EScopeGlobal);
-
-	//test getting this thread's thread list, ETrue as should find the target debug thread
-	DoTestGetThreadList(ETrue, EScopeThreadSpecific, RThread().Id().Id());
-
-	//test getting this process's thread list, ETrue as should find the target debug thread
-	DoTestGetThreadList(ETrue, EScopeProcessSpecific, RProcess().Id().Id());
-
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-void CRunModeAgent::DoTestGetThreadList(const TBool aShouldPass, const TListScope aListScope, const TUint64 aTargetId)
-	{
-	test.Next(_L("DoTestGetThreadList\n"));
-
-	//create data to pass
-	RBuf8 buffer;
-	TUint32 size = 0;
-
-	//perform the call to get the Code segs
-	DoGetList(EThreads, aListScope, buffer, size, aTargetId);
-
-	//initialise data about the target debug thread to compare the kernel's data against
-	TFileName name = iDebugThread.FullName();
-	RProcess thisProcess;
-	TUint64 processId = thisProcess.Id();
-	TUint64 threadId = iDebugThread.Id();
-
-	//look through the buffer and check if the target debug thread is there
-	TBool found = EFalse;
-	TUint8* ptr = (TUint8*)buffer.Ptr();
-	const TUint8* ptrEnd = ptr + size;
-	while(ptr < ptrEnd)
-		{
-		TThreadListEntry* entry = (TThreadListEntry*)ptr;
-		TPtr entryName(&(entry->iName[0]), entry->iNameLength, entry->iNameLength);
-		if( (threadId == entry->iThreadId) && (processId == entry->iProcessId) && (0 == name.CompareF(entryName)) )
-			{
-			test(entry->iSupervisorStackBaseValid);
-			test(entry->iSupervisorStackSizeValid);
-			//if all match then we've found it
-			found = ETrue;
-			}
-
-		ptr += Align4(entry->GetSize());
-		}
-
-	//check whether the expected result happened
-	test(found == aShouldPass);
-
-	//clean up
-	buffer.Close();
-
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0431
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test getting the code segment list
-//! @SYMTestActions Get the code segment list global and for a specified thread
-//! @SYMTestExpectedResults The listings should be returned successfully
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestGetCodeSegsList()
-	{
-	test.Next(_L("TestGetCodeSegsList\n"));
-
-	test(ListingSupported(ECodeSegs, EScopeGlobal));
-	test(ListingSupported(ECodeSegs, EScopeProcessSpecific));
-	test(ListingSupported(ECodeSegs, EScopeThreadSpecific));
-
-	// Cannot perform this test with OEM2 debug token, as the t_rmdebug2 app
-	// needs AllFiles, and the OEM2 debug token does not authorise this.
-	// It seems reasonable to suppose that it would work anyway
-
-#ifndef SYMBIAN_OEM2DEBUG
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-
- 	//test getting the global list, ETrue as should find this process' main codeSeg
-	DoTestGetCodeSegsList(ETrue, EScopeGlobal);
-
-	//test getting this process' codeSegs, ETrue as should find this process' main codeSeg
-	DoTestGetCodeSegsList(ETrue, EScopeProcessSpecific, RProcess().Id().Id());
-
-	//test getting this thread's codeSegs, ETrue as should find this process' main codeSeg
-	DoTestGetCodeSegsList(ETrue, EScopeThreadSpecific, RThread().Id().Id());
-
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-#endif // SYMBIAN_OEM2DEBUG
-
-	}
-
-void CRunModeAgent::DoTestGetCodeSegsList(const TBool aShouldPass, const TListScope aListScope, const TUint64 aTargetId)
-	{
-	//create data to pass
-	RBuf8 buffer;
-	TUint32 size = 0;
-
-	//perform the call to get the Code segs
-	DoGetList(ECodeSegs, aListScope, buffer, size, aTargetId);
-
-	//create memoryInfo to contain info about this process
-	RProcess thisProcess;
-	TModuleMemoryInfo memoryInfo;
-	test(KErrNone == thisProcess.GetMemoryInfo(memoryInfo));
-
-	// check whether this process came from a file in ROM so we know whether to
-	// expect the code seg to be XIP or not.
-	RFs fs;
-	test(KErrNone == fs.Connect());
-	TBool thisFileIsInRom = EFalse;
-	if(fs.IsFileInRom(iFileName))
-		{
-		thisFileIsInRom = ETrue;
-		}
-
-	//look through the buffer to find this process' main code seg
-	TBool found = EFalse;
-	TUint8* ptr = (TUint8*)buffer.Ptr();
-	const TUint8* ptrEnd = ptr + size;
-	while(ptr < ptrEnd)
-		{
-		TCodeSegListEntry* codeSeg = (TCodeSegListEntry*)ptr;
-
-		if( (codeSeg->iIsXip == thisFileIsInRom) && (0 == iFileName.CompareF(TPtr(&(codeSeg->iName[0]), codeSeg->iNameLength, codeSeg->iNameLength))) )
-			{
-			if( (memoryInfo.iCodeBase == codeSeg->iCodeBase) &&
-					(memoryInfo.iCodeSize == codeSeg->iCodeSize) &&
-					(memoryInfo.iConstDataSize == codeSeg->iConstDataSize) &&
-					(memoryInfo.iInitialisedDataBase == codeSeg->iInitialisedDataBase) &&
-					(memoryInfo.iInitialisedDataSize == codeSeg->iInitialisedDataSize) &&
-					(memoryInfo.iUninitialisedDataSize == codeSeg->iUninitialisedDataSize))
-				{
-				//all matched so means we've found the codeSeg we're looking for
-				found = ETrue;
-				}
-			}
-		ptr += Align4(codeSeg->GetSize());
-		}
-
-	//check whether the result was as expected
-	test(found == aShouldPass);
-
-	// only care about rm_debug.ldd if we have global scope (belongs to the system not this process)
-	if (aListScope == EScopeGlobal)
-	{
-		// Search for rm_debug.ldd library and check its UID3 is correct
-		found = EFalse;
-
-_LIT(KRMDebugDriverFileName,"Z:\\sys\bin\\rm_debug.ldd");
-
-		TFileName rmdebugFilename(KRMDebugDriverFileName);
-
-		// reset the Ptr
-		ptr = (TUint8*)buffer.Ptr();
-		ptrEnd = ptr+size;
-		while(ptr < ptrEnd)
-		{
-			TCodeSegListEntry* codeSeg = (TCodeSegListEntry*)ptr;
-
-			if( rmdebugFilename.CompareF(TPtr(&(codeSeg->iName[0]), codeSeg->iNameLength, codeSeg->iNameLength)))
-				{
-				if(codeSeg->iUid3 == 0x101f7157 /* Magic */)
-					{
-					//all matched so means we've found the codeSeg we're looking for
-					found = ETrue;
-					}
-				}
-			ptr += Align4(codeSeg->GetSize());
-		}
-		test((TUint32)found == (TUint32)ETrue);
-	}
-
-	//clean up
-	buffer.Close();
-
-	}
-
-void CRunModeAgent::DoGetList(const TListId aListId, const TListScope aListScope, RBuf8& aBuffer, TUint32& aSize, const TUint64 aTargetId)
-	{
-	//close the buffer in case there's stuff allocated in it
-	aBuffer.Close();
-	//initialise it to be one byte big, which will guarantee data won't fit in it
-	test(KErrNone == aBuffer.Create(1));
-	aSize = 0;
-
-	//should pass this test (assuming we've passed in sensible arguments above...)
-	if(EScopeGlobal == aListScope)
-		{
-		test(KErrTooBig == iServSession.GetList(aListId, aBuffer, aSize));
-		}
-	else if(EScopeThreadSpecific == aListScope)
-		{
-		test(KErrTooBig == iServSession.GetList((TThreadId)aTargetId, aListId, aBuffer, aSize));
-		}
-	else if(EScopeProcessSpecific == aListScope)
-		{
-		test(KErrTooBig == iServSession.GetList((TProcessId)aTargetId, aListId, aBuffer, aSize));
-		}
-	else
-		{
-		// unknown list scope
-		test(0);
-		}
-
-	//keep allocating larger buffers, beginning with the aSize returned by the above call,
-	//and hopefully we'll eventually make a large enough one
-	test(KErrNone == aBuffer.ReAlloc(aSize));
-
-	for(;;)
-		{
-		TInt err = KErrNone;
-		if(EScopeGlobal == aListScope)
-			{
-			err = iServSession.GetList(aListId, aBuffer, aSize);
-			}
-		else if(EScopeThreadSpecific == aListScope)
-			{
-			err = iServSession.GetList((TThreadId)aTargetId, aListId, aBuffer, aSize);
-			}
-		else if(EScopeProcessSpecific == aListScope)
-			{
-			err = iServSession.GetList((TProcessId)aTargetId, aListId, aBuffer, aSize);
-			}
-		else
-			{
-			// unknown list scope
-			test(0);
-			}
-		if(err == KErrTooBig)
-			{
-			//wasn't big enough so double it
-			aSize = aSize << 1;
-			err = aBuffer.ReAlloc(aSize);
-			if(err != KErrNone)
-				{
-				//print out a message if couldn't allocate memory and quit
-				test.Printf(_L("Out ot memory when attempting to allocate %d bytes."), aSize);
-				test(KErrNone == err);
-				}
-
-			//fairly arbitrary test, we don't have a max size for these calls.
-			//In reality a list would have to have many thousands of elements
-			//to break this test which shouldn't really happen
-			test(aSize <= 0x4000);
-			}
-		else
-			{
-			test(KErrNone == err);
-			test(aBuffer.Length() == aSize);
-			//break out of the loop if the list has been successfully read in
-			break;
-			}
-		}
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0432
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test reading and writing memory
-//! @SYMTestActions Multiple calls to read and write memory, with various sizes and at various locations.
-//!	Also test that bad input values cause appropriate errors to be returned.
-//! @SYMTestExpectedResults All tests should pass and the target process should be left unaffected
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestMemoryAccess()
-{
-	TInt err;
-
-	test.Next(_L("TestMemoryAccess - Read Memory\n"));
-
-	//initialise buffer
-	gMemoryAccessBytes.SetLength(0);
-	for (TInt i=0; i<SYMBIAN_RMDBG_MEMORYSIZE; i++)
-		{
-		gMemoryAccessBytes.Append(i);
-		}
-
-	TUint32 address = (TUint32)(&gMemoryAccessBytes[0]);
-	TUint32 dataSize = SYMBIAN_RMDBG_MEMORYSIZE;
-
-	//create size for buffer that is rounded up to nearest 4 bytes if not
-	//already 4 byte aligned
-	TUint32 size = dataSize;
-	if(size % 4 != 0)
-		{
-		size += (4 - (size % 4));
-		}
-
-	RBuf8 dataBlock;
-	err = dataBlock.Create(size);
-	test(err==KErrNone);
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-
-	//suspend the thread prior to memory operations
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-
-	err = iServSession.ReadMemory(iThreadID, address, size, dataBlock, EAccess32, EEndLE8);
-	test(err==KErrNone);
-
-	for (TInt i=0; i<dataSize; i++)
-		{
-		test(dataBlock.Ptr()[i] == gMemoryAccessBytes[i]);
-		}
-
-	test.Next(_L("TestMemoryAccess - Write Memory\n"));
-
-	// Now reset the buffer
-	for (TInt i=0; i<dataSize; i++)
-		{
-		gMemoryAccessBytes[i] = 0;
-		}
-
-	// Write our data into the buffer
-	err = iServSession.WriteMemory(iThreadID, address, size, dataBlock, EAccess32, EEndLE8);
-	test(err==KErrNone);
-
-	for (TInt i=0; i<dataSize; i++)
-		{
-		test(dataBlock.Ptr()[i] == gMemoryAccessBytes[i]);
-		}
-
-	//final test that everything's not been going wrong
-	test(gMemoryAccessBytes[5] != 0);
-
-	test.Next(_L("TestMemoryAccess - Invalid arguments\n"));
-	test.Printf(_L("This test may emit crash-like information. This is intended.\n"));
-
-	//test address that is not 32 bit aligned
-	err = iServSession.ReadMemory(iThreadID, address + 1, size, dataBlock, EAccess32, EEndLE8);
-	test(err == KErrArgument);
-
-	//test size that is not multiple of 4 bytes
-	err = iServSession.WriteMemory(iThreadID, address, size + 2, dataBlock, EAccess32, EEndLE8);
-	test(err == KErrArgument);
-
-	//test size > max block size
-	err = iServSession.ReadMemory(iThreadID, address, (1<<15), dataBlock, EAccess32, EEndLE8);
-	test(err == KErrArgument);
-
-	//test access size == 2 bytes
-	err = iServSession.ReadMemory(iThreadID, address, size, dataBlock, EAccess16, EEndLE8);
-	test(err == KErrNotSupported);
-
-	//test access size == 1 byte
-	err = iServSession.WriteMemory(iThreadID, address, size, dataBlock, EAccess8, EEndLE8);
-	test(err == KErrNotSupported);
-
-	//test endianess == EEndBE8
-	err = iServSession.ReadMemory(iThreadID, address, size, dataBlock, EAccess32, EEndBE8);
-	test(err == KErrNotSupported);
-
-	//test endianess == EEndBE32
-	err = iServSession.WriteMemory(iThreadID, address, size, dataBlock, EAccess32, EEndBE32);
-	test(err == KErrNotSupported);
-
-	//test reading off end of memory
-	err = iServSession.ReadMemory(iThreadID, 0xffffff00, 0x00000101, dataBlock, EAccess32, EEndLE8);
-	test(err == KErrArgument);
-
-	//The following three tests check that edge conditions in the range check are handled correctly.
-	err = iServSession.ReadMemory(iThreadID, 0xffffff00, 0x000000FF, dataBlock, EAccess32, EEndLE8);
-	test(err == KErrArgument);
-
-	err = iServSession.ReadMemory(iThreadID, 0xffffff00, 0x000000F0, dataBlock, EAccess32, EEndLE8);
-	test(err == KErrBadDescriptor);
-
-	//Third range check test. Check that range check is handled correctly even when base + size wraps to 0.
-	err = iServSession.ReadMemory(iThreadID, 0xffffff00, 0x00000100, dataBlock, EAccess32, EEndLE8);
-	test(err == KErrBadDescriptor);
-	//end of range check tests
-
-	//test size == 0
-	err = iServSession.WriteMemory(iThreadID, address, 0, dataBlock, EAccess32, EEndLE8);
-	test(err == KErrArgument);
-
-	//attempt to write to address outside of process data segments,
-	//this address corresponds to the vectors so shouldn't be able to write
-	err = iServSession.WriteMemory(iThreadID, 0xffff0000, size, dataBlock, EAccess32, EEndLE8);
-	test(err == KErrBadDescriptor);
-
-	//attempt to read and write to address in process code segment
-
-	//open a handle to the thread
-	RThread debugThread;
-	test(debugThread.Open(iThreadID) == KErrNone);
-
-	//get a reference to the debug process
-	RProcess debugProcess;
-	test(debugThread.Process(debugProcess) == KErrNone);
-
-	//get the memory info for the process
-	TProcessMemoryInfo info;
-	test(debugProcess.GetMemoryInfo(info) == KErrNone);
-
-	address = info.iCodeBase;
-	if(size <= info.iCodeSize)
-		{
-		test(KErrNone == iServSession.ReadMemory(iThreadID, address, size, dataBlock, EAccess32, EEndLE8));
-		test(KErrBadDescriptor == iServSession.WriteMemory(iThreadID, address, size, dataBlock, EAccess32, EEndLE8));
-		}
-
-	// Some performance tests now
-	TUint32 bytesRead = 0;
-
-	// Allocate a data buffer
-	TUint32* p = (TUint32*)User::Alloc(size);
-	test(p != 0);
-
-	TInt nanokernel_tick_period;
-	HAL::Get(HAL::ENanoTickPeriod, nanokernel_tick_period);
-	test (nanokernel_tick_period != 0);
-
-	static const TInt KOneMillion = 1000000;
-
-	TInt nkTicksPerSecond = KOneMillion/nanokernel_tick_period;
-
-	TUint32 stopTickCount = User::NTickCount() + nkTicksPerSecond;
-
-	while (User::NTickCount() < stopTickCount)
-		{
-		err = iServSession.ReadMemory(iThreadID, (TUint32)p, size, dataBlock, EAccess32, EEndLE8);
-		test(err==KErrNone);
-
-		// Increase the count of bytes read
-		bytesRead += size;
-		}
-
-	test(bytesRead != 0);
-	iMemoryReadKbytesPerSecond = bytesRead/1024;
-
-	// write memory test
-	TUint32 bytesWritten = 0;
-
-	stopTickCount = User::NTickCount() + nkTicksPerSecond;
-
-	while (User::NTickCount() < stopTickCount)
-		{
-		err = iServSession.WriteMemory(iThreadID, (TUint32)p, size, dataBlock, EAccess32, EEndLE8);
-		test(err==KErrNone);
-
-		// Increase the count of bytes read
-		bytesWritten += size;
-		}
-
-	test (bytesWritten != 0);
-	iMemoryWriteKbytesPerSecond = bytesWritten/1024;
-
-	User::Free(p);
-
-	//resume the thread
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-
-	debugThread.Close();
-	dataBlock.Close();
-
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0433
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test suspending and resuming threads
-//! @SYMTestActions Multiple calls to suspend and resume threads with and without attaching to the thread
-//! @SYMTestExpectedResults All tests should pass and the target process should be left unaffected
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestSuspendResume()
-	{
-	TInt err;
-
-	test.Next(_L("TestSuspendResume - Suspend\n"));
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-	// Suspend the thread
-	err = iServSession.SuspendThread(iThreadID);
-	test(err==KErrNone);
-	TInt localtestdata;
-	localtestdata = TestData;
-
-	// Wait 3 seconds (suspends this thread) and hopefully resumes the
-	// thread we are controlling via the iServSession.SuspendThread request
-	User::After(3000000);
-
-	// Now check data hasnt changed
-	test(localtestdata==TestData);
-
-	// Resume the thread
-	test.Next(_L("TestSuspendResume - Resume\n"));
-	err = iServSession.ResumeThread(iThreadID);
-	test(err==KErrNone);
-
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-
-	// Wait 3 seconds (suspends this thread) and hopefully resumes the
-	// thread we are controlling via the iServSession.SuspendThread request
-	User::After(3000000);
-
-	// Now check that the thread being controlled has resumed and is
-	// updating the variable
-	test(localtestdata!=TestData);
-
-	// check that agent can resume thread which it previously detached from
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-
-	// check that agent cannot suspend thread which it previously suspended and then detached from
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-	test(KErrAlreadyExists == iServSession.SuspendThread(iThreadID));
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0434
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test getting the debug functionality from the driver
-//! @SYMTestActions Get the size and contents of the debug functionality block
-//! @SYMTestExpectedResults All tests should pass and the expected data should appear in the functionality block
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestDebugFunctionality()
-	{
-
-	TInt err;
-
-	test.Next(_L("TestDebugFunctionality - GetDebugFunctionalityBufSize\n"));
-
-	TUint32 bufsize = 0;	// Safe default size
-
-	// Get functionality block size
-	err = iServSession.GetDebugFunctionalityBufSize(&bufsize);
-	test(err==KErrNone);
-	test.Next(_L("TestDebugFunctionality - GetDebugFunctionality\n"));
-
-	// Ensure we have a finite buffer size
-	test(bufsize!=0);
-
-	// Allocate space for the functionality data
-	HBufC8* dftext = HBufC8::NewLC(bufsize);
-
-	// create an empty TPtr8 refering to dftext
-	TPtr8 dftextPtr(dftext->Des());
-
-	// Get the functionality block
-	err = iServSession.GetDebugFunctionality(dftextPtr);
-	test(err==KErrNone);
-
-	// Check that the first entry is correct
-	TTagHeader RefHdr =
-	{
-		ETagHeaderIdCore,ECoreLast,
-	};
-
-	// First header passed from rm_debug.ldd
-	TTagHeader* TestHdr = (TTagHeader*)dftextPtr.Ptr();
-
-	// Check
-	test(RefHdr.iTagHdrId==TestHdr->iTagHdrId);
-	// this test might fail if the agent is used with a Debug Security Server different from
-	// the one it was compiled against. So removing it for now.
-	//test(RefHdr.iNumTags==TestHdr->iNumTags);
-
-	// read a value from the data to check it has come through as expected
-	TTagHeader* header = GetTagHdr(dftext->Des(), ETagHeaderIdApiConstants);
-	test(header != NULL);
-	TTag* tag = GetTag(header, EApiConstantsTEventInfoSize);
-	test(tag != NULL);
-	// this test might fail if the agent is used with a Debug Security Server different from
-	// the one it was compiled against. So removing it for now.
-	//test(sizeof(TEventInfo) == tag->iValue);
-
-	// Remove our temporary buffer
-	CleanupStack::PopAndDestroy(dftext);
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0435
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test setting and clearing consecutive breakpoints
-//! @SYMTestActions Set and clear consecutive breakpoints of all combinations of breakpoint types
-//! @SYMTestExpectedResults All breakpoints should be set and cleared without error
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestConsecutiveBreakPoints()
-	{
-	test.Next(_L("TestConsecutiveBreakPoints\n"));
-
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-
-	// just a temporary structure for storing info about a breakpoint
-	struct TBreakPoint
-		{
-	public:
-		TBreakPoint()
-			:iId(0),
-			iMode((TArchitectureMode)0),
-			iAddress(0)
-			{}
-		TBreakId iId;
-		TArchitectureMode iMode;
-		TUint32 iAddress;
-		inline TInt Size() { return (EArmMode == iMode) ? 4 : 2; }
-		};
-
-	//an address in the target debug thread
-	TUint32 address = (TUint32)(&TestFunction);
-
-	// there are six orders in which three breakpoints can be set, these are looped
-	// through below to check setting and clearing consecutive breakpoints works
-	TUint8 order[6][3] =
-		{
-			{0,1,2},
-			{0,2,1},
-			{1,0,2},
-			{1,2,0},
-			{2,0,1},
-			{2,1,0}
-		};
-
-	// The following code checks that setting and clearing consecutive breakpoints works correctly:
-	// It checks that setting all combinations of three arm and thumb breakpoints succeeds, and check that the
-	// breakpoints can be set in any order, and then cleared in any order
-
-	// the 3 least significant bits of i control whether each of the three breakpoints should be arm or thumb
-	for(TInt i=0; i<8; i++)
-		{
-		// controls the order in which the breakpoints should be set
-		for(TInt j=0; j<6; j++)
-			{
-			// create the three breakpoints and set their modes
-			TBreakPoint bp[3];
-			bp[0].iMode = (i&1) ? EArmMode : EThumbMode;
-			bp[1].iMode = (i&2) ? EArmMode : EThumbMode;
-			bp[2].iMode = (i&4) ? EArmMode : EThumbMode;
-
-			// set the address of each of the breakpoints
-			bp[0].iAddress = address;
-			if(EArmMode == bp[0].iMode)
-				{ // if an arm breakpoint then must be on a four byte boundary
-				bp[0].iAddress = Align4(bp[0].iAddress);
-				}
-			bp[1].iAddress = bp[0].iAddress + bp[0].Size();
-			if(EArmMode == bp[1].iMode)
-				{ // if an arm breakpoint then must be on a four byte boundary
-				bp[1].iAddress = Align4(bp[1].iAddress);
-				}
-			bp[2].iAddress = bp[1].iAddress + bp[1].Size();
-			if(EArmMode == bp[2].iMode)
-				{ // if an arm breakpoint then must be on a four byte boundary
-				bp[2].iAddress = Align4(bp[2].iAddress);
-				}
-			for(TInt k=0; k<6; k++)
-				{
-				// set the three breakpoints in the order defined by j and then clear them in the order defined by k
-				test(KErrNone==iServSession.SetBreak(bp[order[j][0]].iId, iThreadID, bp[order[j][0]].iAddress, bp[order[j][0]].iMode));
-				test(KErrNone==iServSession.SetBreak(bp[order[j][1]].iId, iThreadID, bp[order[j][1]].iAddress, bp[order[j][1]].iMode));
-				test(KErrNone==iServSession.SetBreak(bp[order[j][2]].iId, iThreadID, bp[order[j][2]].iAddress, bp[order[j][2]].iMode));
-				test(KErrNone==iServSession.ClearBreak(bp[order[k][0]].iId));
-				test(KErrNone==iServSession.ClearBreak(bp[order[k][1]].iId));
-				test(KErrNone==iServSession.ClearBreak(bp[order[k][2]].iId));
-				}
-			}
-		}
-
-	// resume the thread
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0436
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test breakpoint functionality
-//! @SYMTestActions Multiple calls to set and clear breakpoints. Checking bad input produces appropriate errors.
-//! @SYMTestExpectedResults All tests should pass and the target debug thread should be left unaffected
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestBreakPoints()
-	{
-	TInt err;
-
-	test.Next(_L("TestBreakPoints - Set\n"));
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-
-	TestConsecutiveBreakPoints();
-
-	//an address in the target debug thread
-	TUint32 address = (TUint32)(&TestFunction);
-
-	/*
-	 * Ensure that breakpoint operations don't
-	 * affect memory read/write by checking that reads/writes
-	 * in locations containing breakpoints don't change behaviour
-	 * because of the breakpoints.
-	 */
-
-	TUint32 size = SYMBIAN_RMDBG_MEMORYSIZE;
-
-	RBuf8 originalDataBlock;
-	err = originalDataBlock.Create(size);
-	test(err==KErrNone);
-
-	//suspend the thread
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-
-	err = iServSession.ReadMemory(iThreadID, address, size, originalDataBlock, EAccess32, EEndLE8);
-	test(err==KErrNone);
-
-	// Test data block for comparison
-	RBuf8 testDataBlock;
-	err = testDataBlock.Create(size);
-	test(err==KErrNone);
-
-	/*
-	 * set an arm breakpoint
-	 */
-	TBreakId armBreakId = 0;
-	err = iServSession.SetBreak(armBreakId, iThreadID, address, EArmMode);
-	test(err == KErrNone);
-
-	// Ensure that memory read is not corrupted
-	err = iServSession.ReadMemory(iThreadID, address, size, testDataBlock, EAccess32, EEndLE8);
-	test(err==KErrNone);
-
-	test (testDataBlock == originalDataBlock);
-
-	/*
-	 * set a thumb breakpoint
-	 */
-	TBreakId thumbBreakId = 0;
-	err = iServSession.SetBreak(thumbBreakId, iThreadID, address+4, EThumbMode);
-	test(err == KErrNone);
-
-	/*
-	 * set a thumb2EE breakpoint
-	 */
-	TBreakId thumb2EEBreakId = 0;
-	err = iServSession.SetBreak(thumb2EEBreakId, iThreadID, address+8, EThumb2EEMode);
-	test(err == KErrNotSupported);
-
-	/*
-	 * overlapping breakpoint (same address/threadId/mode)
-	 */
-	TBreakId overlapBreakId = 0;
-	err = iServSession.SetBreak(overlapBreakId, iThreadID, address, EArmMode);
-	test(err == KErrAlreadyExists);
-
-	/*
-	 * overlapping breakpoint (different address/same threadId/different mode)
-	 *
-	 * address - EArmBreakpoint
-	 * address+2 - EThumbBreakpoint
-	 */
-	TBreakId overlap2BreakId = 0;
-	err = iServSession.SetBreak(overlap2BreakId, iThreadID, address+2, EThumbMode);
-	test(err == KErrAlreadyExists);
-
-	/*
-	 * Un-aligned address (arm)
-	 */
-	TBreakId armUnalignedBreakId = 0;
-	err = iServSession.SetBreak(armUnalignedBreakId, iThreadID, address+6, EArmMode);
-	test(err == KErrArgument);
-
-	/*
-	 * Un-aligned address (thumb)
-	 */
-	TBreakId thumbUnalignedBreakId = 0;
-	err = iServSession.SetBreak(thumbUnalignedBreakId, iThreadID, address+7, EThumbMode);
-	test(err == KErrArgument);
-
-	/*
-	 * Invalid address (arm)
-	 */
-	TBreakId armBadAddressBreakId = 0;
-	err = iServSession.SetBreak(armBadAddressBreakId, iThreadID, 0 /* address */, EThumbMode);
-	test(err == KErrBadDescriptor);
-
-	/*
-	 * Different thread, same address. Should fail for the same process, but succeed
-	 * for a different process.
-	 */
-
-	/*
-	 * Invalid thread
-	 */
-	TBreakId invalidThreadBreakId = 0;
-	err = iServSession.SetBreak(invalidThreadBreakId, 0xbabababa, address, EThumbMode);
-	test(err == KErrPermissionDenied);
-
-	// Clear the ARM breakpoint
-	err = iServSession.ClearBreak(armBreakId);
-	test(err == KErrNone);
-
-	// Clear the Thumb breakpoint
-	err = iServSession.ClearBreak(thumbBreakId);
-	test(err == KErrNone);
-
-	// to do : two threads at the same address
-	// to do : two processes at the same address
-
-	// Ensure that memory read is not corrupted after clearing the breakpoints
-	err = iServSession.ReadMemory(iThreadID, address, size, testDataBlock, EAccess32, EEndLE8);
-	test(err==KErrNone);
-
-	test (testDataBlock == originalDataBlock);
-
-	/*
-	 * How fast can we set breakpoints?
-	 *
-	 * Measure the time by setting/clearing breakpoints for 1 second.
-     */
-	TInt nanokernel_tick_period;
-	HAL::Get(HAL::ENanoTickPeriod, nanokernel_tick_period);
-	test (nanokernel_tick_period != 0);
-
-	TInt nkTicksPerSecond = HelpTicksPerSecond();
-
-	TInt breaksPerSecond = 0;
-
-	TUint32 stopTickCount = User::NTickCount() + nkTicksPerSecond;
-
-	while (User::NTickCount() < stopTickCount)
-		{
-		// set the breakpoint
-		TBreakId armBreakId = 0;
-		err = iServSession.SetBreak(armBreakId, iThreadID, address, EArmMode);
-		test(err == KErrNone);
-
-		// Clear the breakpoint
-		err = iServSession.ClearBreak(armBreakId);
-		test(err == KErrNone);
-
-		// Update the count of breakpoints
-		breaksPerSecond++;
-
-		// Gone wrong if we wrap to negative breakpoints (cannot set 2billion/second!)
-		test(breaksPerSecond >0);
-		}
-
-	// Store the results for later
-	iBreakpointsPerSecond = breaksPerSecond;
-
-	/*
-	 * How many breakpoints can we set?
-	 */
-
-	TBool done = EFalse;
-
-	// We assume all the breakpoints id's are issued in ascending order
-	TInt maxBreakPoints = 0;
-
-	// Temporary buffer
-	RArray<TBreakId> breakIdList;
-
-	TUint32 testAddress = address;
-
-	while(!done)
-		{
-		TBreakId breakId = 0;
-
-		// set the breakpoint
-		testAddress += 4;	// ensure the addresses don't overlap
-
-		err = iServSession.SetBreak(breakId, iThreadID, testAddress, EArmMode);
-		test (err == KErrNone || err == KErrOverflow);
-		if (err != KErrNone)
-			{
-			// we've reached the limit of the number of breaks we can set
-			done = ETrue;
-			break;
-			}
-
-		// store the id of this breakpoint
-		breakIdList.Append(breakId);
-
-		// Increase the count of breakpoints
-		maxBreakPoints++;
-		test(maxBreakPoints > 0);
-		}
-
-	// How many breakpoints can we set?
-	iMaxBreakpoints = maxBreakPoints;
-
-	// now clear all those breakpoints again
-	while(breakIdList.Count() != 0)
-		{
-		// Place it into a TBreakId
-		TBreakId id = breakIdList[0];
-
-		err = iServSession.ClearBreak(id);
-		test(err == KErrNone);
-
-		// next id
-		breakIdList.Remove(0);
-		}
-
-	breakIdList.Close();
-
-	// close our temporary buffers
-	originalDataBlock.Close();
-	testDataBlock.Close();
-
-	err = iServSession.ResumeThread(iThreadID);
-	test (err == KErrNone);
-
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0437
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test modifying breakpoints
-//! @SYMTestActions Several calls to modify breakpoints
-//! @SYMTestExpectedResults Valid requests should result in the breakpoints being changed, invalid requests should return errors
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestModifyBreak()
-	{
-	test.Next(_L("TestModifyBreak\n"));
-
-	DoTestModifyBreak(ETrue);
-	DoTestModifyBreak(EFalse);
-	}
-
-void CRunModeAgent::DoTestModifyBreak(TBool aThreadSpecific)
-	{
-	test.Printf(_L("DoTestModifyBreak: aThreadSpecific: %d\n"), aThreadSpecific?1:0);
-
-	TInt err;
-
-	RProcess process;
-	TProcessId processId = process.Id();
-	process.Close();
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-
-	//suspend the thread
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-
-	//an address in the target debug thread
-	TUint32 address = (TUint32)(&TestFunction);
-
-	//set an arm mode break point
-	TBreakId armBreakId = 0;
-	err = aThreadSpecific
-		? iServSession.SetBreak(armBreakId, iThreadID, address, EArmMode)
-		: iServSession.SetProcessBreak(armBreakId, processId, address, EArmMode);
-	test(err == KErrNone);
-
-	/*
-	 * Invalid thread
-	 */
-	err = aThreadSpecific
-		? iServSession.ModifyBreak(armBreakId, 0xbabababa, address, EArmMode)
-		: iServSession.ModifyProcessBreak(armBreakId, 0xbabababa, address, EArmMode);
-	test(err == KErrPermissionDenied);
-
-	/*
-	 * Valid address
-	 */
-	err = aThreadSpecific
-		? iServSession.ModifyBreak(armBreakId, iThreadID, address+4, EArmMode)
-		: iServSession.ModifyProcessBreak(armBreakId, processId, address+4, EArmMode);
-	test(err == KErrNone);
-
-	/*
-	 * Invalid address
-	 */
-	err = aThreadSpecific
-		? iServSession.ModifyBreak(armBreakId, iThreadID, 0, EArmMode)
-		: iServSession.ModifyProcessBreak(armBreakId, processId, 0, EArmMode);
-	test(err == KErrBadDescriptor);
-
-	/*
-	 * Thumb mode
-	 */
-	err = aThreadSpecific
-		? iServSession.ModifyBreak(armBreakId, iThreadID, address, EThumbMode)
-		: iServSession.ModifyProcessBreak(armBreakId, processId, address, EThumbMode);
-	test(err == KErrNone);
-
-	/*
-	 * Thumb2EE mode
-	 */
-	err = aThreadSpecific
-		? iServSession.ModifyBreak(armBreakId, iThreadID, address, EThumb2EEMode)
-		: iServSession.ModifyProcessBreak(armBreakId, processId, address, EThumb2EEMode);
-	test(err == KErrNotSupported);
-
-	/*
-	 * Arm mode
-	 */
-	err = aThreadSpecific
-		? iServSession.ModifyBreak(armBreakId, iThreadID, address, EArmMode)
-		: iServSession.ModifyProcessBreak(armBreakId, processId, address, EArmMode);
-	test(err == KErrNone);
-
-	// Finally, clear the breakpoint
-	err = iServSession.ClearBreak(armBreakId);
-	test(err == KErrNone);
-
-	//resume the thread
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0438
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test extracting information about breakpoints
-//! @SYMTestActions Several calls to get information about breakpoints
-//! @SYMTestExpectedResults All tests should pass and the target process should be left unaffected
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestBreakInfo()
-	{
-	test.Next(_L("TestBreakInfo\n"));
-
-	DoTestBreakInfo(ETrue);
-	DoTestBreakInfo(EFalse);
-	}
-
-void CRunModeAgent::DoTestBreakInfo(TBool aThreadSpecific)
-	{
-	test.Printf(_L("DoTestModifyBreak: aThreadSpecific: %d\n"), aThreadSpecific?1:0);
-
-	TInt err;
-
-	RProcess process;
-	TProcessId processId = process.Id();
-	process.Close();
-
-	//an address in the target debug thread
-	TUint32 address = (TUint32)(&TestFunction);
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-
-	//suspend thread
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-
-	//set an arm mode break point
-	TBreakId armBreakId = 0;
-	err = aThreadSpecific
-		? iServSession.SetBreak(armBreakId, iThreadID, address, EArmMode)
-		: iServSession.SetProcessBreak(armBreakId, processId, address, EArmMode);
-	test(err == KErrNone);
-
-	// Read back the information and check it is correct
-	TThreadId testThreadId = TThreadId(0);
-	TProcessId testProcessId = TProcessId(0);
-	TUint32 testAddress = 0;
-	TArchitectureMode testMode = EArmMode;
-
-	err = aThreadSpecific
-		? iServSession.BreakInfo(armBreakId,testThreadId,testAddress, testMode)
-		: iServSession.ProcessBreakInfo(armBreakId, testProcessId, testAddress, testMode);
-	test (err == KErrNone);
-	test (aThreadSpecific ? (testThreadId == iThreadID) : (testProcessId == processId));
-	test (testAddress == address);
-	test (testMode == EArmMode);
-
-	//change the address
-	TUint32 changeAddress = address + 64;
-	err = aThreadSpecific
-		? iServSession.ModifyBreak(armBreakId, iThreadID, changeAddress,EArmMode)
-		: iServSession.ModifyProcessBreak(armBreakId, processId, changeAddress, EArmMode);
-	test(err == KErrNone);
-
-	// Check the address has changed
-	err = aThreadSpecific
-		? iServSession.BreakInfo(armBreakId,testThreadId,testAddress, testMode)
-		: iServSession.ProcessBreakInfo(armBreakId, testProcessId, testAddress, testMode);
-	test (err == KErrNone);
-	test (testAddress == changeAddress);
-
-	// change the architecture type
-	TArchitectureMode checkMode = EThumbMode;
-	err = aThreadSpecific
-		? iServSession.ModifyBreak(armBreakId, iThreadID, address,checkMode)
-		: iServSession.ModifyProcessBreak(armBreakId, processId, address, checkMode);
-	test (err == KErrNone);
-
-	// Check the mode has changed
-	err = aThreadSpecific
-		? iServSession.BreakInfo(armBreakId,testThreadId,testAddress,testMode)
-		: iServSession.ProcessBreakInfo(armBreakId, testProcessId, testAddress, testMode);
-	test (err == KErrNone);
-	test (testMode == checkMode);
-
-	// clear the breakpoint again
-	err = iServSession.ClearBreak(armBreakId);
-	test (err == KErrNone);
-
-	//resume thread
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-// Needed for the RunToBreak test
-IMPORT_C extern void RMDebug_BranchTst1();
-IMPORT_C extern void RMDebug_BranchTst2();
-
-//---------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-0439
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test hitting various types of breakpoints
-//! @SYMTestActions Several calls to register to observe breakpoints and to hit breakpoints of different types
-//! @SYMTestExpectedResults All tests should pass and the target process should be left unaffected
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//---------------------------------------------
-void CRunModeAgent::TestRunToBreak()
-	{
-	test.Next(_L("TestRunToBreak\n"));
-
-	DoTestRunToBreak(ETrue);
-	DoTestRunToBreak(EFalse);
-	}
-
-void CRunModeAgent::DoTestRunToBreak(TBool aThreadSpecific)
-	{
-	test.Printf(_L("DoTestRunToBreak: aThreadSpecific: %d\n"), aThreadSpecific?1:0);
-
-	TInt err = KErrNone;
-
-	RProcess process;
-	TProcessId processId = process.Id();
-	process.Close();
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-	// we should suspend the thread first, then set the breakpoint
-	err = iServSession.SuspendThread(iThreadID);
-	test (err == KErrNone);
-
-	// Try to set the breakpoint
-	TBreakId armBreakId;
-	TUint32 address = (TUint32)(&RMDebug_BranchTst1);
-
-	err = aThreadSpecific
-		? iServSession.SetBreak(armBreakId,iThreadID,address,EArmMode)
-		: iServSession.SetProcessBreak(armBreakId, processId, address, EArmMode);
-	test(err == KErrNone);
-
-	err = aThreadSpecific
-		? iServSession.SetEventAction(iFileName,EEventsBreakPoint, EActionContinue)
-		: iServSession.SetEventAction(iFileName,EEventsProcessBreakPoint, EActionContinue);
-	test (err == KErrNone);
-
-	// Continue the thread
-	err = iServSession.ResumeThread(iThreadID);
-	test (err == KErrNone);
-
-	// wait for the breakpoint to be hit
-	TEventInfo info;
-	static TRequestStatus status;
-
-	TPtr8 infoPtr((TUint8*)&info,0,sizeof(TEventInfo));
-
-	iServSession.GetEvent(iFileName,status,infoPtr);
-
-	// Wait for notification of the breakpoint hit event
-	User::WaitForRequest(status);
-	test(status==KErrNone);
-
-	// info should now be filled with the details
-	test(info.iEventType == (aThreadSpecific ? EEventsBreakPoint : EEventsProcessBreakPoint));
-	test(info.iThreadBreakPointInfo.iRmdArmExcInfo.iR15 == address);
-	test(info.iProcessIdValid);
-	test(info.iThreadIdValid);
-
-	// Not interested in breakpoint events any more
-	err = aThreadSpecific
-		? iServSession.SetEventAction(iFileName,EEventsBreakPoint, EActionIgnore)
-		: iServSession.SetEventAction(iFileName, EEventsProcessBreakPoint, EActionIgnore);
-	test (err == KErrNone);
-
-	// Clear the breakpoint again
-	err = iServSession.ClearBreak(armBreakId);
-	test(err == KErrNone);
-
-	// continue the thread again
-	err = iServSession.ResumeThread(iThreadID);
-	test (err == KErrNone);
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0440
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Test access to target user-side registers.
-//! @SYMTestActions     Suspends a target thread, and reads/writes target thread register contents
-//!
-//! @SYMTestExpectedResults KErrNone. Should access target registers without problems.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-void CRunModeAgent::TestRegisterAccess()
-	{
-	TInt err;
-
-	test.Next(_L("TestRegisterAccess - Read\n"));
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-
-	//suspend the thread to read registers
-	err = iServSession.SuspendThread(iThreadID);
-	test(err==KErrNone);
-
-	//we'll try to read/write registers ERegisterR0 - ERegisterCPSR and ERegisterR13_IRQ
-	//this way should get valid register values back, invalid ones and not supported ones, and it
-	//means that the register IDs are not completely contiguous
-
-	TInt firstRegister = 0;
-	TInt lastRegister = 17;
-	TInt numberOfRegisters = (lastRegister - firstRegister) + 1;
-
-	RBuf8 ids;
-	err = ids.Create(numberOfRegisters * sizeof(TRegisterInfo));
-	test(err == KErrNone);
-
-	for(TInt i=0; i<numberOfRegisters - 1; i++)
-		{
-		TRegisterInfo reg = (TRegisterInfo)((i + firstRegister)<<8);
-		ids.Append(reinterpret_cast<const TUint8*>(&reg), sizeof(TRegisterInfo));
-		}
-
-	TRegisterInfo reg = ERegisterR13Irq;
-	ids.Append(reinterpret_cast<const TUint8*>(&reg), sizeof(TRegisterInfo));
-
-	//create a buffer to store the register values in
-	RBuf8 originalValues;
-	err = originalValues.Create(numberOfRegisters*sizeof(TUint32));
-	test(err == KErrNone);
-
-	//create a buffer to store the register flags in
-	RBuf8 originalFlags;
-	err = originalFlags.Create(numberOfRegisters*sizeof(TUint8));
-	test(err == KErrNone);
-
-	//read register values
-	err = iServSession.ReadRegisters(iThreadID, ids, originalValues, originalFlags);
-	test(err == KErrNone);
-
-	//create a buffer containing data to write into the registers
-	RBuf8 tempValues;
-	err = tempValues.Create(numberOfRegisters*sizeof(TUint32));
-	test(err == KErrNone);
-
-	TUint cpsrId = 16;
-	for(TUint8 i=0; i<numberOfRegisters*sizeof(TUint32); i++)
-		{
-		if(i/sizeof(TUint32) == cpsrId)
-			{
-			//For the CPSR we wish to write data that makes sense - for USR mode we are
-			//allowed change all except the mode, ie. we must stay in usr mode. We try that here
-			//(allowedCPSRValue[4:0] = 10000) thus not changing the mode.
-			TUint32 allowedCPSRValue = 0x50000010;
-			tempValues.Append((TUint8*)&allowedCPSRValue, 4);
-			i += 3;
-			}
-		else
-			{
-			tempValues.Append(&i, 1);
-			}
-		}
-
-	test.Next(_L("TestRegisterAccess - Write\n"));
-
-	//create a buffer to store the register flags in
-	RBuf8 tempWriteFlags;
-	err = tempWriteFlags.Create(numberOfRegisters*sizeof(TUint8));
-	test(err == KErrNone);
-
-	//write the temp data into the registers
-	err = iServSession.WriteRegisters(iThreadID, ids, tempValues, tempWriteFlags);
-	test(err == KErrNone);
-
-	//create another buffer to store the register flags in
-	RBuf8 tempReadFlags;
-	err = tempReadFlags.Create(numberOfRegisters*sizeof(TUint8));
-	test(err == KErrNone);
-
-	RBuf8 tempReadValues;
-	err = tempReadValues.Create(numberOfRegisters*sizeof(TUint32));
-	test(err == KErrNone);
-
-	//read the temp data out again
-	err = iServSession.ReadRegisters(iThreadID, ids, tempReadValues, tempReadFlags);
-	test(err == KErrNone);
-
-	//check values are correct
-	for(TInt i=0; i<numberOfRegisters; i++)
-		{
-		TRegisterFlag writeFlag;
-		err = GetFlag(tempWriteFlags, i, writeFlag);
-		test(err == KErrNone);
-
-		TRegisterFlag readFlag;
-		err = GetFlag(tempReadFlags, i, readFlag);
-		test(err == KErrNone);
-
-		if((writeFlag == EValid) && (readFlag == EValid))
-			{
-			TUint8 offset = i * sizeof(TUint32);
-			for(TUint j = offset; j< offset + sizeof(TUint32); j++)
-				{
-				test(tempValues.Ptr()[j] == tempReadValues.Ptr()[j]);
-				}
-			}
-		}
-
-	//write the original data into the registers
-	err = iServSession.WriteRegisters(iThreadID, ids, originalValues, originalFlags);
-	test(err == KErrNone);
-
-	//read the data out again
-	err = iServSession.ReadRegisters(iThreadID, ids, tempValues, tempReadFlags);
-	test(err == KErrNone);
-
-	//check values are correct
-	for(TInt i=0; i<numberOfRegisters; i++)
-		{
-		TRegisterFlag writeFlag;
-		err = GetFlag(originalFlags, i, writeFlag);
-		test(err == KErrNone);
-
-		TRegisterFlag readFlag;
-		err = GetFlag(tempReadFlags, i, readFlag);
-		test(err == KErrNone);
-
-		if((writeFlag == EValid) && (readFlag == EValid))
-			{
-			TUint8 offset = i * sizeof(TUint32);
-			for(TUint j = offset; j< offset + sizeof(TUint32); j++)
-				{
-				test(tempValues.Ptr()[j] == originalValues.Ptr()[j]);
-				}
-			}
-		}
-
-	test.Next(_L("TestRegisterAccess - Invalid data\n"));
-
-	//create a buffer of max size 1
-	RBuf8 emptyBuffer;
-	emptyBuffer.Create(1);
-
-	//test register IDs buffer not being a multiple of sizeof(TRegisterInfo)
-	err = iServSession.ReadRegisters(iThreadID, emptyBuffer, tempValues, tempReadFlags);
-	test(err == KErrArgument);
-
-	//test register values buffer not being a multiple of sizeof(TUint32)
-	err = iServSession.ReadRegisters(iThreadID, ids, emptyBuffer, tempReadFlags);
-	test(err == KErrArgument);
-
-	//test flags buffer being representing different number of registers from other two
-	err = iServSession.ReadRegisters(iThreadID, ids, tempValues, emptyBuffer);
-	test(err == KErrArgument);
-
-	//set max length to 0
-	emptyBuffer.ReAlloc(0);
-
-	//test ids buffer being of 0 max length
-	err = iServSession.ReadRegisters(iThreadID, emptyBuffer, tempValues, tempReadFlags);
-	test(err == KErrArgument);
-
-	//do cleanup
-	emptyBuffer.Close();
-	tempValues.Close();
-	tempWriteFlags.Close();
-	tempReadFlags.Close();
-	tempReadValues.Close();
-
-	test.Next(_L("TestRegisterAccess - Setting PC value\n"));
-
-	//create buffer containing PC register ID
-	RBuf8 pcId;
-	err = pcId.Create(sizeof(TRegisterInfo));
-	test(err == KErrNone);
-	TRegisterInfo reg1 = (TRegisterInfo)0x00000f00;
-	pcId.Append(reinterpret_cast<const TUint8*>(&reg1), sizeof(TRegisterInfo));
-
-	//create buffer containing desired PC value
-	RBuf8 pcValue;
-	err = pcValue.Create(sizeof(TUint32));
-	test(err == KErrNone);
-	TUint32 address = (TUint32)(&TestFunction);
-	pcValue.Append(reinterpret_cast<const TUint8*>(&address), sizeof(TUint32));
-
-	//craete buffer for PC flag value
-	RBuf8 pcFlag;
-	err = pcFlag.Create(sizeof(TUint8));
-
-	//write the new PC value
-	err = iServSession.WriteRegisters(iThreadID, pcId, pcValue, pcFlag);
-	test(err==KErrNone);
-
-	//get the flag and check the PC value was written ok
-	TRegisterFlag flag = ENotSupported;
-	err = GetFlag(pcFlag, 0, flag);
-	test(err==KErrNone);
-
-	//if the PC value was successfully changed then resume the thread and
-	//the value of TestData will hopefully be changed to our specified
-	//value
-	if(flag == EValid)
-		{
-		err = iServSession.ResumeThread(iThreadID);
-		test(err==KErrNone);
-
-		User::After(500000);
-
-		err = iServSession.SuspendThread(iThreadID);
-		test(err==KErrNone);
-
-		test(TestData == 0xffeeddcc);
-		}
-
-	//Make sure we cannot change the CPSR
-	test.Next(_L("Verifying we cannot change the CPSR mode from USR Mode"));
-
-	TUint32 disallowedCpsr = 0x50000013;
-
-	RBuf8 cpsrRegId;
-	err = cpsrRegId.Create(sizeof(TUint32));
-	test(err == KErrNone);
-
-	TRegisterInfo cpsr = (TRegisterInfo)((cpsrId + firstRegister)<<8);
-	cpsrRegId.Append(reinterpret_cast<const TUint8*>(&cpsr), sizeof(TRegisterInfo));
-
-	RBuf8 cpsrRegFlags;
-	err = cpsrRegFlags.Create(sizeof(TUint8));
-	test(err == KErrNone);
-
-	RBuf8 cpsrVal;
-	err = cpsrVal.Create(sizeof(TUint32));
-	test(err == KErrNone);
-
-	cpsrVal.Append((TUint8*)&disallowedCpsr, 4);
-
-	//attempt to write disallowed CPSR in
-	err = iServSession.WriteRegisters(iThreadID, cpsrRegId, cpsrVal, cpsrRegFlags);
-	test(err == KErrNone);
-
-	RBuf8 cpsrReadVal;
-	err = cpsrReadVal.Create(sizeof(TUint32));
-	test(err == KErrNone);
-
-	//Read back the CPSR
-	err = iServSession.ReadRegisters(iThreadID, cpsrRegId, cpsrReadVal, cpsrRegFlags);
-	test(err == KErrNone);
-
-	//Make sure we havent switched modes ie. its not what we wrote
-	TUint32* readVal = (TUint32*)cpsrReadVal.Ptr();
-	test(*readVal != disallowedCpsr);
-
-	cpsrRegId.Close();
-	cpsrRegFlags.Close();
-	cpsrVal.Close();
-	cpsrReadVal.Close();
-
-	//write the original values back into here
-	err = iServSession.WriteRegisters(iThreadID, ids, originalValues, originalFlags);
-	test(err == KErrNone);
-
-	// Resume the thread
-	err = iServSession.ResumeThread(iThreadID);
-	test(err==KErrNone);
-
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-
-	//do cleanup
-	pcId.Close();
-	pcValue.Close();
-	pcFlag.Close();
-	ids.Close();
-	originalValues.Close();
-	originalFlags.Close();
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0441
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Test registration/de-registration of debug interest in target exe with the Debug Security Server
-//! @SYMTestActions     As per description
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-void CRunModeAgent::TestAttachExecutable()
-	{
-
-	test.Next(_L("TestAttachExecutable - Attach\n"));
-
-	//attach to process passively
-	test(KErrNone == iServSession.AttachExecutable(iFileName, ETrue));
-
-	//make a thread id for a non-existent thread
-	TThreadId threadId(0x12345678);
-
-	//get a handle to the target thread
-	RThread targetThread;
-	TInt err = targetThread.Open(threadId);
-	test(err != KErrNone);
-
-	//not registered for this thread's process (as it doesn't exist)
-	//so should fail security check
-	err = iServSession.ResumeThread(threadId);
-	test(err==KErrPermissionDenied);
-
-	//try to attach to the same process (and fail)
-	test(KErrAlreadyExists == iServSession.AttachExecutable(iFileName, EFalse));
-
-	test.Next(_L("TestAttachExecutable - Detach\n"));
-
-	//detach from process
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-
-	//attach non-passively
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-
-	//not registered for this thread's process (as it doesn't exist)
-	//so should fail security check
-	err = iServSession.ResumeThread(0x12345678);
-	test(err==KErrPermissionDenied);
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0442
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Tests single-stepping target threads.
-//! @SYMTestActions     Steps target thread assembly level instructions, mainly branch/change PC
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-void CRunModeAgent::TestStep()
-	{
-	//Dont run the test for an SMP System
-	if (UserSvr::HalFunction(EHalGroupKernel, EKernelHalSmpSupported, 0, 0) == KErrNone)
-		return;
-
-	test.Next(_L("TestStep\n"));
-
-	DoTestStep(EFalse);
-	DoTestStep(ETrue);
-	}
-
-void CRunModeAgent::DoTestStep(TBool aThreadSpecific)
-	{
-	test.Printf(_L("DoTestStep: aThreadSpecific: %d\n"), aThreadSpecific?1:0);
-
-	TInt err = KErrNone;
-
-	RProcess process;
-	TProcessId processId = process.Id();
-	process.Close();
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-	//set the target thread to execute the stepping functions
-	test(KErrNone == SwitchTestFunction(EStepFunction));
-
-	err = iServSession.SetEventAction(iFileName,EEventsBreakPoint, EActionContinue);
-	test (err == KErrNone);
-
-	if(!aThreadSpecific)
-		{
-		err = iServSession.SetEventAction(iFileName, EEventsProcessBreakPoint, EActionContinue);
-		test (err == KErrNone);
-		}
-
-	TUint32	startAddress;
-	TUint32	endAddress;
-
-	/*
-	 * RMDebug_StepTest_Non_PC_Modifying
-	 */
-	test.Next(_L("TestStep - Non-PC modifying\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_Non_PC_Modifying);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_Non_PC_Modifying_OK);
-
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1, EFalse, processId);
-	test(err==KErrNone);
-
-	/*
-	 * RMDebug_StepTest_Branch
-	 */
-	test.Next(_L("TestStep - Branch\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_Branch);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_Branch_1);
-
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1, EFalse, processId);
-	test(err==KErrNone);
-
-	/*
-	 * RMDebug_StepTest_Branch_And_Link
-	 */
-	test.Next(_L("TestStep - Branch_And_Link\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_Branch_And_Link_1);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_Branch_And_Link_2);
-
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1, EFalse, processId);
-	test(err==KErrNone);
-
-	/*
-	 * RMDebug_StepTest_MOV_PC
-	 */
-	test.Next(_L("TestStep - MOV PC,X\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_MOV_PC_1);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_MOV_PC_2);
-
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1, EFalse, processId);
-	test(err==KErrNone);
-
-	/*
-	 * RMDebug_StepTest_LDR_PC
-	 */
-	test.Next(_L("TestStep - LDR PC\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_LDR_PC);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_LDR_PC_1);
-
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1, EFalse, processId);
-	test(err==KErrNone);
-
-// thumb and interworking tests are not supported on armv4
-#ifdef __MARM_ARMV5__
-
-	/*
-	 * RMDebug_StepTest_Thumb_Non_PC_Modifying
-	 */
-	test.Next(_L("TestStep - Thumb Non PC-Modifying\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_Thumb_Non_PC_Modifying_1);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_Thumb_Non_PC_Modifying_2);
-
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1, EFalse, processId);
-	test(err==KErrNone);
-
-	/*
-	 * RMDebug_StepTest_Thumb_Branch
-	 */
-	test.Next(_L("TestStep - Thumb Branch\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_Thumb_Branch_1);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_Thumb_Branch_2);
-
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1, EFalse, processId);
-	test(err==KErrNone);
-
-	/*
-	 * RMDebug_StepTest_Thumb_Branch_And_Link
-	 */
-	test.Next(_L("TestStep - Thumb Branch_And_Link\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_Thumb_Branch_And_Link_2);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_Thumb_Branch_And_Link_3);
-
-	TInt muid=0;
-    test(HAL::Get(HAL::EMachineUid, muid)==KErrNone);
-
-	// check if running on ARMv7 core
-	if(muid==HAL::EMachineUid_OmapH6 || muid==HAL::EMachineUid_OmapZoom || muid==HAL::EMachineUid_EmuBoard)
-        {
-        // Note: ARMv7 treats BL instructions as single 32-bit instructions
-        err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1, EFalse, processId);
-        }
-    else
-	    {
-        // Note: Due to the fact that the stepper treats BL instructions
-		// as two instructions (as the hardware does), then we must step
-		// the first half instruction first)
-
-		err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,startAddress+2,EThumbMode,1)
-		: HelpTestStep(iThreadID,startAddress,startAddress+2,EThumbMode,1, EFalse, processId);
-		test(err==KErrNone);
-
-	// Now we actually do the BL
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress+2,endAddress,EThumbMode,1)
-		: HelpTestStep(iThreadID,startAddress+2,endAddress,EThumbMode,1, EFalse, processId);
-        }
-	test(err==KErrNone);
-
-	/*
-	 * RMDebug_StepTest_Thumb_Back_Branch_And_Link
-	 */
-	test.Next(_L("TestStep - Thumb Back_Branch_And_Link\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_Thumb_Back_Branch_And_Link_2);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_Thumb_Back_Branch_And_Link_3);
-
-	// check if running on ARMv7 core
-	if(muid==HAL::EMachineUid_OmapH6 || muid==HAL::EMachineUid_OmapZoom || muid==HAL::EMachineUid_EmuBoard)
-		{
-		// Note: ARMv7 treats BL instructions as single 32-bit instructions
-		err = aThreadSpecific
-			? HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1)
-			: HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1, EFalse, processId);
-		}
-	else
-		{
-		// Note: Due to the fact that the stepper treats BL instructions
-		// as two instructions (as the hardware does), then we must step
-		// the first half instruction first)
-
-		err = aThreadSpecific
-	   		? HelpTestStep(iThreadID,startAddress,startAddress+2,EThumbMode,1)
-			: HelpTestStep(iThreadID,startAddress,startAddress+2,EThumbMode,1, EFalse, processId);
-		test(err==KErrNone);
-
-	   	// Now we actually do the BL
-		err = aThreadSpecific
-   			? HelpTestStep(iThreadID,startAddress+2,endAddress,EThumbMode,1)
-			: HelpTestStep(iThreadID,startAddress+2,endAddress,EThumbMode,1, EFalse, processId);
-		}
-	test(err==KErrNone);
-
-	/*
-	 * RMDebug_StepTest_Thumb_AddPC
-	 */
-	test.Next(_L("TestStep - Thumb ADD PC, PC, R0\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_Thumb_AddPC_2);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_Thumb_AddPC_3);
-
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1, EFalse, processId);
-	test(err==KErrNone);
-
-	/*
-	 * RMDebug_StepTest_Interwork ARM to Thumb
-	 */
-	test.Next(_L("TestStep - Interworking ARM to Thumb - BLX \n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_Interwork_1);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_Interwork_2);
-
-	err = aThreadSpecific // nb initial breakpoint in ARM code
-		? HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,1, EFalse, processId);
-
-	test(err==KErrNone);
-
-	/*
-	 * RMDebug_StepTest_Interwork Thumb to ARM
-	 */
-	test.Next(_L("TestStep - Interworking Thumb to ARM - BLX\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_Interwork_2);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_Interwork_3);
-
-	// check if running on ARMv7 core
-	if(muid==HAL::EMachineUid_OmapH6 || muid==HAL::EMachineUid_OmapZoom || muid==HAL::EMachineUid_EmuBoard)
-        {
-        // ARMv7 treats BLX instructions as single 32-bit instructions
-        err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EThumbMode,1, EFalse, processId);
-        }
-    else
-        {
-    	// Stepper treats this as a two-stage instruction (just like the hardware)
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,startAddress+2,EThumbMode,1)
-		: HelpTestStep(iThreadID,startAddress,startAddress+2,EThumbMode,1, EFalse, processId);
-	test(err == KErrNone);
-
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress+2,endAddress,EThumbMode,1)
-		: HelpTestStep(iThreadID,startAddress+2,endAddress,EThumbMode,1, EFalse, processId);
-        }
-	test(err == KErrNone);
-
-#endif // __MARM_ARMV5__
-
-	/*
-	 * Test multiple-step of ARM code
-	 */
-	test.Next(_L("TestStep - ARM Multiple instruction step\n"));
-
-	startAddress = (TUint32)(&RMDebug_StepTest_ARM_Step_Multiple);
-
-	endAddress = (TUint32)(&RMDebug_StepTest_ARM_Step_Multiple_1);
-
-	err = aThreadSpecific
-		? HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,5)
-		: HelpTestStep(iThreadID,startAddress,endAddress,EArmMode,5, EFalse, processId);
-	test(err == KErrNone);
-	// stepping performance
-	test.Next(_L("TestStep - Steps per second\n"));
-
-	// run until we reach RMDebug_StepTest_Count_1
-	TBreakId stepBreakId;
-	startAddress = (TUint32)(&RMDebug_StepTest_Count_1);
-	endAddress = (TUint32)(&RMDebug_StepTest_Count_2);
-
-	err = aThreadSpecific
-		? HelpTestStepSetBreak(stepBreakId,iThreadID,startAddress,EArmMode)
-		: HelpTestStepSetBreak(stepBreakId,iThreadID,startAddress,EArmMode,EFalse,processId);
-	test (err == KErrNone);
-
-	// wait until we hit the breakpoint
-	TEventInfo info;
-	err = HelpTestStepWaitForBreak(iFileName,info);
-	test (err == KErrNone);
-
-	// Now clear the breakpoint
-	err = iServSession.ClearBreak(stepBreakId);
-	test(err == KErrNone);
-
-	if(aThreadSpecific)
-		{
-		// now step the code
-		TInt stepsPerSecond = 0;
-
-		TUint32 stopTickCount = User::NTickCount() + HelpTicksPerSecond();
-
-		while (User::NTickCount() < stopTickCount)
-			{
-			err = iServSession.Step(iThreadID,1);
-			test (err == KErrNone);
-
-			// we need to wait now until the step completes before asking for the next step
-				{
-				TEventInfo info;
-				static TRequestStatus status;
-
-				TPtr8 infoPtr((TUint8*)&info,0,sizeof(TEventInfo));
-
-				iServSession.GetEvent(iFileName,status,infoPtr);
-
-				// Wait for notification of the breakpoint hit event
-				User::WaitForRequest(status);
-				test(status==KErrNone);
-				}
-
-			// Update the count of steps
-			stepsPerSecond += 1;
-
-			// Gone wrong if we do too many
-			test(stepsPerSecond < 10000);
-			}
-
-		iStepsPerSecond = stepsPerSecond;
-		test(iStepsPerSecond != 0);
-		}
-
-	// finally resume the thread
-	err = iServSession.ResumeThread(iThreadID);
-	test (err == KErrNone);
-
-	err = iServSession.SetEventAction(iFileName,EEventsBreakPoint, EActionIgnore);
-	test (err == KErrNone);
-
-	if(!aThreadSpecific)
-		{
-		err = iServSession.SetEventAction(iFileName, EEventsProcessBreakPoint, EActionIgnore);
-		test (err == KErrNone);
-		}
-
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0443
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Tests registration and occurrence of target thread event (in this case panic)
-//! @SYMTestActions     Registers for a panic in the target thread, causes it, and catches the panic notification.
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-void CRunModeAgent::TestEvents()
-	{
-	TInt err = KErrNone;
-
-	test.Next(_L("TestEvents\n"));
-
-	TInt panicReason = 12345;
-
-	test.Printf(_L("Thread t_rmdebug.exe::DebugThread should panic with reason %d.\n"), panicReason);
-
-	//attach non-passively
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-
-	RThread threadToPanic;
-	test(KErrNone == StartDebugThread(threadToPanic, _L("EventsThread")));
-	TThreadId threadToPanicId = threadToPanic.Id();
-	TEventInfo info;
-
-	// Set things up to wait for a thread kill event
-	err = iServSession.SetEventAction(iFileName, EEventsKillThread, EActionContinue);
-	test(err==KErrNone);
-
-	// Wait for an event to occur in this process - nothing should have happened yet.
-	static TRequestStatus status;
-
-	TPtr8 infoPtr((TUint8*)&info,0,sizeof(TEventInfo));
-
-	iServSession.GetEvent(iFileName,status,infoPtr);
-
-	// Test Request cancellation
-	err = iServSession.CancelGetEvent(iFileName);
-	test (err==KErrNone);
-
-	// Again wait for an event to occur in our process - we will provoke the
-	// thread kill event by panic'ing the test thread.
-	iServSession.GetEvent(iFileName,status,infoPtr);
-
-	// Panic the debug thread to cause a thread kill event
-	threadToPanic.Panic(_L("t_rmdebug panic thread test"), panicReason);
-
-	// Wait for notification of the Thread Kill event
-	User::WaitForRequest(status);
-	test(status==KErrNone);
-
-	// Check we are really recieving information about the panic
-	test(info.iProcessIdValid);
-	test(info.iThreadIdValid);
-	test(info.iProcessId==RProcess().Id());
-	test(info.iThreadId==threadToPanicId);
-	test(info.iEventType==EEventsKillThread);
-	test(info.iThreadKillInfo.iExitType==EExitPanic);
-
-	// Ignore other panic events
-	err = iServSession.SetEventAction(iFileName, EEventsKillThread, EActionIgnore);
-	test(err==KErrNone);
-
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0444
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Tests registration and occurence of target thread events in separate process.
-//! @SYMTestActions     Registers for a hardware exception and kill thread events, and receives them.
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-void CRunModeAgent::TestEventsForExternalProcess()
-	{
-	//Dont run the test for an SMP System
-	if (UserSvr::HalFunction(EHalGroupKernel, EKernelHalSmpSupported, 0, 0) == KErrNone)
-		return;
-
-	test.Next(_L("TestEventsForExternalProcess\n"));
-
-	for(TInt main=0; main<3; main++)
-		{
-		for(TInt extra=0; extra<3; extra++)
-			{
-			TestEventsWithExtraThreads((TKernelEventAction)main, (TKernelEventAction)extra, 0);
-			TestEventsWithExtraThreads((TKernelEventAction)main, (TKernelEventAction)extra, 2);
-			}
-		}
-	}
-
-void CRunModeAgent::TestEventsWithExtraThreads(TKernelEventAction aActionMain, TKernelEventAction aActionExtra, TUint32 aExtraThreads)
-	{
-	const TInt KNumberOfTypes = 8;
-	struct TEventStruct
-		{
-		public:
-		TDebugFunctionType iDebugFunctionType;
-		TEventType iEventType;
-		};
-
-	TEventStruct type[KNumberOfTypes] =
-		{
-			{EStackOverflowFunction, EEventsHwExc},
-			{EUserPanicFunction, EEventsKillThread},
-			{EPrefetchAbortFunction, EEventsHwExc},
-			{EDataAbortFunction, EEventsHwExc},
-			{EUndefInstructionFunction, EEventsHwExc},
-			{EDataReadErrorFunction, EEventsHwExc},
-			{EDataWriteErrorFunction, EEventsHwExc},
-			{EUserExceptionFunction, EEventsSwExc},
-		};
-
-	for(TInt j=0; j<KNumberOfTypes; j++)
-		{
-		//RDebug::Printf("**** type: %d, main action: %d, extra action: %d, extraThreads: %d", j, (TUint32)aActionMain, (TUint32)aActionExtra, aExtraThreads);
-
-		// do this check as it seems to hard to do these cases with the current set up
-		if(EEventsKillThread == type[j].iEventType)
-			{
-			if(EActionSuspend != aActionMain)
-				{
-				if(aActionMain != aActionExtra)
-					{
-					return;
-					}
-				}
-			}
-		// attach to KRMDebugTestApplication
-		test(KErrNone == iServSession.AttachExecutable(KRMDebugTestApplication, EFalse));
-
-		// Set things up to wait for the expected exception in KRMDebugTestApplication
-		test(KErrNone == iServSession.SetEventAction(KRMDebugTestApplication, type[j].iEventType, aActionMain));
-
-		if(EActionSuspend != aActionMain)
-			{
-			test(KErrNone == iServSession.SetEventAction(KRMDebugTestApplication, EEventsKillThread, aActionExtra));
-			}
-
-		// declare a TRequestStatus object for asynchronous calls
-		TRequestStatus status;
-
-		TEventInfo info;
-		TPtr8 infoBuffer = TPtr8((TUint8*)&info,0,sizeof(TEventInfo));
-		if(EActionIgnore != aActionMain)
-			{
-			iServSession.GetEvent(KRMDebugTestApplication(), status, infoBuffer);
-			}
-
-		// launch the target process to trigger the expected exception
-		RProcess targetProcess;
-		test(KErrNone == LaunchProcess(targetProcess, KRMDebugTestApplication(), type[j].iDebugFunctionType, 0, aExtraThreads));
-		TProcessId processId(targetProcess.Id());
-		targetProcess.Close();
-
-		if(EActionIgnore != aActionMain)
-			{
-			// wait for notification of the exception
-			User::WaitForRequest(status);
-			test(KErrNone == status.Int());
-
-			// check that this is the event we were expecting
-			test(info.iProcessIdValid);
-			test(info.iThreadIdValid);
-			test(info.iProcessId==processId);
-			test(info.iEventType==type[j].iEventType);
-			}
-
-		if(EActionSuspend == aActionMain)
-			{
-			// read the thread list, partly to check the call works, and partly to check the thread still exists
-			test(ThreadExistsForProcess(info.iThreadId, info.iProcessId));
-
-			// register to catch all the thread kills which will occur
-			test(KErrNone == iServSession.SetEventAction(KRMDebugTestApplication, EEventsKillThread, aActionExtra));
-			// we specified EActionSuspend earlier so need to call resume on this thread
-			test(KErrNone == iServSession.ResumeThread(info.iThreadId));
-			}
-
-		// find out how many threads there are in the process and catch all the thread kill events,
-		// the number of kill thread events should correspond to the number of extra threads launched,
-		// plus one if the main thread panicked with a Sw/Hw exception
-		if(EActionIgnore != aActionExtra)
-			{
-			TInt dyingThreads = aExtraThreads + ( (type[j].iEventType != EEventsKillThread) ? 1 : 0);
-			for(TInt k=0; k<dyingThreads; k++)
-				{
-				iServSession.GetEvent(KRMDebugTestApplication(), status, infoBuffer);
-				// wait for notification of the kill thread
-				User::WaitForRequest(status);
-				test(KErrNone == status.Int());
-
-				// check that this is the event we were expecting
-				test(info.iProcessIdValid);
-				test(info.iThreadIdValid);
-				test(info.iProcessId==processId);
-				test(info.iEventType==EEventsKillThread);
-				if(EActionSuspend == aActionExtra)
-					{
-					// do some calls to check listings work ok at this stage
-					test(ProcessExists(info.iProcessId));
-					test(ThreadExistsForProcess(info.iThreadId, info.iProcessId));
-					// we specified EActionSuspend earlier so need to call resume on this thread
-					test(KErrNone == iServSession.ResumeThread(info.iThreadId));
-					}
-				}
-			}
-		// reset the thread kill event
-		test(KErrNone == iServSession.SetEventAction(KRMDebugTestApplication(), EEventsKillThread, EActionIgnore));
-
-		// reset events for KRMDebugTestApplication
-		test(KErrNone == iServSession.SetEventAction(KRMDebugTestApplication(), type[j].iEventType, EActionIgnore));
-
-		// finished debugging KRMDebugTestApplication so detach
-		test(KErrNone == iServSession.DetachExecutable(KRMDebugTestApplication()));
-
-		// want to validate that the process has really exited, i.e. we're not accidentally keeping a handle to it...
-		if(ProcessExists(processId))
-			{
-			// wait a little while and try again, just in case the process was still being shut down when we tried the first time
-			User::After(1000000);
-			test(!ProcessExists(processId));
-			}
-		}
-	}
-
-// helper function to check whether a thread with id aThreadId exists in the process with id aProcessId
-TBool CRunModeAgent::ThreadExistsForProcess(const TThreadId aThreadId, const TProcessId aProcessId)
-	{
-	TUint32 size;
-	RBuf8 buffer;
-	test(KErrNone == buffer.Create(1024));
-	TInt err = iServSession.GetList(aProcessId, EThreads, buffer, size);
-	while(KErrTooBig == err)
-		{
-		size*=2;
-		test(size<=16*1024);
-		test(KErrNone == buffer.ReAlloc(size));
-		err = iServSession.GetList(aProcessId, EThreads, buffer, size);
-		}
-	test(KErrNone == err);
-
-	//look through the buffer and check if the target debug thread is there
-	TUint8* ptr = (TUint8*)buffer.Ptr();
-	const TUint8* ptrEnd = ptr + size;
-	while(ptr < ptrEnd)
-		{
-		TThreadListEntry& entry = *(TThreadListEntry*)ptr;
-		if(aThreadId.Id() == entry.iThreadId)
-			{
-			buffer.Close();
-			return ETrue;
-			}
-		ptr += Align4(entry.GetSize());
-		}
-	buffer.Close();
-	return EFalse;
-	}
-
-// helper function to check whether a process with id aProcessId exists
-TBool CRunModeAgent::ProcessExists(const TProcessId aProcessId)
-	{
-	TUint32 size;
-	RBuf8 buffer;
-	test(KErrNone == buffer.Create(1024));
-	TInt err = iServSession.GetList(EProcesses, buffer, size);
-	while(KErrTooBig == err)
-		{
-		size*=2;
-		test(size<=16*1024);
-		test(KErrNone == buffer.ReAlloc(size));
-		err = iServSession.GetList(EProcesses, buffer, size);
-		}
-	test(KErrNone == err);
-
-	//look through the buffer and check if the target debug thread is there
-	TUint8* ptr = (TUint8*)buffer.Ptr();
-	const TUint8* ptrEnd = ptr + size;
-	while(ptr < ptrEnd)
-		{
-		TProcessListEntry& entry = *(TProcessListEntry*)ptr;
-		if(aProcessId.Id() == entry.iProcessId)
-			{
-			buffer.Close();
-			return ETrue;
-			}
-		ptr += Align4(entry.GetSize());
-		}
-	buffer.Close();
-	return EFalse;
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0445
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Tests basic debug functions work on demand-paged target threads
-//! @SYMTestActions     Checks it can r/w memory, set breakpoints etc in a demand paged target.
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-void CRunModeAgent::TestDemandPaging(void)
-	{
-	test.Next(_L("TestDemandPaging\n"));
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-
-	// get the address of a function in code that will be paged in
-	TUint32 address = (TUint32)(&RMDebugDemandPagingTest);
-	const TUint32 armInstSize = 4;
-
-	// read the memory at &RMDebugDemandPagingTest to check that reading memory in demand paged code works
-	TUint32 demandPagedInst = 0;
-	TPtr8 demandPagedInstBuf((TUint8*)&demandPagedInst, armInstSize);
-	test(KErrNone == iServSession.ReadMemory(iThreadID, address, armInstSize, demandPagedInstBuf, EAccess32, EEndLE8));
-
-	// this is the MOVS instruction that we expect to find in RMDebugDemandPagingTest
-	TUint32 expectedDemandPagedInst = 0xe1b02000;
-
-	// check that the instruction we read is as expected
-	test(demandPagedInst == expectedDemandPagedInst);
-
-	// set event action for break points
-	test(KErrNone == iServSession.SetEventAction(RProcess().FileName(), EEventsBreakPoint, EActionContinue));
-
-	// set an arm breakpoint on RMDebugDemandPagingTest
-	TBreakId armBreakId = 0;
-	test(KErrNone == iServSession.SetBreak(armBreakId, iThreadID, address, EArmMode));
-
-	// Ensure that after setting the breakpoint the memory read returns the correct value
-	TUint32 demandPagedInstWithBreakPoint = 0;
-	TPtr8 spinForeverInstWithBreakPointBuf((TUint8*)&demandPagedInstWithBreakPoint, armInstSize);
-	test(KErrNone == iServSession.ReadMemory(iThreadID, address, armInstSize, spinForeverInstWithBreakPointBuf, EAccess32, EEndLE8));
-	test(demandPagedInst == demandPagedInstWithBreakPoint);
-
-	// switch the target thread to run the demand paging function
-	test(KErrNone == SwitchTestFunction(EDemandPagingFunction));
-
-	// set up event watcher to catch breakpoint being hit in demand paged code
-	TEventInfo info;
-	static TRequestStatus status;
-	TPtr8 infoPtr((TUint8*)&info,sizeof(TEventInfo));
-	iServSession.GetEvent(RProcess().FileName(), status, infoPtr);
-
-	// resume the thread
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-	// wait for notification of the breakpoint hit event
-	User::WaitForRequest(status);
-	test(status==KErrNone);
-
-	// info should now be filled with the details
-	test(info.iProcessIdValid);
-	test(info.iThreadIdValid);
-	test(info.iEventType == EEventsBreakPoint);
-	test(info.iThreadBreakPointInfo.iRmdArmExcInfo.iR15 == address);
-
-	// remove the break point and resume the thread
-	test(KErrNone == iServSession.ClearBreak(armBreakId));
-
-	// switch the target thread to run the default function
-	test(KErrNone == SwitchTestFunction(EDefaultFunction));
-
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-// Names of some test programs used for testing security
-_LIT(KRMDebugSecurity0FileName,"z:\\sys\\bin\\t_rmdebug_security0.exe"); // Debuggable
-_LIT(KRMDebugSecurity1FileName,"z:\\sys\\bin\\t_rmdebug_security1.exe"); // Not debuggable
-_LIT(KRMDebugSecurity2FileName,"z:\\sys\\bin\\t_rmdebug_security2.exe"); // AllFiles
-_LIT(KRMDebugSecurity3FileName,"z:\\sys\\bin\\t_rmdebug_security3.exe"); // TCB AllFiles
-
-// include the test header file here
-#include "rm_debug_kerneldriver.h"
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0446
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Tests Debug Device Driver is locked to the SID of the Debug Security Svr.
-//! @SYMTestActions     Loads rm-debug.ldd and tries to open a handle to it. This should fail.
-//!
-//! @SYMTestExpectedResults KErrPermissionDenied.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-void CRunModeAgent::TestDriverSecurity(void)
-	{
-	test.Next(_L("TestDriverSecurity\n"));
-
-	RRM_DebugDriver kernelDriver;
-
-	// Load the debug device driver
-	TInt err = User::LoadLogicalDevice( KDebugDriverFileName );
-	test((KErrNone == err) || (KErrAlreadyExists == err));
-
-	// we were allowed to load the driver, or its already loaded.
-
-	// Try to open a handle to the driver - this should return KErrPermissionDenied as we don't have the DSS SID
-	TRM_DebugDriverInfo driverInfo;
-	driverInfo.iUserLibraryEnd = 0;
-	err = kernelDriver.Open(driverInfo);
-	test((err == KErrInUse) || (err == KErrPermissionDenied));
-
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0447
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Tests Debug driver can only be access via the DSS. Also tests DSS cannot
-//!						be subverted. Tests functionality of two representative OEM Debug Tokens.
-//! @SYMTestActions     Tries to open rm_debug.ldd (should fail). Tries to debug various processes
-//!						(only debuggable one should succeed).
-//!
-//! @SYMTestExpectedResults KErrPermissionDenied.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-void CRunModeAgent::TestSecurity(void)
-	{
-	// Things to test
-	//
-	// try to use debug driver directly ( should have the wrong UID/SID value!)
-	test.Next(_L("TestSecurity - Bypass Debug Security Server to Debug Device Driver - DSS running\n"));
-
-	// Things to test
-	//
-	// Load the debug device driver
-	RRM_DebugDriver kernelDriver;
-	TInt err = User::LoadLogicalDevice( KDebugDriverFileName );
-	test((KErrNone == err) || (KErrAlreadyExists == err));
-
-	// we were allowed to load the driver, or its already loaded.
-
-	// Try to open handle a to the driver - this should return KErrPermission/KErrInUse as we don't have the DSS SID
-	// and we expect the DSS to already be using it.
-	TRM_DebugDriverInfo driverInfo;
-	driverInfo.iUserLibraryEnd = 0;
-	err = kernelDriver.Open(driverInfo);
-	test(err == KErrInUse);
-
-	//
-	// Attach to the Debug Security Server (passive)
-	//
-	test.Next(_L("TestSecurity - Attach to the Debug Security Server (passive)\n"));
-
-	_LIT(KSecurityServerProcessName, "z:\\sys\\bin\\rm_debug_svr.exe");
-
-	test(KErrPermissionDenied == iServSession.AttachExecutable(KSecurityServerProcessName, ETrue));
-
-	//
-	// Attach to the Debug Security Server (active)
-	//
-	test.Next(_L("TestSecurity - Attach to the Debug Security Server (active)\n"));
-
-	test(KErrPermissionDenied == iServSession.AttachExecutable(KSecurityServerProcessName, EFalse));
-
-	//
-	// Attach to Process 0
-	//
-	// Target: Debuggable
-	//
-	test.Next(_L("TestSecurity - Attach to test process 0\n"));
-
-	// Agent can debug the target app as it is marked debuggable - ie capabilities are ignored)
-	HelpTestSecurityAttachDetachExecutable(KRMDebugSecurity0FileName,ETrue);
-
-	//
-	// Attach to Process - 1
-	//
-	// Target: Non-debuggable for ordinary debug agent, debuggable for OEM/OEM2 token authorised agent
-	//
-	// Note: This target app has no PlatSec capabilities
-	//
-	// Agent cannot debug the app unless it has an OEM/OEM2 Debug Token
-	test.Next(_L("TestSecurity - Attach to test process 1\n"));
-
-#ifdef SYMBIAN_STANDARDDEBUG
-	HelpTestSecurityAttachDetachExecutable(KRMDebugSecurity1FileName,EFalse);
-#endif
-
-#ifdef SYMBIAN_OEMDEBUG
-	HelpTestSecurityAttachDetachExecutable(KRMDebugSecurity1FileName,ETrue);
-#endif
-
-#ifdef SYMBIAN_OEM2DEBUG
-	HelpTestSecurityAttachDetachExecutable(KRMDebugSecurity1FileName,ETrue);
-#endif
-
-	//
-	// Attach to Process - 2
-	//
-	// Target: Non-debuggable for ordinary debug agent, non-debuggable for OEM2 authorised agent (insufficient caps)
-	//
-	// Note: This target app has AllFiles capability
-	//
-	// Agent cannot debug the app unless it has an OEM Debug Token
-	test.Next(_L("TestSecurity - Attach to test process 2\n"));
-
-#ifdef SYMBIAN_STANDARDDEBUG
-	HelpTestSecurityAttachDetachExecutable(KRMDebugSecurity2FileName,EFalse);
-#endif
-
-#ifdef SYMBIAN_OEMDEBUG
-	HelpTestSecurityAttachDetachExecutable(KRMDebugSecurity2FileName,ETrue);
-#endif
-
-#ifdef SYMBIAN_OEM2DEBUG
-	HelpTestSecurityAttachDetachExecutable(KRMDebugSecurity2FileName,EFalse);
-#endif
-
-	//
-	// Attach to Process - 3
-	//
-	// Target: Non-debuggable for ordinary debug agent, non-debuggable for OEM authorised agent (insufficient caps)
-	//
-	// Note: This target app has AllFiles and TCB and NetworkControl capabilities
-	//
-	test.Next(_L("TestSecurity - Attach to test process 3\n"));
-
-	HelpTestSecurityAttachDetachExecutable(KRMDebugSecurity3FileName,EFalse);
-
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0543
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Validates that a dll can be built which #include's the rm_debug_api.h header, i.e. rm_debug_api.h contains no static data.
-//! @SYMTestActions     Calls a dummy function in t_rmdebug_dll.dll which implies the dll has been built correctly.
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-void CRunModeAgent::TestDllUsage(void)
-	{
-	test.Next(_L("TestDllUsage\n"));
-	test(KUidDebugSecurityServer == GetDSSUid());
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0812
-//! @SYMTestType
-//! @SYMPREQ            PREQ1700
-//! @SYMTestCaseDesc    Writes a known data to the crash flash and validates the data written
-//!						using the read operation and finally erase the data. In the absence
-//!						of an OEM debug token, access to the crash partition should not be allowed
-//! @SYMTestActions     Invoke the flash write method in DSS and call the read method in DSS
-//!						to validate the data is written correctly and then erase the written area
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-void CRunModeAgent::TestCrashFlash(void)
-	{
-#if  defined (SYMBIAN_STANDARDDEBUG)  || defined (SYMBIAN_OEM2DEBUG)
-
-	test.Next(_L("@SYMTestCaseID:DT-debug-securityserver-006 Testing We cannot Erase the Crash Flash with insufficient privileges"));
-
-	TUint32 size = 0;
-	TInt err = iServSession.EraseCrashLog(0, 1);
-	test(KErrPermissionDenied == err);
-
-	test.Next(_L("@SYMTestCaseID:DT-debug-securityserver-005 Testing We can't Write to the Crash Flash with insufficient privileges"));
-
-	err = iServSession.WriteCrashConfig(0, KCrashDummyData, size);
-	test(KErrPermissionDenied == err);
-	test(size == 0);
-
-	test.Next(_L("@SYMTestCaseID:DT-debug-securityserver-008 Testing We can't Read from the Crash Flash with insufficient privileges"));
-
-	TUint32 readSize = 0x10;
-	RBuf8 buf;
-	buf.CleanupClosePushL();
-	err = buf.Create(readSize);
-
-	test(err == KErrNone);
-
-	err = iServSession.ReadCrashLog(0, buf, readSize);
-	test(KErrPermissionDenied == err);
-
-	test.Next(_L("@SYMTestCaseID:DT-debug-securityserver-004 Testing Writing To an invalid location"));
-
-	TUint32 writeSize = 0;
-	err = iServSession.WriteCrashConfig(0xFFFFFFFF, KCrashDummyData, writeSize);
-
-	test(err == KErrPermissionDenied);
-
-	test.Next(_L("@SYMTestCaseID:DT-debug-securityserver-003 Testing Reading from an invalid location"));
-
-	buf.FillZ();
-	err = iServSession.ReadCrashLog(0, buf, writeSize);
-
-	test(err == KErrPermissionDenied);
-
-	CleanupStack::PopAndDestroy(&buf);
-
-#endif
-
-#ifdef SYMBIAN_OEMDEBUG
-
-	TInt err = KErrNone;
-
-	test.Next(_L("@SYMTestCaseID:DT-debug-securityserver-007 Testing We can Erase the Crash Flash with sufficient privileges"));
-
-	err = iServSession.EraseCrashLog(0, 1);
-
- 	//For platforms without a flash partition we get KErrNotFound - this is still a pass
- 	if(KErrNotFound == err)
- 		{
- 		test.Printf(_L("Platform has no flash partition - continue"));
- 		return;
- 		}
-
-	test(KErrNone == err);
-
-	//Read back the start of the block to make sure its 0xFFFFFFFF
-	const TUint numBytesToCheck = 0x80;  //We dont know the block size
-	TBuf8<numBytesToCheck> eraseCheck;
-	eraseCheck.SetLength(numBytesToCheck);
-
-	err = iServSession.ReadCrashLog(0, eraseCheck, numBytesToCheck);
-	test(err == KErrNone);
-
-	TBool dataIsOk = ETrue;
-	for(TUint cnt = 0; cnt < numBytesToCheck; cnt++)
-		{
-		if(eraseCheck[cnt] != 0xFF)
-			{
-			dataIsOk = EFalse;
-			}
-		}
-
-	test(dataIsOk);
-
-	test.Next(_L("@SYMTestCaseID:DT-debug-securityserver-002 Testing We can Write to the Crash Flash with sufficient privileges"));
-
-	TUint32 writeSize = 0;
-	err = iServSession.WriteCrashConfig(0, KCrashDummyData, writeSize);
-
-	test(writeSize == KCrashDummyData().Length());
-
-	test.Next(_L("@SYMTestCaseID:DT-debug-securityserver-001 Testing We can Read from the Crash Flash with sufficient privileges"));
-
-	RBuf8 buf;
-	buf.CleanupClosePushL();
-	err = buf.Create(writeSize);
-
-	test(err == KErrNone);
-
-	buf.FillZ();
-
-	err = iServSession.ReadCrashLog(0, buf, writeSize);
-
-	test(0 == buf.Compare(KCrashDummyData));
-
-	test.Next(_L("@SYMTestCaseID:DT-debug-securityserver-004 Testing Writing To an invalid location"));
-
-	writeSize = 0;
-	err = iServSession.WriteCrashConfig(0xFFFFFFFF, KCrashDummyData, writeSize);
-
-	test(err == KErrArgument);
-
-	test.Next(_L("@SYMTestCaseID:DT-debug-securityserver-003 Testing Reading from an invalid location"));
-
-	buf.FillZ();
-	err = iServSession.ReadCrashLog(0xFFFFFFFF, buf, writeSize);
-
-	test(err == KErrArgument);
-
-	CleanupStack::PopAndDestroy(&buf);
-
-#endif
-	}
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0735
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Tests the Kill Process functionality. Only can kill a debuggable process.
-//! @SYMTestActions     Launches a debuggable and non-debuggable process and tries to kill both.
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-void CRunModeAgent::TestKillProcess(void)
-	{
-	test.Next(_L("TestKillProcess\n"));
-
-	// Kill a debuggable process
-
-	// check that killing a process is supported
-	TTag tag = GetTag(ETagHeaderIdKillObjects, EFunctionalityKillProcess);
-	test(tag.iValue);
-	// check that killing a thread is not supported
-	tag = GetTag(ETagHeaderIdKillObjects, EFunctionalityKillThread);
-	test(!tag.iValue);
-
-	// attach first!
-	TInt err = iServSession.AttachExecutable(KRMDebugTestApplication, EFalse /* Active */);
-	test(err == KErrNone);
-
-	// first launch a debuggable process
-	RProcess process;
-	err = LaunchProcess(process, KRMDebugTestApplication(),ESpinForever, 0, 0);
-	test (err == KErrNone);
-
-	// try to find the process in the list
-_LIT(KRMDebugAppName, "t_rmdebug_app");
-
-	TBool found = ProcessExists(KRMDebugAppName);
-	test (found);
-
-	// program now running, so try to kill it
-	err = iServSession.KillProcess(process.Id(), 0 /* kill reason */);
-	test(err == KErrNone);
-
-	process.Close();
-
-	User::After(2000000);	// should die within two seconds.
-
-	// can we still find it? Should be gone
-	found = ProcessExists(KRMDebugAppName);
-	test (!found);
-
-	// release the program again.
-	err = iServSession.DetachExecutable(KRMDebugTestApplication);
-	test(err == KErrNone);
-
-	// Try to kill a non-debuggable process and fail.
-
-	// first launch a non-debuggable process
-	RProcess process2;
-	err = LaunchProcess(process2, KRMDebugSecurity1FileName(),ESpinForever, 0, 0);
-	test (err == KErrNone);
-
-	// try to find the process in the list
-_LIT(KRMDebugAppName2, "t_rmdebug_security1");
-
-	TBool found2 = ProcessExists(KRMDebugAppName2);
-	test (found2);
-
-	// program now running, so try to kill it
-	err = iServSession.KillProcess(process2.Id(), 0 /* kill reason */);
-	test(err == KErrPermissionDenied);
-
-	process2.Close();
-
-	User::After(2000000);	// should die within two seconds if it is going to die.
-
-	// can we still find it? Should be still around!
-	found2 = ProcessExists(KRMDebugAppName2);
-	test (found2);
-
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-1388
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Tests the correct operation of the AddProcess and Remove Process
-//! @SYMTestActions     1. Registers for AddProcess and Remove Process events
-//!                     2. Starts a test process z:\sys\bin\t_rmdebug_security0.exe
-//!                     3. Wait for the AddProcess event to be reported
-//!                     4. Kill the newly started test process
-//!                     5. Wait for the RemoveProcess event to be reported
-//!                     6. Tell the DSS it is no longer interested in AddProcess and RemoveProcess events
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-void CRunModeAgent::TestAddRemoveProcessEvents()
-	{
-	test.Next(_L("TestAddRemoveProcessEvents\n"));
-
-	// attach to a process (e.g. one of the simple security test programs)
-	// launch the security program
-	// wait for the add event
-	// continue the program.
-	// wait for the remove event
-	// detach process
-
-	test(KErrNone == iServSession.AttachExecutable(KRMDebugSecurity0FileName, EFalse));
-
-	test(KErrNone == iServSession.SetEventAction(KRMDebugSecurity0FileName,EEventsAddProcess, EActionContinue));
-
-	test(KErrNone == iServSession.SetEventAction(KRMDebugSecurity0FileName,EEventsRemoveProcess, EActionContinue));
-
-	// Creator thread ID of the current thread (to be creator of test application)
-	TInt creatorThreadId = RThread().Id();
-
-	RProcess process;
-	TInt err = process.Create(KRMDebugSecurity0FileName, KNullDesC, EOwnerProcess);
-	test (err == KErrNone);
-
-	// Rendezvous with process
-	TRequestStatus status;
-	process.Rendezvous(status);
-
-	// Start the test program
-	process.Resume();
-	User::WaitForRequest(status);
-	test(status==KErrNone);
-
-	// Wait for the addprocess event
-	TEventInfo info;
-	TPtr8 infoPtr((TUint8*)&info,0,sizeof(TEventInfo));
-
-	iServSession.GetEvent(KRMDebugSecurity0FileName,status,infoPtr);
-
-	// Wait for notification of the addprocess hit event
-	User::WaitForRequest(status);
-	test(status==KErrNone);
-
-	// Check this was the right kind of event
-	test(info.iEventType == EEventsAddProcess);
-
-	const TInt uid3offset = 2;
-
-	// Get UID3 for current process
-	TUint32 Uid3 = process.Type()[uid3offset].iUid;
-
-	// Check correct UID3 is returned from the driver
-    test(info.iAddProcessInfo.iUid3 == Uid3);
-
-    // Check correct creator ID for test application is returned from the driver
-    test(info.iAddProcessInfo.iCreatorThreadId == creatorThreadId);
-
-	// Kill the process, as we don't need it anymore
-	process.Kill(KErrNone);
-
-	// Wait for the remove process event
-	iServSession.GetEvent(KRMDebugSecurity0FileName,status,infoPtr);
-
-	// Wait for notification of the remove process hit event
-	User::WaitForRequest(status);
-	test(status==KErrNone);
-
-	// Check this was the right kind of event
-	test(info.iEventType == EEventsRemoveProcess);
-
-	test(KErrNone == iServSession.SetEventAction(KRMDebugSecurity0FileName,EEventsRemoveProcess, EActionIgnore));
-
-	test(KErrNone == iServSession.SetEventAction(KRMDebugSecurity0FileName,EEventsAddProcess, EActionIgnore));
-
-	test(KErrNone == iServSession.DetachExecutable(KRMDebugSecurity0FileName));
-
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-0736
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Checks that process break points can be set, and that they can co-exist alongside thread breakpoints
-//! @SYMTestActions     Checks that process break points can be set, and that they can co-exist alongside thread breakpoints
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-void CRunModeAgent::TestProcessBreakPoints(void)
-	{
-	test.Next(_L("TestProcessBreakPoints\n"));
-
-	// check that process breakpoints are supported
-	TTag tag = GetTag(ETagHeaderIdBreakpoints, EBreakpointProcess);
-	test(tag.iValue);
-
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-
-	// Try to set the breakpoint
-	TBreakId breakId;
-	TUint32 address = (TUint32)(&RMDebug_BranchTst1);
-	RProcess process;
-	TProcessId processId = process.Id();
-	process.Close();
-
-	test(KErrNone == iServSession.SetProcessBreak(breakId, processId, address, EArmMode));
-	test(KErrAlreadyExists == iServSession.SetBreak(breakId, iThreadID, address, EArmMode));
-	test(KErrAlreadyExists == iServSession.SetBreak(breakId, iThreadID, address, EThumbMode));
-	test(KErrAlreadyExists == iServSession.SetProcessBreak(breakId, processId, address, EArmMode));
-	test(KErrAlreadyExists == iServSession.SetProcessBreak(breakId, processId, address, EThumbMode));
-	test(KErrNone == iServSession.ClearBreak(breakId));
-
-	test(KErrNone == iServSession.SetBreak(breakId, iThreadID, address, EArmMode));
-	test(KErrAlreadyExists == iServSession.SetProcessBreak(breakId, processId, address, EArmMode));
-	test(KErrAlreadyExists == iServSession.SetProcessBreak(breakId, processId, address, EThumbMode));
-	test(KErrNone == iServSession.ClearBreak(breakId));
-
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-RMDEBUG2-1309
-//! @SYMTestType
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Checks that in the case of multiple low priority events (user traces in this case) we can still receive higher
-//!				priority events should the buffer reach a critical level
-//! @SYMTestActions     Run to first breakpoint in our test code. Then multiple trace events are issued. We should still be able to hit
-//!				the second breakpoint
-//!
-//! @SYMTestExpectedResults KErrNone.
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-void CRunModeAgent::TestMultipleTraceEvents(void)
-	{
-	//Dont run the test for an SMP System
-	if (UserSvr::HalFunction(EHalGroupKernel, EKernelHalSmpSupported, 0, 0) == KErrNone)
-		return;
-
-	test.Next(_L("TestMultipleTraceEvents\n"));
-
-	//attach to target debug process
-	test(KErrNone == iServSession.AttachExecutable(iFileName, EFalse));
-
-	//and suspend the thread
-	test(KErrNone == iServSession.SuspendThread(iThreadID));
-
-	//register interest in BP's & trace events and trace ignored events
-	test(KErrNone == iServSession.SetEventAction(iFileName,EEventsBreakPoint, EActionSuspend));
-	test(KErrNone == iServSession.SetEventAction(iFileName,EEventsUserTrace, EActionContinue));
-	test(KErrNone == iServSession.SetEventAction(iFileName,EEventsUserTracesLost, EActionContinue));
-
-	// Try to set the breakpoints
-	TBreakId armBreakId;
-	TBreakId armBreakId2;
-	TUint32 address = (TUint32)(&RMDebug_BranchTst1);
-	TUint32 address2 = (TUint32)(&RMDebug_StepTest_Non_PC_Modifying);
-
-	test(KErrNone == iServSession.SetBreak(armBreakId,iThreadID,address,EArmMode));
-	test(KErrNone == iServSession.SetBreak(armBreakId2,iThreadID,address2,EArmMode));
-
-	//set the target thread to execute the trace test function
-	test(KErrNone == SwitchTestFunction(EMultipleTraceCalls));
-
-	// Continue the thread
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-
-	// wait for the breakpoint to be hit
-	TEventInfo info;
-	static TRequestStatus status;
-
-	TPtr8 infoPtr((TUint8*)&info,0,sizeof(TEventInfo));
-	iServSession.GetEvent(iFileName,status,infoPtr);
-
-	// Wait for notification of the 1st breakpoint hit event
-	User::WaitForRequest(status);
-	test(status==KErrNone);
-
-	// info should now be filled with the details
-	test(info.iEventType == EEventsBreakPoint);
-	test(info.iThreadBreakPointInfo.iRmdArmExcInfo.iR15 == address);
-	test(info.iProcessIdValid);
-	test(info.iThreadIdValid);
-
-	// Continue the thread
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-
-	//Now we try to hit the second breakpoint. This will occur after a number of trace calls. If we hit this breakpoint it
-	//means many trace calls are not preventing us hitting breakpoints.
-	iServSession.GetEvent(iFileName,status,infoPtr);
-
-	// Wait for notification of the 2nd breakpoint hit event
-	User::WaitForRequest(status);
-	test(status==KErrNone);
-
-	TBool receivedTracesLost = EFalse;
-
-	while(info.iEventType == EEventsUserTrace || info.iEventType == EEventsUserTracesLost)
-		{
-		//ensure we get told traces are being thrown away - we generate enough to flood the buffer
-		if(info.iEventType == EEventsUserTracesLost)
-			{
-			receivedTracesLost = ETrue;
-			}
-
-		iServSession.GetEvent(iFileName,status,infoPtr);
-
-		// Wait for notification of the 2nd breakpoint hit event
-		User::WaitForRequest(status);
-		test(status==KErrNone);
-		}
-
-	//make sure we got told traces were lost
-	test(receivedTracesLost != EFalse);
-
-	// info should now be filled with the details of our breakpoint.
-	test(info.iEventType == EEventsBreakPoint);
-	test(info.iThreadBreakPointInfo.iRmdArmExcInfo.iR15 == address2);
-	test(info.iProcessIdValid);
-	test(info.iThreadIdValid);
-
-	//dont care for breakpoints or trace events no more
-	test(KErrNone == iServSession.SetEventAction(iFileName,EEventsBreakPoint, EActionIgnore));
-	test(KErrNone == iServSession.SetEventAction(iFileName,EEventsUserTrace, EActionIgnore));
-	test(KErrNone == iServSession.SetEventAction(iFileName,EEventsUserTracesLost, EActionIgnore));
-
-	//clear the breaks we set
-	test(KErrNone == iServSession.ClearBreak(armBreakId));
-	test(KErrNone == iServSession.ClearBreak(armBreakId2));
-
-	// Continue the thread
-	test(KErrNone == iServSession.ResumeThread(iThreadID));
-
-	//attach to target debug process
-	test(KErrNone == iServSession.DetachExecutable(iFileName));
-
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID KBase-T-RMDEBUG2-2441
-//! @SYMTestType
-//! @SYMPREQ PREQ1426
-//! @SYMTestCaseDesc Test clearing of a process breakpoint once the process has been killed.
-//! @SYMTestActions Creates a new process then tries to set a process breakpoint and then kills the process which should clear the previously set breakpoint. Then repeat the step once again.
-//! @SYMTestExpectedResults KErrNone
-//! @SYMTestPriority High
-//! @SYMTestStatus Implemented
-//----------------------------------------------------------------------------------------------
-
-void CRunModeAgent::TestProcessKillBreakpoint(void)
-	{
-	//Dont run the test for an SMP System
-	if (UserSvr::HalFunction(EHalGroupKernel, EKernelHalSmpSupported, 0, 0) == KErrNone)
-		return;
-
-	test.Next(_L("TestProcessKillBreakpoint\n"));
-	//SID retrieved, used in Define/Attach of the property
-	iMySid.iUid = RProcess().SecureId();
-
-	static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy);
-
-	//define a property to pass on the address from the other process we would try to debug
-	test ( KErrNone == RProperty::Define(iMySid, EMyPropertyInteger, RProperty::EInt, KAllowAllPolicy, KAllowAllPolicy));
-	    //define a global semaphore to synchronise with debuggable process publishing the property
-	test ( KErrNone == iAddressGlobSem.CreateGlobal(_L("RMDebugGlobSem"), 0) );
-
-	DoTestProcessKillBreakpoint();
-	// called once again
-	// to check if we can set the breakpoint once again after the process gets killed
-	DoTestProcessKillBreakpoint();
-
-	//delete the property
-	test ( KErrNone == RProperty::Delete(iMySid, EMyPropertyInteger));
-	//close the semaphore
-	iAddressGlobSem.Close();
-	}
-
-void CRunModeAgent::DoTestProcessKillBreakpoint()
-	{
-	test.Printf(_L("\nDoTestProcessKillBreakpoint\n"));
-
-	TInt err = KErrNone;
-
-	// check that killing a process is supported
-	TTag tag = GetTag(ETagHeaderIdKillObjects, EFunctionalityKillProcess);
-	test(tag.iValue);
-	// check that killing a thread is not supported
-	tag = GetTag(ETagHeaderIdKillObjects, EFunctionalityKillThread);
-	test(!tag.iValue);
-
-	// attach first!
-	test ( KErrNone == iServSession.AttachExecutable(KRMDebugTestApplication, EFalse/*  Active */));
-
-	// first launch a debuggable process
-	RProcess processDebug;
-	test ( KErrNone == LaunchProcess(processDebug, KRMDebugTestApplication(),ESpinForeverWithBreakPoint, 0, 0));
-
-	// try to find the process in the list
-	_LIT(KRMDebugAppName, "t_rmdebug_app");
-	TBool found = ProcessExists(KRMDebugAppName);
-	test (found);
-
-	//search for the main thread created
-   _LIT(KThreadWildCard, "t_rmdebug_app*");
-	TProcessId processDebugId = processDebug.Id();
-	TThreadId threadDebugId;
-
-   	TFindThread find(KThreadWildCard);
-	TFullName name;
-	found = EFalse;
-	while(find.Next(name)==KErrNone && !found)
-		{
-		RThread thread;
-		err = thread.Open(find);
-       	if (err == KErrNone)
-			{
-			RProcess process;
-			thread.Process(process);
-			if (((TUint32)process.Id() == processDebugId))
-				{
-				TFullName fullname = thread.FullName();
-				test.Printf(_L("Match Found Name %lS Process ID%ld Thread Id %ld"), &fullname, process.Id().Id(), thread.Id().Id());
-				found = ETrue;
-				threadDebugId = thread.Id();
-				}
-			process.Close();
-			}
-			thread.Close();
-   		}
-
-	test (found); //check if we actually found the thread we want to debug
-
-	//get the value(property) for the breakpoint address for the process to debug
-	TInt address;
-	RProperty integerProperty;
-	test ( KErrNone == integerProperty.Attach(iMySid, EMyPropertyInteger, EOwnerThread));
-
-	//waiting on semaphore to be sure that the property is set
-	iAddressGlobSem.Wait();
-
-	test ( KErrNone == integerProperty.Get(address));
-	integerProperty.Close();
-
-	test.Printf(_L("Address retrieved to set breakpoint 0x%8x"), address);
-
-	//suspend the thread before we set a breakpoint
-	test ( KErrNone == iServSession.SuspendThread(threadDebugId));
-
-	//set a process breakpoint
-	TBreakId breakId;
-	test(KErrNone == iServSession.SetProcessBreak(breakId, processDebugId, address, EArmMode));
-
-	test(KErrNone ==iServSession.SetEventAction(KRMDebugTestApplication,EEventsProcessBreakPoint, EActionContinue));
-
-	//resume the thread now
-	test(KErrNone == iServSession.ResumeThread(threadDebugId));
-
-	// wait for the breakpoint to be hit
-	static TRequestStatus status;
-	TEventInfo info;
-	TPtr8 infoPtr((TUint8*)&info,0,sizeof(TEventInfo));
-	iServSession.GetEvent(KRMDebugTestApplication,status,infoPtr);
-	// Wait for notification of the breakpoint hit event
-	User::WaitForRequest(status);
-	test(status==KErrNone);
-
-	// info should now be filled with the details
-	test(info.iEventType ==  EEventsProcessBreakPoint);
-	test(info.iThreadBreakPointInfo.iRmdArmExcInfo.iR15 == address);
-	test(info.iProcessIdValid);
-	test(info.iThreadIdValid);
-
-	// Not interested in breakpoint events any more
-	test(KErrNone == iServSession.SetEventAction(KRMDebugTestApplication, EEventsProcessBreakPoint, EActionIgnore));
-
-	// program now running, so try to kill it which should clear all the breakpoints
-	test(KErrNone == iServSession.KillProcess(processDebugId, 0  /* kill reason */ ));
-
-	processDebug.Close();
-	User::After(2000000);	// should die within two seconds.
-
-	// can we still find it? Should be gone
-	found = ProcessExists(KRMDebugAppName);
-	test (!found);
-
-	// release the program again
-	test(KErrNone == iServSession.DetachExecutable(KRMDebugTestApplication));
-
-	}
-
-void CRunModeAgent::HelpTestSecurityAttachDetachExecutable(const TDesC& aProcessName, TBool aExpectSuccess)
-	{
-	RProcess process;
-	TInt err = process.Create(aProcessName, KNullDesC, EOwnerProcess);
-	test (err == KErrNone);
-
-	// rendezvous with process
-	TRequestStatus status;
-	process.Rendezvous(status);
-
-	// start the test program
-	process.Resume();
-	User::WaitForRequest(status);
-	test(status==KErrNone);
-
-	// attach to the program (passively)
-	err = iServSession.AttachExecutable(aProcessName, EFalse);
-
-	// Do we expect to successfully attach
-	if (aExpectSuccess)
-	{
-		// Yes
-		test(KErrNone == err);
-
-		// Now detach again
-		test(KErrNone == iServSession.DetachExecutable(aProcessName));
-	}
-	else
-	{
-		// No
-		test(KErrPermissionDenied == err);
-
-		// Just to be sure, try active attachment
-		test(KErrPermissionDenied == iServSession.AttachExecutable(aProcessName, ETrue));
-	}
-
-	// Kill the process, as we don't need it anymore
-	process.Kill(KErrNone);
-	}
-
-void CRunModeAgent::ReportPerformance(void)
-//
-// Reports performance metrics from all the tests
-//
-	{
-	test.Printf(_L("\nPerformance\n"));
-	test.Printf(_L("========================\n"));
-
-	// Memory
-	test.Printf(_L("Memory read: %d KBytes/sec\n"),iMemoryReadKbytesPerSecond);
-	test.Printf(_L("Memory write: %d KBytes/sec\n"),iMemoryWriteKbytesPerSecond);
-
-	// Registers
-	// to do
-
-	// events
-	// to do
-
-	// Breakpoints
-	test.Printf(_L("Breakpoint set/clear: %d/sec\n"),iBreakpointsPerSecond);
-	test.Printf(_L("Maximum number of breakpoints: %d\n"),iMaxBreakpoints);
-
-	// Stepping
-	test.Printf(_L("Stepping speed: %d/sec\n"),iStepsPerSecond);
-
-	// Runtime
-	TInt ticks = HelpGetTestTicks();
-	test (ticks != 0);
-
-	TInt nkTicksPerSecond = HelpTicksPerSecond();
-	test (nkTicksPerSecond != 0);
-
-	test.Printf(_L("Total test runtime: %d seconds\n"),ticks/nkTicksPerSecond);
-
-	// Final sizes of executables/rom/ram etc
-	// to do
-
-	test.Printf(_L("\n"));
-	}
-
-/**
- * Helper code for the stepping tests. Sets a breakpoint in a running thread.
- * It suspends the thread, sets the breakpoint, and resumes the thread.
- *
- * @param aBreakId - Reference to a TBreakId which will be set when the breakpoint is set
- * @param aThreadId - The thread id for which we should set the breakpoint.
- * @param aBreakAddress - The address to set the breakpoint
- * @param aMode - The architecture of the breakpoint to be set (ARM/Thumb/Thumb2EE)
- * @return KErrNone if successful. One of the other system wide error codes otherwise.
- */
-TInt CRunModeAgent::HelpTestStepSetBreak(TBreakId& aBreakId, TThreadId aThreadId, const TUint32 aBreakAddress, TArchitectureMode aMode, TBool aThreadSpecific, TProcessId aProcessId)
-	{
-	TInt err = KErrNone;
-
-	// Suspend the thread
-	err = iServSession.SuspendThread(aThreadId);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStepSetBreak - Failed to suspend thread\n"));
-		return err;
-		}
-
-	// Set the breakpoint
-	err = aThreadSpecific
-		? iServSession.SetBreak(aBreakId,aThreadId,aBreakAddress,aMode)
-		: iServSession.SetProcessBreak(aBreakId, aProcessId, aBreakAddress, aMode);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStepSetBreak - Failed to set breakpoint\n"));
-		return err;
-		}
-
-	// Continue the thread
-	err = iServSession.ResumeThread(aThreadId);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStepSetBreak - Failed to resume thread\n"));
-		return err;
-		}
-
-	return KErrNone;
-	}
-
-/**
- * Helper code for the stepping tests. Clears a breakpoint in a running thread.
- * It suspends the thread, clears the breakpoint, and resumes the thread.
- *
- * @param aBreakId - Reference to a TBreakId which will be set when the breakpoint is set
- * @return KErrNone if successful. One of the other system wide error codes otherwise.
- */
-TInt CRunModeAgent::HelpTestStepClearBreak(TBreakId aBreakId, const TThreadId aThreadId, TBool aThreadSpecific)
-	{
-	TInt err = KErrNone;
-
-	// Find out what thread id we need to suspend
-	TThreadId threadId;
-	TProcessId processId;
-	TUint32 address;
-	TArchitectureMode mode;
-
-	err = aThreadSpecific
-		? iServSession.BreakInfo(aBreakId, threadId, address, mode)
-		: iServSession.ProcessBreakInfo(aBreakId, processId, address, mode);
-	if (err != KErrNone )
-		{
-		test.Printf(_L("HelpTestStepClearBreak - failed to obtain information for breakpoint\n"));
-		return err;
-		}
-	if(aThreadSpecific && aThreadId != threadId)
-		{
-		test.Printf(_L("HelpTestStepClearBreak - mismatched thread Ids\n"));
-		return KErrGeneral;
-		}
-
-	// Suspend the thread
-	err = iServSession.SuspendThread(aThreadId);
-	if (!(err == KErrNone || err == KErrAlreadyExists))
-		{
-		test.Printf(_L("HelpTestStepClearBreak - failed to suspend thread\n"));
-		return err;
-		}
-
-	// Clear the breakpoint
-	err = iServSession.ClearBreak(aBreakId);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStepClearBreak - failed to clear breakpoint\n"));
-		return err;
-		}
-
-	// Continue the thread
-	err = iServSession.ResumeThread(aThreadId);
-	if (!(err == KErrNone || err == KErrNotFound))
-		{
-		test.Printf(_L("HelpTestStepClearBreak - failed to resume thread\n"));
-		return err;
-		}
-
-	return KErrNone;
-	}
-
-/**
- * Helper code for the stepping tests. Waits for a previously set breakpoint to be hit.
- *
- * @param aProcessName - The name of the process in which the breakpoint is set. E.g. z:\sys\bin\app.exe
- * @param aEventInfo - The event information block which is filled in when the breakpoint is hit.
- * @return KErrNone if successful. One of the other system wide error codes otherwise.
- */
-TInt CRunModeAgent::HelpTestStepWaitForBreak(const TDesC& aProcessName, TEventInfo& aEventInfo)
-	{
-	static TRequestStatus status;
-
-	TPtr8 infoPtr((TUint8*)&aEventInfo,0,sizeof(TEventInfo));
-
-	iServSession.GetEvent(aProcessName,status,infoPtr);
-
-	// Wait for notification of the breakpoint hit event
-	User::WaitForRequest(status);
-	if (status == KErrNone)
-		{
-		return KErrNone;
-		}
-	else
-		{
-		return KErrGeneral;
-		}
-	}
-
-/**
- * Helper code for the stepping tests. Reads the current target PC for a given thread.
- *
- * @param aThreadId - Thread id for which to read the current target PC.
- * @param aPc - Reference to a TUint32 which will be set to the current target PC.
- * @return KErrNone if successful. One of the other system wide error codes otherwise.
- */
-TInt CRunModeAgent::HelpTestStepReadPC(TThreadId aThreadId, TUint32& aPC)
-	{
-	TInt err = KErrNone;
-
-	//create buffer containing PC register ID
-	RBuf8 pcId;
-	err = pcId.Create(sizeof(TRegisterInfo));
-	if (err != KErrNone)
-		{
-		return err;
-		}
-
-	TRegisterInfo reg1 = (TRegisterInfo)0x00000f00;
-	pcId.Append(reinterpret_cast<const TUint8*>(&reg1), sizeof(TRegisterInfo));
-
-	//create buffer containing desired PC value
-	TPtr8 pcValue((TUint8*)&aPC,4,4);
-
-	//create buffer for PC flag value
-	RBuf8 pcFlag;
-	err = pcFlag.Create(sizeof(TUint8));
-
-	//read the new PC value
-	err = iServSession.ReadRegisters(aThreadId, pcId, pcValue, pcFlag);
-	if (err != KErrNone)
-		{
-		//delete temporary buffers
-		pcId.Close();
-		pcFlag.Close();
-		return err;
-		}
-
-	//get the flag and check the PC value was read ok
-	TRegisterFlag flag = ENotSupported;
-	err = GetFlag(pcFlag, 0, flag);
-	if (err != KErrNone)
-		{
-		//delete temporary buffers
-		pcId.Close();
-		pcFlag.Close();
-		return err;
-		}
-
-	if (flag == EValid)
-		{
-		//delete temporary buffers
-		pcId.Close();
-		pcFlag.Close();
-		return KErrNone;
-		}
-	else
-		{
-		//delete temporary buffers
-		pcId.Close();
-		pcFlag.Close();
-		return err;
-		}
-	}
-
-/**
- * Helper code for the stepping tests. Single steps a given thread from aStartAddress to aEndAddress. Note
- * that it reaches aStartAddress by setting a breakpoint at that address and waiting until it is hit.
- *
- * @param aThreadId - Thread id for which to read the current target PC.
- * @param aStartAddress - The target address at which stepping will start.
- * @param aEndAddress - The target address at which stepping will end.
- * @param aMode - The architecture of the breakpoint which must be set at the start address (ARM/Thumb/Thumb2EE).
- * @return KErrNone if successful. One of the other system wide error codes otherwise.
- */
-TInt CRunModeAgent::HelpTestStep(TThreadId aThreadId, TUint32 aStartAddress, TUint32 aEndAddress, TArchitectureMode aMode, TUint aNumSteps, TBool aThreadSpecific, TProcessId aProcessId)
-	{
-	TInt err = KErrNone;
-
-	// Ensure that the supplied addresses are word/half-word aligned as appropriate.
-	if (aMode == EArmMode)
-		{
-		// ARM breakpoints must be word-aligned (2 lsb must be zero)
-		aStartAddress &= 0xFFFFFFFC;
-		aEndAddress &= 0xFFFFFFFC;
-		}
-	else if (aMode == EThumbMode)
-		{
-		// Thumb breakpoints must be half-word aligned (lsb must be zero)
-		aStartAddress &= 0xFFFFFFFE;
-		aEndAddress	 &= 0xFFFFFFFE;
-		}
-	else if (aMode == EThumb2EEMode)
-	{
-		// Thumb2EE breakpoints are not currently supported
-		return KErrNotSupported;
-	}
-
-	// Set breakpoint at the start address
-	TBreakId tempBreakId;
-	TEventInfo info;
-
-	err = HelpTestStepSetBreak(tempBreakId,aThreadId,aStartAddress,aMode,aThreadSpecific,aProcessId);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStep - Failed to set breakpoint at aStartAddress 0x%08x\n"),aStartAddress);
-		return err;
-		}
-
-	// wait for the breakpoint to be hit
-	err = HelpTestStepWaitForBreak(iFileName,info);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStep - Failed to hit the breakpoint at aStartAddress 0x%08x\n"),aStartAddress);
-		return err;
-		}
-
-	// Check the PC == aStartAddress
-	TUint32 pc = 0;
-	err = HelpTestStepReadPC(aThreadId,pc);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStep - Failed to read the PC after hitting breakpoint at aStartAddress 0x%08x\n"),aStartAddress);
-		return err;
-		}
-
-	if (pc != aStartAddress)
-		{
-		test.Printf(_L("HelpTestStep - Incorrect PC value after hitting breakpoint (expected 0x%08x actual 0x%08x)\n"),aStartAddress,pc);
-		return KErrGeneral;
-		}
-
-	err = iServSession.Step(aThreadId,aNumSteps);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStep - Failed to do step from 0x%08x to 0x%08x\n"),aStartAddress,aEndAddress,aNumSteps);
-		return err;
-		}
-
-	// only one 'completed step' event in the buffer.
-	err = HelpTestStepWaitForBreak(iFileName,info);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStep - Could not read breakpoint event info after stepping"));
-		return err;
-		}
-	// end
-
-	// Check PC == aEndAddress
-	err = HelpTestStepReadPC(aThreadId,pc);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStep - failed read the PC after stepping\n"));
-		return err;
-		}
-	if (pc != aEndAddress)
-		{
-		test.Printf(_L("HelpTestStep - Incorrect PC value after stepping (expected 0x%08x actual 0x%08x)\n"),aEndAddress,pc);
-		return KErrGeneral;
-		}
-
-	// Clear the breakpoint
-	err = HelpTestStepClearBreak(tempBreakId, aThreadId, aThreadSpecific);
-	if (err != KErrNone)
-		{
-		test.Printf(_L("HelpTestStep - failed to clear temporary breakpoint\n"));
-		return err;
-		}
-
-	return KErrNone;
-	}
-
-/**
- * Helper code for the stepping tests. Returns the number of nanokernel ticks in one second.
- *
- * @return Number of nanokernel ticks. 0 if unsuccesful.
- */
-TInt CRunModeAgent::HelpTicksPerSecond(void)
-	{
-	TInt nanokernel_tick_period;
-	HAL::Get(HAL::ENanoTickPeriod, nanokernel_tick_period);
-
-	ASSERT(nanokernel_tick_period != 0);
-
-	static const TInt KOneMillion = 1000000;
-
-	return KOneMillion/nanokernel_tick_period;
-	}
-
-/**
-  Given aTestNumber runs the appropriate test inside heap markers
-
-  @param aTestNumber test to run, corresponds to an entry in iTestArray
-
-  @panic Panic if aTestNumber is not in valid range
-  */
-void CRunModeAgent::RunTest(TInt aTestNumber)
-	{
-	if( (aTestNumber<0) || (aTestNumber>=KMaxTests) )
-		{
-		User::Panic(_L("Test number out of range"), aTestNumber);
-		}
-	__UHEAP_MARK;
-	(this->*(iTestArray[aTestNumber].iFunctionPtr))();
-	__UHEAP_MARKEND;
-	}
-
-void CRunModeAgent::PrintVersion()
-	{
-	test.Printf(_L("\nt_rmdebug2.exe\nVersion: %S\n"), &(testVersion.Name()));
-	test.Printf(_L("Press any key...\n"));
-	test.Getch();
-	}
-
-void CRunModeAgent::PrintUsage()
-	{
-	test.Printf(_L("Invoke with arguments:\n"));
-	test.Printf(_L("-r: run specified tests in reverse order\n"));
-	test.Printf(_L("-h: display usage information\n"));
-	test.Printf(_L("-v: display version\n"));
-	test.Printf(_L("<number>: test number to run, can specify more than one from the following list:\n"));
-	test.Printf(_L("Press any key for list...\n"));
-	test.Getch();
-	// if there are too many of these they won't fit on the screen! Stick another Getch() in if there get too many
-	for(TInt i=0; i<KMaxTests; i++)
-		{
-		test.Printf(_L("%2d: %S\n"), i, &(iTestArray[i].iFunctionName));
-		}
-	test.Printf(_L("Press any key...\n"));
-	test.Getch();
-	}
-
-/**
-  Parse the command line, see CRunModeAgent::PrintUsage for syntax
-  */
-void CRunModeAgent::ParseCommandLineL(TUint32& aMode, RArray<TInt>& aTests)
-	{
-	// get the length of the command line arguments
-	TInt argc = User::CommandLineLength();
-
-	// allocate a buffer for the command line arguments and extract the data to it
-	HBufC* commandLine = HBufC::NewLC(argc);
-	TPtr commandLineBuffer = commandLine->Des();
-	User::CommandLine(commandLineBuffer);
-
-	// reset mode
-	aMode = (TTestMode)0;
-
-	// create a lexer and read through the command line
-	TLex lex(*commandLine);
-	while (!lex.Eos())
-		{
-		// expecting the first character to be a '-'
-		if (lex.Get() == '-')
-			{
-			TChar arg = lex.Get();
-			switch (arg)
-				{
-				case 'v':
-					//print out the help
-					aMode |= EModeVersion;
-					break;
-				case 'h':
-					//print out the help
-					aMode |= EModeHelp;
-					break;
-				case 'r':
-					//store the fact that we want to run in reverse
-					aMode |= EModeReverse;
-					break;
-				default:
-					// unknown argument so leave
-					User::Leave(KErrArgument);
-				}
-			}
-		else
-			{
-			lex.UnGet();
-			TInt testNumber;
-			User::LeaveIfError(lex.Val(testNumber));
-			if( (testNumber<0) || (testNumber>=KMaxTests) )
-				{
-				User::Leave(KErrArgument);
-				}
-			aTests.AppendL(testNumber);
-			}
-		lex.SkipSpace();
-		}
-	// if no tests specified then run them all
-	if(aTests.Count() == 0)
-		{
-		aMode |= EModeAll;
-		}
-
-	// do clean up
-	CleanupStack::PopAndDestroy(commandLine);
-	}
-
-void CRunModeAgent::ClientAppL()
-//
-// Performs each test in turn
-//
-	{
-	test.Start(_L("ClientAppL"));
-
-	RArray<TInt> testsToRun;
-	TUint32 testMode = 0;
-	ParseCommandLineL(testMode, testsToRun);
-
-	//if help or version mode specified then just print out the relevant stuff and quit
-	if((testMode & EModeHelp) || (testMode & EModeVersion))
-		{
-		if(testMode & EModeHelp)
-			{
-			PrintUsage();
-			}
-		if(testMode & EModeVersion)
-			{
-			PrintVersion();
-			}
-		test.End();
-		return;
-		}
-
-	if(testMode & EModeAll)
-		{
-		for(TInt i=0; i<KMaxTests; i++)
-			{
-			testsToRun.AppendL(i);
-			}
-		}
-
-	// if EModeReverse specified then reverse the array elements
-	TInt numberOfTests = testsToRun.Count();
-	if(testMode & EModeReverse)
-		{
-		for(TInt i=0; i<(numberOfTests>>1); i++)
-			{
-			TInt temp = testsToRun[i];
-			testsToRun[i] = testsToRun[numberOfTests - (i+1)];
-			testsToRun[numberOfTests - (i+1)] = temp;
-			}
-		}
-
-	__UHEAP_MARK;
-	SetupAndAttachToDSS();
-	__UHEAP_MARKEND;
-
-	HelpStartTestTimer();
-	for(TInt i=0; i<numberOfTests; i++)
-		{
-		RunTest(testsToRun[i]);
-		}
-	testsToRun.Close();
-
-	HelpStopTestTimer();
-
-	ReportPerformance();
-
-	test.End();
-	}
-
-/**
-  Fill the test array with pointers to each test.
-  */
-void CRunModeAgent::FillArray()
-	{
-	iTestArray[0].iFunctionPtr = &CRunModeAgent::TestDriverSecurity;
-	iTestArray[0].iFunctionName = _L("TestDriverSecurity");
-	iTestArray[1].iFunctionPtr = &CRunModeAgent::TestDllUsage;
-	iTestArray[1].iFunctionName = _L("TestDllUsage");
-	iTestArray[2].iFunctionPtr = &CRunModeAgent::TestSecurity;
-	iTestArray[2].iFunctionName = _L("TestSecurity");
-	iTestArray[3].iFunctionPtr = &CRunModeAgent::TestAttachExecutable;
-	iTestArray[3].iFunctionName = _L("TestAttachExecutable");
-	iTestArray[4].iFunctionPtr = &CRunModeAgent::TestGetExecutablesList;
-	iTestArray[4].iFunctionName = _L("TestGetExecutablesList");
-	iTestArray[5].iFunctionPtr = &CRunModeAgent::TestGetProcessList;
-	iTestArray[5].iFunctionName = _L("TestGetProcessList");
-	iTestArray[6].iFunctionPtr = &CRunModeAgent::TestGetXipLibrariesList;
-	iTestArray[6].iFunctionName = _L("TestGetXipLibrariesList");
-	iTestArray[7].iFunctionPtr = &CRunModeAgent::TestGetThreadList;
-	iTestArray[7].iFunctionName = _L("TestGetThreadList");
-	iTestArray[8].iFunctionPtr = &CRunModeAgent::TestGetCodeSegsList;
-	iTestArray[8].iFunctionName = _L("TestGetCodeSegsList");
-	iTestArray[9].iFunctionPtr = &CRunModeAgent::TestGetListInvalidData;
-	iTestArray[9].iFunctionName = _L("TestGetListInvalidData");
-	iTestArray[10].iFunctionPtr = &CRunModeAgent::TestMemoryAccess;
-	iTestArray[10].iFunctionName = _L("TestMemoryAccess");
-	iTestArray[11].iFunctionPtr = &CRunModeAgent::TestDebugFunctionality;
-	iTestArray[11].iFunctionName = _L("TestDebugFunctionality");
-	iTestArray[12].iFunctionPtr = &CRunModeAgent::TestSuspendResume;
-	iTestArray[12].iFunctionName = _L("TestSuspendResume");
-	iTestArray[13].iFunctionPtr = &CRunModeAgent::TestBreakPoints;
-	iTestArray[13].iFunctionName = _L("TestBreakPoints");
-	iTestArray[14].iFunctionPtr = &CRunModeAgent::TestModifyBreak;
-	iTestArray[14].iFunctionName = _L("TestModifyBreak");
-	iTestArray[15].iFunctionPtr = &CRunModeAgent::TestBreakInfo;
-	iTestArray[15].iFunctionName = _L("TestBreakInfo");
-	iTestArray[16].iFunctionPtr = &CRunModeAgent::TestRunToBreak;
-	iTestArray[16].iFunctionName = _L("TestRunToBreak");
-	iTestArray[17].iFunctionPtr = &CRunModeAgent::TestRegisterAccess;
-	iTestArray[17].iFunctionName = _L("TestRegisterAccess");
-	iTestArray[18].iFunctionPtr = &CRunModeAgent::TestStep;
-	iTestArray[18].iFunctionName = _L("TestStep");
-	iTestArray[19].iFunctionPtr = &CRunModeAgent::TestDemandPaging;
-	iTestArray[19].iFunctionName = _L("TestDemandPaging");
-	iTestArray[20].iFunctionPtr = &CRunModeAgent::TestEventsForExternalProcess;
-	iTestArray[20].iFunctionName = _L("TestEventsForExternalProcess");
-	iTestArray[21].iFunctionPtr = &CRunModeAgent::TestEvents;
-	iTestArray[21].iFunctionName = _L("TestEvents");
-	iTestArray[22].iFunctionPtr = &CRunModeAgent::TestKillProcess;
-	iTestArray[22].iFunctionName = _L("TestKillProcess");
-	iTestArray[23].iFunctionPtr = &CRunModeAgent::TestProcessBreakPoints;
-	iTestArray[23].iFunctionName = _L("TestProcessBreakPoints");
-	iTestArray[24].iFunctionPtr = &CRunModeAgent::TestMultipleTraceEvents;
-	iTestArray[24].iFunctionName = _L("TestMultipleTraceEvents");
-	iTestArray[25].iFunctionPtr = &CRunModeAgent::TestAddRemoveProcessEvents;
-	iTestArray[25].iFunctionName = _L("TestAddRemoveProcessEvents");
-	iTestArray[26].iFunctionPtr = &CRunModeAgent::TestCrashFlash;
-	iTestArray[26].iFunctionName = _L("TestCrashFlash");
-	iTestArray[27].iFunctionPtr = &CRunModeAgent::TestProcessKillBreakpoint;
-	iTestArray[27].iFunctionName = _L("TestProcessKillBreakpoint");
-	};
-
-GLDEF_C TInt E32Main()
-//
-// Entry point for run mode debug driver test
-//
-	{
-   TInt ret = KErrNone;
-
-	// client
-	CTrapCleanup* trap = CTrapCleanup::New();
-	if (!trap)
-		return KErrNoMemory;
-   	test.Title();
-   RunModeAgent = CRunModeAgent::NewL();
-   if (RunModeAgent != NULL)
-       {
-        __UHEAP_MARK;
-	    TRAP(ret,RunModeAgent->ClientAppL());
-	    __UHEAP_MARKEND;
-
-	    delete RunModeAgent;
-       }
-
-	delete trap;
-
-	return ret;
-	}
-
-/**
-Helper function to get the aOffset'th value from aFlags
-
-@param aFlags descriptor containing TRegisterFlag type flags
-@param aOffset index of flag value to extract from aFlags
-@param aFlagValue the flag value if function returned successfully
-
-@return KErrNone if value was read successfully, KErrTooBig if aOffset is
-        greater than aFlags.Length()
-*/
-TInt CRunModeAgent::GetFlag(const TDes8& aFlags, const TUint aOffset, TRegisterFlag &aFlagValue) const
-	{
-	//get pointer to data
-	const TUint8 *ptr = aFlags.Ptr();
-
-	//check aOffset is valid
-	TUint length = aFlags.Length();
-	if(aOffset >= length)
-		return KErrTooBig;
-
-	//get flag value
-	aFlagValue = (TRegisterFlag)ptr[aOffset];
-	return KErrNone;
-	}
-
-/**
-  Helper function to set the value of FunctionChooser in the target debug thread.
-
-  @param aTestFunction TTestFunction enum to set FunctionChooser to
-
-  @return KErrNone if the value was set correctly, or one of the other system wide error codes
-  */
-TInt CRunModeAgent::SwitchTestFunction(TTestFunction aTestFunction)
-	{
-	//suspend the target thread
-	TInt suspendError = iServSession.SuspendThread(iThreadID);
-	if(! ( (suspendError == KErrNone) || (suspendError == KErrAlreadyExists) ) )
-		{
-		//the thread is not suspended so exit
-		return suspendError;
-		}
-
-	//get the address of FunctionChooser
-	TUint32 functionChooserAddress = (TUint32)&FunctionChooser;
-	//put the new value for FunctionChooser into a descriptor
-	TPtr8 functionBuf((TUint8*)&aTestFunction, sizeof(TTestFunction), sizeof(TTestFunction));
-	//write the new value into the target thread
-	TInt writeError = iServSession.WriteMemory(iThreadID, functionChooserAddress, sizeof(TTestFunction), functionBuf, EAccess32, EEndLE8);
-
-	if(KErrNone == suspendError)
-		{
-		//if this function suspended the target thread then we need to resume it
-		TInt resumeError = iServSession.ResumeThread(iThreadID);
-		if(KErrNone != resumeError)
-			{
-			//resuming failed so return the error
-			return resumeError;
-			}
-		}
-
-	//suspending and resuming was successful so return the error code from the WriteMemory call
-	return writeError;
-	}
-
-/**
-  Launch a separate process to debug.
-
-  @param aProcess the RProcess object to use to create the process
-  @param aFileName file name of the executable to create the process from
-  @param aFunctionType function that the target process should call on execution
-  @param aDelay delay before the new process should call the function represented by aFunctionType
-  @param aExtraThreads number of extra threads to create in the child process
-
-  @return KErrNone on success, or one of the other system wide error codes
-  */
-TInt CRunModeAgent::LaunchProcess(RProcess& aProcess, const TDesC& aFileName, TDebugFunctionType aFunctionType, TUint32 aDelay, TUint32 aExtraThreads)
-	{
-	// at the moment we support two arguments, this number might have to be increased to support arguments
-	const TUint KMaxCommandLineLength = 32;
-
-	// create a command line buffer
-	RBuf commandLine;
-	commandLine.Create(KMaxCommandLineLength);
-
-	// append the command line arguments to the buffer
-	_LIT(KFArg, "-f");
-	commandLine.Append(KFArg());
-	commandLine.AppendNum(aFunctionType);
-
-	_LIT(KSpace, " ");
-	commandLine.Append(KSpace());
-
-	_LIT(KDArg, "-d");
-	commandLine.Append(KDArg());
-	commandLine.AppendNum(aDelay);
-
-	commandLine.Append(KSpace());
-
-	_LIT(KEArg, "-e");
-	commandLine.Append(KEArg());
-	commandLine.AppendNum(aExtraThreads);
-
-	// create the new process, matching on file name only, not specifying uid values
-	TInt err = aProcess.Create(aFileName, commandLine);	// owned by the process
-
-	// check that there was no error raised
-	if(err != KErrNone)
-		{
-		commandLine.Close();
-		return err;
-		}
-
-	TRequestStatus status = KRequestPending;
-	aProcess.Rendezvous(status);
-
-	commandLine.Close();	// after target thread starts
-
-	if(KRequestPending != status.Int())
-		{
-		// startup failed so kill the process
-		aProcess.Kill(KErrNone);
-		return status.Int();
-		}
-	else
-		{
-		// start up succeeded so resume the process
-		aProcess.Resume();
-		User::WaitForRequest(status);
-		if(KErrNone != status.Int())
-			{
-			aProcess.Kill(KErrNone);
-			}
-		return status.Int();
-		}
-	}
-
-/**
-  Helper function to read a tag header from a debug functionality block
-
-  @param aDebugFunctionalityBlock block to read header from
-  @param aTagHdrId header type to find
-
-  @return pointer to the header, or NULL if not available
-  */
-TTagHeader* CRunModeAgent::GetTagHdr(const TDesC8& aDebugFunctionalityBlock, const TTagHeaderId aTagHdrId) const
-	{
-	TUint8* ptr = (TUint8*) aDebugFunctionalityBlock.Ptr();
-	TUint8* blockEnd = ptr + aDebugFunctionalityBlock.Size();
-
-	while(ptr < blockEnd)
-		{
-		TTagHeader* header = (TTagHeader*)ptr;
-		if(header->iTagHdrId == aTagHdrId)
-			{
-			return header;
-			}
-		ptr += sizeof(TTagHeader) + (header->iNumTags * sizeof(TTag));
-		}
-	return NULL;
-	}
-
-/**
-  Helper function to read a tag from a debug functionality block
-
-  @param aTagHdr pointer to a tag header in a debug functionality block
-  @param aElement element to return from the header's data
-
-  @return pointer to the tag, or NULL if not available
-  */
-TTag* CRunModeAgent::GetTag(const TTagHeader* aTagHdr, const TInt aElement) const
-	{
-	TUint8* ptr = (TUint8*)aTagHdr + sizeof(TTagHeader);
-	TUint8* blockEnd = ptr + (aTagHdr->iNumTags * sizeof(TTag));
-
-	while(ptr < blockEnd)
-		{
-		TTag* tag = (TTag*)ptr;
-		if(tag->iTagId == aElement)
-			{
-			return tag;
-			}
-		ptr += sizeof(TTag);
-		}
-	return NULL;
-	}
-
-TTag CRunModeAgent::GetTag(const TTagHeaderId aTagHdrId, const TInt aElement)
-	{
-	TUint32 bufsize = 0;	// Safe default size
-
-	// Get functionality block size
-	test(KErrNone == iServSession.GetDebugFunctionalityBufSize(&bufsize));
-
-	// Ensure we have a finite buffer size
-	test(bufsize!=0);
-
-	// Allocate space for the functionality data
-	HBufC8* dftext = HBufC8::NewLC(bufsize);
-
-	// create an empty TPtr8 refering to dftext
-	TPtr8 dftextPtr(dftext->Des());
-
-	// Get the functionality block
-	test(KErrNone == iServSession.GetDebugFunctionality(dftextPtr));
-
-	// read a value from the data to check it has come through as expected
-	TTagHeader* header = GetTagHdr(dftext->Des(), aTagHdrId);
-	test(header != NULL);
-	TTag* tag = GetTag(header, aElement);
-	test(tag != NULL);
-
-	TTag tagToReturn = *tag;
-
-	// Remove our temporary buffer
-	CleanupStack::PopAndDestroy(dftext);
-
-	return tagToReturn;
-	}
-
-/**
-  Helper function which returns a Boolean indicating with a process with the
-  specified name is currently running.
-
-  @param aProcessName - Name of the process to find
-  @return ETrue if found, EFalse otherwise
-  */
-TBool CRunModeAgent::ProcessExists(const TDesC& aProcessName)
-	{
-	TInt    err=KErrNone;
-	TBool	found = FALSE;
-
-_LIT(KWildCard,"*");
-
-	TFindProcess find(KWildCard);
-	TFullName name;
-	while(find.Next(name)==KErrNone)
-		{
-		RProcess process;
-		err = process.Open(find);
-		if (err == KErrNone)
-			{
-			if (name.Find(aProcessName) != KErrNotFound)
-				{
-					found = TRUE;
-				}
-			process.Close();
-			}
-	   }
-
-	return found;
-	}
--- a/kerneltest/e32test/rm_debug/t_rmdebug2.h	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,189 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Definitions for the run mode debug tests
-// 
-//
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#ifndef RMDEBUG_H
-#define RMDEBUG_H
-
-#include "t_rmdebug_app.h"
-#include "r_user_low_memory_security_svr_session.h"
-#include "r_kernel_low_memory_security_svr_session.h"
-
-
-class CRunModeAgent;
-
-// Create a pointer to function type
-typedef void (CRunModeAgent::*testFunction)();
-
-class TFunctionData
-	{
-public:
-	testFunction iFunctionPtr;
-	TBuf<40> iFunctionName;
-	};
-
-//number of test functions that we have
-const TInt KMaxTests = 28;
-
-//
-// class CRunModeAgent
-//
-// The basic run mode agent.
-//
-class CRunModeAgent : public CBase
-	{
-public:
-	static CRunModeAgent* NewL();
-	~CRunModeAgent();
-	void ClientAppL();
-
-private:
-	CRunModeAgent();
-	void ConstructL();
-	void SetupAndAttachToDSS();
-
-	TInt TestStartup();
-	TInt TestShutdown();
-
-	void TestGetExecutablesList();
-	void TestGetProcessList();
-	void TestGetThreadList();
-	void TestGetCodeSegsList();
-	void TestGetXipLibrariesList();
-	void TestGetListInvalidData();
-
-	void DoTestGetThreadList(const TBool aShouldPass, const Debug::TListScope aListScope, const TUint64 aTargetId=0);
-	void DoTestGetCodeSegsList(const TBool aShouldPass, const Debug::TListScope aListScope, const TUint64 aTargetId=0);
-
-	void DoGetList(const Debug::TListId aListId, const Debug::TListScope aListScope, RBuf8& aBuffer, TUint32& aSize, const TUint64 aTargetId=0);
-
-	void TestMemoryAccess();
-	void TestSuspendResume();
-	void TestBreakPoints();
-	void TestConsecutiveBreakPoints();
-	void TestModifyBreak();
-	void DoTestModifyBreak(TBool aThreadSpecific);
-	void TestBreakInfo();
-	void DoTestBreakInfo(TBool aThreadSpecific);
-	void TestRunToBreak();
-	void DoTestRunToBreak(TBool aThreadSpecific);
-	void TestRegisterAccess();
-	void TestAttachExecutable();
-	void TestDebugFunctionality();
-	void TestStep();
-	void DoTestStep(TBool aThreadSpecific);
-	void TestDriverSecurity();
-	void TestSecurity();
-	void TestEvents();
-	void TestEventsForExternalProcess();
-	void TestDemandPaging();
-	void TestTraceSecurity();
-	void TestDllUsage();
-	void TestKillProcess();
-	void TestProcessBreakPoints();
-	void TestMultipleTraceEvents();
-	void TestAddRemoveProcessEvents();
-	void TestProcessKillBreakpoint();
-	void DoTestProcessKillBreakpoint();
-
-	//crash flash test functions
-	void TestCrashFlash();
-		
-	TInt GetFlag(const TDes8 &aFlags, const TUint aOffset, Debug::TRegisterFlag &aFlagValue) const;
-
-	void ReportPerformance(void);
-
-	// helper functions
-	void HelpTestSecurityAttachDetachExecutable(const TDesC& aProcessName, TBool aExpectSuccess);
-
-	TInt HelpTestStepSetBreak(Debug::TBreakId& aBreakId, TThreadId aThreadId, const TUint32 aBreakAddress, Debug::TArchitectureMode aMode, TBool aThreadSpecific=ETrue, TProcessId aProcessId=0);
-	TInt HelpTestStepClearBreak(const Debug::TBreakId aBreakId, const TThreadId aThreadId, TBool aThreadSpecific);
-	TInt HelpTestStepWaitForBreak(const TDesC& aProcessName, Debug::TEventInfo& aEventInfo);
-	TInt HelpTestStepReadPC(TThreadId aThreadId, TUint32& aPC);
-	TInt HelpTestStep(TThreadId aThreadId, TUint32 aStartAddress, TUint32 aEndAddress, Debug::TArchitectureMode aMode, TUint aNumSteps, TBool aThreadSpecific=ETrue, TProcessId=0);
-
-	TInt HelpTicksPerSecond(void);
-
-	// helper functions
-	void HelpStartTestTimer(void) { iStartTick = User::NTickCount(); iStopTick = 0; };
-	void HelpStopTestTimer(void) { iStopTick = User::NTickCount(); };
-	TInt HelpGetTestTicks(void) { return (iStopTick - iStartTick); };
-	TInt SwitchTestFunction(TTestFunction aTestFunction);
-	TInt LaunchProcess(RProcess& aProcess, const TDesC& aFileName, TDebugFunctionType aFunctionType, TUint32 aDelay=0, TUint32 aExtraThreads=0);
-	Debug::TTagHeader* GetTagHdr(const TDesC8& aDebugFunctionalityBlock, const Debug::TTagHeaderId aTagHdrId) const;
-	Debug::TTag* GetTag(const Debug::TTagHeader* aTagHdr, const TInt aElement) const;
-	Debug::TTag GetTag(const Debug::TTagHeaderId aTagHdrId, const TInt aElement);
-	TBool ProcessExists(const TProcessId aProcessId);
-	TBool ThreadExistsForProcess(const TThreadId aThreadId, const TProcessId aProcessId);
-	TBool ListingSupported(const Debug::TListId aListId, const Debug::TListScope aListScope);
-	void TestEventsWithExtraThreads(Debug::TKernelEventAction aActionMain, Debug::TKernelEventAction aActionExtra, TUint32 aExtraThreads);
-	void FillArray();
-	void PrintUsage();
-	void PrintVersion();
-
-	enum TTestMode 
-		{
-		//run all the tests
-		EModeAll = 1<<0,
-		//run the specified tests in reverse order
-		EModeReverse = 1<<1,
-		//print out help
-		EModeHelp = 1<<2,
-		//print out help
-		EModeVersion = 1<<3
-		};
-
-	void RunTest(TInt aTestNumber);
-	void ParseCommandLineL(TUint32& aMode, RArray<TInt>& aTests);
-
-	TBool ProcessExists(const TDesC& aProcessName);
-
-private:
-
-	TFunctionData iTestArray[KMaxTests];
-#if defined(KERNEL_OOM_TESTING)
-	RKernelLowMemorySecuritySvrSession iServSession;
-#elif defined (USER_OOM_TESTING)
-	RUserLowMemorySecuritySvrSession iServSession;
-#else
-	Debug::RSecuritySvrSession iServSession;
-#endif
-	RThread	iDebugThread;
-	RProcess iDSSProcess;
-	RSemaphore iAddressGlobSem;
-	TThreadId iThreadID;
-	TFileName iFileName;
-	TUid iMySid;
-
-	// Performance data
-	TInt iMemoryReadKbytesPerSecond;	
-	TInt iMemoryWriteKbytesPerSecond;	
-	TInt iBreakpointsPerSecond;
-	TInt iMaxBreakpoints;
-	TInt iStepsPerSecond;
-
-	// Timing information
-	TInt iStartTick;
-	TInt iStopTick;
-	};
-
-#endif // RMDEBUG_H
--- a/kerneltest/e32test/rm_debug/t_rmdebug2_oemtoken.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#include <e32base.h>
-#include <e32base_private.h>
-
-GLDEF_C TInt E32Main()
-	{
-	// No need to do anything, the only requirement is that
-	// this executable can be loaded and runs to completion
-	return 0;
-	}
-
-// End of file - t_rmdebug2_oemtoken.cpp
--- a/kerneltest/e32test/rm_debug/t_rmdebug_app.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,328 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include <e32base.h>
-#include <e32base_private.h>
-#include <e32cmn.h>
-#include <e32cmn_private.h>
-#include <e32debug.h>
-#include <e32property.h> 
-#include "t_rmdebug_app.h"
-
-IMPORT_C extern void RMDebug_BranchTst2();
-
-LOCAL_C void ParseCommandLineL(TInt32& aFunctionType, TUint& aDelay, TUint& aExtraThreads)
-	{
-	// get the length of the command line arguments
-	TInt argc = User::CommandLineLength();
-
-	// allocate a buffer for the command line arguments and extract the data to it
-	HBufC* commandLine = HBufC::NewLC(argc);
-	TPtr commandLineBuffer = commandLine->Des();
-	User::CommandLine(commandLineBuffer);
-
-	// create a lexer and read through the command line
-	TLex lex(*commandLine);
-	while (!lex.Eos())
-		{
-		// expecting the first character to be a '-'
-		if (lex.Get() == '-')
-			{
-			TChar arg = lex.Get();
-			switch (arg)
-				{
-				case 'f':
-					// the digits following '-f' give the function type
-					User::LeaveIfError(lex.Val(aFunctionType));
-					break;
-				case 'd':
-					// the digits following '-d' give the delay
-					User::LeaveIfError(lex.Val(aDelay));
-					break;
-				case 'e':
-					// the digits following '-e' give the number of extra threads to launch
-					User::LeaveIfError(lex.Val(aExtraThreads));
-					break;
-				default:
-					// unknown argument so leave
-					User::Leave(KErrArgument);
-				}
-			lex.SkipSpace();
-			}
-		else
-			{
-			// unknown argument so leave
-			User::Leave(KErrArgument);
-			}
-		}
-
-	// do clean up
-	CleanupStack::PopAndDestroy(commandLine);
-	}
-
-typedef void (*TPfun)();
-
-// test function to call corresponding to EPrefetchAbortFunction
-void PrefetchAbort()
-	{
-	TPfun f = NULL;
-	f();
-	}
-
-// test function to call corresponding to EUserPanicFunction
-void UserPanic()
-	{
-	User::Panic(KUserPanic, KUserPanicCode);
-	}
-
-// calls self repeatedly until stack is used up. Slightly convoluted to prevent UREL optimising this out...
-TUint32 StackOverFlowFunction(TUint32 aInt=0)
-	{
-	TUint32 unusedArray[150];
-	for(TInt i=0; i<150; i++)
-		{
-		unusedArray[i] = StackOverFlowFunction(i);
-		}
-	return unusedArray[0];
-	}
-
-void DataAbort()
-	{
-	TInt* r = (TInt*) 0x1000;
-	*r = 0x42;              
-	}
-
-void UndefInstruction()
-	{
-	TUint32 undef = 0xE6000010;
-	TPfun f = (TPfun) &undef;
-	f();
-	}
-
-TInt DataRead()
-	{
-	TInt* r = (TInt*) 0x1000;
-	TInt rr = (TInt)*r;
-	//include the following line to ensure that rr doesn't get optimised out
-	RDebug::Printf("Shouldn't see this being printed out: %d", rr);
-
-	// Stop compilation warning. Should not get here anyway.
-	rr++;
-	return rr;
-	}
-
-void DataWrite()
-	{
-	TInt* r = (TInt*) 0x1000;
-	*r = 0x42;                
-	}
-
-void UserException()
-	{
-	User::RaiseException(EExcGeneral);
-	}
-
-void SpinForeverWithBreakPoint()
-	{
-
-    // finding the process t_rmdebug2/t_rmdebug2_oem/t_rmdebug2_oem2
-    // we find the process.SID to attach to the property
-	_LIT(KThreadWildCard, "t_rmdebug2*");
-
-	TInt err = KErrNone;
-	TUid propertySid = KNullUid;
-	TFindThread find(KThreadWildCard);
-	TFullName name;
-	TBool found = EFalse;
-	while(find.Next(name)==KErrNone && !found)
-		{
-		RThread thread;
-		err = thread.Open(find);
-		if (err == KErrNone)
-			{
-			RProcess process;
-			thread.Process(process);
-			TFullName fullname = thread.FullName();
-		    //RDebug::Printf("SID Search Match Found Name %lS Process ID%ld Thread Id %ld", &fullname, process.Id().Id(), thread.Id().Id());
-			found = ETrue;
-			//SID saved so that the property can be attached to
-			propertySid = process.SecureId();
-			process.Close();
-			}
-		thread.Close();
-	}
-
-    //attach to the property to publish the address of the RMDebug_BranchTst2 with the correct SID value
-	RProperty integerProperty;
-	err = integerProperty.Attach(propertySid, EMyPropertyInteger, EOwnerThread);
-	if(KErrNone != err)
-		RDebug::Printf("Error Attach to the property %d", err);
-
-	TInt address = (TInt)&RMDebug_BranchTst2;
-	
-	// publish the address where the breakpoint would be set
-	err = integerProperty.Set(address);
-	if(KErrNone != err)
-		RDebug::Printf("Error Set of the property %d", err);
-	integerProperty.Close();
-	
-	//open semaphore to signal the fact we have reached the point where we have to set the property
-	RSemaphore globsem;
-	globsem.OpenGlobal(_L("RMDebugGlobSem"));
-	globsem.Signal();
-	globsem.Close();
-
-	RProcess thisProcess;
-	TFileName thisProcessName = thisProcess.FileName();
-	RDebug::Printf("App Process Name %lS process id %ld thread id %ld", &thisProcessName, thisProcess.Id().Id(), RThread().Id().Id());
-
-	TInt i=0;
-	RThread::Rendezvous(KErrNone);
-	while(i<0xffffffff)
-		{
-		RMDebug_BranchTst2();
-		User::After(10000);
-		}
-	}
-void SpinForever()
-	{
-	TInt i=0;
-	RThread::Rendezvous(KErrNone);
-	while(i<0xffffffff)
-		{
-		User::After(10000);
-		}
-	}
-
-void LaunchThreads(TUint aNumber)
-	{
-	_LIT(KDebugThreadName, "DebugThread");
-	const TUint KDebugThreadDefaultHeapSize=0x10000;
-	for(TInt i=0; i<aNumber; i++)
-		{
-		RThread thread;
-		RBuf threadName;
-		threadName.Create(KDebugThreadName().Length()+10); // the 10 is for appending i to the end of the name
-		threadName.Append(KDebugThreadName());
-		threadName.AppendNum(i);
-		TInt err = thread.Create(threadName, (TThreadFunction)SpinForever, KDefaultStackSize, KDebugThreadDefaultHeapSize, KDebugThreadDefaultHeapSize, NULL);
-		if(err != KErrNone)
-			{
-			RDebug::Printf("Couldn't create thread %d", err);
-			threadName.Close();
-			thread.Close();
-			break;
-			}
-		thread.SetPriority(EPriorityNormal);
-		TRequestStatus status;
-		thread.Rendezvous(status);
-		thread.Resume();
-		User::WaitForRequest(status);
-		thread.Close();
-		threadName.Close();
-		}
-	}
-
-void WaitFiveSecondsThenExit(void)
-	{
-	// wait for 5 seconds
-	User::After(5000000);
-	}
-
-// call the function corresponding to aFunctionType
-LOCAL_C void CallFunction(TDebugFunctionType aFunctionType, TUint aDelay, TUint aExtraThreads)
-	{
-	// pause for aDelay microseconds
-	User::After(aDelay);
-
-	// launch the extra threads
-	LaunchThreads(aExtraThreads);
-
-	// call appropriate function
-	switch( aFunctionType )
-		{
-		case EPrefetchAbortFunction:
-			PrefetchAbort();
-			break;
-		case EUserPanicFunction:
-			UserPanic();
-			break;
-		case EStackOverflowFunction:
-			StackOverFlowFunction();
-			break;
-		case EDataAbortFunction:
-			DataAbort();
-			break;
-		case EUndefInstructionFunction:
-			UndefInstruction();
-			break;
-		case EDataReadErrorFunction:
-			DataRead();
-			break;
-		case EDataWriteErrorFunction:
-			DataWrite();
-			break;
-		case EUserExceptionFunction:
-			UserException();
-			break;
-		case EWaitFiveSecondsThenExit:
-			WaitFiveSecondsThenExit();
-			break;
-		case ESpinForever:
-			SpinForever();
-			break;
-		case ESpinForeverWithBreakPoint:
-			SpinForeverWithBreakPoint();
-			break;
-		case EDefaultDebugFunction:
-		default:
-			break;
-		}
-	}
-
-void PrintHelp()
-	{
-	RDebug::Printf("Invoke with arguments:\n");
-	RDebug::Printf("\t-d<delay>\n\t: delay in microseconds before calling target function\n");
-	RDebug::Printf("\t-f<function-number>\n\t: enumerator from TDebugFunctionType representing function to call\n");
-	RDebug::Printf("\t-e<number>\n\t: number of extra threads to launch, these threads run endlessly\n");
-	}
-
-TInt E32Main()
-	{
-	// setup heap checking and clean up trap
-	__UHEAP_MARK;
-	CTrapCleanup* cleanup=CTrapCleanup::New();
-	RThread().SetPriority(EPriorityNormal);
-	RProcess::Rendezvous(KErrNone);
-
-	// read arguments from command line
-	TUint delay = 0;
-	TInt32 functionTypeAsTInt32 = (TInt32)EDefaultDebugFunction;
-	TUint extraThreads = 0;
-	TRAPD(err, ParseCommandLineL(functionTypeAsTInt32, delay, extraThreads));
-
-	if(KErrNone == err)
-		{
-		// if the command line arguments were successfully read then call the appropriate function
-		CallFunction((TDebugFunctionType)functionTypeAsTInt32, delay, extraThreads);
-		}
-
-	// perform clean up and return any error which was recorded
-	delete cleanup;
-	__UHEAP_MARKEND;
-	return err;
-	}
-
--- a/kerneltest/e32test/rm_debug/t_rmdebug_app.h	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef T_RMDEBUG_APP_H
-#define T_RMDEBUG_APP_H
-
-_LIT(KRMDebugTestApplication, "z:\\sys\\bin\\t_rmdebug_app.exe");
-_LIT(KUserPanic, "UserPanic");
-const TInt KUserPanicCode = 0x1234ABCD;
-
-enum TMyPropertyKeys {EMyPropertyInteger};
-
-
-// enumeration of functions to call in test debug application
-enum TDebugFunctionType
-	{
-	EDefaultDebugFunction,
-	EPrefetchAbortFunction,
-	EUserPanicFunction,
-	EStackOverflowFunction,
-	EDataAbortFunction,
-	EUndefInstructionFunction,
-	EDataReadErrorFunction,
-	EDataWriteErrorFunction,
-	EUserExceptionFunction,
-	EWaitFiveSecondsThenExit,
-	ESpinForever,
-	ESpinForeverWithBreakPoint
-	};
-
-#endif //T_RMDEBUG_APP_H
-
--- a/kerneltest/e32test/rm_debug/t_rmdebug_dll.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include <e32std.h>
-#include <e32std_private.h>
-#include <rm_debug_api.h>
-#include "t_rmdebug_dll.h"
-
-EXPORT_C TUid GetDSSUid()
-	{
-	return Debug::KUidDebugSecurityServer;
-	}
-
--- a/kerneltest/e32test/rm_debug/t_rmdebug_dll.h	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include <e32std.h>
-
-/**
-  This is a simple function that uses an element from rm_debug_api.h.
-  If the e32tests can be built and run then this is 'proof' that the
-  rm_debug_api.h header file can be #include'd into a dll
-  */
-IMPORT_C TUid GetDSSUid();
--- a/kerneltest/e32test/rm_debug/t_rmdebug_security.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Target application to be debugged by t_rmdebug.exe when testing
-// security restrictions. This application is built with various
-// capabilities by the t_rmdebug_securityX.mmp files. This allows
-// the t_rmdebug2 program to ensure that security restrictions are
-// properly enforced by the DSS/DDD subsystem.
-// 
-//
-
-#include <e32base.h>
-#include <e32base_private.h>
-#include <e32cons.h>
-#include <e32test.h>
-#include <e32ldr.h>
-#include <e32cmn.h>
-#include <e32cmn_private.h>
-#include "t_rmdebug_security.h"
-
-CRunModeApp* CRunModeApp::NewL()
-//
-// CRunModeApp::NewL
-//
-	{
-	CRunModeApp* self = new(ELeave) CRunModeApp();
-
-  	self->ConstructL();
-   
-	return self;
-	}
-
-CRunModeApp::CRunModeApp()
-//
-// CRunModeApp constructor
-//
-	{
-	}
-
-CRunModeApp::~CRunModeApp()
-//
-// CRunModeApp destructor
-//
-	{
-	}
-
-void CRunModeApp::ConstructL()
-//
-// CRunModeApp::ConstructL
-//
-	{
-	}
-
-void CRunModeApp::TestWaitDebug()
-//
-// CRunModeApp::TestWaitDebug
-//
-	{
-	RProcess::Rendezvous(KErrNone);
-
-	// Wait a 3secs then quit (long enough to test, but not hang around forever)
-	User::After(3000000);
-	}
-
-GLDEF_C TInt E32Main()
-//
-// Entry point for run mode debug app test program
-//
-	{
-   TInt ret = KErrNone;
-   
-	// client
-	CTrapCleanup* trap = CTrapCleanup::New();
-	if (!trap)
-		return KErrNoMemory;
-
-   CRunModeApp* myApp = CRunModeApp::NewL();
-   if (myApp != NULL)
-       {
-        __UHEAP_MARK;
-	    TRAP(ret,myApp->TestWaitDebug());
-	    __UHEAP_MARKEND;
-
-	    delete myApp;
-       }
-       
-	delete trap;
-
-	return ret;
-	}
--- a/kerneltest/e32test/rm_debug/t_rmdebug_security.h	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Target application to be debugged by t_rmdebug2.exe when testing
-// security restrictions. This application is built with various
-// capabilities by the t_rmdebug_securityX.mmp files. This allows
-// the t_rmdebug2 program to ensure that security restrictions are
-// properly enforced by the DSS/DDD subsystem.
-// 
-//
-
-/**
- @file
- @internalTechnology
- @released
-*/
-
-#ifndef T_RMDEBUG_SECURITY_H
-#define T_RMDEBUG_SECURITY_H
-
-class CRunModeApp : public CBase
-{
-public:
-	static CRunModeApp* NewL();
-	~CRunModeApp();
-
-	void TestWaitDebug();
-
-private:
-	CRunModeApp();
-	void ConstructL();
-};
-
-#endif // T_RMDEBUG_SECURITY_H
--- a/kerneltest/e32test/rm_debug/t_trkdummyapp.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,532 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Ensure that old insecure Trk debug agent cannot be installed
-// as it should be blocked from SWInstall'ing by a trkdummyapp.exe contained within
-// the base OS with the same SID as the insecure Trk.
-// 
-//
-
-#include <e32base.h>
-#include <e32base_private.h>
-#include <e32cons.h>
-#include <e32test.h>
-#include <e32ldr.h>
-#include <e32cmn.h>
-#include <e32cmn_private.h>
-#include <f32dbg.h>
-#include <f32file.h>
-#include "t_trkdummyapp.h"
-
-LOCAL_D RTest test(_L("T_TRKDUMMYAPP"));
-
-CTrkDummyAppTest::CTrkDummyAppTest()
-//
-// CTrkDummyAppTest constructor
-//
-	{
-	// nothing to do
-	}
-
-CTrkDummyAppTest* CTrkDummyAppTest::NewL()
-//
-// CRunModeAgent::NewL
-//
-	{
-	CTrkDummyAppTest* self = new(ELeave) CTrkDummyAppTest();
-
-  	self->ConstructL();
-
-	return self;
-	}
-
-CTrkDummyAppTest::~CTrkDummyAppTest()
-//
-// CTrkDummyAppTest destructor
-//
-	{
-	// Nothing to do
-	}
-
-void CTrkDummyAppTest::ConstructL()
-//
-// CTrkDummyAppTest::ConstructL
-//
-	{
-	// nothing to do here
-	}
-
-
-CTrkDummyAppTest *TrkDummyTest;
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-TRKDUMMYAPP-0792
-//! @SYMTestType        
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Tests that a known insecure debug agent trkapp.sis cannot be installed
-//!                     by ensuring the existence of a Symbian OS common app called trkdummyapp.exe
-//!                     already exists with the same Secure ID as the insecure app.
-//! @SYMTestActions     
-//!    
-//!     1.              Calls RProcess.Create() on z:\sys\bin\trkdummyapp.exe. Fail if unsuccessful.
-//!     
-//!     2.              Obtain the Secure ID of the process derived from z:\sys\bin\trkdummyapp.exe.
-//!
-//!     3.              Close the process derived from z:\sys\bin\trkdummyapp.exe.
-//!
-//! @SYMTestExpectedResults 
-//!
-//!     1.              Fails if unable to create a process from z:\sys\bin\trkdummyapp.exe.
-//!
-//!     2.              The Secure ID of trkdummyapp.exe has the Secure ID 0x101F7159. Fail otherwise.
-//! 
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-// Names of some test programs used for testing security
-_LIT(KRMDebugSecurityTrkDummyApp,"z:\\sys\\bin\\trkdummyapp.exe");
-
-void CTrkDummyAppTest::TestSecurityCheckPreventInsecureTrkDebugAgent(void)
-	{
-
-	test.Next(_L("TestSecurityCheckPreventInsecureTrkDebugAgent, SID 0x101F7159\n"));
-
-	RProcess process;
-	TInt err = process.Create(KRMDebugSecurityTrkDummyApp, KNullDesC, EOwnerProcess);
-	test (err == KErrNone);
-
-	// rendezvous with process
-	TRequestStatus status;
-	process.Rendezvous(status);
-
-	// obtain the secure ID for the process
-	TSecurityInfo secInfo(process);
-
-	static const TSecureId KTrkDummyAppSID = 0x101F7159;
-
-	test(secInfo.iSecureId.iId == KTrkDummyAppSID);
-
-	// Kill the process, as we don't need it anymore
-	process.Kill(KErrNone);
-
-	process.Close();
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-TRKDUMMYAPP-0793
-//! @SYMTestType        
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Tests that a known insecure debug agent trkapp.sis cannot be installed
-//!                     by ensuring the existence of a Symbian OS common app called trkdummyapp.exe
-//!                     already exists with the same Secure ID as the insecure app.
-//! @SYMTestActions     
-//!    
-//!     1.              Calls RProcess.Create() on z:\sys\bin\trkdummyapp2.exe. Fail if unsuccessful.
-//!     
-//!     2.              Obtain the Secure ID of the process derived from z:\sys\bin\trkdummyapp2.exe.
-//!
-//!     3.              Close the process derived from z:\sys\bin\trkdummyapp2.exe.
-//!
-//! @SYMTestExpectedResults 
-//!
-//!     1.              Fails if unable to create a process from z:\sys\bin\trkdummyapp2.exe.
-//!
-//!     2.              The Secure ID of trkdummyapp.exe has the Secure ID 0x2000a7dd. Fail otherwise.
-//! 
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-// Names of some test programs used for testing security
-_LIT(KRMDebugSecurityTrkDummyApp2,"z:\\sys\\bin\\trkdummyapp2.exe");
-
-void CTrkDummyAppTest::TestSecurityCheckPreventInsecureTrkDebugAgent2(void)
-	{
-
-	test.Next(_L("TestSecurityCheckPreventInsecureTrkDebugAgent2, SID 0x2000a7dd\n"));
-
-	RProcess process;
-	TInt err = process.Create(KRMDebugSecurityTrkDummyApp2, KNullDesC, EOwnerProcess);
-	test (err == KErrNone);
-
-	// rendezvous with process
-	TRequestStatus status;
-	process.Rendezvous(status);
-
-	// obtain the secure ID for the process
-	TSecurityInfo secInfo(process);
-
-	static const TSecureId KTrkDummyAppSID2 = 0x2000a7dd;
-
-	test(secInfo.iSecureId.iId == KTrkDummyAppSID2);
-
-	// Kill the process, as we don't need it anymore
-	process.Kill(KErrNone);
-
-	process.Close();
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-TRKDUMMYAPP-2396
-//! @SYMTestType        
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Tests that a known insecure debug agent trkapp.sis cannot be installed
-//!                     by ensuring the existence of a Symbian OS common app called trkdummyapp200159D8.exe
-//!                     already exists with the same Secure ID as the insecure app.
-//! @SYMTestActions     
-//!    
-//!     1.              Calls RProcess.Create() on z:\sys\bin\trkdummyapp200159D8.exe. Fail if unsuccessful.
-//!     
-//!     2.              Obtain the Secure ID of the process derived from z:\sys\bin\trkdummyapp200159D8.exe.
-//!
-//!     3.              Close the process derived from z:\sys\bin\trkdummyapp200159D8.exe.
-//!
-//! @SYMTestExpectedResults 
-//!
-//!     1.              Fails if unable to create a process from z:\sys\bin\trkdummyapp200159D8.exe.
-//!
-//!     2.              The Secure ID of trkdummyapp200159D8.exe has the Secure ID 0x200159D8. Fail otherwise.
-//! 
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-// Names of some test programs used for testing security
-_LIT(KRMDebugSecurityTrkDummyApp200159D8,"z:\\sys\\bin\\trkdummyapp200159D8.exe");
-
-void CTrkDummyAppTest::TestSecurityCheckPreventInsecureTrkDebugAgent200159D8(void)
-	{
-	test.Next(_L("TestSecurityCheckPreventInsecureTrkDebugAgent, SID 0x200159D8\n"));
-
-	RProcess process;
-	TInt err = process.Create(KRMDebugSecurityTrkDummyApp200159D8, KNullDesC, EOwnerProcess);
-	test (err == KErrNone);
-
-	// rendezvous with process
-	TRequestStatus status;
-	process.Rendezvous(status);
-
-	// obtain the secure ID for the process
-	TSecurityInfo secInfo(process);
-
-	static const TSecureId KTrkDummyAppSID2 = 0x200159D8;
-
-	test(secInfo.iSecureId.iId == KTrkDummyAppSID2);
-
-	// Kill the process, as we don't need it anymore
-	process.Kill(KErrNone);
-
-	process.Close();
-	}
-
-//----------------------------------------------------------------------------------------------
-//! @SYMTestCaseID      KBase-T-TRKDUMMYAPP-2397
-//! @SYMTestType        
-//! @SYMPREQ            PREQ1426
-//! @SYMTestCaseDesc    Tests that a known insecure debug agent trkapp.sis cannot be installed
-//!                     by ensuring the existence of a Symbian OS common app called trkdummyapp200170BC.exe
-//!                     already exists with the same Secure ID as the insecure app.
-//! @SYMTestActions     
-//!    
-//!     1.              Calls RProcess.Create() on z:\sys\bin\trkdummyapp200170BC.exe. Fail if unsuccessful.
-//!     
-//!     2.              Obtain the Secure ID of the process derived from z:\sys\bin\trkdummyapp200170BC.exe.
-//!
-//!     3.              Close the process derived from z:\sys\bin\trkdummyapp200170BC.exe.
-//!
-//! @SYMTestExpectedResults 
-//!
-//!     1.              Fails if unable to create a process from z:\sys\bin\trkdummyapp200170BC.exe.
-//!
-//!     2.              The Secure ID of trkdummyapp.exe has the Secure ID 0x200170BC. Fail otherwise.
-//! 
-//! @SYMTestPriority        High
-//! @SYMTestStatus          Implemented
-//----------------------------------------------------------------------------------------------
-
-// Names of some test programs used for testing security
-_LIT(KRMDebugSecurityTrkDummyApp200170BC,"z:\\sys\\bin\\trkdummyapp200170BC.exe");
-
-void CTrkDummyAppTest::TestSecurityCheckPreventInsecureTrkDebugAgent200170BC(void)
-	{
-
-	test.Next(_L("TestSecurityCheckPreventInsecureTrkDebugAgent, SID 0x200170BC\n"));
-
-	RProcess process;
-	TInt err = process.Create(KRMDebugSecurityTrkDummyApp200170BC, KNullDesC, EOwnerProcess);
-	test (err == KErrNone);
-
-	// rendezvous with process
-	TRequestStatus status;
-	process.Rendezvous(status);
-
-	// obtain the secure ID for the process
-	TSecurityInfo secInfo(process);
-
-	static const TSecureId KTrkDummyAppSID2 = 0x200170BC;
-
-	test(secInfo.iSecureId.iId == KTrkDummyAppSID2);
-
-	// Kill the process, as we don't need it anymore
-	process.Kill(KErrNone);
-
-	process.Close();
-	}
-
-void CTrkDummyAppTest::ClientAppL()
-//
-// Performs each test in turn
-//
-	{
-	test.Start(_L("ClientAppL"));
-
-	TestSecurityCheckPreventInsecureTrkDebugAgent();
-
-	TestSecurityCheckPreventInsecureTrkDebugAgent2();
-
-	TestSecurityCheckPreventInsecureTrkDebugAgent200159D8();
-
-	TestSecurityCheckPreventInsecureTrkDebugAgent200170BC();
-
-	test.End();
-	}
-
-
-
-GLDEF_C TInt E32Main()
-//
-// Entry point for run mode debug driver test
-//
-	{
-   TInt ret = KErrNone;
-
-	// client
-	CTrapCleanup* trap = CTrapCleanup::New();
-	if (!trap)
-		return KErrNoMemory;
-
-   	test.Title();
-   TrkDummyTest = CTrkDummyAppTest::NewL();
-   if (TrkDummyTest != NULL)
-       {
-        __UHEAP_MARK;
-	    TRAP(ret,TrkDummyTest->ClientAppL());
-	    __UHEAP_MARKEND;
-
-	    delete TrkDummyTest;
-       }
-       
-	delete trap;
-
-	return ret;
-	}
-
-// End of file - t_trkdummyapp.cpp
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
--- a/kerneltest/e32test/rm_debug/t_trkdummyapp.h	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Ensure that old insecure Trk debug agent cannot be installed
-// as it should be blocked from SWInstall'ing by a trkdummyapp.exe contained within
-// the base OS with the same SID as the insecure Trk.
-// 
-//
-
-/**
-@file
-@internalTechnology
-@released
-*/
-
-#ifndef T_TRKDUMMYAPP_H
-#define T_TRKDUMMYAPP_H
-
-class CTrkDummyAppTest;
-
-//
-// class CTrkDummyAppTest
-//
-// Basic test of the existence of the TrkDummyApp.
-//
-class CTrkDummyAppTest : public CBase
-	{
-public:
-	static CTrkDummyAppTest* NewL();
-	~CTrkDummyAppTest();
-	void ClientAppL();
-
-	void TestSecurityCheckPreventInsecureTrkDebugAgent(void);
-
-	void TestSecurityCheckPreventInsecureTrkDebugAgent2(void);
-
-	void TestSecurityCheckPreventInsecureTrkDebugAgent200159D8(void);
-
-	void TestSecurityCheckPreventInsecureTrkDebugAgent200170BC(void);
-
-private:
-	CTrkDummyAppTest();
-	void ConstructL();
-
-	void TestTrkDummyAppExists();
-
-	};
-
-#endif // T_TRKDUMMYAPP_H
--- a/kerneltest/e32test/secure/t_suser.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/e32test/secure/t_suser.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -42,6 +42,8 @@
 #include <e32test.h>
 #include <e32svr.h>
 #include <nkern/nk_trace.h>
+#include <e32hal.h>
+#include <hal.h>
 
 LOCAL_D RTest test(_L("T_SUSER"));
 
@@ -946,21 +948,26 @@
 	test(logonStatus==KErrPermissionDenied);
 	CLOSE_AND_WAIT(process);
 
-	test.Next(_L("Calling UserSvr::AddEvent(ESwitchOff) with ECapabilityPowerMgmt & ECapabilitySwEvent"));
-	TRequestStatus absstatus;
-	RTimer abstimer;
-	TInt r = abstimer.CreateLocal();
-	test (r == KErrNone);
-	SetAbsoluteTimeout(abstimer, 5000000, absstatus); // 5 sec
-	process.Create((1u<<ECapabilitySwEvent)|(1u<<ECapabilityPowerMgmt),ETestProcessAddEventESwitchOff);
-	process.Logon(logonStatus);
-	process.Resume();
-	User::WaitForRequest(absstatus);
-	abstimer.Close();
-	User::WaitForRequest(logonStatus);
-	test(process.ExitType()==EExitKill);
-	test(logonStatus==KErrNone);
-	CLOSE_AND_WAIT(process);
+	TInt muid = 0;
+	HAL::Get(HAL::EMachineUid, muid);
+	if(muid==HAL::EMachineUid_OmapH2 || muid==HAL::EMachineUid_OmapH4 || muid==HAL::EMachineUid_OmapH6 || muid==HAL::EMachineUid_NE1_TB || muid==HAL::EMachineUid_X86PC || muid==HAL::EMachineUid_Win32Emulator)
+		{
+		test.Next(_L("Calling UserSvr::AddEvent(ESwitchOff) with ECapabilityPowerMgmt & ECapabilitySwEvent"));
+		TRequestStatus absstatus;
+		RTimer abstimer;
+		TInt r = abstimer.CreateLocal();
+		test (r == KErrNone);
+		SetAbsoluteTimeout(abstimer, 5000000, absstatus); // 5 sec
+		process.Create((1u<<ECapabilitySwEvent)|(1u<<ECapabilityPowerMgmt),ETestProcessAddEventESwitchOff);
+		process.Logon(logonStatus);
+		process.Resume();
+		User::WaitForRequest(absstatus);
+		abstimer.Close();
+		User::WaitForRequest(logonStatus);
+		test(process.ExitType()==EExitKill);
+		test(logonStatus==KErrNone);
+		CLOSE_AND_WAIT(process);
+		}
 
 	test.End();
 	}
--- a/kerneltest/e32test/system/d_mstim.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/e32test/system/d_mstim.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -41,6 +41,8 @@
 #include <rvemuboard.h>
 #elif defined(__NE1_TB__)
 #include <upd35001_timer.h>
+#elif defined(__MRAP__)
+#include <rap.h>
 #endif
 #include "d_mstim.h"
 #include "../misc/prbs.h"
@@ -93,6 +95,11 @@
 inline TCounter TIMER()
 	{ return NETimer::Timer(2).iTimerCount; }
 #endif
+#ifdef __MRAP__
+inline TCounter TIMER()
+	{ TRap::SetRegister32(1, KRapRegRTC001_TRIGGER);
+	return  TRap::Register32(KRapRegRTC001_LONGCOUNT); }
+#endif
 #if defined(__EPOC32__) && defined(__CPU_X86)
 TCounter TIMER();
 void SetUpTimerChannel2();
@@ -137,6 +144,10 @@
 inline TDelta TimeDelta(TCounter initial, TCounter final)
 	{ return final - initial; }
 #endif
+#if defined(__MRAP__)
+inline TDelta TimeDelta(TCounter initial, TCounter final)
+	{ return final-initial; }				// RAP RTC timer counts up
+#endif
 #ifdef __WINS__
 inline TDelta TimeDelta(TCounter initial, TCounter final)
 	{ return final-initial; }		// counts up
@@ -197,6 +208,15 @@
 	x /= TInt64(f);
 	return (TInt)x;
 #endif
+#if defined(__MRAP__)
+    // RTC runs with 32.768 kHz -> one tick is 
+    const TUint KRTCClockHz = 32768;
+    Int64 ticks(aTicks);
+    ticks*=(1000000);
+	ticks+=KRTCClockHz/2;		// 32.768 kHz tick
+	ticks/=KRTCClockHz;
+	return (TInt)ticks;
+#endif
 #if defined(__EPOC32__) && defined(__CPU_X86)
 	TInt x = aTicks;
 	TInt y = x;
--- a/kerneltest/e32test/system/d_tick.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/e32test/system/d_tick.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -37,6 +37,8 @@
 #include <rvemuboard.h>
 #elif defined(__NE1_TB__)
 #include <upd35001_timer.h>
+#elif defined(__MRAP__)
+#include <rap.h>
 #endif
 #include <kernel/kern_priv.h>
 #include "d_tick.h"
@@ -78,6 +80,11 @@
 inline TCounter TIMER()
 	{ return NETimer::Timer(2).iTimerCount; }
 #endif
+#ifdef __MRAP__
+inline TCounter TIMER()
+	{ TRap::SetRegister32(1, KRapRegRTC001_TRIGGER);
+	return  TRap::Register32(KRapRegRTC001_LONGCOUNT); }
+#endif
 #if defined(__EPOC32__) && defined(__CPU_X86)
 TCounter TIMER();
 void SetUpTimerChannel2();
@@ -90,6 +97,12 @@
 	return c.QuadPart;
 	}
 #endif
+#if defined(__MRAP__)
+inline TDelta TimeDelta(TCounter initial, TCounter final)
+	{ return final-initial; }				// RAP RTC timer counts up
+inline TInt LongTimeDelta(TCounter initial, TCounter final, TUint, TUint)
+	{ return final-initial; }				// RAP RTC timer counts up
+#endif
 
 #if defined(__MISA__) || defined(__MCOT__)
 inline TDelta TimeDelta(TCounter initial, TCounter final)
--- a/kerneltest/f32test/shostmassstorage/msman/app/husbconsapp.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/f32test/shostmassstorage/msman/app/husbconsapp.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -26,7 +26,6 @@
 #include <f32file.h>
 
 #include "rusbhostmsdevice.h"
-#include "rusbhostmslogicalunit.h"
 
 #include <d32usbdi_hubdriver.h>
 #include "usbtypes.h"
--- a/kerneltest/f32test/shostmassstorage/msman/src/cusbhost.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/f32test/shostmassstorage/msman/src/cusbhost.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -23,7 +23,6 @@
 
 #include "usbtypes.h"
 #include "rusbhostmsdevice.h"
-#include "rusbhostmslogicalunit.h"
 #include "rextfilesystem.h"
 #include "cusbmsmountmanager.h"
 
--- a/kerneltest/f32test/shostmassstorage/msman/src/cusbhostao.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/f32test/shostmassstorage/msman/src/cusbhostao.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -13,18 +13,6 @@
 // Description:
 //
 
-//#include <d32usbdi.h>
-//#include <d32otgdi.h>
-//#include <d32usbdescriptors.h>
-//#include <d32usbtransfers.h>
-
-
-//#include "rusbhostmslogicalunit.h"
-//
-//
-//
-//
-
 #include <e32base.h>
 #include <f32file.h>
 #include <d32usbdi_hubdriver.h>
--- a/kerneltest/f32test/shostmassstorage/msman/src/rextfilesystem.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/kerneltest/f32test/shostmassstorage/msman/src/rextfilesystem.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -16,7 +16,6 @@
 #include <f32file.h>
 
 #include "rusbhostmsdevice.h"
-#include "rusbhostmslogicalunit.h"
 #include "rextfilesystem.h"
 #include "tmslog.h"
 
--- a/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/inc/tfatbootsector.inl	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,460 +0,0 @@
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Inline methods of TFatBootSector class.
-// 
-//
-
-
-
-
-/**
- @file
- @internalTechnology
- 
- Returns Sectors in Fat table for 32 bit volume
- 
- @return iFatSectors32
-*/
-inline TUint32 TFatBootSector::FatSectors32() const	
-	{return iFatSectors32;}
-/**
-Fat flags
-
-@return iFATFlags
-*/
-inline TUint16 TFatBootSector::FATFlags() const		
-	{return iFATFlags;}
-/**
-Version number of the file system
-
-@return iVersionNumber
-*/
-inline TUint16 TFatBootSector::VersionNumber() const		
-	{return iVersionNumber;}
-/**
-Cluster number of the root directory
-
-@return iRootClusterNum
-*/
-inline TUint32 TFatBootSector::RootClusterNum() const	
-	{return iRootClusterNum;}
-/**
-Sector number containing the FSIInfo structure
-
-@return iFSInfoSectorNum
-*/
-inline TUint16 TFatBootSector::FSInfoSectorNum() const
-	{return iFSInfoSectorNum;}
-/**
-Backup boot sector
-
-@return iBkBootRecSector
-*/
-inline TUint16 TFatBootSector::BkBootRecSector() const
-	{return iBkBootRecSector;}
-/**
-Sets the number of sectors in Fat table for 32 bit volume
-
-@param aFatSectors32
-*/
-inline void TFatBootSector::SetFatSectors32(TUint32	aFatSectors32)
-	{iFatSectors32 = aFatSectors32;}
-/**
-Sets the Fat flags
-
-@param aFATFlags
-*/
-inline void TFatBootSector::SetFATFlags(TUint16 aFATFlags)
-	{iFATFlags = aFATFlags;}
-/**
-Sets the version number of the file system
-
-@param aVersionNumber
-*/
-inline void TFatBootSector::SetVersionNumber(TUint16 aVersionNumber)
-	{iVersionNumber = aVersionNumber;}
-/**
-Sets the cluster number of the root directory
-
-@param aRootClusterNum
-*/
-inline void TFatBootSector::SetRootClusterNum(TUint32 aRootClusterNum)	
-	{iRootClusterNum = aRootClusterNum;}
-/**
-Set the sector number containing the FSIInfo structure
-
-@param aFSInfoSectorNum
-*/
-inline void TFatBootSector::SetFSInfoSectorNum(TUint16 aFSInfoSectorNum)
-	{iFSInfoSectorNum = aFSInfoSectorNum;}
-/**
-Set the backup boot sector
-
-@param aBkBootRecSector
-*/
-inline void TFatBootSector::SetBkBootRecSector(TUint16 aBkBootRecSector)
-	{iBkBootRecSector = aBkBootRecSector;}	
-/**
-Quick test as to whether the volume is Fat32
-
-@return True for Fat32
-*/
-inline TBool TFatBootSector::Is32BitFat()
-	{return(iRootDirEntries==0);}
-/**
-Returns the vendor ID of the file system that formatted the volume
-
-@return A descriptor containing the vendor ID 
-*/
-inline const TPtrC8 TFatBootSector::VendorId() const
-	{return TPtrC8(iVendorId,KVendorIdSize);}
-/**
-Return the bytes per sector
-
-@return iBytesPerSector
-*/
-inline TUint16 TFatBootSector::BytesPerSector() const
-	{return iBytesPerSector;}
-/**
-Returns the sectors per cluster ratio
-
-@return iSectorsPerCluster
-*/
-inline TInt TFatBootSector::SectorsPerCluster() const
-	{return iSectorsPerCluster;}
-/**
-Returns the number of reserved sectors on the volume
-
-@return iReservedSectors
-*/
-inline TInt TFatBootSector::ReservedSectors() const
-	{return iReservedSectors;}
-/**
-Returns the number of Fats on the volume
-
-@return iNumberOfFats
-*/
-inline TInt TFatBootSector::NumberOfFats() const
-	{return iNumberOfFats;}
-/**
-Returns the number of entries allowed in the root directory, specific to Fat12/16, zero for FAT32
-
-@return iRootDirEntries
-*/
-inline TInt TFatBootSector::RootDirEntries() const
-	{return iRootDirEntries;}
-/**
-Returns the total sectors on the volume, zero for FAT32
-
-@return iTotalSectors
-*/
-inline TInt TFatBootSector::TotalSectors() const
-	{return iTotalSectors;}
-/**
-Returns the media descriptor
-
-@return iMediaDescriptor
-*/
-inline TUint8 TFatBootSector::MediaDescriptor() const
-	{return iMediaDescriptor;}
-/**
-Returns sectors used for the Fat table, zero for FAT32
-
-@return iFatSectors
-*/
-inline TInt TFatBootSector::FatSectors() const
-	{return iFatSectors;}
-/**
-Returns sectors per track
-
-@return iSectorsPerTrack
-*/
-inline TInt TFatBootSector::SectorsPerTrack() const
-	{return iSectorsPerTrack;}
-/**
-Returns the number of heads 
-
-@return iNumberOfHeads
-*/
-inline TInt TFatBootSector::NumberOfHeads() const
-	{return iNumberOfHeads;}
-/**
-Returns the number of hidden sectors in the volume
-
-@return iHiddenSectors
-*/
-inline TInt TFatBootSector::HiddenSectors() const
-	{return iHiddenSectors;}
-/**
-Returns total sectors in the volume, Used if totalSectors > 65535
-
-@return iHugeSectors
-*/
-inline TInt TFatBootSector::HugeSectors() const
-	{return iHugeSectors;}
-/**
-Returns the physical drive number, not used in Symbian OS
-
-@return iPhysicalDriveNumber
-*/
-inline TInt TFatBootSector::PhysicalDriveNumber() const
-	{return iPhysicalDriveNumber;}
-/**
-Returns the extended boot signiture
-
-@return iExtendedBootSignature
-*/
-inline TInt TFatBootSector::ExtendedBootSignature() const
-	{return iExtendedBootSignature;}
-/**
-Returns the unique volume ID
-
-@return iUniqueID
-*/
-inline TUint32 TFatBootSector::UniqueID() const
-	{return iUniqueID;}
-/**
-Returns the volume's label
-
-@return A descriptor containing the volume label
-*/
-inline const TPtrC8 TFatBootSector::VolumeLabel() const
-	{return TPtrC8(iVolumeLabel,KVolumeLabelSize);}
-/**
-Returns the file system type
-
-@return A descriptor containing the file system type
-*/
-inline const TPtrC8 TFatBootSector::FileSysType() const
-	{return TPtrC8(iFileSysType,KFileSysTypeSize);}
-/**
-Returns the boot sector signiture
-
-@return KBootSectorSignature
-*/
-inline TInt TFatBootSector::BootSectorSignature() const
-	{return KBootSectorSignature;}
-/**
-Set the jump instruction 
-*/
-inline void TFatBootSector::SetJumpInstruction()
-	{iJumpInstruction[0]=0xE9;iJumpInstruction[2]=0x90;}
-/**
-Set the vendor ID of the file system that formatted the volume
-
-@param aDes Descriptor containing the Vendor ID
-*/
-inline void TFatBootSector::SetVendorID(const TDesC8& aDes)
-	{
-	__ASSERT_DEBUG(aDes.Length()<=KVendorIdSize,User::Panic(_L("FATFILESYS"),1));
-	TPtr8 buf(iVendorId,KVendorIdSize);
-	buf=aDes;
-	}
-/**
-Sets the bytes per sector 
-
-@param aBytesPerSector Number of bytes per sector
-*/
-inline void TFatBootSector::SetBytesPerSector(TInt aBytesPerSector)
-	{
-	__ASSERT_DEBUG(!(aBytesPerSector&~KMaxTUint16),User::Panic(_L("FATFILESYS"),1));
-	iBytesPerSector=(TUint16)aBytesPerSector;
-	}
-/**
-Set the sectors per cluster ratio
-
-@param aSectorsPerCluster Number of sectors per cluster
-*/
-inline void TFatBootSector::SetSectorsPerCluster(TInt aSectorsPerCluster)
-	{
-	__ASSERT_DEBUG(!(aSectorsPerCluster&~KMaxTUint8),User::Panic(_L("FATFILESYS"),1));
-	iSectorsPerCluster=(TUint8)aSectorsPerCluster;
-	}
-/**
-Sets the number of reserved sectors on the volume
-
-@param aReservedSectors Number of reserved sectors
-*/
-inline void TFatBootSector::SetReservedSectors(TInt aReservedSectors)
-	{
-	__ASSERT_DEBUG(!(aReservedSectors&~KMaxTUint16),User::Panic(_L("FATFILESYS"),1));
-	iReservedSectors=(TUint16)aReservedSectors;
-	}
-/**
-Sets the number of Fats on the volume
-
-@param aNumberOfFats Number of fats
-*/
-inline void TFatBootSector::SetNumberOfFats(TInt aNumberOfFats)
-	{
-	__ASSERT_DEBUG(!(aNumberOfFats&~KMaxTUint8),User::Panic(_L("FATFILESYS"),1));
-	iNumberOfFats=(TUint8)aNumberOfFats;
-	}
-/**
-Number of entries allowed in the root directory, specific to Fat12/16, zero for FAT32
-
-@param aRootDirEntries
-*/
-inline void TFatBootSector::SetRootDirEntries(TInt aRootDirEntries)
-	{
-	__ASSERT_DEBUG(!(aRootDirEntries&~KMaxTUint16),User::Panic(_L("FATFILESYS"),1));
-	iRootDirEntries=(TUint16)aRootDirEntries;
-	}
-/**
-Total sectors on the volume, zero for FAT32
-
-@param aTotalSectors Total number of sectors
-*/
-inline void TFatBootSector::SetTotalSectors(TInt aTotalSectors)
-	{
-	__ASSERT_DEBUG(!(aTotalSectors&~KMaxTUint16),User::Panic(_L("FATFILESYS"),1));
-	iTotalSectors=(TUint16)aTotalSectors;
-	}
-/**
-Set the media descriptor
-
-@param aMediaDescriptor
-*/
-inline void TFatBootSector::SetMediaDescriptor(TUint8 aMediaDescriptor)
-	{iMediaDescriptor=aMediaDescriptor;}
-/**
-Sectors used for the Fat table, zero for FAT32
-
-@param aFatSectors Number of Fat sectors
-*/
-inline void TFatBootSector::SetFatSectors(TInt aFatSectors)
-	{
-	__ASSERT_DEBUG(!(aFatSectors&~KMaxTUint16),User::Panic(_L("FATFILESYS"),1));
-	iFatSectors=(TUint16)aFatSectors;
-	}
-/**
-Set the sectors per track
-
-@param aSectorsPerTrack Number of sectors per track
-*/
-inline void TFatBootSector::SetSectorsPerTrack(TInt aSectorsPerTrack)
-	{
-	__ASSERT_DEBUG(!(aSectorsPerTrack&~KMaxTUint16),User::Panic(_L("FATFILESYS"),1));
-	iSectorsPerTrack=(TUint16)aSectorsPerTrack;
-	}
-/**
-Set the number of heads
-
-@param aNumberOfHeads Number of heads
-*/
-inline void TFatBootSector::SetNumberOfHeads(TInt aNumberOfHeads)
-	{
-	__ASSERT_DEBUG(!(aNumberOfHeads&~KMaxTUint16),User::Panic(_L("FATFILESYS"),1));
-	iNumberOfHeads=(TUint16)aNumberOfHeads;
-	}
-/**
-Set the number of hidden sectors in the volume
-
-@param aHiddenSectors Number of hidden sectors
-*/
-inline void TFatBootSector::SetHiddenSectors(TUint32 aHiddenSectors)
-	{
-	iHiddenSectors=(TUint32)(aHiddenSectors);
-	}
-/**
-Set the total sectors in the volume, Used if totalSectors > 65535
-
-@param aHugeSectors
-*/
-inline void TFatBootSector::SetHugeSectors(TUint32 aHugeSectors)
-	{iHugeSectors=aHugeSectors;}
-/**
-Physical drive number, not used in Symbian OS
-
-@param aPhysicalDriveNumber Physical drive number 
-*/
-inline void TFatBootSector::SetPhysicalDriveNumber(TInt aPhysicalDriveNumber)
-	{
-	__ASSERT_DEBUG(!(aPhysicalDriveNumber&~KMaxTUint8),User::Panic(_L("FATFILESYS"),1));
-	iPhysicalDriveNumber=(TUint8)aPhysicalDriveNumber;
-	}
-/**
-Set the reserved byte value
-
-@param aReservedByte Value for reserved byte
-*/
-inline void TFatBootSector::SetReservedByte(TUint8 aReservedByte)
-	{iReserved=aReservedByte;}
-/**
-Set the extended boot signiture
-
-@param anExtendedBootSignature The extended boot signiture
-*/
-inline void TFatBootSector::SetExtendedBootSignature(TInt anExtendedBootSignature)
-	{
-	__ASSERT_DEBUG(!(anExtendedBootSignature&~KMaxTUint8),User::Panic(_L("FATFILESYS"),1));
-	iExtendedBootSignature=(TUint8)anExtendedBootSignature;
-	}
-/**
-Set the unique volume ID
-
-@param anUniqueID Set the unique ID
-*/
-inline void TFatBootSector::SetUniqueID(TUint32 anUniqueID)
-	{iUniqueID=anUniqueID;}
-/**
-Set the volume's label
-
-@param aDes A descriptor containg the volume label
-*/
-inline void TFatBootSector::SetVolumeLabel(const TDesC8& aDes)
-	{
-	__ASSERT_DEBUG(aDes.Length()<=KVolumeLabelSize,User::Panic(_L("FATFILESYS"),1));
-	TPtr8 buf(iVolumeLabel,KVolumeLabelSize);
-	buf=aDes;
-	}
-/**
-Set the file system type
-
-@param aDes A descriptor containing the file system type
-*/
-inline void TFatBootSector::SetFileSysType(const TDesC8& aDes)
-	{
-	__ASSERT_DEBUG(aDes.Length()<=8,User::Panic(_L("FATFILESYS"),1));
-	TPtr8 buf(iFileSysType,8);
-	buf=aDes;
-	}
-/**
-Tests if the volume is Fat 16 or not
-
-@return True if the volume is Fat16
-*/
-inline TBool TFatBootSector::Is16BitFat()
-	{return(FileSysType()==_L8("FAT16   "));}
-/**
-Returns the position of the first sector of the first Fat
-
-@return The first Fat sector's byte position
-*/
-inline TInt TFatBootSector::FirstFatSectorPos()
-	{return(ReservedSectors()*BytesPerSector());}
-/**
-Returns the start sector number of the root directory
-
-@return Start sector number of the root directory
-*/
-inline TInt TFatBootSector::RootDirStartSector()
-	{return(ReservedSectors()+FatSectors()*NumberOfFats());}
-/**
-Returns the sector number of the first sector after the root directory 
-
-@return 
-*/
-inline TInt TFatBootSector::FirstFreeSector()
-	{return(RootDirStartSector()+(RootDirEntries()*KSizeOfFatDirEntry+BytesPerSector()-1)/BytesPerSector());}
--- a/package_definition.xml	Mon Mar 15 12:45:50 2010 +0200
+++ b/package_definition.xml	Wed Mar 31 23:38:45 2010 +0300
@@ -3,7 +3,7 @@
   <package id="kernelhwsrv" name="Kernel and Hardware Services" levels="hw-if adaptation framework test">
     <collection id="brdbootldr" name="Board Boot Loader" level="hw-if">
       <component id="ubootldr" name="Boot Loader" introduced="9.2" purpose="optional">
-        <unit mrp="brdbootldr/ubootldr/base_ubootldr.mrp"/>
+        <unit bldFile="brdbootldr/ubootldr" mrp="brdbootldr/ubootldr/base_ubootldr.mrp"/>
       </component>
     </collection>
     <collection id="bsptemplate" name="Board Support Package Template" level="hw-if">
--- a/userlibandfileserver/fileserver/etshell/ts_com.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/etshell/ts_com.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -1110,8 +1110,30 @@
 	//-- Print out information about file system installed
 	if(aFlags & EFSInfo)
     {
+        //-- print out drive properties
+        Buf.Format(_L("\nDrive %c: No:%d"), 'A'+aDrvNum, aDrvNum);
         
-        apConsole->Printf(_L("\nDrive %c: number:%d\n"), 'A'+aDrvNum, aDrvNum);
+        //-- find out if the drive is synchronous / asynchronous
+        TPckgBuf<TBool> drvSyncBuf;
+        nRes = aFs.QueryVolumeInfoExt(aDrvNum, EIsDriveSync, drvSyncBuf);
+        if(nRes == KErrNone)
+        {
+            Buf.AppendFormat(_L(", Sync:%d"), drvSyncBuf() ? 1:0);        
+        }
+
+        //-- find out if drive runs a rugged FS (debug mode only)
+        const TInt KControlIoIsRugged=4;
+        TUint8 ruggedFS;
+        TPtr8 pRugged(&ruggedFS, 1, 1);
+        nRes=aFs.ControlIo(aDrvNum, KControlIoIsRugged, pRugged);
+        if(nRes == KErrNone)
+        {
+            Buf.AppendFormat(_L(", Rugged:%d"), ruggedFS ? 1:0);        
+        }
+
+        Buf.Append(_L("\n"));
+        apConsole->Printf(Buf);
+
 
 	    //-- print the FS name
 	    if(aFs.FileSystemName(Buf, aDrvNum) == KErrNone)
@@ -1154,19 +1176,36 @@
 
 
 
-            //-- print out FileSystem volume finalisation info
+            
             if(bVolumeOK && (aFlags & EFSInfoEx))
             {
-
+                Buf.Zero();
+
+                //-- print out FileSystem volume finalisation info
                 TPckgBuf<TBool> boolPckg;
                 nRes = aFs.QueryVolumeInfoExt(aDrvNum, EIsDriveFinalised, boolPckg);
                 if(nRes == KErrNone)
                 {
                     if(boolPckg() >0)
-                        apConsole->Printf(_L("Volume Finalised\n"));
+                        Buf.Copy(_L("Volume: Finalised"));
                     else
-                        apConsole->Printf(_L("Volume Not finalised\n"));
+                        Buf.Copy(_L("Volume: Not finalised"));
                 }
+
+                //-- print out cluster size that FS reported
+                TVolumeIOParamInfo volIoInfo;
+                nRes = aFs.VolumeIOParam(aDrvNum, volIoInfo);
+                if(nRes == KErrNone && volIoInfo.iClusterSize >= 512)
+                {
+                    Buf.AppendFormat(_L(", Cluster Sz:%d"), volIoInfo.iClusterSize);
+                }
+
+                if(Buf.Length())
+                {
+                    Buf.Append(_L("\n"));
+                    apConsole->Printf(Buf);    
+                }
+
             }
 	    }
     }//if(aFlags & EFSInfo)
--- a/userlibandfileserver/fileserver/fs_utils/filesystem_utils.inl	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/fs_utils/filesystem_utils.inl	Wed Mar 31 23:38:45 2010 +0300
@@ -54,7 +54,10 @@
 inline TBool IsPowerOf2(TUint32 aVal)
     {
     if (aVal==0)
+        {
+        ASSERT(0);
         return EFalse;
+        }
 
     return !(aVal & (aVal-1));
     }
@@ -67,7 +70,10 @@
 inline TBool IsPowerOf2_64(TUint64 aVal)
     {
     if (aVal==0)
+        {
+        ASSERT(0);
         return EFalse;
+        }
 
     return !(aVal & (aVal-1));
 
--- a/userlibandfileserver/fileserver/group/release.txt	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/group/release.txt	Wed Mar 31 23:38:45 2010 +0300
@@ -1,3 +1,82 @@
+Version 2.00.2048
+=================
+(Made by vfebvre 15/03/2010)
+
+1.	niccox
+	1.	DEF144933 Improper Mass Storage Error Code for Empty Drive case
+
+
+Version 2.00.2047
+=================
+(Made by vfebvre 12/03/2010)
+
+1.	famustaf
+	1.	MINOR_CHANGE Updated RFs::ScanDrive and RFs::CheckDisk Documentation
+
+
+Version 2.00.2046
+=================
+(Made by vfebvre 10/03/2010)
+
+1.	frhofman
+	1.	PDEF144910: Revert IsFileOpen() behaviour to perform file existance check
+	2.	DEF144911: SALM-82WCVK: efile.exe crashes in dynamic dir cache code when out-of-memory
+
+
+Version 2.00.2045
+=================
+(Made by vfebvre 08/03/2010)
+
+1.	shamaden
+	1.	DEF144753 Crash when usb memory is dismounted during copy
+
+2.	dlyokhin
+	1.	DEF144750 FAT: unable to mount volume larger than 1TB  
+
+
+Version 2.00.2044
+=================
+(Made by vfebvre 05/03/2010)
+
+1.	niccox
+	1.	DEF144749 Transcend flash drive not recognised 
+
+
+Version 2.00.2043
+=================
+(Made by vfebvre 04/03/2010)
+
+1.	dlyokhin
+	1.	DEF144779 exFAT: T_chkUID test failure  
+
+
+Version 2.00.2042
+=================
+(Made by vfebvre 03/03/2010)
+
+1.	niccox
+	1.	DEF144548 Initialisation of MaxLun if USB device stalls request
+
+
+Version 2.00.2041
+=================
+(Made by vfebvre 02/03/2010)
+
+1.	dlyokhin
+	1.	DEF144598 FAT leaf directory cache should be enabled by default  
+
+
+Version 2.00.2040
+=================
+(Made by vfebvre 26/02/2010)
+
+1.	famustaf
+	1.	DEF144608 Missing Trap in a non-leaving function.
+
+2.	dlyokhin
+	1.	PDEF144630 Better checks in CFat16FixedCache code 
+
+
 Version 2.00.2039
 =================
 (Made by vfebvre 23/02/2010)
--- a/userlibandfileserver/fileserver/inc/f32ver.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/inc/f32ver.h	Wed Mar 31 23:38:45 2010 +0300
@@ -58,6 +58,6 @@
 
 @see TVersion
 */
-const TInt KF32BuildVersionNumber=2039;
+const TInt KF32BuildVersionNumber=2048;
 //
 #endif
--- a/userlibandfileserver/fileserver/sfat32/common_constants.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/common_constants.h	Wed Mar 31 23:38:45 2010 +0300
@@ -115,12 +115,12 @@
 const TUint8 KEntryErasedMarker=0xE5;           ///< Erased entry marker for a directory entry
 
 
-const TInt EOF_32Bit =0x0fffffff;   ///< End of cluster chain value for Fat32
-const TInt EOF_16Bit =0xffff;       ///< End of cluster chain value for Fat16
-const TInt EOF_12Bit =0xfff;        ///< End of cluster chain value for Fat12
-const TInt KBad_32Bit=0x0ffffff7;   ///< Bad cluster value for Fat32
-const TInt KBad_16Bit=0xfff7;       ///< Bad cluster value for Fat16
-const TInt KBad_12Bit=0xff7;        ///< bad cluster value for Fat12
+const TUint EOF_32Bit =0x0fffffff;   ///< End of cluster chain value for Fat32
+const TUint EOF_16Bit =0xffff;       ///< End of cluster chain value for Fat16
+const TUint EOF_12Bit =0xfff;        ///< End of cluster chain value for Fat12
+const TUint KBad_32Bit=0x0ffffff7;   ///< Bad cluster value for Fat32
+const TUint KBad_16Bit=0xfff7;       ///< Bad cluster value for Fat16
+const TUint KBad_12Bit=0xff7;        ///< bad cluster value for Fat12
 
 const TUint   KSpareCluster = 0;          ///< FAT entry value for the spare cluster
 const TUint32 KFatFirstSearchCluster = 2; ///< FAT usable clusters start from 2; FAT[0] and FAT[1] are reserved
--- a/userlibandfileserver/fileserver/sfat32/fat_config.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/fat_config.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -64,7 +64,7 @@
 
 
 //=======================================================================================================================
-//-- FAT directory cache settings
+//-- plain old FAT directory cache settings
 //=======================================================================================================================
 //-- FAT_DirCache <CacheSizeKB>,<Log2(max page size)>
 //-- e.g:   FAT_DirCache 16,12
@@ -102,10 +102,10 @@
 //=======================================================================================================================
 //-- A leaf directory cache for Fat volumes
 _LIT8(KPN_FAT_LeafDirCache, "FAT_LeafDirCacheSize"); 
-static const TUint32 KDef_KLeafDirCacheSize = 1;    //-- default number of the most recently visited leaf dirs to be cached
+static const TUint32 KDef_KLeafDirCacheSize = 32;    //-- default number of the most recently visited leaf dirs to be cached
 
 //=======================================================================================================================
-//-- New directory cache settings
+//-- DP directory cache settings
 //=======================================================================================================================
 //-- New directory cache uses the global cache memory manager for dynamic size allocation
 _LIT8(KPN_FAT_DynamicDirCacheMin, "FAT_DirCacheSizeMin"); 
@@ -116,12 +116,6 @@
                                                                 //  maximal size Log2, 2^14 (16K) by default
 
 
-
-
-
-
-
-
 //########################################################################################################################
 
 
@@ -358,6 +352,7 @@
 #ifdef _DEBUG
 
     ASSERT(iInitialised);
+    __PRINT(_L("\n\n"));
     __PRINT(_L("#>- TFatConfig parameters:\n"));
 
     DoDumpUintParam(KPN_ScanDrvSkipFinalisedVolume, iScanDrvSkipFinalisedVolume);
@@ -376,6 +371,12 @@
     DoDumpUintParam(_L8("FAT_32Cache RdGr Log2"), iFat32LRUCacheReadGrLog2);
     DoDumpUintParam(_L8("FAT_32Cache WrGr Log2"), iFat32LRUCacheWriteGrLog2);
 
+    
+    DoDumpUintParam(KPN_FAT_LeafDirCache,       iLeafDirCacheSize);
+    DoDumpUintParam(KPN_FAT_DynamicDirCacheMin, iDynamicDirCacheSizeMinKB);
+    DoDumpUintParam(KPN_FAT_DynamicDirCacheMax, iDynamicDirCacheSizeMaxKB);
+    DoDumpUintParam(_L8("DynamicDirCacheMaxPageSizeLog2"), iDynamicDirCacheMaxPageSizeLog2);
+
     __PRINT(_L("#>------ end -------<#\n\n"));
 
 #endif
--- a/userlibandfileserver/fileserver/sfat32/fat_dir_entry.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/fat_dir_entry.h	Wed Mar 31 23:38:45 2010 +0300
@@ -29,7 +29,7 @@
 
 
 const TInt      KFatDirNameSize         = 11;   ///< Dos directory/File name length
-const TInt      KVFatEntryAttribute     = 0x0F;  ///< VFat entry attribute setting
+const TUint     KVFatEntryAttribute     = 0x0F;  ///< VFat entry attribute setting
 const TUint8    KDotEntryByte           = 0x2e;  ///< Dot value for self and parent pointer directory entries
 const TUint8    KBlankSpace             = 0x20;  ///< Blank space in a directory entry
 const TInt      KSizeOfFatDirEntryLog2  = 5;     ///< Log2 of size in bytes of a Fat directry entry 
@@ -74,35 +74,49 @@
     inline void InitZ();
 
     inline const TPtrC8 Name() const;
-    inline TInt Attributes() const;
+    inline void SetName(const TDesC8& aDes);
+
+    inline TUint Attributes() const;
+    inline void SetAttributes(TUint anAtt);
+
     inline TTime Time(TTimeIntervalSeconds aOffset) const;
-    inline TInt StartCluster() const;
+    inline void SetTime(TTime aTime, TTimeIntervalSeconds aOffset);
+    inline TBool IsTimeTheSame(TTime aTime, TTimeIntervalSeconds aOffset) const; 
+    
+
+    inline TUint32 StartCluster() const;
+    inline void SetStartCluster(TUint32 aStartCluster);
+
     inline TUint32 Size() const;
+    inline void SetSize(TUint32 aFilesize);
+
     inline TBool IsErased() const;
+    inline void SetErased();
+
     inline TBool IsCurrentDirectory() const;
+    inline void SetCurrentDirectory();
+
     inline TBool IsParentDirectory() const;
+    inline void SetParentDirectory();
+
     inline TBool IsEndOfDirectory() const;
+    inline void SetEndOfDirectory();
+
     inline TBool IsGarbage() const;
-    inline void SetName(const TDesC8& aDes);
-    inline void SetAttributes(TInt anAtt);
-    inline void SetTime(TTime aTime, TTimeIntervalSeconds aOffset);
+    
     inline void SetCreateTime(TTime aTime, TTimeIntervalSeconds aOffset);
-    inline void SetStartCluster(TInt aStartCluster);
-    inline void SetSize(TUint32 aFilesize);
-    inline void SetErased();
-    inline void SetCurrentDirectory();
-    inline void SetParentDirectory();
-    inline void SetEndOfDirectory();
-    inline TUint RuggedFatEntryId() const;
+
+    inline TUint16 RuggedFatEntryId() const;
     inline void  SetRuggedFatEntryId(TUint16 aId);
 
-public:
+    inline TInt NumFollowing() const;
+    inline TUint8 CheckSum() const;
+
     void SetVFatEntry(const TDesC& aName, TUint aRemainderLen, TUint8 aCheckSum);
     void ReadVFatEntry(TDes16& aVBuf) const;
+    
     inline TBool IsLongNameStart() const;
     inline TBool IsVFatEntry() const;
-    inline TInt NumFollowing() const;
-    inline TUint8 CheckSum() const;
 
 
 public:
--- a/userlibandfileserver/fileserver/sfat32/fat_dir_entry.inl	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/fat_dir_entry.inl	Wed Mar 31 23:38:45 2010 +0300
@@ -53,7 +53,7 @@
 /**
 @return The attributes for the Directory entry
 */
-inline TInt TFatDirEntry::Attributes() const
+inline TUint TFatDirEntry::Attributes() const
     {return pDir->iAttributes;}
 /**
 @param aOffset This offset will be subtracted from the returned time.
@@ -67,7 +67,7 @@
 /**
 @return The Start cluster for the file or directory for this entry 
 */
-inline TInt TFatDirEntry::StartCluster() const      
+inline TUint32 TFatDirEntry::StartCluster() const      
     {
     const TUint16 KStClustMaskHi = 0x0FFF;  
     return ((pDir->iStartClusterHi & KStClustMaskHi) << 16) | pDir->iStartClusterLo;
@@ -117,7 +117,7 @@
 
 @param anAtts The file or directory attributes
 */
-inline void TFatDirEntry::SetAttributes(TInt anAtts)
+inline void TFatDirEntry::SetAttributes(TUint anAtts)
     {
     __ASSERT_DEBUG(!(anAtts&~KMaxTUint8),Fault(EFatBadDirEntryParameter));
     pDir->iAttributes=(TUint8)anAtts;
@@ -147,7 +147,7 @@
 
 @param aStartCluster The start cluster number
 */
-inline void TFatDirEntry::SetStartCluster(TInt aStartCluster)
+inline void TFatDirEntry::SetStartCluster(TUint32 aStartCluster)
     {
     pDir->iStartClusterLo=(TUint16)(aStartCluster);
     pDir->iStartClusterHi=(TUint16)(aStartCluster >> 16);
@@ -192,7 +192,7 @@
     Get VFAT entry ID. Uset by Rugged FAT and Scan Drive to fix broken entries
     Uses 1 byte from "Last Access Date" field, offset 19. Hack.
 */
-TUint TFatDirEntry::RuggedFatEntryId() const
+TUint16 TFatDirEntry::RuggedFatEntryId() const
     {
     return pDir->iReserved2;
     }
@@ -243,6 +243,28 @@
 
 
 
+//-----------------------------------------------------------------------------
+/**
+    Checks if the entry has the same "modification time" as given (with 2 seconds granularity precision, see FAT specs). 
+    
+    @param  aTime   time to check
+    @param  aOffset time offset
+
+    @return ETrue if the given time+offset is the same (with 2 second granularity) as the one set in the entry.
+*/
+inline TBool TFatDirEntry::IsTimeTheSame(TTime aTime, TTimeIntervalSeconds aOffset) const
+    {
+    aTime+=aOffset;
+
+    const TUint16 time = (TUint16)DosTimeFromTTime(aTime);
+    if(time != pDir->iTime)
+        return EFalse;
+
+    const TUint16 date = (TUint16)DosDateFromTTime(aTime);
+    return (date == pDir->iDate);
+    }
+
+
 #endif //FAT_DIR_ENTRY_INL
 
 
--- a/userlibandfileserver/fileserver/sfat32/fat_table32.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/fat_table32.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -264,35 +264,39 @@
 //-----------------------------------------------------------------------------
 
 /**
-Count the number of contiguous cluster from a start cluster
+    Count the number of continuous cluster from a start cluster in FAT table.
 
 @param aStartCluster cluster to start counting from
-@param anEndCluster contains the end cluster number upon return
+    @param  aEndCluster     contains the end cluster number upon return
 @param aMaxCount Maximum cluster required
-@leave System wide error values
-@return Number of contiguous clusters from aStartCluster.
+    @return Number of continuous clusters from aStartCluster.
 */
-TInt CFatTable::CountContiguousClustersL(TUint32 aStartCluster,TInt& anEndCluster,TUint32 aMaxCount) const
+TUint32 CFatTable::CountContiguousClustersL(TUint32 aStartCluster, TUint32& aEndCluster, TUint32 aMaxCount) const
 	{
 	__PRINT2(_L("CFatTable::CountContiguousClustersL() start:%d, max:%d"),aStartCluster, aMaxCount);
-	TUint32 clusterListLen=1;
-	TInt endCluster=aStartCluster;
-	TInt64 endClusterPos=DataPositionInBytes(endCluster);
-	while (clusterListLen<aMaxCount)
-		{
-		TInt oldCluster=endCluster;
-		TInt64 oldClusterPos=endClusterPos;
-		if (GetNextClusterL(endCluster)==EFalse || (endClusterPos=DataPositionInBytes(endCluster))!=(oldClusterPos+(1<<iOwner->ClusterSizeLog2())))
-			{
-			endCluster=oldCluster;
-			break;
-			}
-		clusterListLen++;
-		}
-	anEndCluster=endCluster;
-	return(clusterListLen);
+
+    ASSERT(ClusterNumberValid(aStartCluster));
+
+    TUint32 currClusterNo = aStartCluster;
+    
+    TUint32 clusterListLen;
+    for(clusterListLen=1; clusterListLen < aMaxCount; ++clusterListLen)
+        {
+        TUint32 nextClusterNo = currClusterNo;
+
+        if(!GetNextClusterL(nextClusterNo))
+            break; //-- end of cluster chain
+            
+        if(nextClusterNo != currClusterNo+1)
+            break; //-- not the next cluster
+      
+        currClusterNo = nextClusterNo;
+        }
+
+    aEndCluster = aStartCluster+clusterListLen-1;
+
+    return clusterListLen;
 	}	
-
 //-----------------------------------------------------------------------------
 
 /**
@@ -303,7 +307,7 @@
 
     @leave KErrDiskFull + system wide error codes
 */
-void CFatTable::ExtendClusterListL(TUint32 aNumber,TInt& aCluster)
+void CFatTable::ExtendClusterListL(TUint32 aNumber, TUint32& aCluster)
 	{
 	__PRINT2(_L("CFatTable::ExtendClusterListL() num:%d, clust:%d"), aNumber, aCluster);
 	__ASSERT_DEBUG(aNumber>0,Fault(EFatBadParameter));
@@ -385,9 +389,9 @@
 		User::Leave(KErrDiskFull);
 		}
 
-	TInt firstCluster = aNearestCluster = AllocateSingleClusterL(aNearestCluster);
+	TUint32 firstCluster = aNearestCluster = AllocateSingleClusterL(aNearestCluster);
 	if (aNumber>1)
-		ExtendClusterListL(aNumber-1, (TInt&)aNearestCluster);
+		ExtendClusterListL(aNumber-1, aNearestCluster);
 
     return(firstCluster);
 	}	
@@ -491,7 +495,7 @@
     TUint32 cntFreedClusters = 0;
 
     TUint32 currCluster = aCluster;
-    TInt    nextCluster = aCluster;
+    TUint32 nextCluster = aCluster;
 
     for(;;)
     {
@@ -1740,7 +1744,7 @@
     @param aCluster number to read, contains next cluster upon return
     @return False if end of cluster chain
 */
-TBool CFatTable::GetNextClusterL(TInt& aCluster) const
+TBool CFatTable::GetNextClusterL(TUint32& aCluster) const
     {
 	__PRINT1(_L("CAtaFatTable::GetNextClusterL(%d)"), aCluster);
     
--- a/userlibandfileserver/fileserver/sfat32/inc/fat_table32.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/inc/fat_table32.h	Wed Mar 31 23:38:45 2010 +0300
@@ -160,8 +160,10 @@
     TInt64 DataPositionInBytes(TUint32 aCluster) const;
     void FreeClusterListL(TUint32 aCluster);
     TUint32 AllocateSingleClusterL(TUint32 aNearestCluster);
-    void ExtendClusterListL(TUint32 aNumber,TInt& aCluster);
+    void ExtendClusterListL(TUint32 aNumber, TUint32& aCluster);
     TUint32 AllocateClusterListL(TUint32 aNumber,TUint32 aNearestCluster);
+    
+    virtual TUint32 CountContiguousClustersL(TUint32 aStartCluster, TUint32& anEndCluster, TUint32 aMaxCount) const;
 
 private:
     CRamFatTable(CFatMountCB& aOwner);
--- a/userlibandfileserver/fileserver/sfat32/inc/sl_bpb.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/inc/sl_bpb.h	Wed Mar 31 23:38:45 2010 +0300
@@ -30,7 +30,7 @@
 const TInt KVolumeLabelSize			=11;    ///< Volume lable size
 const TInt KFileSysTypeSize			=8;     ///< File system type parameter size
 const TInt KVendorIdSize			=8;     ///< Vendor ID parameter size
-const TInt KBootSectorSignature		=0xAA55;///< File system Boot sector signiture
+const TUint16 KBootSectorSignature	=0xAA55;///< File system Boot sector signiture
 const TInt KFat16VolumeLabelPos 	=43;    ///< Position of volume lable in BPB for Fat12/16
 const TInt KFat32VolumeLabelPos		=71;    ///< Position of volume lable in BPB for Fat32
 const TInt KSizeOfFatBootSector     = 90;   ///< Size in bytes of Boot sector parameter block (BPB) 
@@ -57,23 +57,23 @@
 	//-- simple getters / setters
     inline const TPtrC8 VendorId() const;
 	inline TUint16 BytesPerSector() const;
-	inline TInt SectorsPerCluster() const;
-	inline TInt ReservedSectors() const;
-	inline TInt NumberOfFats() const;
-	inline TInt RootDirEntries() const;
-	inline TInt TotalSectors() const;
+	inline TUint8 SectorsPerCluster() const;
+	inline TUint16 ReservedSectors() const;
+	inline TUint8 NumberOfFats() const;
+	inline TUint16 RootDirEntries() const;
+	inline TUint16 TotalSectors() const;
 	inline TUint8 MediaDescriptor() const;
-	inline TInt FatSectors() const;
-	inline TInt SectorsPerTrack() const;
-	inline TInt NumberOfHeads() const;
-	inline TInt HiddenSectors() const;
-	inline TInt HugeSectors() const;
-	inline TInt PhysicalDriveNumber() const;
-	inline TInt ExtendedBootSignature() const;
+	inline TUint16 FatSectors() const;
+	inline TUint16 SectorsPerTrack() const;
+	inline TUint16 NumberOfHeads() const;
+	inline TUint32 HiddenSectors() const;
+	inline TUint32 HugeSectors() const;
+	inline TUint8 PhysicalDriveNumber() const;
+	inline TUint8 ExtendedBootSignature() const;
 	inline TUint32 UniqueID() const;
 	inline const TPtrC8 VolumeLabel() const;
 	inline const TPtrC8 FileSysType() const;
-	inline TInt BootSectorSignature() const;
+	inline TUint16 BootSectorSignature() const;
 	inline TUint32 FatSectors32() const;	
 	inline TUint16 FATFlags() const;		
 	inline TUint16 VersionNumber() const;		
@@ -83,21 +83,21 @@
 
 	inline void SetJumpInstruction();
 	inline void SetVendorID(const TDesC8& aDes);
-	inline void SetBytesPerSector(TInt aBytesPerSector);
-	inline void SetSectorsPerCluster(TInt aSectorsPerCluster);
-	inline void SetReservedSectors(TInt aReservedSectors);
-	inline void SetNumberOfFats(TInt aNumberOfFats);
-	inline void SetRootDirEntries(TInt aRootDirEntries);
-	inline void SetTotalSectors(TInt aTotalSectors);
+	inline void SetBytesPerSector(TUint16 aBytesPerSector);
+	inline void SetSectorsPerCluster(TUint aSectorsPerCluster);
+	inline void SetReservedSectors(TUint aReservedSectors);
+	inline void SetNumberOfFats(TUint8 aNumberOfFats);
+	inline void SetRootDirEntries(TUint16 aRootDirEntries);
+	inline void SetTotalSectors(TUint aTotalSectors);
 	inline void SetMediaDescriptor(TUint8 aMediaDescriptor);
-	inline void SetFatSectors(TInt aFatSectors);
-	inline void SetSectorsPerTrack(TInt aSectorsPerTrack);
-	inline void SetNumberOfHeads(TInt aNumberOfHeads);
+	inline void SetFatSectors(TUint aFatSectors);
+	inline void SetSectorsPerTrack(TUint16 aSectorsPerTrack);
+	inline void SetNumberOfHeads(TUint16 aNumberOfHeads);
 	inline void SetHiddenSectors(TUint32 aHiddenSectors);
 	inline void SetHugeSectors(TUint32 aTotalSectors);
 	inline void SetPhysicalDriveNumber(TInt aPhysicalDriveNumber);
 	inline void SetReservedByte(TUint8 aReservedByte);
-	inline void SetExtendedBootSignature(TInt anExtendedBootSignature);
+	inline void SetExtendedBootSignature(TUint8 anExtendedBootSignature);
 	inline void SetUniqueID(TUint32 anUniqueID);
 	inline void SetVolumeLabel(const TDesC8& aDes);
 	inline void SetFileSysType(const TDesC8& aDes);
--- a/userlibandfileserver/fileserver/sfat32/inc/sl_bpb.inl	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/inc/sl_bpb.inl	Wed Mar 31 23:38:45 2010 +0300
@@ -131,35 +131,35 @@
 
 @return iSectorsPerCluster
 */
-inline TInt TFatBootSector::SectorsPerCluster() const
+inline TUint8 TFatBootSector::SectorsPerCluster() const
 	{return iSectorsPerCluster;}
 /**
 Returns the number of reserved sectors on the volume
 
 @return iReservedSectors
 */
-inline TInt TFatBootSector::ReservedSectors() const
+inline TUint16 TFatBootSector::ReservedSectors() const
 	{return iReservedSectors;}
 /**
 Returns the number of Fats on the volume
 
 @return iNumberOfFats
 */
-inline TInt TFatBootSector::NumberOfFats() const
+inline TUint8 TFatBootSector::NumberOfFats() const
 	{return iNumberOfFats;}
 /**
 Returns the number of entries allowed in the root directory, specific to Fat12/16, zero for FAT32
 
 @return iRootDirEntries
 */
-inline TInt TFatBootSector::RootDirEntries() const
+inline TUint16 TFatBootSector::RootDirEntries() const
 	{return iRootDirEntries;}
 /**
 Returns the total sectors on the volume, zero for FAT32
 
 @return iTotalSectors
 */
-inline TInt TFatBootSector::TotalSectors() const
+inline TUint16 TFatBootSector::TotalSectors() const
 	{return iTotalSectors;}
 /**
 Returns the media descriptor
@@ -173,49 +173,49 @@
 
 @return iFatSectors
 */
-inline TInt TFatBootSector::FatSectors() const
+inline TUint16 TFatBootSector::FatSectors() const
 	{return iFatSectors;}
 /**
 Returns sectors per track
 
 @return iSectorsPerTrack
 */
-inline TInt TFatBootSector::SectorsPerTrack() const
+inline TUint16 TFatBootSector::SectorsPerTrack() const
 	{return iSectorsPerTrack;}
 /**
 Returns the number of heads 
 
 @return iNumberOfHeads
 */
-inline TInt TFatBootSector::NumberOfHeads() const
+inline TUint16 TFatBootSector::NumberOfHeads() const
 	{return iNumberOfHeads;}
 /**
 Returns the number of hidden sectors in the volume
 
 @return iHiddenSectors
 */
-inline TInt TFatBootSector::HiddenSectors() const
+inline TUint32 TFatBootSector::HiddenSectors() const
 	{return iHiddenSectors;}
 /**
 Returns total sectors in the volume, Used if totalSectors > 65535
 
 @return iHugeSectors
 */
-inline TInt TFatBootSector::HugeSectors() const
+inline TUint32 TFatBootSector::HugeSectors() const
 	{return iHugeSectors;}
 /**
 Returns the physical drive number, not used in Symbian OS
 
 @return iPhysicalDriveNumber
 */
-inline TInt TFatBootSector::PhysicalDriveNumber() const
+inline TUint8 TFatBootSector::PhysicalDriveNumber() const
 	{return iPhysicalDriveNumber;}
 /**
 Returns the extended boot signiture
 
 @return iExtendedBootSignature
 */
-inline TInt TFatBootSector::ExtendedBootSignature() const
+inline TUint8 TFatBootSector::ExtendedBootSignature() const
 	{return iExtendedBootSignature;}
 /**
 Returns the unique volume ID
@@ -243,7 +243,7 @@
 
 @return KBootSectorSignature
 */
-inline TInt TFatBootSector::BootSectorSignature() const
+inline TUint16 TFatBootSector::BootSectorSignature() const
 	{return KBootSectorSignature;}
 /**
 Set the jump instruction 
@@ -266,17 +266,17 @@
 
 @param aBytesPerSector Number of bytes per sector
 */
-inline void TFatBootSector::SetBytesPerSector(TInt aBytesPerSector)
+inline void TFatBootSector::SetBytesPerSector(TUint16 aBytesPerSector)
 	{
 	__ASSERT_DEBUG(!(aBytesPerSector&~KMaxTUint16),Fault(EFatBadBootSectorParameter));
-	iBytesPerSector=(TUint16)aBytesPerSector;
+	iBytesPerSector=aBytesPerSector;
 	}
 /**
 Set the sectors per cluster ratio
 
 @param aSectorsPerCluster Number of sectors per cluster
 */
-inline void TFatBootSector::SetSectorsPerCluster(TInt aSectorsPerCluster)
+inline void TFatBootSector::SetSectorsPerCluster(TUint aSectorsPerCluster)
 	{
 	__ASSERT_DEBUG(!(aSectorsPerCluster&~KMaxTUint8),Fault(EFatBadBootSectorParameter));
 	iSectorsPerCluster=(TUint8)aSectorsPerCluster;
@@ -286,7 +286,7 @@
 
 @param aReservedSectors Number of reserved sectors
 */
-inline void TFatBootSector::SetReservedSectors(TInt aReservedSectors)
+inline void TFatBootSector::SetReservedSectors(TUint aReservedSectors)
 	{
 	__ASSERT_DEBUG(!(aReservedSectors&~KMaxTUint16),Fault(EFatBadBootSectorParameter));
 	iReservedSectors=(TUint16)aReservedSectors;
@@ -296,27 +296,27 @@
 
 @param aNumberOfFats Number of fats
 */
-inline void TFatBootSector::SetNumberOfFats(TInt aNumberOfFats)
+inline void TFatBootSector::SetNumberOfFats(TUint8 aNumberOfFats)
 	{
 	__ASSERT_DEBUG(!(aNumberOfFats&~KMaxTUint8),Fault(EFatBadBootSectorParameter));
-	iNumberOfFats=(TUint8)aNumberOfFats;
+	iNumberOfFats=aNumberOfFats;
 	}
 /**
 Number of entries allowed in the root directory, specific to Fat12/16, zero for FAT32
 
 @param aRootDirEntries
 */
-inline void TFatBootSector::SetRootDirEntries(TInt aRootDirEntries)
+inline void TFatBootSector::SetRootDirEntries(TUint16 aRootDirEntries)
 	{
 	__ASSERT_DEBUG(!(aRootDirEntries&~KMaxTUint16),Fault(EFatBadBootSectorParameter));
-	iRootDirEntries=(TUint16)aRootDirEntries;
+	iRootDirEntries=aRootDirEntries;
 	}
 /**
 Total sectors on the volume, zero for FAT32
 
 @param aTotalSectors Total number of sectors
 */
-inline void TFatBootSector::SetTotalSectors(TInt aTotalSectors)
+inline void TFatBootSector::SetTotalSectors(TUint aTotalSectors)
 	{
 	__ASSERT_DEBUG(!(aTotalSectors&~KMaxTUint16),Fault(EFatBadBootSectorParameter));
 	iTotalSectors=(TUint16)aTotalSectors;
@@ -333,7 +333,7 @@
 
 @param aFatSectors Number of Fat sectors
 */
-inline void TFatBootSector::SetFatSectors(TInt aFatSectors)
+inline void TFatBootSector::SetFatSectors(TUint aFatSectors)
 	{
 	__ASSERT_DEBUG(!(aFatSectors&~KMaxTUint16),Fault(EFatBadBootSectorParameter));
 	iFatSectors=(TUint16)aFatSectors;
@@ -343,20 +343,20 @@
 
 @param aSectorsPerTrack Number of sectors per track
 */
-inline void TFatBootSector::SetSectorsPerTrack(TInt aSectorsPerTrack)
+inline void TFatBootSector::SetSectorsPerTrack(TUint16 aSectorsPerTrack)
 	{
 	__ASSERT_DEBUG(!(aSectorsPerTrack&~KMaxTUint16),Fault(EFatBadBootSectorParameter));
-	iSectorsPerTrack=(TUint16)aSectorsPerTrack;
+	iSectorsPerTrack=aSectorsPerTrack;
 	}
 /**
 Set the number of heads
 
 @param aNumberOfHeads Number of heads
 */
-inline void TFatBootSector::SetNumberOfHeads(TInt aNumberOfHeads)
+inline void TFatBootSector::SetNumberOfHeads(TUint16 aNumberOfHeads)
 	{
 	__ASSERT_DEBUG(!(aNumberOfHeads&~KMaxTUint16),Fault(EFatBadBootSectorParameter));
-	iNumberOfHeads=(TUint16)aNumberOfHeads;
+	iNumberOfHeads=aNumberOfHeads;
 	}
 /**
 Set the number of hidden sectors in the volume
@@ -373,7 +373,9 @@
 @param aHugeSectors
 */
 inline void TFatBootSector::SetHugeSectors(TUint32 aHugeSectors)
-	{iHugeSectors=aHugeSectors;}
+	{
+    iHugeSectors=aHugeSectors;
+    }
 /**
 Physical drive number, not used in Symbian OS
 
@@ -390,16 +392,19 @@
 @param aReservedByte Value for reserved byte
 */
 inline void TFatBootSector::SetReservedByte(TUint8 aReservedByte)
-	{iReserved=aReservedByte;}
+	{
+    iReserved=aReservedByte;
+    }
+
 /**
 Set the extended boot signiture
 
 @param anExtendedBootSignature The extended boot signiture
 */
-inline void TFatBootSector::SetExtendedBootSignature(TInt anExtendedBootSignature)
+inline void TFatBootSector::SetExtendedBootSignature(TUint8 anExtendedBootSignature)
 	{
 	__ASSERT_DEBUG(!(anExtendedBootSignature&~KMaxTUint8),Fault(EFatBadBootSectorParameter));
-	iExtendedBootSignature=(TUint8)anExtendedBootSignature;
+	iExtendedBootSignature=anExtendedBootSignature;
 	}
 /**
 Set the unique volume ID
--- a/userlibandfileserver/fileserver/sfat32/inc/sl_scandrv.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/inc/sl_scandrv.h	Wed Mar 31 23:38:45 2010 +0300
@@ -82,6 +82,9 @@
         EClusterAlreadyInUse,   ///< 2  cross-linked cluster chain
         EBadClusterValue,       ///< 3  also means "lost cluster"
         EInvalidEntrySize,      ///< 4  size of file/directory does not correspond to the cluster chain length
+        EEntrySetIncomplete,    ///< 5  incomplete VFAT entryset
+        EEntryBadAtt,           ///< 6  incorrect entry attributes
+
         
         EUnknownError = 95,     ///< unknown error
 
@@ -116,12 +119,12 @@
 
 	TUint32 ReadFatL(TUint aClusterNum) ;
 	void FindSameStartClusterL();
-	TInt FindStartClusterL(TInt aDirCluster);
+	TInt FindStartClusterL(TUint32 aDirCluster);
 	void CheckDirStructureL();
 	void CheckDirL(TUint32 aCluster);
 	void ProcessEntryL(const TFatDirEntry& aEntry);
 	TInt CheckEntryClusterL(const TFatDirEntry& aEntry, const TEntryPos& aEntryPos);
-	void RecordClusterChainL(TInt aCluster,TUint aSizeInBytes);
+	void RecordClusterChainL(TUint32 aCluster,TUint aSizeInBytes);
 	TBool MoveToVFatEndL(TEntryPos& aPos,TFatDirEntry& aEntry,TInt& aDirLength);
 	TBool IsValidVFatEntry(const TFatDirEntry& aEntry,TInt prevNum)const;
 	TBool IsDosEntry(const TFatDirEntry& aEntry)const;
--- a/userlibandfileserver/fileserver/sfat32/inc/sl_std.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/inc/sl_std.h	Wed Mar 31 23:38:45 2010 +0300
@@ -64,7 +64,7 @@
 	{
 public:
 	TEntryPos() : iCluster(EOF_32Bit), iPos(0) {}
-	TEntryPos(TInt aCluster,TUint aPos) : iCluster(aCluster), iPos(aPos) {}
+	TEntryPos(TUint aCluster,TUint aPos) : iCluster(aCluster), iPos(aPos) {}
 
     inline TUint32 Cluster() const;
     inline TUint32 Pos() const;
@@ -72,8 +72,8 @@
     inline void SetEndOfDir();
 
 public:
-	TInt iCluster;
-	TUint iPos;
+	TUint32 iCluster;
+	TUint32 iPos;
 	};
 
 
@@ -204,7 +204,7 @@
     virtual void InvalidateCacheL(TInt64 /*aPos*/,TUint32 /*aLength*/) {};
 
 	virtual void FreeClusterListL(TUint32 aCluster);
-	virtual void ExtendClusterListL(TUint32 aNumber,TInt& aCluster);
+	virtual void ExtendClusterListL(TUint32 aNumber, TUint32& aCluster);
 	
     virtual TUint32 AllocateSingleClusterL(TUint32 aNearestCluster);
 	virtual TUint32 AllocateClusterListL(TUint32 aNumber,TUint32 aNearestCluster);
@@ -218,13 +218,15 @@
     virtual void InitializeL();
     virtual TBool ConsistentState() const {return ETrue;} //-- dummy
 
+    virtual TUint32 CountContiguousClustersL(TUint32 aStartCluster, TUint32& anEndCluster, TUint32 aMaxCount) const;
+
     //-----------------------------------------------------------------
     //-- non-virtual interface
-    TBool GetNextClusterL(TInt& aCluster) const;
+    TBool GetNextClusterL(TUint32& aCluster) const;
     void WriteFatEntryEofL(TUint32 aFatIndex);
 
     void MarkAsBadClusterL(TUint32 aCluster);
-    TInt CountContiguousClustersL(TUint32 aStartCluster,TInt& anEndCluster, TUint32 aMaxCount) const;
+    
     
     inline TUint32 MaxEntries() const;
     
@@ -516,17 +518,17 @@
 
 	inline TBool ReadOnly(void) const;
     inline void  SetReadOnly(TBool aReadOnlyMode);
-	inline TInt StartCluster(const TFatDirEntry & anEntry) const;
+	inline TUint32 StartCluster(const TFatDirEntry & anEntry) const;
 	inline CRawDisk& RawDisk() const;
 	inline CFatFileSystem& FatFileSystem() const;
 	inline CFatTable& FAT() const;
-	inline TInt ClusterSizeLog2() const;
-	inline TInt SectorSizeLog2() const;
-	inline TInt TotalSectors() const;
-	inline TInt SectorsPerCluster() const;
-	inline TInt ClusterBasePosition() const;
-    inline TInt RootDirectorySector() const;
-    inline TUint RootDirEnd() const;
+	inline TUint32 ClusterSizeLog2() const;
+	inline TUint32 SectorSizeLog2() const;
+	inline TUint32 TotalSectors() const;
+	inline TUint32 SectorsPerCluster() const;
+	inline TUint32 ClusterBasePosition() const;
+    inline TUint32 RootDirectorySector() const;
+    inline TUint32 RootDirEnd() const;
     inline TUint32 RootClusterNum() const;
 
 	inline TFatType FatType() const;
@@ -534,33 +536,33 @@
     inline TBool Is32BitFat() const;
 
 	inline TUint32 MaxClusterNumber() const;
-	inline TInt StartOfFatInBytes() const;
+	inline TUint32 StartOfFatInBytes() const;
     inline TUint32 FirstFatSector() const;
 
-	inline TInt NumberOfFats() const;
-	inline TInt FatSizeInBytes() const;
-	inline TInt ClusterRelativePos(TInt aPos) const;
-	inline TUint StartOfRootDirInBytes() const;
+	inline TUint32 NumberOfFats() const;
+	inline TUint32 FatSizeInBytes() const;
+	inline TUint32 ClusterRelativePos(TUint32 aPos) const;
+	inline TUint32 StartOfRootDirInBytes() const;
 	inline TUint32 UsableClusters() const;
     inline TBool ClusterNumberValid(TUint32 aClusterNo) const;
-	inline TBool IsBadCluster(TInt aCluster) const;
+	inline TBool IsBadCluster(TUint32 aCluster) const;
 	
 	inline TBool IsRuggedFSys() const;
 	inline void SetRuggedFSys(TBool aVal);
 	inline TUint32 AtomicWriteGranularityLog2() const;
 
 	
-	inline TInt RootIndicator() const;
+	inline TUint32 RootIndicator() const;
 	
     inline TBool IsRootDir(const TEntryPos &aEntry) const;
 	inline CAsyncNotifier* Notifier() const;
 	inline TDriveInterface& DriveInterface() const;
 
-    inline TBool IsEndOfClusterCh(TInt aCluster) const;
-	inline void SetEndOfClusterCh(TInt &aCluster) const;
+    inline TBool IsEndOfClusterCh(TUint32 aCluster) const;
+	inline void SetEndOfClusterCh(TUint32 &aCluster) const;
 
     
-    void ReadUidL(TInt aCluster,TEntry& anEntry) const;
+    void ReadUidL(TUint32 aCluster,TEntry& anEntry) const;
 	
     void ReadDirEntryL(const TEntryPos& aPos,TFatDirEntry& aDirEntry) const;
 	void WriteDirEntryL(const TEntryPos& aPos,const TFatDirEntry& aDirEntry);
@@ -569,7 +571,8 @@
     void DirWriteL(const TEntryPos& aPos,const TDesC8& aDes);
 
 	void ReadFromClusterListL(TEntryPos& aPos,TInt aLength,const TAny* aTrg,const RMessagePtr2& aMessage,TInt anOffset) const;
-	void WriteToClusterListL(TEntryPos& aPos,TInt aLength,const TAny* aSrc,const RMessagePtr2& aMessage,TInt anOffset, TInt& aBadcluster, TInt &aGoodcluster);
+    void WriteToClusterListL(TEntryPos& aPos,TInt aLength,const TAny* aSrc,const RMessagePtr2& aMessage,TInt anOffset, TUint& aBadcluster, TUint& aGoodcluster);
+	
 	void MoveToNextEntryL(TEntryPos& aPos) const;
 	void MoveToDosEntryL(TEntryPos& aPos,TFatDirEntry& anEntry) const;
 	void EnlargeL(TInt aSize);
@@ -697,14 +700,16 @@
     void FindEntryStartL(const TDesC& aName,TUint anAtt,TFatDirEntry& anEntry,TEntryPos& aPos) const;
 
 	void CheckFatForLoopsL(const TFatDirEntry& anEntry) const;
-	void DoCheckFatForLoopsL(TInt aCluster,TInt& aPreviousCluster,TInt& aChangePreviousCluster,TInt& aCount) const;
+	void DoCheckFatForLoopsL(TUint32 aCluster, TUint32& aPreviousCluster, TUint32& aChangePreviousCluster, TUint32& aCount) const;
     void InitializeL(const TLocalDriveCaps& aLocDrvCaps, TBool aIgnoreFSInfo=EFalse);
+
 	void DoReadFromClusterListL(TEntryPos& aPos,TInt aLength,const TAny* aTrg,const RMessagePtr2& aMessage,TInt anOffset) const;
-	void DoWriteToClusterListL(TEntryPos& aPos,TInt aLength,const TAny* aSrc,const RMessagePtr2& aMessage,TInt anOffset, TInt aLastcluster, TInt& aBadcluster, TInt& aGoodcluster);
-	TBool IsUniqueNameL(const TShortName& aName,TInt aDirCluster);
+    void DoWriteToClusterListL(TEntryPos& aPos,TInt aLength,const TAny* aSrc,const RMessagePtr2& aMessage,TInt anOffset, TUint aLastcluster, TUint& aBadcluster, TUint& aGoodcluster);
+
+	TBool IsUniqueNameL(const TShortName& aName, TUint32 aDirCluster);
 	TBool FindShortNameL(const TShortName& aName,TEntryPos& anEntryPos);
 	void ReplaceClashingNameL(const TShortName& aNewName,const TEntryPos& anEntryPos);
-    TBool GenerateShortNameL(TInt aDirCluster,const TDesC& aLongName,TShortName& aShortName, TBool aForceRandomize=EFalse);
+    TBool GenerateShortNameL(TUint32 aDirCluster,const TDesC& aLongName,TShortName& aShortName, TBool aForceRandomize=EFalse);
     TInt FindLeafDirL(const TDesC& aName, TLeafDirData& aLeafDir) const;
 	
 	TInt GetDirEntry(TEntryPos& aPos,TFatDirEntry& aDosEntry,TFatDirEntry& aStartEntry,TDes& aLongFileName) const;
@@ -713,9 +718,9 @@
 	void WriteDirEntryL(TEntryPos& aPos,const TFatDirEntry& aFatDirEntry,const TDesC& aLongFileName);
 	void EraseDirEntryL(TEntryPos aPos,const TFatDirEntry& anEntry);
 	void EraseDirEntryL(const TEntryPos& aPos);
-	void InitializeFirstDirClusterL(TInt aCluster,TInt aParentCluster);
+	void InitializeFirstDirClusterL(TUint32 aCluster, TUint32 aParentCluster);
 	void AddDirEntryL(TEntryPos& aPos,TInt aNameLength);
-	void ZeroDirClusterL(TInt aCluster);
+	void ZeroDirClusterL(TUint32 aCluster);
 	
     TInt DoWriteBootSector(TInt64 aMediaPos, const TFatBootSector& aBootSector) const;
 	TInt DoReadBootSector(TInt64 aMediaPos, TFatBootSector& aBootSector) const;
@@ -724,8 +729,8 @@
     TInt WriteFSInfoSector(TInt64 aMediaPos, const TFSInfo& aFSInfo) const;
 	TInt ReadFSInfoSector(TInt64 aMediaPos, TFSInfo& aFSInfo) const;
 
-    TBool IsDirectoryEmptyL(TInt aCluster);
-	void ExtendClusterListZeroedL(TInt aNumber,TInt& aCluster);
+    TBool IsDirectoryEmptyL(TUint32 aCluster);
+	void ExtendClusterListZeroedL(TUint32 aNumber, TUint32& aCluster);
 	void WritePasswordData();
 	
     void WriteVolumeLabelL(const TDesC8& aVolumeLabel) const;
@@ -768,12 +773,10 @@
     TUint32  iFatEocCode;       ///< End Of Cluster Chain code, 0xff8 for FAT12, 0xfff8 for FAT16, and 0xffffff8 for FAT32 
 
     CLeafDirCache* iLeafDirCache;	///< A cache for most recently visited directories, only valid when limit is set bigger than 1
-    HBufC* iLastLeafDir;        	///< The last visited directory, only valid when limit of iLeafDirCache is less than 1 
-    TInt iLastLeafDirCluster;   	///< Cluster number of the last visited cluster, only valid when limit of iLeafDirCache is less than 1
 
 	TFatVolParam iVolParam;         ///< FAT volume parameters, populated form the boot sector values.
     
-	TInt iFirstFreeByte;            ///< First free byte in media (start of the data area on the volume)
+	TUint32 iFirstFreeByte;         ///< First free byte in media (start of the data area on the volume)
 	TUint32 iUsableClusters;        ///< Number of usable cluster on the volume 
 	
     CFatTable* iFatTable;           ///< Pointer to the volume Fat 
@@ -782,7 +785,6 @@
     CAsyncNotifier* iNotifier;  ///< Async notifier for notifying user of Fat error conditions 
 
     XDriveInterface iDriverInterface; ///< the object representing interface to the drive, provides read/write access and notifiers
-    TInt            iChkDiscRecLevel; ///< Check disk recursion level counter. A temporary measure. 
 	TFatConfig      iFatConfig;       ///< FAT parametrers from estart.txt
 
 	XFileCreationHelper iFileCreationHelper;
@@ -814,7 +816,7 @@
 	};
 
 
-
+//---------------------------------------------------------------------------------------------------------------------------------
 
 /**
 Fat file system file subsession implmentation, provides all that is required of a plug in
@@ -835,10 +837,7 @@
 	void FlushAllL();
 public:
 	void CheckPosL(TUint aPos);
-	void SetL(const TFatDirEntry& aFatDirEntry,TShare aShare,const TEntryPos& aPos);
-	void CreateSeekIndex();
-	
-    inline TBool IsSeekIndex() const;	
+	void SetupL(const TFatDirEntry& aFatDirEntry, const TEntryPos& aFileDosEntryPos);
 	
 	// from MBlockMapInterface
 	TInt BlockMap(SBlockMapInfo& aInfo, TInt64& aStartPos, TInt64 aEndPos);
@@ -859,26 +858,58 @@
 
 
     void FlushStartClusterL();
-	TInt SeekToPosition(TInt aNewCluster,TInt aClusterOffset);
-	void SetSeekIndexValueL(TInt aFileCluster,TInt aStoredCluster);
+	TInt SeekToPosition(TUint aNewCluster, TUint aClusterOffset);
+	void SetSeekIndexValueL(TUint aFileCluster,TUint aStoredCluster);
 	void ResizeIndex(TInt aNewMult,TUint aNewSize);
 	TInt CalcSeekIndexSize(TUint aSize);
 	TBool IsSeekBackwards(TUint aPos);
 	void ClearIndex(TUint aNewSize);
-	void DoSetSizeL(TUint aSize,TBool aIsSizeWrite);
+	void DoSetSizeL(TUint aSize, TBool aForceCachesFlush);
 	void WriteFileSizeL(TUint aSize);
 
+    //----------------------------
+    inline TUint32 FCB_StartCluster() const;
+    inline TUint32 FCB_FileSize() const; 
+
+    inline void  FCB_SetStartCluster(TUint32 aVal);
+    inline void  FCB_SetFileSize(TUint32 aVal);  
+
+    inline TBool FileAttModified() const;
+    inline void  IndicateFileAttModified(TBool aModified);
+    
+    inline TBool FileSizeModified() const;
+    inline void  IndicateFileSizeModified(TBool aModified);
+
+    inline TBool FileTimeModified() const;
+    inline void  IndicateFileTimeModified(TBool aModified);
+
+    //----------------------------
+
+	void CreateSeekIndex();
+
+    void DoShrinkFileToZeroSizeL();
+    void DoShrinkFileL(TUint32  aNewSize, TBool aForceCachesFlush);
+    void DoExpandFileL(TUint32 aNewSize, TBool aForceCachesFlush);
+
+
 private:
 
 	TUint32* iSeekIndex;    ///< Seek index into file
 	TInt iSeekIndexSize;    ///< size of seek index
-	TInt iStartCluster;     ///< Start cluster number of file
+	
+    TUint     iStartCluster;     ///< Start cluster number of file
 	TEntryPos iCurrentPos;  ///< Current position in file data
-	TEntryPos iFileDirPos;  ///< File directory entry position
-	TBool iFileSizeModified; 
+	
+    TEntryPos iFileDosEntryPos;  ///< File DOS dir. entry position
+	
+    TBool iFileSizeModified :1;  ///< flag, indicating that file size was modified and needs to be flushed onto the media (see FlushL())
+    TBool iFileTimeModified :1;  ///< flag, indicating that file modification time was modified and needs to be flushed onto the media (see FlushL())
+
 	};
 
 
+
+//---------------------------------------------------------------------------------------------------------------------------------
 /**
 Fat file system directory subsession implmentation, provides all that is required of a plug in
 file system directory as well as Fat specific functionality
@@ -932,12 +963,12 @@
 	void InitializeFormatDataL();
 	void DoZeroFillMediaL(TInt64 aStartPos, TInt64 aEndPos);
 
-    TInt InitFormatDataForVariableSizeDisk(TInt aDiskSizeInSectors);
-	TInt InitFormatDataForFixedSizeDiskNormal(TInt aDiskSizeInSectors, const TLocalDriveCapsV6& aCaps);
+    TInt InitFormatDataForVariableSizeDisk(TUint aDiskSizeInSectors);
+	TInt InitFormatDataForFixedSizeDiskNormal(TUint aDiskSizeInSectors, const TLocalDriveCapsV6& aCaps);
 	TInt InitFormatDataForFixedSizeDiskCustom(const TLDFormatInfo& aFormatInfo);
-    TInt InitFormatDataForFixedSizeDiskUser(TInt aDiskSizeInSectors);
-	void AdjustClusterSize(TInt aRecommendedSectorsPerCluster);
-	TInt AdjustFirstDataSectorAlignment(TInt aBlockSize);
+    TInt InitFormatDataForFixedSizeDiskUser(TUint aDiskSizeInSectors);
+	void AdjustClusterSize(TUint aRecommendedSectorsPerCluster);
+	TInt AdjustFirstDataSectorAlignment(TUint aBlockSize);
 	TInt FirstDataSector() const;
 
 	TInt HandleCorrupt(TInt aError);
@@ -945,9 +976,11 @@
     void TranslateL();
     TInt DoTranslate(TPtr8& aBuf, RArray<TInt>& aArray);
     void RecordOldInfoL();
-	TInt MaxFat12Sectors() const;
-	TInt MaxFat16Sectors() const;
-	TUint32 MaxFat32Sectors() const;
+	
+    TUint MaxFat12Sectors() const;
+	TUint MaxFat16Sectors() const;
+	TUint MaxFat32Sectors() const;
+	
 	inline TBool Is16BitFat() const;
 	inline TBool Is32BitFat() const;
 	inline CFatMountCB& FatMount();
@@ -957,19 +990,20 @@
 private:
 	
     TBool   iVariableSize;      ///< Flag to indicat if we are dealing with a variable size volume
-	TInt    iBytesPerSector;    ///< Byte per sector of media
+	
+    TUint16 iBytesPerSector;    ///< Byte per sector of media
     TInt    iSectorSizeLog2;    ///< Sector size in log2
-	TInt    iNumberOfFats;      ///< Number of Fats the volume will contain
-	TInt    iReservedSectors;   ///< Number of reserved sectors in the volume
-	TInt    iRootDirEntries;    ///< Nummer of root directory entries the root dir will have, specific to Fat12/16 volumes
-	TInt    iSectorsPerCluster; ///< Sector per cluster ration the volume will be formatted with
-	TInt    iSectorsPerFat;     ///< Number of sectors the Fat uses
-	TInt    iMaxDiskSectors;    ///< number of sectors the volume has
+	TUint8  iNumberOfFats;      ///< Number of Fats the volume will contain
+	TUint   iReservedSectors;   ///< Number of reserved sectors in the volume
+	TUint16 iRootDirEntries;    ///< Nummer of root directory entries the root dir will have, specific to Fat12/16 volumes
+	TUint   iSectorsPerCluster; ///< Sector per cluster ration the volume will be formatted with
+	TUint   iSectorsPerFat;     ///< Number of sectors the Fat uses
+	TUint32 iMaxDiskSectors;    ///< number of sectors the volume has
 	TFormatInfo iFormatInfo;    ///< format information for a custom format
 	TBuf8<16>   iFileSystemName;///< Buffer to contain the volume name 
 	TInt    iHiddenSectors;     ///< Number of hidden sectors in the volume
-	TInt    iNumberOfHeads;     ///< Number of heads the media device has, not used so far as only used on solid state media.
-	TInt    iSectorsPerTrack;   ///< Number of sectors the media device has, not used so far as only used on solid state media.
+	TUint16 iNumberOfHeads;     ///< Number of heads the media device has, not used so far as only used on solid state media.
+	TUint16 iSectorsPerTrack;   ///< Number of sectors the media device has, not used so far as only used on solid state media.
 	TUint32 iRootClusterNum;    ///< cluster number used for root directory, Fat32 specific
 	TUint32 iCountOfClusters;   ///< Count of clusters on the media
     RArray<TInt> iBadClusters;  ///< Array of bad cluster numbers
--- a/userlibandfileserver/fileserver/sfat32/inc/sl_std.inl	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/inc/sl_std.inl	Wed Mar 31 23:38:45 2010 +0300
@@ -61,43 +61,47 @@
     }
 
 
-inline TInt CFatMountCB::RootDirectorySector() const
-    {return iVolParam.RootDirectorySector();}
+inline TUint32 CFatMountCB::RootDirectorySector() const
+    {
+    return iVolParam.RootDirectorySector();
+    }
 
-inline TUint CFatMountCB::RootDirEnd() const
-    {return iVolParam.RootDirEnd();}
+inline TUint32 CFatMountCB::RootDirEnd() const
+    {
+    return iVolParam.RootDirEnd();
+    }
 
 inline TUint32 CFatMountCB::RootClusterNum() const
-    {return iVolParam.RootClusterNum(); }        
+    {
+    return iVolParam.RootClusterNum();
+    }        
 
 
-inline TInt CFatMountCB::StartCluster(const TFatDirEntry & anEntry) const
+inline TUint32 CFatMountCB::StartCluster(const TFatDirEntry & anEntry) const
 	{
 	if(Is32BitFat())	
 		return anEntry.StartCluster();
 	else
-		return 0xFFFF&anEntry.StartCluster();
+		return anEntry.StartCluster() & 0xFFFF;
 	}
 
 /**
 returns true for root dir on Fat12/16 (fixed root dir versions of Fat) false on fat32 
 this function is used to handle special cases for reading/writing the root directory on FAT via the use of cluster zero.
 
-@param aEntry position on volume being queried
-@return Whether Root dir position or not
+    @param entryPos     directory entry position
+    @return ETrue       if entryPos belongs to the FAT12/16 root directory
 */
-TBool CFatMountCB::IsRootDir(const TEntryPos &aEntry) const
+TBool CFatMountCB::IsRootDir(const TEntryPos &entryPos) const
 	{
-	if(Is32BitFat())
-		return EFalse;
-	else
-		return((aEntry.iCluster==0) ? (TBool)ETrue : (TBool)EFalse);	
+	//-- for FAT12/16 cluster 0 means "root directory"
+    return !(Is32BitFat() || entryPos.iCluster);
 	}
 /**
 Indicates the root directory cluster, For Fat12/16 root is always indicated by cluster number zero, on Fat32 the is a root cluster number
 @return The root cluster indicator
 */
-TInt CFatMountCB::RootIndicator() const
+TUint32 CFatMountCB::RootIndicator() const
 	{
 	if(Is32BitFat())
         return iVolParam.RootClusterNum();
@@ -107,24 +111,34 @@
 
 
 /** @return Log2 of cluster size on volume */
-TInt CFatMountCB::ClusterSizeLog2() const
-    {return(iVolParam.ClusterSizeLog2());}
+TUint32 CFatMountCB::ClusterSizeLog2() const
+    {
+    return(iVolParam.ClusterSizeLog2());
+    }
 
 /** @return Log2 of media sector size  */
-TInt CFatMountCB::SectorSizeLog2() const
-    {return(iVolParam.SectorSizeLog2());}
+TUint32 CFatMountCB::SectorSizeLog2() const
+    {
+    return(iVolParam.SectorSizeLog2());
+    }
 
 /** @return sector per cluster */
-TInt CFatMountCB::SectorsPerCluster() const
-    {return(1<<(iVolParam.ClusterSizeLog2()-iVolParam.SectorSizeLog2()));}
+TUint32 CFatMountCB::SectorsPerCluster() const
+    {
+    return(1<<(iVolParam.ClusterSizeLog2()-iVolParam.SectorSizeLog2()));
+    }
 
 /** @return the base position of a cluster */
-TInt CFatMountCB::ClusterBasePosition() const
-	{return(iFirstFreeByte);}
+TUint32 CFatMountCB::ClusterBasePosition() const
+	{
+    return(iFirstFreeByte);
+    }
 
 /** @return the offset into a cluster of a byte address */
-TInt CFatMountCB::ClusterRelativePos(TInt aPos) const
-	{return(aPos&((1<<ClusterSizeLog2())-1));}
+TUint32 CFatMountCB::ClusterRelativePos(TUint32 aPos) const
+	{
+    return(aPos & ((1<<ClusterSizeLog2())-1));
+    }
 
 /**
 Calculates the maximum number of clusters
@@ -134,29 +148,42 @@
     {return(TotalSectors()>>(ClusterSizeLog2()-SectorSizeLog2()));}
 
 /** @return the the total sectors on volume */
-TInt CFatMountCB::TotalSectors() const
-    {return iVolParam.TotalSectors();}
+TUint32 CFatMountCB::TotalSectors() const
+    {
+    return iVolParam.TotalSectors();
+    }
 
 /** @return total size of a Fat in bytes */
-TInt CFatMountCB::FatSizeInBytes() const
-    {return iVolParam.FatSizeInBytes();}
+TUint32 CFatMountCB::FatSizeInBytes() const
+    {
+    return iVolParam.FatSizeInBytes();
+    }
 
 /** @return first sector of the Fat */
 TUint32 CFatMountCB::FirstFatSector() const
-    {return iVolParam.FirstFatSector();}
+    {
+    return iVolParam.FirstFatSector();
+    }
 
 /** @return the byte offset of the Fat */
-TInt CFatMountCB::StartOfFatInBytes() const
-	{return(FirstFatSector()<<SectorSizeLog2());}
+TUint32 CFatMountCB::StartOfFatInBytes() const
+	{
+    return(FirstFatSector()<<SectorSizeLog2());
+    }
 
 /** @return Number of Fats used by the volume */
-TInt CFatMountCB::NumberOfFats() const
-    {return iVolParam.NumberOfFats();}
+TUint32 CFatMountCB::NumberOfFats() const
+    {
+    return iVolParam.NumberOfFats();
+    }
 
 
 /** @return refrence to the fat table owned by the mount */
 CFatTable& CFatMountCB::FAT() const
-	{return(*iFatTable);}
+	{
+    return(*iFatTable);
+    }
+
 /**
     @return refrence to the file system object that has produced this CFatMountCB
 */
@@ -173,8 +200,10 @@
 /**
 @return ETrue if aCluster value is bad cluster marker defined in FAT specification
 */
-TBool CFatMountCB::IsBadCluster(TInt aCluster) const
-	{return Is32BitFat() ? aCluster==0xFFFFFF7 : Is16BitFat() ? aCluster==0xFFF7 : aCluster==0xFF7;}
+TBool CFatMountCB::IsBadCluster(TUint32 aCluster) const
+	{
+    return Is32BitFat() ? aCluster==0xFFFFFF7 : Is16BitFat() ? aCluster==0xFFF7 : aCluster==0xFF7;
+    }
 
 /**
 Returns whether the current mount is running as rugged Fat or not, this is held in the file system object
@@ -195,7 +224,7 @@
     }
 
 /**
-    @return Log2(Meida atomic write granularity).
+    @return Log2(Media atomic write granularity).
     This is mostly to be used in Rugged FAT mode, see IsRuggedFSys(). For Rugged FAT the media shall support atomic writes.
     By default this is the sector (512 bytes)
 
@@ -208,11 +237,15 @@
 
 /** @return the usable clusters count for a volume */
 TUint32 CFatMountCB::UsableClusters() const
-	{return(iUsableClusters);}
+    {
+    return(iUsableClusters);
+    }
 
 
-TUint CFatMountCB::StartOfRootDirInBytes() const
-    {return iVolParam.RootDirectorySector()<<SectorSizeLog2();}
+TUint32 CFatMountCB::StartOfRootDirInBytes() const
+    {
+    return iVolParam.RootDirectorySector()<<SectorSizeLog2();
+    }
 
 
 /** @return FAT type for this mount */
@@ -234,7 +267,9 @@
 }
 
 CAsyncNotifier* CFatMountCB::Notifier() const
-	{return iNotifier;}	
+	{
+    return iNotifier;
+    }	
 
 
 
@@ -350,23 +385,19 @@
     @param  aCluster FAT table entry (cluster number) to check
     @return ETrue    if aCluster is a EOC for the FAT type being used by CFatMountCB
 */
-TBool CFatMountCB::IsEndOfClusterCh(TInt aCluster) const
+TBool CFatMountCB::IsEndOfClusterCh(TUint32 aCluster) const
 	{
     ASSERT(iFatEocCode);
-
-    if((TUint32)aCluster >= iFatEocCode)
-        return ETrue;
+    ASSERT((TUint32)aCluster <= iFatEocCode+7); //-- aCluster value is always masked accordingly.
 
-    ASSERT((TUint32)aCluster <= iFatEocCode+7);
-
-	return EFalse;
+    return (aCluster >= iFatEocCode);
     }
 
 /**
     Sets "End of Cluster Chain" value in aCluster depending on the FAT type.
     @param aCluster cluster to set to end of chain marker
 */
-void CFatMountCB::SetEndOfClusterCh(TInt &aCluster) const
+void CFatMountCB::SetEndOfClusterCh(TUint32 &aCluster) const
 	{
     ASSERT(iFatEocCode);
     aCluster = iFatEocCode+7;
@@ -484,12 +515,72 @@
 TInt CFatFileCB::ClusterSizeLog2()
 	{return(FatMount().ClusterSizeLog2());}
 
-/*
- Note: this replaces SeekIndex() which was only used in sl_mnt
- to verify whether the seek index had been created/initialised
+
+//---------------------------------------------------------------------------------------------------------------------------------
+TBool CFatFileCB::FileSizeModified() const 
+    {
+    return iFileSizeModified;
+    }  
+
+void CFatFileCB::IndicateFileSizeModified(TBool aModified) 
+    {
+    iFileSizeModified = aModified;
+    }
+
+//-----------------------------------------------------------------------------
+/** @return ETrue if file attributes' 'Modified' flag is set*/
+TBool CFatFileCB::FileAttModified() const 
+    {
+    return (Att() & KEntryAttModified);
+    }   
+
+/** 
+    Set or reset a flag indicating that file attributes had beed modified
+    @param aModified ETrue means that attributes are modified
 */
-inline TBool CFatFileCB::IsSeekIndex() const
-{return (iSeekIndex==NULL?(TBool)EFalse:(TBool)ETrue); }
+
+void  CFatFileCB::IndicateFileAttModified(TBool aModified)
+    {
+    if(aModified)
+        iAtt |= KEntryAttModified;
+    else
+        iAtt &= ~KEntryAttModified;
+    }
+
+TUint32 CFatFileCB::FCB_StartCluster() const
+    {
+    return iStartCluster;
+    }
+
+
+void CFatFileCB::FCB_SetStartCluster(TUint32 aVal)
+    {
+    ASSERT(aVal == 0 || (aVal >= KFatFirstSearchCluster));
+    iStartCluster = aVal;
+    }
+
+/** @return file size from CFileCB */
+TUint32 CFatFileCB::FCB_FileSize() const
+    {
+    return Size();
+    } 
+
+/** set file size in the CFileCB*/
+void CFatFileCB::FCB_SetFileSize(TUint32 aVal)
+    {
+    SetSize(aVal);
+    } 
+
+TBool CFatFileCB::FileTimeModified() const 
+    {
+    return iFileTimeModified;
+    }
+
+void  CFatFileCB::IndicateFileTimeModified(TBool aModified)
+    {
+    iFileTimeModified = aModified;
+    }
+
 
 
 //---------------------------------------------------------------------------------------------------------------------------------
--- a/userlibandfileserver/fileserver/sfat32/ram_fat_table32.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/ram_fat_table32.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -287,7 +287,7 @@
 
 /**
     Copy memory with filling the source buffer with zeroes. Target and source buffers can overlap.
-    Used on RAMDrive srinking in order to wipe data from the file that is being deleted.
+    Used on RAMDrive shrinking in order to wipe data from the file that is being deleted.
     
     @param   aTrg       pointer to the target address
     @param   aSrc       pointer to the destination address
@@ -391,7 +391,7 @@
     
     if (aNumber>1)
 	    {//-- if this part leaves (e.g. fail to expand the RAM drive), we will need to handle the first allocated EOC
-    	TRAPD(nRes, ExtendClusterListL(aNumber-1, (TInt&)aNearestCluster));
+    	TRAPD(nRes, ExtendClusterListL(aNumber-1, aNearestCluster));
         if(nRes != KErrNone)
             {
             __PRINT1(_L("CRamFatTable::AllocateClusterListL:ExtendClusterListL() failed with %d") ,nRes);
@@ -431,7 +431,7 @@
     @param aCluster     starting cluster number / ending cluster number after
     @leave KErrDiskFull + system wide error codes
 */
-void CRamFatTable::ExtendClusterListL(TUint32 aNumber, TInt& aCluster)
+void CRamFatTable::ExtendClusterListL(TUint32 aNumber, TUint32& aCluster)
     {
     __PRINT2(_L("CRamFatTable::ExtendClusterListL(%d, %d)"), aNumber, aCluster);
     __ASSERT_DEBUG(aNumber>0,Fault(EFatBadParameter));
@@ -479,8 +479,8 @@
         return; // File has no cluster allocated
 
     const TInt clusterShift=iOwner->ClusterSizeLog2();
-    TInt startCluster=aCluster;
-    TInt endCluster=0;
+    TUint32 startCluster=aCluster;
+    TUint32 endCluster=0;
     TInt totalFreed=0;
     TLinAddr srcEnd=0;
 
@@ -628,5 +628,27 @@
 #endif
     }
 
+TUint32 CRamFatTable::CountContiguousClustersL(TUint32 aStartCluster, TUint32& aEndCluster, TUint32 aMaxCount) const
+	{
+	__PRINT2(_L("CRamFatTable::CountContiguousClustersL() start:%d, max:%d"),aStartCluster, aMaxCount);
+	TUint32 clusterListLen=1;
+	TUint32 endCluster=aStartCluster;
+	TInt64 endClusterPos=DataPositionInBytes(endCluster);
+	while (clusterListLen<aMaxCount)
+		{
+		TInt oldCluster=endCluster;
+		TInt64 oldClusterPos=endClusterPos;
+		if (GetNextClusterL(endCluster)==EFalse || (endClusterPos=DataPositionInBytes(endCluster))!=(oldClusterPos+(1<<iOwner->ClusterSizeLog2())))
+			{
+			endCluster=oldCluster;
+			break;
+			}
+		clusterListLen++;
+		}
+	aEndCluster=endCluster;
+	
+    return(clusterListLen);
+    }
 
 
+
--- a/userlibandfileserver/fileserver/sfat32/sl_bpb32.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/sl_bpb32.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -62,7 +62,7 @@
         if(TotalSectors() >0 && HugeSectors() >0 )
             goto Invalid; //-- values clash
 
-        const TUint32 totSectors = Max(TotalSectors(), HugeSectors());
+        const TUint32 totSectors = Max((TUint32)TotalSectors(), HugeSectors());
         const TUint32 rootDirStartSec =  ReservedSectors() + FatSectors()*NumberOfFats(); //-- root directory start sector
 
         if(FatSectors() < 1 || rootDirStartSec < 3 || RootDirEntries() < 1 || totSectors < 5)
@@ -228,11 +228,11 @@
     __PRINT1(_L("FatSectors:%d"),FatSectors());
     __PRINT1(_L("SectorsPerTrack:%d"),SectorsPerTrack());
     __PRINT1(_L("NumberOfHeads:%d"),NumberOfHeads());
-    __PRINT1(_L("HugeSectors:%d"),HugeSectors());
-    __PRINT1(_L("Fat32 Sectors:%d"),FatSectors32());
+    __PRINT1(_L("HugeSectors:%u"),HugeSectors());
+    __PRINT1(_L("Fat32 Sectors:%u"),FatSectors32());
     __PRINT1(_L("Fat32 Flags:%d"),FATFlags());
     __PRINT1(_L("Fat32 Version Number:%d"),VersionNumber());
-    __PRINT1(_L("Root Cluster Number:%d"),RootClusterNum());
+    __PRINT1(_L("Root Cluster Number:%u"),RootClusterNum());
     __PRINT1(_L("FSInfo Sector Number:%d"),FSInfoSectorNum());
     __PRINT1(_L("Backup Boot Rec Sector Number:%d"),BkBootRecSector());
     __PRINT1(_L("PhysicalDriveNumber:%d"),PhysicalDriveNumber());
@@ -256,7 +256,7 @@
     {
 
     //-- check iBytesPerSector validity; it shall be one of: 512,1024,2048,4096
-    if(!IsPowerOf2(iBytesPerSector) || iBytesPerSector < 512 ||  iBytesPerSector > 4096)
+    if(iBytesPerSector < 512 ||  iBytesPerSector > 4096 || !IsPowerOf2(iBytesPerSector))
         return EInvalid; //-- invalid iBytesPerSector value
 
     //-- check iSectorsPerCluster validity, it shall be one of: 1,2,4,8...128
@@ -326,14 +326,14 @@
 TUint32 TFatBootSector::VolumeTotalSectorNumber() const
 {
     __ASSERT_DEBUG(IsValid(), Fault(EFatBadBootSectorParameter));
-    return TotalSectors() >0 ? (TUint32)TotalSectors() : (TUint32)HugeSectors();
+    return TotalSectors() >0 ? TotalSectors() : HugeSectors();
 }
 
 /** @return FAT-type independent number of sectors in one FAT */
 TUint32 TFatBootSector::TotalFatSectors() const
 {
     __ASSERT_DEBUG(IsValid(), Fault(EFatBadBootSectorParameter));
-    return FatSectors() >0 ? (TUint32)FatSectors() : FatSectors32();
+    return FatSectors() >0 ? FatSectors() : FatSectors32();
 }
 
 
--- a/userlibandfileserver/fileserver/sfat32/sl_dir_cache.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/sl_dir_cache.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -27,9 +27,9 @@
 The static cache page creation function.
 Cache page objects are not supposed to be created on the stack, so this factory function is required.
 */
-TDynamicDirCachePage* TDynamicDirCachePage::NewL(CDynamicDirCache* aOwnerCache, TInt64 aStartMedPos, TUint8* aStartRamAddr)
+TDynamicDirCachePage* TDynamicDirCachePage::CreateCachePage(CDynamicDirCache* aOwnerCache, TInt64 aStartMedPos, TUint8* aStartRamAddr)
 	{
-	return new(ELeave) TDynamicDirCachePage(aOwnerCache, aStartMedPos, aStartRamAddr);
+	return new TDynamicDirCachePage(aOwnerCache, aStartMedPos, aStartRamAddr);
 	}
 
 /**
@@ -158,7 +158,7 @@
 
 	// allocate as many permanently locked pages as there are threads - plus one
 	// otherwise DoMakePageMRU() won't work properly with only one thread
-    //-- At present moment the size of TDrive thread pool is 1 (1 drive thread in a pool)
+	//-- At present moment the size of TDrive thread pool is 1 (1 drive thread in a pool)
 	const TUint KThreadCount = 1;
 	iPermanentlyAllocatedPageCount = KThreadCount + 1; 
 
@@ -167,7 +167,10 @@
 
 	for (TUint n=0; n<iPermanentlyAllocatedPageCount; n++)
 		{
-		TDynamicDirCachePage* pPage = AllocateAndLockNewPageL(0);
+		TDynamicDirCachePage* pPage = AllocateAndLockNewPage(0);
+		ASSERT(pPage);
+		if (!pPage)
+			User::Leave(KErrNoMemory);
 		AddFirstOntoQueue(pPage, TDynamicDirCachePage::ELocked);
 		LookupTblAdd(pPage);
 		}
@@ -694,47 +697,45 @@
 		}
 
 	TDynamicDirCachePage* pPage = FindPageByPos(aPos);
-    if (pPage)
-    	{
-    	ASSERT(pPage->IsValid());
+	if (pPage)
+		{
+		ASSERT(pPage->IsValid());
 		// lock page before make it MRU
-    	if (pPage->PageType() == TDynamicDirCachePage::EUnlocked)
-    		{
-    		ASSERT(!pPage->IsLocked());
-        	if (LockPage(pPage) == NULL)
-        		{
-        		DeQueue(pPage);
-        		LookupTblRemove(pPage->StartPos());
-        		DecommitPage(pPage);
-        		delete pPage;
-        		pPage = NULL;
-        		}
-    		}
-    	else
-    		{
-    		// error checking: page should either be locked or active
-    		ASSERT(LockPage(pPage) != NULL);
-    		}
-    	}
+		if (pPage->PageType() == TDynamicDirCachePage::EUnlocked)
+			{
+			ASSERT(!pPage->IsLocked());
+			if (LockPage(pPage) == NULL)
+				{
+				DeQueue(pPage);
+				LookupTblRemove(pPage->StartPos());
+				DecommitPage(pPage);
+				delete pPage;
+				pPage = NULL;
+				}
+			}
+		else
+			{
+			// error checking: page should either be locked or active
+			ASSERT(LockPage(pPage) != NULL);
+			}
+		}
+	// if page not found or page data not valid anymore, use active page to read data
+	if (!pPage)
+		{
+		TRAPD(err, pPage = UpdateActivePageL(aPos));
+		if (err != KErrNone)
+			{
+			// problem occurred reading active page, return immediately.
+			return;
+			}
+		}
 
-    // if page not found or page data not valid anymore, use active page to read data
-    if (!pPage)
-    	{
-        TRAPD(err, pPage = UpdateActivePageL(aPos));
-        if (err != KErrNone)
-        	{
-        	// problem occurred reading active page, return immediately.
-        	return;
-        	}
-    	}
-
-    // by now, the page is either locked or active page
+	// by now, the page is either locked or active page
 	ASSERT(pPage && pPage->IsValid() && pPage->IsLocked());
 
 
-
-	TBool allocateNewPage = pPage == iLockedQ.Last() && !CacheIsFull();
-
+	// if we used the active page (last on the queue), try to grow the cache.
+	TBool growCache = pPage == iLockedQ.Last();
 
 	switch (pPage->PageType())
 		{
@@ -762,24 +763,24 @@
 			ASSERT(0);
 		}
 
-	if (allocateNewPage)
-		{
-		TDynamicDirCachePage* nPage = NULL;
-		TRAPD(err, nPage = AllocateAndLockNewPageL(0));
-		if (err == KErrNone)
-			{
+	if (CacheIsFull() || !growCache)
+		return;
+
+	// attempt to grow the cache by appending a clean, new page at the end of the LRU list.
+	// This can fail when out of memory; the LRU mechanism then makes sure the oldest page will be re-used.
+	TDynamicDirCachePage* nPage = AllocateAndLockNewPage(0);
+	if (!nPage)
+		return;
 
-			// about to add a page to end of locked queue, so lie about iLockedQCount
-			iLockedQCount++;
-			CheckThresholds();
-			iLockedQCount--;
+	// about to add a page to end of locked queue, so lie about iLockedQCount
+	iLockedQCount++;
+	CheckThresholds();
+	iLockedQCount--;
 
-			iLockedQ.AddLast(*nPage);
-			nPage->SetPageType(TDynamicDirCachePage::ELocked);
-			++iLockedQCount;
-			LookupTblAdd(nPage);
-			}
-		}
+	iLockedQ.AddLast(*nPage);
+	nPage->SetPageType(TDynamicDirCachePage::ELocked);
+	++iLockedQCount;
+	LookupTblAdd(nPage);
 	}
 
 /**
@@ -821,7 +822,7 @@
 		return activePage;
 		}
 
-	__PRINT2(_L("CDynamicDirCache::UpdateActivePageL(aPos=%lx, active=%lx)"), aPos, activePage->StartPos());
+	//__PRINT2(_L("CDynamicDirCache::UpdateActivePageL(aPos=%lx, active=%lx)"), aPos, activePage->StartPos());
 
 	activePage->Deque();
 	LookupTblRemove(activePage->StartPos());
@@ -898,23 +899,31 @@
 @param	aStartMedPos	the starting media address of the page to be created.
 @pre	aStartMedPos should not already be existing in the cache.
 */
-TDynamicDirCachePage* CDynamicDirCache::AllocateAndLockNewPageL(TInt64 aStartMedPos)
+TDynamicDirCachePage* CDynamicDirCache::AllocateAndLockNewPage(TInt64 aStartMedPos)
 	{
-	__PRINT1(_L("CDynamicDirCache::AllocateAndLockNewPageL(aStartMedPos=%lx)"), aStartMedPos);
+	__PRINT1(_L("CDynamicDirCache::AllocateAndLockNewPage(aStartMedPos=%lx)"), aStartMedPos);
 
 	TUint8* startRamAddr = iCacheMemoryClient->AllocateAndLockSegments(PageSizeInSegs());
-	if (startRamAddr)
+
+	if (!startRamAddr)
+		return NULL;
+
+	TDynamicDirCachePage* pPage = TDynamicDirCachePage::CreateCachePage(this, aStartMedPos, startRamAddr);
+
+	// Failure would mean the cache chunk was able to grow but we've run out of heap.
+	// This seems extremely unlikely, but decommit the now-unmanageable cache segment just in case.
+	if (!pPage)
 		{
-		// create new page and return
-		TDynamicDirCachePage* pPage = TDynamicDirCachePage::NewL(this, aStartMedPos, startRamAddr);
-		pPage->SetLocked(ETrue);
-		pPage->SetValid(EFalse);
-		return pPage;
+		iCacheMemoryClient->DecommitSegments(startRamAddr, PageSizeInSegs());
+		return NULL;
 		}
 
-	return NULL;
+	pPage->SetLocked(ETrue);
+	pPage->SetValid(EFalse);
+	return pPage;
 	}
 
+
 #ifdef _DEBUG
 /**
 Dump cache information, only enabled in debug mode.
--- a/userlibandfileserver/fileserver/sfat32/sl_dir_cache.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/sl_dir_cache.h	Wed Mar 31 23:38:45 2010 +0300
@@ -47,7 +47,7 @@
 
 public:
 	~TDynamicDirCachePage();
-	static TDynamicDirCachePage* NewL(CDynamicDirCache* aOwnerCache, TInt64 aStartMedPos, TUint8* aStartRamAddr);
+	static TDynamicDirCachePage* CreateCachePage(CDynamicDirCache* aOwnerCache, TInt64 aStartMedPos, TUint8* aStartRamAddr);
 	
 	inline void	SetLocked(TBool);
 	inline TBool	IsLocked() const;
@@ -145,7 +145,7 @@
 
 	TDynamicDirCachePage* FindPageByPos(TInt64 aPos);
 	TDynamicDirCachePage* UpdateActivePageL(TInt64 aPos);
-	TDynamicDirCachePage* AllocateAndLockNewPageL(TInt64 aStartMedPos);
+	TDynamicDirCachePage* AllocateAndLockNewPage(TInt64 aStartMedPos);
 	TUint8* LockPage(TDynamicDirCachePage* aPage);
 	TInt 	UnlockPage(TDynamicDirCachePage* aPage);
 	TInt 	DecommitPage(TDynamicDirCachePage* aPage);
--- a/userlibandfileserver/fileserver/sfat32/sl_drv.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/sl_drv.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1996-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -47,7 +47,7 @@
 */
 void TDriveInterface::Close()
 {
-	 if(iMount)
+	 if((iMount != NULL) && (iMount->LocalDrive() != NULL))
 		{
 		iMount->LocalDrive()->SetMount(NULL);
         }
--- a/userlibandfileserver/fileserver/sfat32/sl_fatcache.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/sl_fatcache.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -396,8 +396,17 @@
     //__PRINT1(_L("#-CFat16FixedCache::ReadEntryL() FAT idx:%d"), aIndex);
     ASSERT(aIndex >= KFatFirstSearchCluster &&  aIndex < (FatSize() >> KFat16EntrySzLog2));
 
-    //-- calculate page index in the array
-    const TInt pgIdx = aIndex >> (PageSizeLog2()-KFat16EntrySzLog2);
+    //-- calculate page index in the array. Theoretically, aIndex can't be wrong because it is checked by the caller;
+    //-- but in some strange situations (malformed volume ?) aIndex might get bigger than number of usable clusters.
+    const TUint pgIdx = aIndex >> (PageSizeLog2()-KFat16EntrySzLog2);
+    
+    if(pgIdx >= (TUint)iPages.Count())
+        {
+        __PRINT1(_L("#-CFat16FixedCache::ReadEntryL() FAT idx:%d #1"), aIndex);
+        ASSERT(0);
+        User::Leave(KErrCorrupt);
+        }
+    
     CFat16FixedCachePage *pPage = iPages[pgIdx];
     
     TUint32 entry = KMaxTUint;
@@ -436,8 +445,17 @@
 
     SetDirty(ETrue);
 
-    //-- calculate page index in the array
-    const TInt pgIdx = aIndex >> (PageSizeLog2()-KFat16EntrySzLog2);
+    //-- calculate page index in the array. Theoretically, aIndex can't be wrong because it is checked by the caller;
+    //-- but in some strange situations (malformed volume ?) aIndex might get bigger than number of usable clusters.
+    const TUint pgIdx = aIndex >> (PageSizeLog2()-KFat16EntrySzLog2);
+    
+    if(pgIdx >= (TUint)iPages.Count())
+        {
+        __PRINT2(_L("#-CFat16FixedCache::WriteEntryL() FAT idx:%d, val:%d #1"), aIndex, aEntry);
+        ASSERT(0);
+        User::Leave(KErrCorrupt);
+        }
+
     CFat16FixedCachePage *pPage = iPages[pgIdx];
 
     if(!pPage)
--- a/userlibandfileserver/fileserver/sfat32/sl_fatmisc32.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/sl_fatmisc32.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -39,12 +39,12 @@
 
 @return The number of sectors
 */
-TUint32 CFatFormatCB::MaxFat32Sectors() const
+TUint CFatFormatCB::MaxFat32Sectors() const
 	{
 	TUint32 calc1 = iMaxDiskSectors - iReservedSectors;
 	TUint32 calc2 = (256 * iSectorsPerCluster) + iNumberOfFats;
 	calc2 = calc2 >> 1;
-	return (calc1 + (calc2 - 1))/calc2;
+	return ((calc1 + (calc2 - 1))/calc2);
 	}
 
 
@@ -76,7 +76,7 @@
 @param  aDiskSizeInSectors Size of volume in sectors
 @return system-wide error code
 */
-TInt  CFatFormatCB::InitFormatDataForFixedSizeDiskNormal(TInt aDiskSizeInSectors, const TLocalDriveCapsV6& aCaps)
+TInt  CFatFormatCB::InitFormatDataForFixedSizeDiskNormal(TUint aDiskSizeInSectors, const TLocalDriveCapsV6& aCaps)
 	{
 	__PRINT1(_L("CFatFormatCB::InitFormatDataForFixedSizeDiskNormal() sectors:%d"), aDiskSizeInSectors);
     
@@ -117,11 +117,13 @@
 	else if(aDiskSizeInSectors<1048576) // >= 16Mb - FAT16   < (1048576) 512MB
 		{
 		iFileSystemName=KFileSystemName16;
-		TInt minSectorsPerCluster=(aDiskSizeInSectors+KMaxFAT16Entries-1)/KMaxFAT16Entries;
+		TUint minSectorsPerCluster=(aDiskSizeInSectors+KMaxFAT16Entries-1)/KMaxFAT16Entries;
 		iRootDirEntries=512;
 		iSectorsPerCluster=1;
+		
 		while (minSectorsPerCluster>iSectorsPerCluster)
 			iSectorsPerCluster<<=1;
+
 		iSectorsPerFat=MaxFat16Sectors();
 		}
 	else	//use FAT32
@@ -195,34 +197,36 @@
     return iHiddenSectors + iReservedSectors + iNumberOfFats*iSectorsPerFat + rootDirSectors;
 	}
 
-void CFatFormatCB::AdjustClusterSize(TInt aRecommendedSectorsPerCluster)
+void CFatFormatCB::AdjustClusterSize(TUint aRecommendedSectorsPerCluster)
 	{
-    const TInt KMaxSecPerCluster = 64;	// 32K
+    const TUint KMaxSecPerCluster = 64;	// 32K
+
 	while (aRecommendedSectorsPerCluster > iSectorsPerCluster && iSectorsPerCluster <= (KMaxSecPerCluster/2))
 		iSectorsPerCluster<<= 1;
+
 	}
 
 // AdjustFirstDataSectorAlignment()
 // Attempts to align the first data sector on an erase block boundary by modifying the
 // number of reserved sectors.
-TInt CFatFormatCB::AdjustFirstDataSectorAlignment(TInt aEraseBlockSizeInSectors)
+TInt CFatFormatCB::AdjustFirstDataSectorAlignment(TUint aEraseBlockSizeInSectors)
 	{
 	const TBool bFat16 = Is16BitFat();
     const TBool bFat32 = Is32BitFat();
 
 	// Save these 2 values in the event of a convergence failure; this should 
 	// hopefully never happen, but we will cater for this in release mode to be safe,
-	TInt reservedSectorsSaved = iReservedSectors;
-	TInt sectorsPerFatSaved = iSectorsPerFat;
+	TUint reservedSectorsSaved = iReservedSectors;
+	TUint sectorsPerFatSaved = iSectorsPerFat;
 
-	TInt reservedSectorsOld = 0;
+	TUint reservedSectorsOld = 0;
 
 	// zero for FAT32
-	TInt rootDirSectors = (iRootDirEntries * KSizeOfFatDirEntry + (iBytesPerSector-1)) / iBytesPerSector;
-	TInt fatSectors = 0;
+	TUint rootDirSectors = (iRootDirEntries * KSizeOfFatDirEntry + (iBytesPerSector-1)) / iBytesPerSector;
+	TUint fatSectors = 0;
 
-	TInt KMaxIterations = 10;
-	TInt n;
+	TUint KMaxIterations = 10;
+	TUint n;
 	for (n=0; n<KMaxIterations && reservedSectorsOld != iReservedSectors; n++)
 		{
 		reservedSectorsOld = iReservedSectors;
@@ -237,7 +241,7 @@
 		iReservedSectors = (nBlocks * aEraseBlockSizeInSectors) - rootDirSectors - fatSectors;
 		}
 	
-	ASSERT(iReservedSectors >= (TInt) (bFat32 ? KDefFat32ResvdSec : KDefFatResvdSec));
+	ASSERT(iReservedSectors >= (bFat32 ? KDefFat32ResvdSec : KDefFatResvdSec));
 
 	if ((FirstDataSector() & (aEraseBlockSizeInSectors-1)) == 0)
 		{
@@ -314,7 +318,7 @@
 		bootSector.SetFatSectors(iSectorsPerFat);
 		bootSector.SetRootDirEntries(iRootDirEntries);
 
-		if (iMaxDiskSectors<=(TInt)KMaxTUint16)
+		if (iMaxDiskSectors<=KMaxTUint16)
 			{
 			bootSector.SetTotalSectors(iMaxDiskSectors);
 			bootSector.SetHugeSectors(0);
@@ -568,7 +572,7 @@
     @param  aDiskSizeInSectors disk size in sectors
     @return system-wide error code
 */
-TInt CFatFormatCB::InitFormatDataForFixedSizeDiskUser(TInt aDiskSizeInSectors)
+TInt CFatFormatCB::InitFormatDataForFixedSizeDiskUser(TUint aDiskSizeInSectors)
 	{
     __PRINT1(_L("CFatFormatCB::InitFormatDataForFixedSizeDiskUser() sectors:%d"), aDiskSizeInSectors);
     Dump_TLDFormatInfo(iSpecialInfo());
@@ -591,8 +595,8 @@
         iReservedSectors = iSpecialInfo().iReservedSectors;
 
 
-    const TInt KMaxSecPerCluster    = 64; 
-	const TInt KDefaultSecPerCluster= 8;   //-- default value, if the iSpecialInfo().iSectorsPerCluster isn't specified
+    const TUint KMaxSecPerCluster    = 64; 
+	const TUint KDefaultSecPerCluster= 8;   //-- default value, if the iSpecialInfo().iSectorsPerCluster isn't specified
 
     iSectorsPerCluster = iSpecialInfo().iSectorsPerCluster;
     if(iSectorsPerCluster <= 0)
@@ -613,23 +617,23 @@
         }
 	else if (aDiskSizeInSectors < 8192) // < 4MB
         {
-        iSectorsPerCluster = Min(iSectorsPerCluster, 2);
+        iSectorsPerCluster = Min((TUint32)iSectorsPerCluster, (TUint32)2);
 		iRootDirEntries = 256;
         }
 	else if (aDiskSizeInSectors < 32768) // < 16MB
         {
-        iSectorsPerCluster = Min(iSectorsPerCluster, 4);
+        iSectorsPerCluster = Min((TUint32)iSectorsPerCluster, (TUint32)4);
 		iRootDirEntries = 512;
         }
 	else if (aDiskSizeInSectors < 1048576) // < 512MB
         {
-        iSectorsPerCluster = Min(iSectorsPerCluster, 8);
+        iSectorsPerCluster = Min((TUint32)iSectorsPerCluster, (TUint32)8);
 		iRootDirEntries = 512;
         }
     else // FAT32
 		{
         iRootDirEntries = 512;
-        iSectorsPerCluster = Min(iSectorsPerCluster, KMaxSecPerCluster);
+        iSectorsPerCluster = Min((TUint32)iSectorsPerCluster, (TUint32)KMaxSecPerCluster);
         }
 
 
@@ -819,14 +823,15 @@
 		sizeofFatAndRootDir = iSectorsPerFat*iNumberOfFats + ((iRootDirEntries*KSizeOfFatDirEntry+(1<<iSectorSizeLog2)-1)>>iSectorSizeLog2);
     else
         sizeofFatAndRootDir = (iRootClusterNum-2) * iSectorsPerCluster;
-    TInt firstFreeSector = iReservedSectors + sizeofFatAndRootDir;
+
+    TUint firstFreeSector = iReservedSectors + sizeofFatAndRootDir;
 
     // Check in rare case that corrupt in critical area
     // which includes bootsector, FAT table, (and root dir if not FAT32)
     TInt i, r;
     for (i=0; i<iBadSectors.Count(); ++i)
         {
-        TInt badSector = iBadSectors[i];
+        const TUint badSector = iBadSectors[i];
         // Check in rare case that corrupt in critical area
         // which includes bootsector, FAT table, (and root dir if not FAT32)
         if (firstFreeSector > badSector)
--- a/userlibandfileserver/fileserver/sfat32/sl_file.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/sl_file.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -25,13 +25,12 @@
 
 CFatFileCB::CFatFileCB()
 	{
-
 	__PRINT1(_L("CFatFileCB created 0x%x"),this);
 	}
 
 CFatFileCB::~CFatFileCB()
 	{
-	__PRINT1(_L("CFatFileCB deleted 0x%x"),this);
+	__PRINT1(_L("~CFatFileCB deleted 0x%x"),this);
 
     //-- a nasty trick to find out if the CFatFileCB is in consistent state on the moment of destruction.
     //-- Because of OOM conditions CFatFileCB might not be fully constructed and to be deleted, while FlushAll()
@@ -39,9 +38,12 @@
     const CMountCB* pMount  = &Mount();
     if(pMount)
         {//-- do some finalisation work if CMountCB is valid
-        if (iAtt&KEntryAttModified)
+        if(FileAttModified())
+            {
+            IndicateFileTimeModified(ETrue); //-- this will force writing file modification time to the media on Flush
             TRAP_IGNORE(FlushAllL());
         }
+        }
 
     delete[] iSeekIndex;
 	}
@@ -59,10 +61,10 @@
 
 	Mem::FillZ(iSeekIndex, sizeof(TUint32) * KSeekIndexSize);
 
-	iSeekIndexSize=CalcSeekIndexSize(Size());
+	iSeekIndexSize=CalcSeekIndexSize(FCB_FileSize());
 	}
 
-TInt CFatFileCB::SeekToPosition(TInt aNewRelCluster,TInt aClusterOffset)
+TInt CFatFileCB::SeekToPosition(TUint aNewRelCluster, TUint aClusterOffset)
 //
 // Use the seek index to set iCurrentPos.iCluster as close as possible to aNewRelCluster
 // Return aNewRelCluster-aCurrentPos.iCluster
@@ -81,7 +83,7 @@
 		return(aClusterOffset);
 	if (seekPos<0)
 		{
-		iCurrentPos.iCluster=iStartCluster;
+		iCurrentPos.iCluster=FCB_StartCluster();
 		return(aNewRelCluster);
 		}
 
@@ -89,7 +91,7 @@
 	return(aNewRelCluster-((seekPos+1)<<iSeekIndexSize));
 	}
 
-void CFatFileCB::SetSeekIndexValueL(TInt aRelCluster,TInt aStoredCluster)
+void CFatFileCB::SetSeekIndexValueL(TUint aRelCluster, TUint aStoredCluster)
 //
 // Sets a value in the seekindex
 //
@@ -122,19 +124,22 @@
 	__PRINT1(_L("CFatFileCB::CheckPosL(%d)"), aPos);
 	if (aPos==iCurrentPos.iPos)
 		return;
-    __ASSERT_DEBUG(aPos <= (TUint)Size(), Fault(EFatFilePosBeyondEnd));
+    __ASSERT_DEBUG(aPos <= FCB_FileSize(), Fault(EFatFilePosBeyondEnd));
 
-	if (iFileSizeModified && IsSeekBackwards(aPos))
+	if (FileSizeModified() && IsSeekBackwards(aPos))
 		FlushDataL(); 
 	
 	TUint newRelCluster=aPos>>ClusterSizeLog2();
 	if ( aPos && (aPos==(newRelCluster<<ClusterSizeLog2())) )
 		newRelCluster--;
 	TUint oldRelCluster=iCurrentPos.iPos>>ClusterSizeLog2();
+	
 	if ( iCurrentPos.iPos && (iCurrentPos.iPos==(oldRelCluster<<ClusterSizeLog2())) )
 		oldRelCluster--;	
+	
 	TInt clusterOffset=newRelCluster-oldRelCluster;
-	TInt oldCluster=iCurrentPos.iCluster;
+	TUint32 oldCluster=iCurrentPos.iCluster;
+
 	iCurrentPos.iPos=aPos;
 	if (clusterOffset==0)
 		return;
@@ -147,7 +152,7 @@
 		}
 	if (clusterOffset==-1 && seekOffset!=1)
 		{ // Check previous cluster
-		TInt cluster=oldCluster-1;
+		TUint32 cluster=oldCluster-1;
 		if (FAT().GetNextClusterL(cluster) && cluster==oldCluster)
 			{
             iCurrentPos.iCluster=oldCluster-1;
@@ -157,7 +162,7 @@
 	if (seekOffset<0)
 		{
 		seekOffset=newRelCluster;
-		iCurrentPos.iCluster=iStartCluster;
+		iCurrentPos.iCluster=FCB_StartCluster();
 		}
 	while (seekOffset--)
 		{
@@ -172,30 +177,60 @@
 		}
 	}
 
-void CFatFileCB::SetL(const TFatDirEntry& aFatDirEntry,TShare aShare,const TEntryPos& aPos)
-//
-// Initialize FileCB from entry data
-//
+//-----------------------------------------------------------------------------
+/** 
+    Initialize FileCB from file's entry data.
+    
+    @param  aFatDirEntry        this file DOS dir entry.
+    @param  aFileDosEntryPos    this file DOS entry dir. iterator in the parent directory.
+*/
+void CFatFileCB::SetupL(const TFatDirEntry& aFatDirEntry, const TEntryPos& aFileDosEntryPos)
 	{
+	__PRINT1(_L("CFatFileCB::SetupL[0x%x]"), this);
+	
 
-	__PRINT(_L("CFatFileCB::SetL"));
-	SetSize(aFatDirEntry.Size()); 
+    //-- set up a file control block
 	iCurrentPos.iCluster= FatMount().StartCluster(aFatDirEntry);
-	iStartCluster=iCurrentPos.iCluster;
 	iCurrentPos.iPos=0;
-	iAtt=aFatDirEntry.Attributes();
-	iModified= aFatDirEntry.Time(FatMount().TimeOffset());
-	iShare=aShare;
-	iFileDirPos=aPos;
+	
+    SetAtt(aFatDirEntry.Attributes());
+	SetModified(aFatDirEntry.Time(FatMount().TimeOffset()));
+    
+    FCB_SetStartCluster(iCurrentPos.iCluster);
+    FCB_SetFileSize(aFatDirEntry.Size()); 
+
+	iFileDosEntryPos = aFileDosEntryPos;
 
     SetMaxSupportedSize(KMaxSupportedFatFileSize);
+
+    //-- create seek index
+    ASSERT(!iSeekIndex);
+    CreateSeekIndex();
+    if(!iSeekIndex)
+        User::Leave(KErrNoMemory);
+
+    
+    IndicateFileAttModified(EFalse);
+    IndicateFileSizeModified(EFalse);
+    IndicateFileTimeModified(EFalse);
 	}
 
 //-----------------------------------------------------------------------------
-// from CFileCB::MExtendedFileInterface
+/**
+    Read data from the file.
+    
+    @param  aFilePos    start read position within a file
+    @param  aLength     how many bytes to read; on return will be how many bytes actually read
+    @param  aDes        local buffer desctriptor
+    @param  aMessage    from file server, used to write data to the buffer in different address space.
+    @param  aDesOffset  offset within data descriptor where the data will be copied
+
+    @leave on media read error
+
+*/
 void CFatFileCB::ReadL(TInt64 aPos,TInt& aLength, TDes8* aDes, const RMessagePtr2& aMessage, TInt aOffset)
 	{
-	__PRINT2(_L("CFatFileCB::ReadL aFilePos=%LU aLength=%d"),aPos,aLength);
+	__PRINT3(_L("CFatFileCB::ReadL[0x%x] pos=%LU len=%d"), this, aPos, aLength);
 	
     if((TUint64)aPos > KMaxSupportedFatFileSize-1)
         User::Leave(KErrNotSupported);  //-- max. position in the file is 0xFFFFFFFE
@@ -205,7 +240,7 @@
 	CheckPosL(I64LOW(aPos));
 	
 	const TUint startPos = iCurrentPos.iPos;
-	const TUint curSize  = (TUint)Size();
+	const TUint curSize  = FCB_FileSize();
 	const TUint length   = (TUint)aLength;
 	
 	if((startPos + length > curSize) || (startPos > startPos + length) )
@@ -222,10 +257,22 @@
 	}
 
 //-----------------------------------------------------------------------------
-// from CFileCB::MExtendedFileInterface
+/**
+    Write data to the file.
+    
+    @param  aFilePos    start write position within a file
+    @param  aLength     how many bytes to write; on return contain amount of data actually written
+    @param  aDes        local buffer desctriptor
+    @param  aMessage    from file server, used to write data to the media from different address space.
+    @param  aDesOffset  offset within data descriptor 
+
+    @leave on media read error
+
+*/
 void CFatFileCB::WriteL(TInt64 aPos,TInt& aLength,const TDesC8* aSrc,const RMessagePtr2& aMessage, TInt aOffset)
 	{
-	__PRINT2(_L("CFatFileCB::WriteL aFilePos=%LU aLength=%d"),aPos,aLength);
+	__PRINT3(_L("CFatFileCB::WriteL[0x%x] pos=%LU len=%d"), this, aPos, aLength);
+
 	// FAT supports 32 bits only for file size
    	TUint64 endPos = aPos + aLength;
    	if(endPos > KMaxSupportedFatFileSize)
@@ -236,17 +283,17 @@
     const TUint pos = I64LOW(aPos);
   	CheckPosL(pos);
   	
-	const TUint startCluster = (TUint)iStartCluster;
+	const TUint startCluster = FCB_StartCluster();
 	const TUint length       = (TUint)aLength;
 	
 	endPos = iCurrentPos.iPos + length; 
-	if ((endPos           > (TUint)Size()) ||
+	if ((endPos           > FCB_FileSize()) ||
 	    (iCurrentPos.iPos > endPos)         ) // Overflow condition 
 		DoSetSizeL(iCurrentPos.iPos+length,EFalse);
    	
 	TUint startPos=iCurrentPos.iPos;
-	TInt badcluster=0;
-	TInt goodcluster=0;
+	TUint badcluster=0;
+	TUint goodcluster=0;
    	
 	TRAPD(ret, FatMount().WriteToClusterListL(iCurrentPos,aLength,aSrc,aMessage,aOffset,badcluster, goodcluster));
    	
@@ -254,9 +301,11 @@
 		{
         if(startCluster == 0)
 			{ //Empty File, revert all the clusters allocated.
-			TInt cluster = iStartCluster;
-			iStartCluster = 0;
-			SetSize(0);
+			const TUint32 cluster = FCB_StartCluster();
+			FCB_SetStartCluster(0);
+			FCB_SetFileSize(0);
+			IndicateFileSizeModified(ETrue);
+            
 			FlushAllL();
 
 			iCurrentPos.iCluster = 0;
@@ -267,14 +316,14 @@
 			}
 		else
 			{ //Calculate the clusters required based on file size, revert extra clusters if allocated.
-			const TUint curSize = (TUint)Size();
+			const TUint curSize = FCB_FileSize();
 			TUint ClustersNeeded = curSize >> ClusterSizeLog2();
 			if(curSize > (ClustersNeeded << ClusterSizeLog2()))
 				{
 				ClustersNeeded++;
 				}
 
-			TInt cluster = iStartCluster;
+			TUint32 cluster = FCB_StartCluster();
 			while(--ClustersNeeded)
 				{
 				FAT().GetNextClusterL(cluster);
@@ -296,14 +345,14 @@
 
 	if(badcluster != 0)
 		{
-		if(iStartCluster == badcluster)
+		if(FCB_StartCluster() == badcluster)
 			{
-			iStartCluster = goodcluster;
+            FCB_SetStartCluster(goodcluster);
 			FlushStartClusterL();
 			}
 		else
 			{
-			TInt aCluster = iStartCluster;
+			TUint32 aCluster = FCB_StartCluster();
 			do
 				{
                 if((TUint)badcluster == FAT().ReadL(aCluster))
@@ -318,7 +367,7 @@
 		}
 	aLength=iCurrentPos.iPos-startPos;
 
-	if(FatMount().IsRuggedFSys() && pos+(TUint)aLength>(TUint)Size())
+	if(FatMount().IsRuggedFSys() && pos+(TUint)aLength > FCB_FileSize())
 		{
 		WriteFileSizeL(pos+aLength);
 		}
@@ -441,169 +490,228 @@
 	}
 
 //-----------------------------------------------------------------------------
-
+/**
+    Set file size.
+    @param aSize new file size.
+*/
 void CFatFileCB::SetSizeL(TInt64 aSize)
 	{
-	__PRINT(_L("CFatFileCB::SetSizeL"));
+	__PRINT2(_L("CFatFileCB::SetSizeL[0x%x] sz=%LU"), this, aSize);
 	
-	// FAT supports 32 bits only for file size
+	//-- max. file size for FAT is 4GB-1
 	if (I64HIGH(aSize))
 		User::Leave(KErrNotSupported);
 
-	if(FatMount().IsRuggedFSys())
-		DoSetSizeL(I64LOW(aSize),ETrue);
-	else
-		DoSetSizeL(I64LOW(aSize),EFalse);
+    DoSetSizeL(I64LOW(aSize), FatMount().IsRuggedFSys());
 	}
 
 
 void CFatFileCB::SetSizeL(TInt aSize)
-//
-// Envelope function around DoSetSizeL to enable aSize to
-// be written to disk for rugged fat file system
-//
 	{
 	SetSizeL(TInt64(aSize));
 	}
 
-void CFatFileCB::DoSetSizeL(TUint aSize,TBool aIsSizeWrite)
-//
-// Extend or truncate the file.
-// Expects the modified attribute and iSize are set afterwards.
-// Does not alter iCurrentPos, the current file position.
-// Writes size of file to disk if aIsSizeWrite set
-//
+//-----------------------------------------------------------------------------
+/**
+    Shrink file to zero size.
+*/
+void CFatFileCB::DoShrinkFileToZeroSizeL()
+    {
+	    ASSERT(FCB_FileSize());
+        ASSERT(FileSizeModified());
+        
+            ClearIndex(0); //-- clear seek index array
+		
+        //-- update file dir. entry
+        const TUint32 cluster = FCB_StartCluster();
+		FCB_SetStartCluster(0);
+		FCB_SetFileSize(0);
+			FlushAllL();
+		
+        //-- free cluster list. 
+			CheckPosL(0);
+			FAT().FreeClusterListL(cluster);
+			FAT().FlushL();
+			}
+
+//-----------------------------------------------------------------------------
+/*
+    Shrink file to smaller size, but > 0
+
+    @param aNewSize new file size
+    @param aForceCachesFlush if ETrue, all file/FAT caches will be flushed 
+*/
+void CFatFileCB::DoShrinkFileL(TUint32 aNewSize, TBool aForceCachesFlush)
+		{
+    ASSERT(FileSizeModified());
+    ASSERT(FCB_FileSize() > aNewSize && aNewSize);
+	
+    if(aForceCachesFlush)		
+        WriteFileSizeL(aNewSize); //-- write file size directly to its dir. entry
+
+	CheckPosL(aNewSize);
+	
+    TUint32 cluster=iCurrentPos.iCluster;
+		if (FAT().GetNextClusterL(cluster))
+	    {//-- truncate the cluster chain
+			FAT().WriteFatEntryEofL(iCurrentPos.iCluster);
+			FAT().FreeClusterListL(cluster);
+			}
+		
+    ClearIndex(aNewSize);
+		FAT().FlushL();
+		}
+	
+//-----------------------------------------------------------------------------
+/**
+    Expand a file.
+	
+    @param aNewSize new file size.
+    @param aForceCachesFlush if ETrue, all file/FAT caches will be flushed
+*/
+void CFatFileCB::DoExpandFileL(TUint32 aNewSize, TBool aForceCachesFlush)
+		{
+    ASSERT(FCB_FileSize() < aNewSize);
+    ASSERT(FileSizeModified());
+
+    const TUint32 KClusterSzLog2  = ClusterSizeLog2();
+    const TUint32 newSizeClusters = (TUint32)(((TUint64)aNewSize + Pow2(KClusterSzLog2) - 1) >> KClusterSzLog2);
+
+
+	//-- expanding a file
+	if (FCB_StartCluster() == 0)
+		{//-- the initial file size is 0 (no cluster chain)
+         
+        ClearIndex(0); //-- clear seek index array
+        //-- FAT().FreeClusterHint() will give us a hint of the last free cluster
+        const TUint32 tempStartCluster=FAT().AllocateClusterListL(newSizeClusters, FAT().FreeClusterHint()); 
+		FAT().FlushL();
+
+		iCurrentPos.iCluster=tempStartCluster;
+		FCB_SetStartCluster(tempStartCluster);
+		FCB_SetFileSize(aNewSize);
+		FlushAllL();
+		}
+	else
+		{
+		const TUint curSize = FCB_FileSize(); 
+	    const TUint32 oldSizeClusters = ((curSize + Pow2(KClusterSzLog2) - 1) >> KClusterSzLog2);
+        ASSERT(newSizeClusters >= oldSizeClusters);
+		const TUint newClusters = newSizeClusters-oldSizeClusters;	//-- Number of clusters we need to append to the existing cluster chain
+		if (newClusters)
+			{
+			TEntryPos currentPos=iCurrentPos;
+			CheckPosL(FCB_FileSize());
+			FAT().ExtendClusterListL(newClusters,iCurrentPos.iCluster);
+			iCurrentPos=currentPos;
+			}
+	
+		FAT().FlushL();
+		
+        if(aForceCachesFlush)			// write file size if increasing
+			WriteFileSizeL(aNewSize);
+		}
+
+	}
+
+//-----------------------------------------------------------------------------
+/**
+    Set file size. This can involve extending/truncating file's cluster chain.
+    @param  aSize               new file size
+    @param  aForceCachesFlush   if ETrue, all changes in metadata will go to the media immediately. 
+                                it is used in Rugged FAT mode.
+*/
+void CFatFileCB::DoSetSizeL(TUint aSize, TBool aForceCachesFlush)
 	{
-	__PRINT2(_L("CFatFileCB::DoSetSizeL sz:%d, fileWrite=%d"),aSize ,aIsSizeWrite);
+	__PRINT4(_L("CFatFileCB::DoSetSizeL[0x%x] sz:%d, oldSz:%d, flush:%d"), this, aSize, FCB_FileSize(), aForceCachesFlush);
 
     FatMount().CheckStateConsistentL();
     FatMount().CheckWritableL();
 
 	
 	// Can not change the file size if it is clamped
-	if(Mount().IsFileClamped(MAKE_TINT64(0,iStartCluster)) > 0)
+	if(Mount().IsFileClamped(MAKE_TINT64(0,FCB_StartCluster())) > 0)
 		User::Leave(KErrInUse);
 	
-	iFileSizeModified=ETrue;
+	if(aSize == FCB_FileSize())
+        return;
+
+    IndicateFileSizeModified(ETrue);
 
 	TInt newIndexMult=CalcSeekIndexSize(aSize);
 	if (iSeekIndex!=NULL && newIndexMult!=iSeekIndexSize)
 		ResizeIndex(newIndexMult,aSize);
-	if (aSize == 0)
-		{
-		if (Size() != 0)
-			{
-            ClearIndex(0); //-- clear seek index array
-			TInt cluster=iStartCluster;
-			iStartCluster = 0;
-			SetSize(0);
-			FlushAllL();
-			CheckPosL(0);
-			FAT().FreeClusterListL(cluster);
-			FAT().FlushL();
-			}
-		return;
-		}
-	if (aSize<(TUint)Size())
+
+	//-------------------------------------------
+    //-- shrinking file to 0 size
+    if(aSize == 0)
+        {
+        DoShrinkFileToZeroSizeL();
+        return;
+        }
+
+    //-------------------------------------------
+	//-- shrinking file to non-zero size
+    if (aSize < FCB_FileSize())
 		{
-		if(aIsSizeWrite)		// write file size if decreasing
-				WriteFileSizeL(aSize);
-		CheckPosL(aSize);
-		TInt cluster=iCurrentPos.iCluster;
-		if (FAT().GetNextClusterL(cluster))
-			{
-			FAT().WriteFatEntryEofL(iCurrentPos.iCluster);
-			FAT().FreeClusterListL(cluster);
-			}
-		ClearIndex(aSize);
-		FAT().FlushL();
-		return;
-		}
-	
-	TUint newSize=aSize>>ClusterSizeLog2();	//	Number of clusters we now need
-	if (aSize > (newSize<<ClusterSizeLog2()))
-		newSize++;	//	File size is not an exact multiple of cluster size
-					//	Increment the number of clusters required to accomodate tail
-	
-	if (iStartCluster==0)
-		{
-        //-- FAT().FreeClusterHint() will give us a hint of the last free cluster
-        ClearIndex(0); //-- clear seek index array
-        TInt tempStartCluster=FAT().AllocateClusterListL(newSize, FAT().FreeClusterHint());
-		FAT().FlushL();
-		iCurrentPos.iCluster=tempStartCluster;
-		iStartCluster=tempStartCluster;
-		SetSize(aSize);
-		FlushAllL();
-		}
-	else
-		{
-		const TUint curSize = (TUint)Size(); 
-		TUint oldSize=curSize>>ClusterSizeLog2();	//	Number of clusters we had previously
-		if (curSize>(oldSize<<ClusterSizeLog2()))
-			oldSize++;
-	
-		TInt newClusters=newSize-oldSize;	//	Number of clusters we need to prepare
-		if (newClusters)
-			{
-			TEntryPos currentPos=iCurrentPos;
-			CheckPosL(Size());
-			FAT().ExtendClusterListL(newClusters,iCurrentPos.iCluster);
-			iCurrentPos=currentPos;
-			}
-		FAT().FlushL();
-		if(aIsSizeWrite)			// write file size if increasing
-			WriteFileSizeL(aSize);
-		}
+        DoShrinkFileL(aSize, aForceCachesFlush);
+        return;
+        }
+    
+    //-------------------------------------------
+	//-- expanding a file
+    DoExpandFileL(aSize, aForceCachesFlush);
+
 	}
 
 //-----------------------------------------------------------------------------
 /**
-    Set the entry's attributes and modified time.
+    Set file entry details, like file attributes and modified time
+    This method doesn't write data to the media immediately, instead, all modified data are cached and can be flushed later 
+    in FlushAllL()
+
+    @param  aTime           file modification time (and last access as well)
+    @param  aSetAttMask     file attributes OR mask
+    @param  aClearAttMask   file attributes AND mask
+
 */
 void CFatFileCB::SetEntryL(const TTime& aTime,TUint aSetAttMask,TUint aClearAttMask)
 	{
-	__PRINT(_L("CFatFileCB::SetEntryL"));
+	__PRINT1(_L("CFatFileCB::SetEntryL[0x%x]"), this);
     
     FatMount().CheckStateConsistentL();
     FatMount().CheckWritableL();
 
-	TUint setAttMask=aSetAttMask&KEntryAttMaskSupported;
+    //-- change file attributes
+    const TUint setAttMask = (aSetAttMask & KEntryAttMaskSupported); //-- supported attributes to set
+    TUint newAtt = Att();
+
 	if (setAttMask|aClearAttMask)
 		{
-		iAtt|=setAttMask;
-		iAtt&=(~aClearAttMask);
+        newAtt |= setAttMask;
+        newAtt &= ~aClearAttMask;
+        SetAtt(newAtt);
+        IndicateFileAttModified(ETrue); //-- indicate that file attributes have changed
 		}
+    
+    //-- set file entry modification time if required
 	if (aSetAttMask&KEntryAttModified)
-		iModified=aTime;
-	iAtt|=KEntryAttModified;
+	{
+        SetModified(aTime);        //-- set file modified time
+        IndicateFileAttModified(ETrue); //-- indicate that file attributes have changed
+        IndicateFileTimeModified(ETrue); //-- this will force writing file mod. time to the media on Flush
+        }
+
 	}
 
-/**
-    This is a RuggedFAT - specific method. Writes file size to the corresponding field of this
-    file direcrory entry.
-*/
-void CFatFileCB::WriteFileSizeL(TUint aSize)
-	{
-	__PRINT(_L("CFatFileCB::WriteFileSizeL"));
-	TEntryPos entryPos=iFileDirPos;
-	entryPos.iPos+=_FOFF(SFatDirEntry,iSize);
-	TPtrC8 size((TUint8*)&aSize,sizeof(TUint));
-	
-    //-- use directory cache when dealing with directories
-    FatMount().DirWriteL(entryPos,size);
-	iFileSizeModified=EFalse;
-    }
 
 //-----------------------------------------------------------------------------
 /** 
-    Flush file size, attributes, time etc. to the media.
-    It doesn't matter if whole directory entry is being written of only part of it. Anyway, a single DOS
-    dir. entry always fits into 1 sector.
+    The same as FlushAllL(). This method is called from RFile::Flush()
 */
 void CFatFileCB::FlushDataL()
 	{
-	__PRINT(_L("CFatFileCB::FlushDataL"));
+	__PRINT1(_L("CFatFileCB::FlushDataL[0x%x]"), this);
     FlushAllL();
 	}
 
@@ -613,7 +721,13 @@
 */
 void CFatFileCB::FlushAllL()
 	{
-	__PRINT(_L("CFatFileCB::FlushAllL()"));
+
+    //-- define this symbol in order to enable legacy behaviour, i.e. compulsory updating file dir. entry on flush.
+    //-- otherwise the FlushAllL() will update the file dir. entry only if it differs from what is on the media, i.e.
+    //-- file size, start cluster, attributes and modification timestamp
+    #define ALWAYS_UPDATE_ENTRY_ON_FLUSH
+
+	__PRINT1(_L("CFatFileCB::FlushAllL[0x%x]"), this);
 
     if (Mount().IsCurrentMount()==EFalse)
 		User::Leave(KErrDisMounted);
@@ -621,21 +735,58 @@
     FatMount().CheckStateConsistentL();
     FatMount().CheckWritableL();
 
+	if(!FileSizeModified() && !FileAttModified() && !FileTimeModified())
+        return; //-- nothing has changed in the file entry at all
+
+
+    //-- read file dir. entry
 	TFatDirEntry entry;
-	FatMount().ReadDirEntryL(iFileDirPos,entry);
+	FatMount().ReadDirEntryL(iFileDosEntryPos,entry);
 	__ASSERT_ALWAYS(entry.IsEndOfDirectory()==EFalse,User::Leave(KErrCorrupt));
-	entry.SetAttributes(iAtt&KEntryAttMaskSupported);
-	entry.SetSize(Size());
-	entry.SetTime(iModified, FatMount().TimeOffset());
-	entry.SetStartCluster(iStartCluster);
+
+    //-- the problem with KEntryAttModified here is that the file server uses this flag to 
+    //-- deal with dirty file data. This means that this flag can be set even if there were no changes
+    //-- in file time and attributes. Just check if any of the entry field has changed at all
+    
+    TBool bUpdateDirEntry = ETrue;
+    const TTimeIntervalSeconds  timeOffset = FatMount().TimeOffset();
+
+#ifndef ALWAYS_UPDATE_ENTRY_ON_FLUSH
+    
+    TBool bTimeModified = FileTimeModified();  //-- check if file modifiication time has been changed explicitly
+    if(bTimeModified)
+        {//-- additional check; for FAT entry modification time has 2 sec. granularity.
+        bTimeModified = !entry.IsTimeTheSame(iModified, timeOffset);
+        }
 
-	TBool setNotify = FatMount().GetNotifyUser();
+    if(!bTimeModified)
+      if(//-- TS is the same as on the media, check other entry fields
+        (entry.Attributes() == (Att() & KEntryAttMaskSupported)) && //-- file attributes have not changed
+        (entry.Size() == FCB_FileSize()) &&                         //-- file size hasn't changed
+        (entry.StartCluster() == FCB_StartCluster())                //-- file start cluster hasn't changed 
+        )               
+        {
+        bUpdateDirEntry = EFalse; //-- no need to update file dir. entry
+        }
+
+#endif //#ifndef ALWAYS_UPDATE_ENTRY_TS_ON_FLUSH
+
+    if(bUpdateDirEntry)
+        {//-- write entry to the media
+	    __PRINT(_L("  CFatFileCB::FlushAllL #1"));
+        entry.SetAttributes(Att() & KEntryAttMaskSupported);
+	    entry.SetSize(FCB_FileSize());
+	    entry.SetTime(iModified, timeOffset);
+	    
+        entry.SetStartCluster(FCB_StartCluster());
+
+	    const TBool setNotify = FatMount().GetNotifyUser();
 	if(setNotify)
 		{
 		FatMount().SetNotifyOff();	// do not launch a notifier
 		}
 
-	TRAPD(ret, FatMount().WriteDirEntryL(iFileDirPos,entry));
+	    TRAPD(ret, FatMount().WriteDirEntryL(iFileDosEntryPos,entry));
 	
 	if(setNotify)
 		{
@@ -643,8 +794,14 @@
 		}
 
 	User::LeaveIfError(ret);
-	iAtt&=(~KEntryAttModified);
-	iFileSizeModified=EFalse;
+
+        IndicateFileSizeModified(EFalse);
+        IndicateFileTimeModified(EFalse);
+	    }
+
+
+        //-- KEntryAttModified must be reset anyway
+        IndicateFileAttModified(EFalse); 
 	}
 
 //-----------------------------------------------------------------------------
@@ -663,7 +820,7 @@
     const TPtrC fileName = RemoveTrailingDots(aNewName); //-- remove trailing dots from the name
 
 
-	FatMount().DoRenameOrReplaceL(*iFileName, fileName, CFatMountCB::EModeRename,iFileDirPos);
+	FatMount().DoRenameOrReplaceL(*iFileName, fileName, CFatMountCB::EModeRename, iFileDosEntryPos);
 	
     AllocBufferL(iFileName, fileName);
 	
@@ -712,7 +869,7 @@
 	aInfo.iBlockStartOffset = fatMount.ClusterRelativePos(iCurrentPos.iPos);
 	aInfo.iBlockGranularity = 1 << FatMount().ClusterSizeLog2();
 	const TUint myStartPos = iCurrentPos.iPos;
-	if ( myStartPos + length > (TUint)Size())
+	if ( myStartPos + length > FCB_FileSize())
 		return KErrArgument;
 
 	TRAP(r, FatMount().BlockMapReadFromClusterListL(iCurrentPos, length, aInfo));
@@ -720,7 +877,7 @@
 		return r;
 
 	aStartPos = iCurrentPos.iPos;
-	if ((I64LOW(aStartPos) == (TUint)Size()) || ( I64LOW(aStartPos) == (myStartPos + length)))
+	if ((I64LOW(aStartPos) == FCB_FileSize()) || ( I64LOW(aStartPos) == (myStartPos + length)))
 		return KErrCompletion;
 	else
 		return KErrNone;
@@ -756,17 +913,37 @@
 */
 void CFatFileCB::FlushStartClusterL()
 	{
-	__PRINT(_L("CFatFileCB::FlushStartClusterL"));
+	__PRINT1(_L("CFatFileCB::FlushStartClusterL[0x%x]"), this);
 
     CFatMountCB& mount = FatMount();
     TFatDirEntry dirEntry;
     
-    mount.ReadDirEntryL(iFileDirPos, dirEntry);      //-- read this file's dir. entry
-    dirEntry.SetStartCluster(iStartCluster);         //-- set new start cluster
-    mount.WriteDirEntryL(iFileDirPos, dirEntry);//-- write the entry back
+    mount.ReadDirEntryL(iFileDosEntryPos, dirEntry); //-- read this file's dir. entry
+    dirEntry.SetStartCluster(FCB_StartCluster());    //-- set new start cluster
+    mount.WriteDirEntryL(iFileDosEntryPos, dirEntry);//-- write the entry back
 	}
 
 
+/**
+    This is a RuggedFAT - specific method. Writes file size to the corresponding field of its file directory entry.
+*/
+void CFatFileCB::WriteFileSizeL(TUint aSize)
+	{
+	__PRINT2(_L("CFatFileCB::WriteFileSizeL[0x%x], sz:%d"), this, aSize);
+
+    CFatMountCB& mount = FatMount();
+    TFatDirEntry dirEntry;
+
+    mount.ReadDirEntryL(iFileDosEntryPos, dirEntry); //-- read this file's dir. entry
+    dirEntry.SetSize(aSize);                         //-- set new size
+    mount.WriteDirEntryL(iFileDosEntryPos, dirEntry);//-- write the entry back
+
+    IndicateFileSizeModified(EFalse);
+    }
+
+
 
 
 
+
+
--- a/userlibandfileserver/fileserver/sfat32/sl_fmt.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/sl_fmt.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -51,24 +51,24 @@
 	iBadClusters.Close();
 	}
 
-TInt CFatFormatCB::MaxFat16Sectors() const
-//
-// Calculate the size of a 16 bit FAT
-//
+/**
+    Calculate the size of a 16 bit FAT
+*/
+TUint CFatFormatCB::MaxFat16Sectors() const
 	{
-	
-	TInt fatSizeInBytes=(2*iMaxDiskSectors)/iSectorsPerCluster+(iBytesPerSector-1);
+	const TUint32 fatSizeInBytes=(2*iMaxDiskSectors)/iSectorsPerCluster+(iBytesPerSector-1);
 	return(fatSizeInBytes/iBytesPerSector);
 	}
 
-TInt CFatFormatCB::MaxFat12Sectors() const
-//
-// Calculate the size of a 12 bit FAT
-//
+
+/**
+    Calculate the size of a 12 bit FAT
+*/
+TUint CFatFormatCB::MaxFat12Sectors() const
 	{
+	const TUint32 maxDiskClusters=iMaxDiskSectors/iSectorsPerCluster;
+	const TUint32 fatSizeInBytes=maxDiskClusters+(maxDiskClusters>>1)+(iBytesPerSector-1);
 	
-	TInt maxDiskClusters=iMaxDiskSectors/iSectorsPerCluster;
-	TInt fatSizeInBytes=maxDiskClusters+(maxDiskClusters>>1)+(iBytesPerSector-1);
 	return(fatSizeInBytes/iBytesPerSector);
 	}
 
@@ -205,15 +205,17 @@
     @param  aDiskSizeInSectors volume size in sectors
     @return standard error code
 */
-TInt  CFatFormatCB::InitFormatDataForVariableSizeDisk(TInt aDiskSizeInSectors)
+TInt  CFatFormatCB::InitFormatDataForVariableSizeDisk(TUint aDiskSizeInSectors)
 	{
 	iNumberOfFats=2; // 1 FAT 1 Indirection table (FIT)
 	iReservedSectors=1;
 	iRootDirEntries=2*(4*KDefaultSectorSize)/sizeof(SFatDirEntry);
-	TInt minSectorsPerCluster=(aDiskSizeInSectors+KMaxFAT16Entries-1)/KMaxFAT16Entries;
+	TUint minSectorsPerCluster=(aDiskSizeInSectors+KMaxFAT16Entries-1)/KMaxFAT16Entries;
 	iSectorsPerCluster=1;
+
 	while (minSectorsPerCluster>iSectorsPerCluster)
 		iSectorsPerCluster<<=1;
+
 	__PRINT1(_L("iSectorsPerCluster = %d"),iSectorsPerCluster);
 	iSectorsPerFat=MaxFat16Sectors();
 	__PRINT1(_L("iSectorsPerFat = %d"),iSectorsPerFat);
@@ -277,7 +279,10 @@
     TPtr8 readBufPtr(readBuf, size);
     RArray<TInt> newArray;
     TInt r = DoTranslate(readBufPtr, newArray);
+    
     delete[] readBuf;
+    readBuf = NULL;
+
     newArray.Close();
     User::LeaveIfError(r);
     }
--- a/userlibandfileserver/fileserver/sfat32/sl_leafdir_cache.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/sl_leafdir_cache.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -235,6 +235,7 @@
 CLeafDirTree::CLeafDirTree(TUint32 aSize)
 :iSize(aSize)
 	{
+	__PRINT2(_L("CLeafDirTree created[0x%x] sz:%d"), this, aSize);
 	}
 
 _LIT(KRootDirPath, "\\");
@@ -254,6 +255,8 @@
 */
 CLeafDirTree::~CLeafDirTree()
 	{
+	__PRINT1(_L("~CLeafDirTree[0x%x]"), this);
+
 	Reset();
 	delete iRoot;
 	iLruList.Close();
--- a/userlibandfileserver/fileserver/sfat32/sl_mnt.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/sl_mnt.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -304,11 +304,6 @@
     	{
         iLeafDirCache->Reset();
     	}
-    else
-    	{
-        User::Free(iLastLeafDir);
-        iLastLeafDir=NULL;
-    	}
 	}
 
 //-------------------------------------------------------------------------------------------------------------------
@@ -843,7 +838,7 @@
     @param  aStartCluster   this entry start cluster number
     @param  aParentCluster  parent entry start cluster number
 */
-void CFatMountCB::InitializeFirstDirClusterL(TInt aStartCluster,TInt aParentCluster)
+void CFatMountCB::InitializeFirstDirClusterL(TUint32 aStartCluster, TUint32 aParentCluster)
     {
     const TUint32 KClusterSz= 1<<ClusterSizeLog2();
     const TUint32 KMaxBufSz = KClusterSz;           //-- max. nuffer size is a cluster
@@ -1362,7 +1357,7 @@
 
 //-----------------------------------------------------------------------------------------
 
-void CFatMountCB::DoCheckFatForLoopsL(TInt aCluster, TInt& aPreviousCluster, TInt& aChangePreviousCluster, TInt& aCount) const
+void CFatMountCB::DoCheckFatForLoopsL(TUint32 aCluster, TUint32& aPreviousCluster, TUint32& aChangePreviousCluster, TUint32& aCount) const
 //
 // Check one fat cluster for loops.
 //
@@ -1388,13 +1383,13 @@
 //
     {
 
-    TInt cluster=StartCluster(anEntry);
+    TUint32 cluster = StartCluster(anEntry);
     if (cluster==0 && anEntry.Size()==0)
         return;
 
-    TInt previousCluster=cluster;
-    TInt changePreviousCluster=1;
-    TInt count=0;
+    TUint32 previousCluster=cluster;
+    TUint32 changePreviousCluster=1;
+    TUint32 count=0;
 
 
     for(;;)
@@ -1506,14 +1501,13 @@
         }
 
     CFatFileCB& file=(*((CFatFileCB*)aFile));
-    file.SetL(firstEntry,(TShare)(aMode&KFileShareMask),firstEntryPos);
+    file.SetupL(firstEntry, firstEntryPos);
+
     if (anOpen==EFileReplace && file.Size())
         {
         file.SetSizeL(0);
-        file.SetSize(0);
         }
-    if (file.IsSeekIndex()==EFalse)
-        file.CreateSeekIndex();
+
     if (anOpen==EFileReplace || anOpen==EFileCreate)
         file.SetArchiveAttribute();
 
@@ -1582,10 +1576,10 @@
 
 //-----------------------------------------------------------------------------------------
 
-TBool CFatMountCB::IsDirectoryEmptyL(TInt aCluster)
 //
 // Check aCluster contains no directory entries other than . and ..
 //
+TBool CFatMountCB::IsDirectoryEmptyL(TUint32 aCluster)
     {
 
     __PRINT(_L("CFatMountCB::IsDirectoryEmptyL"));
@@ -1613,13 +1607,13 @@
 /**
     Overwrite as many contiguous file clusters as possible.
 */
-void CFatMountCB::DoWriteToClusterListL(TEntryPos& aPos,TInt aLength,const TAny* aSrc,const RMessagePtr2& aMessage,TInt anOffset, TInt aLastcluster, TInt &aBadcluster, TInt &aGoodcluster)
+void CFatMountCB::DoWriteToClusterListL(TEntryPos& aPos,TInt aLength,const TAny* aSrc,const RMessagePtr2& aMessage,TInt anOffset, TUint aLastcluster, TUint& aBadcluster, TUint& aGoodcluster)
     {
 
     __PRINT(_L("CFatMountCB::DoWriteToClusterListL"));
     __ASSERT_ALWAYS(aPos.Cluster()>=KFatFirstSearchCluster,User::Leave(KErrCorrupt));
 
-    TInt endCluster=0;
+    TUint32 endCluster=0;
 
     const TInt clusterRelativePos=ClusterRelativePos(aPos.iPos);
     const TInt maxClusters=((aLength+clusterRelativePos-1)>>ClusterSizeLog2())+1;
@@ -1645,11 +1639,11 @@
     if(r == KErrNone && errinf().iReasonCode == TErrorInfo::EBadSector) // GetLastErrorInfo succeded and Last Error was caused by bad sector
         {
 
-        const TInt badcluster = (TInt)(((dataStart + errinf().iErrorPos) - ClusterBasePosition())>>ClusterSizeLog2())+KFatFirstSearchCluster;
-              TInt goodcluster = FAT().AllocateSingleClusterL(badcluster);
+        const TUint32 badcluster = (TInt)(((dataStart + errinf().iErrorPos) - ClusterBasePosition())>>ClusterSizeLog2())+KFatFirstSearchCluster;
+              TUint32 goodcluster = FAT().AllocateSingleClusterL(badcluster);
 
         //Calculate cluster number to check whether this write started at the beginning of new cluster or middle of previous cluster.
-        TInt cluster = aPos.iCluster;
+        TUint32 cluster = aPos.iCluster;
         if ( (aPos.iPos) && ((aPos.iPos)==((aPos.iPos >> ClusterSizeLog2())<<ClusterSizeLog2())))
             cluster--;
 
@@ -1742,7 +1736,7 @@
 
 //-----------------------------------------------------------------------------------------
 
-void CFatMountCB::WriteToClusterListL(TEntryPos& aPos,TInt aLength,const TAny* aSrc,const RMessagePtr2& aMessage,TInt anOffset, TInt &aBadcluster, TInt& aGoodcluster)
+void CFatMountCB::WriteToClusterListL(TEntryPos& aPos,TInt aLength,const TAny* aSrc,const RMessagePtr2& aMessage,TInt anOffset, TUint& aBadcluster, TUint& aGoodcluster)
 //
 // Overwrite cluster list.
 //
@@ -1787,7 +1781,7 @@
 
     __PRINT(_L("CFatMountCB::DoReadFromClusterListL"));
 
-    TInt endCluster=0;
+    TUint32 endCluster=0;
 
     const TInt clusterRelativePos=ClusterRelativePos(aPos.iPos);
     const TInt maxClusters=((aLength+clusterRelativePos-1)>>ClusterSizeLog2())+1;
@@ -1860,33 +1854,20 @@
 //
     {
 
-    __PRINT(_L("CFatMountCB::FindLeafDirL"));
+    __PRINT2(_L("CFatMountCB::FindLeafDirL drv:%d, dir:%S"),DriveNumber() ,&aLeafDir);
 
     TLex lex(aName);
     TInt r;
     TEntryPos entryPos(RootIndicator(),0);
 
-    if (iLeafDirCache == NULL)
-    	{
-        TInt leaflen=(iLastLeafDir) ? iLastLeafDir->Length() : 0;
-        TInt namelen=aName.Length();
-        if (leaflen>1 && namelen>=leaflen && *iLastLeafDir==aName.Left(leaflen))
-            {
-            if (leaflen==namelen)
-                return(iLastLeafDirCluster);
-            lex.Inc(leaflen-1);
-            entryPos.iCluster=iLastLeafDirCluster;
-            }
-    	}
-    else
-    	{
-        // Skip root directory
+    ASSERT(iLeafDirCache);
+
         if (iLeafDirCache->CacheCount() > 0 && aName.Length() > 1)
         	{
-        	TInt err = iLeafDirCache->FindInCache(aName, aLeafDir);
+        const TInt err = iLeafDirCache->FindInCache(aName, aLeafDir);
         	if (err == KErrNone)
         		{
-        		ASSERT(aLeafDir.iClusterNum > 0);
+        	ASSERT(ClusterNumberValid(aLeafDir.iClusterNum)); 
         		return aLeafDir.iClusterNum;
         		}
         	else if (err != KErrNotFound)
@@ -1894,23 +1875,27 @@
         		User::LeaveIfError(err);
         		}
         	}
-    	}
-
-    FOREVER
+
+    TFatDirEntry entry;
+    TFileName fileName;
+    TEntryPos startPos;
+    TFatDirEntry startEntry;
+
+    for(;;)
         {
         lex.Inc(); // Skip path delimiter
         lex.Mark();
         r=lex.Remainder().Locate(KPathDelimiter);
+        
         if (r==KErrNotFound)
             r=lex.Remainder().Length();
+        
         if (r==0) // End of the path
             break;
+        
         lex.Inc(r); // Set the token length
-        TFatDirEntry entry;
-
-        TFileName fileName;
-        TEntryPos startPos;
-        TFatDirEntry startEntry;
+        
+        
         DoFindL(lex.MarkedToken(),
         		KEntryAttMatchMask|KEntryAttMatchExclusive,
         		startPos, startEntry, entryPos, entry,
@@ -1921,21 +1906,13 @@
 
         entryPos.iCluster=StartCluster(entry);
         entryPos.iPos=0;
-        }
-
-    if (iLeafDirCache == NULL)
-    	{
-        AllocBufferL(((CFatMountCB*)this)->iLastLeafDir,aName);
-        ((CFatMountCB*)this)->iLastLeafDirCluster=entryPos.iCluster;
-    	}
-    else
-    	{
+        }// for(;;)
+
         if (aName.Length() > 1)
         	{
         	aLeafDir = TLeafDirData(entryPos.iCluster);
             iLeafDirCache->AddToCacheL(aName, aLeafDir);
         	}
-    	}
 
     return entryPos.iCluster;
     }
@@ -1995,7 +1972,7 @@
 
 	TInt numFound = 0;
 	TEntryPos startPos = DosEntryPos1;
-	TInt clusterNum = DosEntryPos1.iCluster;
+	TUint32 clusterNum = DosEntryPos1.iCluster;
 
     for(TUint32 entryCnt=0; entryCnt < maxDirEntries; ++entryCnt)
         {//-- walk through directory cluster list. The loop is limited by maximal number of dir entries
@@ -2041,7 +2018,7 @@
             for(;;)
                 {
                 StartEntryPos1 = DosEntryPos1;
-                TInt clSave = DosEntryPos1.iCluster; //-- need to save current cluster number because GetDirEntry() & MoveToNextEntryL() can change it
+                TUint32 clSave = DosEntryPos1.iCluster; //-- need to save current cluster number because GetDirEntry() & MoveToNextEntryL() can change it
 
                 //-- get directory entry from the cache. We know that the DosEntryPos1 is cached.
                 nErr = GetDirEntry(DosEntryPos1, DosEntry1, StartEntry1, aFileName);
@@ -2460,10 +2437,10 @@
 
     __PRINT2(_L("CFatMountCB::DoFindL() drv:%d, %S"),Drive().DriveNumber(),&aTrgtName);
 
-    TInt previousCluster=aDosEntryPos.iCluster;
+    TUint32 previousCluster=aDosEntryPos.iCluster;
     TUint previousPosition=aDosEntryPos.iPos;
-    TInt changePreviousCluster=1;
-    TInt count=0;
+    TUint32 changePreviousCluster=1;
+    TUint32 count=0;
 
     TBool trgNameIsWildCard     = EFalse; //-- ETrue if the name we are looking for is a wildcard
     TBool trgNameFullySpecified = ETrue;  //-- ETrue if the name we are looking for doesn't contain wildcards
@@ -2948,7 +2925,7 @@
     Zero fill a cluster
     @param  aCluster cluster number to zero-fill
 */
-void CFatMountCB::ZeroDirClusterL(TInt aCluster)
+void CFatMountCB::ZeroDirClusterL(TUint32 aCluster)
     {
 
     __PRINT1(_L("CFatMountCB::ZeroDirClusterL %d"),aCluster);
@@ -3165,12 +3142,12 @@
 //-----------------------------------------------------------------------------------------
 
 /** Read the Uid of the entry starting at aCluster */
-void CFatMountCB::ReadUidL(TInt aCluster,TEntry& anEntry) const
+void CFatMountCB::ReadUidL(TUint32 aCluster,TEntry& anEntry) const
     {
 
     __PRINT1(_L("CFatMountCB::ReadUidL(%d)"), aCluster);
 
-    if((TUint)aCluster < KFatFirstSearchCluster || (TUint)aCluster >= UsableClusters()+KFatFirstSearchCluster)
+    if(aCluster < KFatFirstSearchCluster || aCluster >= UsableClusters()+KFatFirstSearchCluster)
         User::Leave(KErrCorrupt);
 
     TBuf8<sizeof(TCheckedUid)> uidBuf;
@@ -3227,10 +3204,10 @@
     if ((TUint)(aPos+aLength)>fileSize)
         aLength=fileSize-aPos;
 
-    TInt cluster=StartCluster(dosEntry);
+    TUint32 cluster=StartCluster(dosEntry);
 	TInt pos = aPos;
 
-    TInt endCluster;
+    TUint32 endCluster;
     TInt clusterSize=1<<ClusterSizeLog2();      //  Size of file clusters
 	TInt readTotal = 0;
 
@@ -3346,14 +3323,16 @@
 
 //-----------------------------------------------------------------------------------------
 
+/**
+    Write a FAT directory entry to disk. Assumes sufficient space has been created for it by AddDirEntry.
+
+    @param  aPos        dir. entry position 
+    @param  aDirEntry   entry data
+*/
 void CFatMountCB::WriteDirEntryL(const TEntryPos& aPos,const TFatDirEntry& aDirEntry)
-//
-// Write a FAT directory entry to disk.
-// Assumes sufficient space has been created for it by AddDirEntry.
-//
     {
 
-    __PRINT(_L("CFatMountCB::WriteDirEntryL"));
+    __PRINT2(_L("CFatMountCB::WriteDirEntryL cl:%d, pos:%d"), aPos.Cluster(), aPos.Pos());
 
     //-- use special interface to access FAT directory file
     DirWriteL(aPos,TPtrC8((TUint8*)&aDirEntry,KSizeOfFatDirEntry));
@@ -3361,15 +3340,13 @@
 
 //-----------------------------------------------------------------------------------------
 
+/**
+    Mark a dir entry as erased
+    @param  aPos dir. entry position 
+*/
 void CFatMountCB::EraseDirEntryL(const TEntryPos& aPos)
-//
-// Mark a dir entry as erased
-//
     {
-
-    __PRINT(_L("CFatMountCB::EraseDirEntryL"));
-    if(!iLeafDirCache && iLastLeafDir)
-        iLastLeafDir->Des().SetLength(0);
+    __PRINT2(_L("CFatMountCB::EraseDirEntryL cl:%d, pos:%d"), aPos.Cluster(), aPos.Pos());
 
     //-- use special interface to access FAT directory file
     DirWriteL(aPos,TPtrC8((TUint8*)&KEntryErasedMarker,sizeof(TUint8)));
@@ -3377,10 +3354,12 @@
 
 //-----------------------------------------------------------------------------------------
 
+/**
+    Read a FAT directory entry 
+    @param  aPos        dir. entry position 
+    @param  aDirEntry   entry data
+*/
 void CFatMountCB::ReadDirEntryL(const TEntryPos& aPos,TFatDirEntry& aDirEntry) const
-//
-// Read a FAT directory entry to disk
-//
     {
 
 //  __PRINT(_L("CFatMountCB::ReadDirEntryL"));
@@ -3525,7 +3504,7 @@
     This method is called for rugged FAT only.
     for parameters see CFatTable::ExtendClusterListL
 */
-void CFatMountCB::ExtendClusterListZeroedL(TInt aNumber,TInt& aCluster)
+void CFatMountCB::ExtendClusterListZeroedL(TUint32 aNumber, TUint32& aCluster)
     {
     __PRINT(_L("CFatMountCB::ExtendClusterListZeroedL"));
     __ASSERT_DEBUG(aNumber>0,Fault(EFatBadParameter));
@@ -3961,10 +3940,10 @@
         User::Leave(KErrNotFound); // Allows maximum number of entries in root directory
         }
 
-    TInt previousCluster= aDosEntryPos.iCluster;
+    TUint32 previousCluster= aDosEntryPos.iCluster;
     TUint previousPosition= aDosEntryPos.iPos;
-    TInt changePreviousCluster=1;
-    TInt count=0;
+    TUint32 changePreviousCluster=1;
+    TUint32 count=0;
 
     TFatDirEntry startEntry;
     TFileName dummyLongName;
@@ -4054,7 +4033,7 @@
     TUint i = 0;
     TInt clusterRelativePos;
     TInt maxClusters;
-    TInt endCluster;
+    TUint32 endCluster;
     TInt clusterListLen;
     TInt readLength;
     TInt temp;
@@ -4205,6 +4184,7 @@
         }
 
     delete pScnDrv;
+    pScnDrv = NULL;
 
     if(chkDskRes != KErrNone)
         {
@@ -4234,7 +4214,7 @@
 
     const TBool bNeedFatRemount = (nScnDrvRes!=KErrNone) || pScnDrv->ProblemsDiscovered();
     delete pScnDrv;
-
+    pScnDrv = NULL;
 
     if(bNeedFatRemount)
         {//-- ScanDrive found and probably fixed some errors.
--- a/userlibandfileserver/fileserver/sfat32/sl_mnt32.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/sl_mnt32.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -256,7 +256,7 @@
 
         if(tmp != fatEntry)
             {//-- write FAT[1] entry to all available FATs
-                for(TInt i=0; i<NumberOfFats(); ++i)
+                for(TUint32 i=0; i<NumberOfFats(); ++i)
                 {
                 const TInt64 pos = StartOfFatInBytes()+KFatEntrySize+(FatSizeInBytes()*i);
                 User::LeaveIfError(LocalDrive()->Write(pos, ptrFatEntry)); //write FAT32[1] entry
@@ -287,7 +287,7 @@
 
             if(tmp != fatEntry)
                 {//-- write FAT[1] entry to all available FATs
-                for(TInt i=0; i<NumberOfFats(); ++i)
+                for(TUint32 i=0; i<NumberOfFats(); ++i)
                     {
                     const TInt64 pos = StartOfFatInBytes()+KFatEntrySize+(FatSizeInBytes()*i);
                     User::LeaveIfError(LocalDrive()->Write(pos, ptrFatEntry)); //write FAT16[1] entry
@@ -367,7 +367,7 @@
 
     const TInt driveNo = Drive().DriveNumber();
     
-    __PRINT2(_L("CFatMountCB::MountL() drv:%d, forceMount=%d\n"),driveNo,aForceMount);
+    __PRINT3(_L("CFatMountCB::MountL() drv:%d, forceMount=%d, RuggedFAT:%d\n"), driveNo, aForceMount, IsRuggedFSys());
 
     ASSERT(State() == ENotMounted || State() == EDismounted);
     SetState(EMounting);
@@ -476,13 +476,13 @@
 
 
 	    {//-- check if volume geometry looks valid
-        const TInt usableSectors=TotalSectors()-(iFirstFreeByte>>SectorSizeLog2());
+        const TUint32 usableSectors = TotalSectors()-(iFirstFreeByte>>SectorSizeLog2());
 	    iUsableClusters=usableSectors>>(ClusterSizeLog2()-SectorSizeLog2());
 
         const TUint32 KMinClusters = 32; //-- absolute minimum number of clusters on the volume
         const TUint32 KMaxClusters=(TotalSectors()-FirstFatSector()-NumberOfFats()*(FatSizeInBytes()>>SectorSizeLog2())) >> (ClusterSizeLog2()-SectorSizeLog2());
         
-        if(usableSectors <=0 || iUsableClusters < KMinClusters || iUsableClusters > KMaxClusters)
+        if(iUsableClusters < KMinClusters || iUsableClusters > KMaxClusters)
             {
             __PRINT(_L("CFatMountCB::InitializeL() Wrong number of usable cluster/sectors on the volume!"));
             User::Leave(KErrCorrupt);
@@ -493,6 +493,7 @@
 	//-- CFatMountCB parameters might have changed, e.g. after formatting. Reconstruct directory cache with new parameters
 	
     delete iRawDisk;
+    iRawDisk = NULL;
 	iRawDisk=CRawDisk::NewL(*this, aLocDrvCaps);
     iRawDisk->InitializeL();
 
@@ -538,6 +539,7 @@
     //========== create and initialise FAT table 
 	
     delete iFatTable;
+    iFatTable = NULL;
     iFatTable=CFatTable::NewL(*this, aLocDrvCaps);
 
     //-- mount the FAT table. Depending on mount parameters and configuration this method 
@@ -550,19 +552,17 @@
     //-- make a callback, telling FileServer about free space discovered.
     const TInt64 freeSpace = ((TInt64)FAT().NumberOfFreeClusters()) << ClusterSizeLog2();
     SetDiskSpaceChange(freeSpace);
-    //========== create and setup leaf direcotry cache if cache limit is set bigger than one 
 
-	const TUint32 cacheLimit = iFatConfig.LeafDirCacheSize();
-	if (cacheLimit > 1)
+    //========== create and setup leaf direcotry cache
 		{
-		// destroy the old leaf dir cache to avoid memory leak.
+	const TUint32 cacheLimit = Max(iFatConfig.LeafDirCacheSize(), 1lu);
+	
 		delete iLeafDirCache;
+        iLeafDirCache = NULL;
 		iLeafDirCache = CLeafDirCache::NewL(cacheLimit);
 		}
-	else
-		{
-		iLeafDirCache = NULL;
-		}
+
+
     
     __PRINT3(_L("#- CFatMountCB::InitializeL() done. drv:%d, Free clusters:%d, 1st Free cluster:%d"),DriveNumber(), FAT().NumberOfFreeClusters(), FAT().FreeClusterHint());
 
@@ -881,6 +881,7 @@
         nRes = IsFinalised(bFinalised);
         if(nRes == KErrNone)
             {
+            ASSERT(aParam);
             *((TBool*)aParam) = bFinalised;
             }
         
@@ -1047,7 +1048,7 @@
     TInt cluster=StartCluster(dosEntry);	
 	TInt64 pos = aPos;
 	
-    TInt endCluster;
+    TUint32 endCluster;
     TInt clusterSize=1<<ClusterSizeLog2();      //  Size of file clusters
 	TInt readTotal = 0;
 	
--- a/userlibandfileserver/fileserver/sfat32/sl_scan32.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/sl_scan32.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -94,7 +94,7 @@
 //----------------------------------------------------------------------------------------------------
 /**
     FAT type-agnostic parser. Reads whole FAT and sets up a bit vector.
-    for FAT12/16 it's OK, because the FAT12/16 is fully cached.
+    For FAT12/16 it's OK, because the FAT12/16 is fully cached.
 */
 void CScanDrive::DoParseFatL()
     {
@@ -255,8 +255,9 @@
 
 //----------------------------------------------------------------------------------------------------
 /**
-    Start the scanner. The this calss description about what it actually does.
-    @param  aMode specifies the operational mode.
+    Starts the scanner.
+    
+    @param	aMode	Specifies the operational mode.
 */
 void CScanDrive::StartL(TScanDriveMode aMode)
 	{
@@ -277,7 +278,7 @@
 
 	CheckDirStructureL();
 
-    //-- uncomments a line below if you need to compare real and restored FAT tables and print out all differences
+    //-- uncomment a line below if you need to compare real and restored FAT tables and print out all differences
     //CompareFatsL(EFalse);
 
         //timeEnd.UniversalTime(); //-- take end time
@@ -363,7 +364,11 @@
 			}
 		}
 
-	__ASSERT_ALWAYS(err==KErrNone,User::Leave(KErrNotFound));
+    if(err != KErrNone)
+        {
+        __PRINT1(_L("CScanDrive::FindSameStartClusterL() #1 %d"), err);
+        User::Leave(KErrNotFound);
+        }
 	}
 
 //----------------------------------------------------------------------------------------------------
@@ -374,21 +379,32 @@
     @return System wide error value
     @leave 
 */
-TInt CScanDrive::FindStartClusterL(TInt aDirCluster)
+TInt CScanDrive::FindStartClusterL(TUint32 aDirCluster)
 	{
 	__PRINT1(_L("CScanDrive::FindStartCluster dirCluster=%d"),aDirCluster);
-	__ASSERT_ALWAYS(aDirCluster>=iMount->RootIndicator(),User::Leave(KErrCorrupt));
+	
+	if(aDirCluster < (TUint)iMount->RootIndicator() || aDirCluster >= MaxClusters())
+        {
+        __PRINT(_L("CScanDrive::FindStartCluster() #!\n"));
+        IndicateErrorsFound(EBadClusterNumber);
+        User::Leave(KErrCorrupt);
+        }
+
+
 	if(++iRecursiveDepth==KMaxScanDepth)
 		{
 		--iRecursiveDepth;
 		return(KErrNotFound);
 		}
+
 	TEntryPos entryPos(aDirCluster,0);
 	TInt dirEntries=0;
-	FOREVER
+
+	for(;;)
 		{
 		TFatDirEntry entry;
 		ReadDirEntryL(entryPos,entry);
+
 		if(entry.IsParentDirectory()||entry.IsCurrentDirectory()||entry.IsErased())
 			{
 			if(IsEndOfRootDir(entryPos))
@@ -396,12 +412,20 @@
 			MoveToNextEntryL(entryPos);
 			continue;
 			}
+
 		if(entry.IsEndOfDirectory())
 			break;
-		TBool isComplete;
+		
 		TEntryPos vfatPos=entryPos;
-		isComplete=MoveToVFatEndL(entryPos,entry,dirEntries);
-		__ASSERT_ALWAYS(isComplete,User::Leave(KErrBadName));
+		const TBool isComplete = MoveToVFatEndL(entryPos,entry,dirEntries);
+		
+        if(!isComplete)
+            {
+            __PRINT(_L("CScanDrive::FindStartCluster() #2\n"));
+            IndicateErrorsFound(EEntrySetIncomplete);
+            User::Leave(KErrBadName);
+            }
+
 
 		TInt err=CheckEntryClusterL(entry,vfatPos);
 		if(err==KErrNone)
@@ -440,7 +464,7 @@
 	else if(aEntry.Attributes()&KEntryAttDir)
 		return(FindStartClusterL(iMount->StartCluster(aEntry)));
 
-	return(KErrNotFound);
+	return KErrNotFound;
 	}
 
 //----------------------------------------------------------------------------------------------------
@@ -526,6 +550,7 @@
         
         if(!isComplete && CheckDiskMode())
             {//-- broken VFAT entryset; in CheckDisk mode this is the FS error, abort further activity
+                __PRINT(_L("CScanDrive::CheckDirL() #1"));
                 IndicateErrorsFound(EInvalidEntrySize);
                 User::Leave(KErrCorrupt);
             }
@@ -577,13 +602,18 @@
 void CScanDrive::ProcessEntryL(const TFatDirEntry& aEntry)
 	{
 	__PRINT(_L("CScanDrive::ProcessEntryL"));
-	TInt entryAtt=aEntry.Attributes();
+	const TUint entryAtt=aEntry.Attributes();
 
-	__ASSERT_ALWAYS(!(entryAtt&~KEntryAttMaskSupported)&&!aEntry.IsErased(),User::Leave(KErrCorrupt));
+    if((entryAtt & ~KEntryAttMaskSupported) || aEntry.IsErased())
+        {
+        __PRINT1(_L("CScanDrive::ProcessEntryL() wrong entry att: 0x%x"), entryAtt);
+        IndicateErrorsFound(EEntryBadAtt);
+        User::Leave(KErrCorrupt);
+        }
 	
     if(!(entryAtt&(KEntryAttDir|KEntryAttVolume)) && iMount->StartCluster(aEntry)>0)
 		{//-- this is a file with length >0. Check that its cluster chain corresponds to its size
-        RecordClusterChainL(iMount->StartCluster(aEntry),(TUint) aEntry.Size());
+        RecordClusterChainL(iMount->StartCluster(aEntry), aEntry.Size());
         }
 	else if(entryAtt&KEntryAttDir)
 		{//-- this is the directory, walk into it
@@ -601,34 +631,52 @@
     @param aSizeInBytes Size of the file or directory in bytes
     @leave System wide error values
 */
-void CScanDrive::RecordClusterChainL(TInt aCluster, TUint aSizeInBytes)
+void CScanDrive::RecordClusterChainL(TUint32 aCluster, TUint aSizeInBytes)
 	{
 	__PRINT2(_L("CScanDrive::RecordClusterChainL() cl:%d, sz:%d") ,aCluster, aSizeInBytes);
-	__ASSERT_ALWAYS(aCluster>0, User::Leave(KErrCorrupt));
+
+    if(aCluster < KFatFirstSearchCluster || aCluster >= MaxClusters())
+	    {
+        __PRINT(_L("CScanDrive::RecordClusterChainL() #0"));
+        IndicateErrorsFound(EBadClusterNumber);
+        User::Leave(KErrCorrupt);
+        }
 	
     TUint clusterCount;
 	
     if(aSizeInBytes==0)
+		{
 		clusterCount=1;
+        }
 	else
 		{
         const TUint64 tmp = aSizeInBytes + Pow2_64(iMount->ClusterSizeLog2()) - 1;
         clusterCount = (TUint) (tmp >> iMount->ClusterSizeLog2());
         }
 
-	TInt startCluster=aCluster;
+	TUint startCluster=aCluster;
+	
 	while(clusterCount)
 		{
         if(IsClusterUsedL(aCluster))
 			{//-- this cluster already seems to belong to some other object; crosslinked cluster chain. Can't fix it.
-			if(CheckDiskMode())
+                __PRINT1(_L("CScanDrive::RecordClusterChainL #1 %d"),aCluster); 
+            
+            if(CheckDiskMode())
                 {//-- in check disk mode this is a FS error; Indicate error and abort furter scanning
-                __PRINT1(_L("CScanDrive::RecordClusterChainL #1 %d"),aCluster); 
+                __PRINT(_L("CScanDrive::RecordClusterChainL #1.1")); 
                 IndicateErrorsFound(EClusterAlreadyInUse);
                 User::Leave(KErrCorrupt);
                 }
             
-            __ASSERT_ALWAYS(!IsDirError() && iMatching.iStartCluster==0 && aCluster==startCluster,User::Leave(KErrCorrupt));
+            
+            if(IsDirError() || iMatching.iStartCluster > 0 || aCluster != startCluster)
+                {//-- secondary entry into this state
+                __PRINT(_L("CScanDrive::RecordClusterChainL #1.2")); 
+                IndicateErrorsFound(EClusterAlreadyInUse);
+                User::Leave(KErrCorrupt);
+                }
+
 			iMatching.iStartCluster=aCluster;
 			iDirError=EScanMatchingEntry;		//ERROR POINT
             IndicateErrorsFound(EScanDriveDirError); //-- indicate that we have found errors
@@ -637,10 +685,10 @@
 
 		
         if(clusterCount==1)
-			{
+			{//-- we have reached the end of the cluster chain
 			if(!iMount->IsEndOfClusterCh(ReadFatL(aCluster)))
-				{//-- seems to be a rugged FAT artefact; File truncation had failed before and now file length is less than
-                 //-- the corresponding cluster chain shall be. It will be truncated.
+				{//-- seems to be a rugged FAT artefact; File truncation/extension had failed before and now file length is less than
+                 //-- the corresponding cluster chain shall be. It will be truncated to the size recorded in file DOS entry.
 				iTruncationCluster = aCluster;								
                 
                 if(CheckDiskMode())
@@ -660,8 +708,14 @@
 			const TUint clusterVal=ReadFatL(aCluster);
 
             //__PRINT2(_L("#--: %d -> %d"), aCluster, clusterVal); 
-			
-            __ASSERT_ALWAYS(!IsEofF(clusterVal) && clusterVal !=KSpareCluster, User::Leave(KErrCorrupt));
+            if(IsEofF(clusterVal) || clusterVal == KSpareCluster )
+                {//-- unexpected end of the cluster chain (it is shorter than recorded in file dir. entry)
+                __PRINT1(_L("CScanDrive::RecordClusterChainL #3 %d"),clusterVal); 
+                IndicateErrorsFound(EBadClusterValue);
+                User::Leave(KErrCorrupt);
+                }
+
+
 			MarkClusterUsedL(aCluster);
 			aCluster=clusterVal;
 			--clusterCount;
@@ -688,9 +742,16 @@
 		return IsDosEntry(aEntry);
 
 	TInt toFollow=aEntry.NumFollowing();
-	__ASSERT_ALWAYS(toFollow>0 && !aEntry.IsErased(), User::Leave(KErrCorrupt));
 
-	FOREVER
+    if(toFollow <=0 || aEntry.IsErased())
+        {
+        __PRINT1(_L("CScanDrive::MoveToVFatEndL #1 %d"),toFollow);
+        IndicateErrorsFound(EEntrySetIncomplete);
+        User::Leave(KErrCorrupt);
+        }
+
+
+	for(;;)
 		{
 		MoveToNextEntryL(aPos);
 		ReadDirEntryL(aPos,aEntry);
@@ -731,7 +792,7 @@
 */
 TBool CScanDrive::IsDosEntry(const TFatDirEntry& aEntry)const
 	{
-	TBool res = !(aEntry.Attributes()&~KEntryAttMaskSupported) && !aEntry.IsErased() && !aEntry.IsVFatEntry() && !aEntry.IsEndOfDirectory();
+	const TBool res = !(aEntry.Attributes()&~KEntryAttMaskSupported) && !aEntry.IsErased() && !aEntry.IsVFatEntry() && !aEntry.IsEndOfDirectory();
 	return res;
 	} 
 
@@ -746,7 +807,13 @@
 void CScanDrive::AddPartialVFatL(const TEntryPos& aStartPos, const TFatDirEntry& aEntry)
 	{
 	__PRINT2(_L("CScanDrive::AddPartialVFatL cluster=%d pos=%d"),aStartPos.iCluster,aStartPos.iPos);
-	__ASSERT_ALWAYS(!IsDirError(),User::Leave(KErrCorrupt));
+
+    if(IsDirError())
+        {
+        __PRINT(_L("CScanDrive::AddPartialVFatL #1"));
+        User::Leave(KErrCorrupt);
+        }
+
 	iPartEntry.iEntryPos=aStartPos;
 	iPartEntry.iEntry=aEntry;
 	iDirError=EScanPartEntry;
@@ -763,7 +830,14 @@
 TBool CScanDrive::AddMatchingEntryL(const TEntryPos& aEntryPos)
 	{
 	__PRINT2(_L("CScanDrive::AddMatchingEntryL cluster=%d pos=%d"),aEntryPos.iCluster,aEntryPos.iPos);
-	__ASSERT_ALWAYS(iMatching.iStartCluster>0 && iMatching.iCount<KMaxMatchingEntries,User::Leave(KErrCorrupt));
+	
+    if(iMatching.iStartCluster <= 0 || iMatching.iCount >= KMaxMatchingEntries)
+        {
+        __PRINT(_L("CScanDrive::AddMatchingEntryL #1"));
+        User::Leave(KErrCorrupt);
+        }
+
+
 	iMatching.iEntries[iMatching.iCount++]=aEntryPos;
 	return iMatching.iCount==KMaxMatchingEntries;
 	}
@@ -873,7 +947,6 @@
     Read the "Rugged FAT" ID, stored in reserved2 in the Dos entry or associated with the Dos entry of the 
     Entry at the position passed in. This is used to find which version of two matching entries should be kept.
 
-
     @param aVFatPos Position of an entry to read ID from
     @leave System wide error codes
     @return The ID found in reserved2 field of dos entry 
@@ -886,10 +959,13 @@
 	if(!IsDosEntry(entry))
 		{
 		TInt toMove=entry.NumFollowing();
+		
 		while(toMove--)
 			MoveToNextEntryL(aVFatPos);
+		
 		ReadDirEntryL(aVFatPos,entry);
 		}
+	
 	return(entry.RuggedFatEntryId());
 	}
 
@@ -916,15 +992,24 @@
 	{
 	
     __PRINT1(_L("CScanDrive::FixMatchingEntryL() start cluster=%d"),iMatching.iStartCluster);
-	__ASSERT_ALWAYS(iMatching.iCount==KMaxMatchingEntries,User::Leave(KErrCorrupt));
+	
+    if(iMatching.iCount != KMaxMatchingEntries)
+        {
+        __PRINT1(_L("CScanDrive::FixMatchingEntryL() #1 %d"), iMatching.iCount);            
+        User::Leave(KErrCorrupt);
+        }
+
 	ASSERT(!CheckDiskMode());
 
-    TInt idOne=GetReservedidL(iMatching.iEntries[0]);
-	TInt idTwo=GetReservedidL(iMatching.iEntries[1]);
+    const TInt idOne=GetReservedidL(iMatching.iEntries[0]);
+	const TInt idTwo=GetReservedidL(iMatching.iEntries[1]);
 	TFatDirEntry entry;
-	TInt num=idOne>idTwo?0:1;
+	
+    const TInt num = idOne>idTwo ? 0:1;
 	ReadDirEntryL(iMatching.iEntries[num],entry);
+
 	iMount->EraseDirEntryL(iMatching.iEntries[num],entry);
+    
     IndicateErrorsFound(EScanDriveDirError); //-- indicate that we have found errors
 	}
 
@@ -964,6 +1049,7 @@
 
 	if(iClusterListArray[iListArrayIndex]==NULL)
 		iClusterListArray[iListArrayIndex]=new(ELeave) RArray<TInt>(KClusterListGranularity);
+
 	iClusterListArray[iListArrayIndex]->Append(aCluster);
 	}
 
@@ -1111,6 +1197,7 @@
 	{
 	if(aClusterNum < KFatFirstSearchCluster || aClusterNum >= MaxClusters())
         {
+        __PRINT1(_L("CScanDrive::ReadFatL() bad cluster:%d\n"),aClusterNum);
         IndicateErrorsFound(EBadClusterNumber);
         User::Leave(KErrCorrupt);
         }
@@ -1129,6 +1216,7 @@
 	{
 	if(aClusterNum < KFatFirstSearchCluster || aClusterNum >= MaxClusters())
         {
+        __PRINT1(_L("CScanDrive::MarkClusterUsedL() bad cluster:%d\n"),aClusterNum);
         IndicateErrorsFound(EBadClusterNumber);
         User::Leave(KErrCorrupt);
         }
@@ -1145,6 +1233,7 @@
 	{
 	if(aClusterNum < KFatFirstSearchCluster || aClusterNum >= MaxClusters())
         {
+        __PRINT1(_L("CScanDrive::IsClusterUsedL() bad cluster:%d\n"),aClusterNum);
         IndicateErrorsFound(EBadClusterNumber);
         User::Leave(KErrCorrupt);
         }
--- a/userlibandfileserver/fileserver/sfat32/sl_vfat.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfat32/sl_vfat.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -439,14 +439,12 @@
 /**
     Returns ETrue if aName is unique, EFalse if a matching name is found.
 */
-TBool CFatMountCB::IsUniqueNameL(const TShortName& aName,TInt aDirCluster)
+TBool CFatMountCB::IsUniqueNameL(const TShortName& aName, TUint32 aDirCluster)
 	{
 
 	__PRINT(_L("CFatMountCB::IsUniqueNameL"));	
 	TEntryPos entryPos(aDirCluster,0);
-	if (FindShortNameL(aName,entryPos))
-		return(EFalse);
-	return(ETrue);
+	return ! FindShortNameL(aName,entryPos);
 	}
 
 //-----------------------------------------------------------------------------
@@ -478,12 +476,11 @@
 		}
 	}
 
-//-----------------------------------------------------------------------------
 /**
     Generate a legal dos filename as an alias for aName.
     @return ETrue if aName is a legal dos name.
 */
-TBool CFatMountCB::GenerateShortNameL(TInt aDirCluster,const TDesC& aName,TShortName& aGeneratedName, TBool aForceRandomize)
+TBool CFatMountCB::GenerateShortNameL(TUint32 aDirCluster,const TDesC& aName,TShortName& aGeneratedName, TBool aForceRandomize)
 	{
 
 	__PRINT1(_L("CFatMountCB::GenerateShortNameL() cl:%d"), aDirCluster);
--- a/userlibandfileserver/fileserver/sfile/sf_ext.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfile/sf_ext.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -226,14 +226,14 @@
 /** Create drive
 	Ascertain if the drive is mapped to a local drive or a proxy drive, and create the drive
 	as appropriate
-	@param aDriveNumer drive number
-	@return KErrNone on success
-		     KErrArgument is the drive is not mapped to a proxy or a local drive or if the number
-		     is invalid
+	@param	aDriveNumber	drive number
+	@return	KErrNone		on success
+			KErrArgument	if the drive is not mapped to a proxy or a local drive or if the number
+							is invalid
 */
 	{
 	// dunno why we are using TInts instead of TUints here
-	__PRINT(_L("CLocDrvMountCB::CreateLocalDrive()"));
+	__PRINT(_L("CLocDrvMountCB::CreateDrive()"));
 
 	if (aDriveNumber<0 || aDriveNumber>=KMaxDrives) return KErrArgument;
 	TInt r = KErrNone;
@@ -246,10 +246,10 @@
 	else
 		{
 		CExtProxyDrive* pProxyDrive = LocalDrives::GetProxyDrive(aDriveNumber);
-		__ASSERT_ALWAYS(pProxyDrive != NULL,User::Panic(_L("CreateDrive - pProxyDrive == NULL"), -999));
+		__ASSERT_ALWAYS(pProxyDrive != NULL,User::Panic(_L("CreateDrive() - pProxyDrive == NULL"), -999));
 
-		iProxyDrive = CreateProxyDriveL(pProxyDrive, this);
-		__ASSERT_ALWAYS(iProxyDrive != NULL,User::Panic(_L("CreateDrive - CreateProxyDrive returned NULL"), -999));
+		TRAP(r, iProxyDrive = CreateProxyDriveL(pProxyDrive,this));
+		__ASSERT_ALWAYS(r == KErrNone,User::Panic(_L("CreateDrive() - CreateProxyDriveL error"), -999));
 
 		r = InitLocalDrive();
 		}
--- a/userlibandfileserver/fileserver/sfile/sf_file.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfile/sf_file.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -462,13 +462,24 @@
 
 	__PRINT(_L("TFsIsFileOpen::DoRequestL(CFsRequest* aRequest)"));
 	CFileCB* file;
-	TInt r=aRequest->Drive()->IsFileOpen(aRequest->Src().FullName().Mid(2),file);
-	if (r!=KErrNone)
-		return(r);
-	TBool isOpen = file?(TBool)ETrue:(TBool)EFalse;
+	TInt r = aRequest->Drive()->IsFileOpen(aRequest->Src().FullName().Mid(2), file);
+	if (r != KErrNone)
+		return (r);
+	TBool isOpen = file ? (TBool)ETrue : (TBool)EFalse;
+	if (!isOpen)
+		{
+		// perform the existance check to retain compatibility with old-style clients
+		TEntry e;
+		r = aRequest->Drive()->Entry(aRequest->Src().FullName().Mid(2), e);
+		if (r == KErrNone && e.IsDir())
+			r = KErrArgument;
+		}
+	if (r != KErrNone)
+		return (r);
+
 	TPtrC8 pA((TUint8*)&isOpen,sizeof(TBool));
 	aRequest->WriteL(KMsgPtr1,pA);
-	return(KErrNone);
+	return (KErrNone);
 	}
 
 TInt TFsIsFileOpen::Initialise(CFsRequest* aRequest)
--- a/userlibandfileserver/fileserver/sfsrv/cl_cli.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/sfsrv/cl_cli.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -2630,29 +2630,37 @@
 	}
 
 
-
 /**
-Checks the integrity of the disk on the specified drive.
-On FAT, this checks if a cluster number is invalid, if a cluster is allocated to
-more than one file entry, if an unallocated cluster is not set free, and if size
-of an entry is invalid.
-
-@param aDrive Path indicating the drive which contains the disk to be checked. If the drive 
-        information is not specified the current session drive is taken by default.
-		Checkdisk is performed on the requested drive irrespective of the correctness or
-		existance of the given path.
-
-@return KErrNone, if successful;
-		1, if successful but a file cluster contains a bad value;
-		2, if successful but two files are linked to the same cluster;
-		3, if successful but an unallocated cluster contains a value;
-		4, if successful but the size of a file is not equal to the number of clusters in chain;
-        KErrNotReady, if the specified drive is empty;
-        KErrNotSupported, if the drive cannot handle this request;
-        KErrPermissionDenied, if the caller doesn't have DiskAdmin capability;
-        Other system wide error codes may also be returned.
-
-@capability DiskAdmin
+Checks the integrity of the File System mounted on the specified drive.
+The behaviour of this API and return codes are File System specific,
+dependent on how the File System implements its CheckDisk functionality.
+Note that CheckDisk does not fix any errors that may be found,
+it just reports the first problem it has found.
+
+@param	aDrive	Path containing the drive to be checked.
+				If the drive letter is not specified, the current session drive is taken by default.
+
+@return	KErrNone				If CheckDisk has not found any errors it knows about.
+        KErrNotReady			If the specified drive is not ready.
+        KErrNotSupported		If this functionality is not supported.
+        KErrPermissionDenied	If the caller does not have DiskAdmin capability.
+        Other system-wide error codes.
+
+@capability	DiskAdmin
+
+FAT File System specific information:
+
+CheckDisk checks for a limited amount of possible corruption cases such as
+invalid cluster numbers in the FAT table, lost and cross-linked cluster chains,
+various errors within the directory entry etc.
+
+If CheckDisk returns KErrNone, this means that there are no errors that CheckDisk on FAT is aware of.
+
+Error codes returned by the FAT version of CheckDisk include: 
+		1	Bad cluster value in FAT table detected.
+		2	Cross-linked cluster chain detected.
+		3	Lost cluster chain detected.
+		4	File size does not correspond to the number of clusters reported in the FAT table.
 */
 EFSRV_EXPORT_C TInt RFs::CheckDisk(const TDesC& aDrive) const
 	{
@@ -2668,24 +2676,42 @@
 
 EFSRV_EXPORT_C TInt RFs::ScanDrive(const TDesC& aDrive) const
 /**
-Checks the specified drive for errors and corrects them. Specifically, it
-checks if long file name entries' IDs are in sequence and short name is valid,
-and file's allocated clusters are not used by other files.
-
-This does not run on the internal RAM drive, and only applies to a
-FAT file system.
-
-@param aDrive Path indicating the drive which contains the disk to be checked. If the drive 
-        information is not specified the current session drive is taken by default.
-		ScanDrive is performed on the requested drive irrespective of the correctness or
-		existance of the given path.
-
-@return KErrNone if successful,
-        KErrPermissionDenied if caller doesn't have capability DiskAdmin,
-        KErrInUse if drive is in use,
-        otherwise one of the other system-wide error codes
-
-@capability DiskAdmin
+Checks the integrity of the File System mounted on the specified drive
+and attempts to correct some known File System errors.
+The behaviour of this API and return codes are File System specific,
+dependent on how the File System implements its ScanDrive functionality.
+
+ScanDrive will not run on drives that have files or directories opened.
+
+@param	aDrive	Path indicating the drive which contains the disk to be checked.
+				If the drive letter is not specified, the current session drive is taken by default.
+
+@return KErrNone				On success.
+		KErrInUse				If drive is in use (i.e. if there are files and/or directories opened in the drive).
+		KErrCorrupt				If ScanDrive has detected a file system corruption that it cannot fix.
+        KErrNotSupported		If this functionality is not supported.
+        KErrPermissionDenied	If the caller does not have DiskAdmin capability.
+		Other system-wide error codes.
+
+@capability	DiskAdmin
+
+FAT File System specific information:
+
+ScanDrive is intended to be run ONLY on "Rugged-FAT" file system
+which is applicable to internal non-removable drives.
+Internal RAM drives are not supported.
+
+The "Rugged FAT" file system is designed in such a way that only a limited number
+of known cases of corruption can be caused by sudden power loss.
+All of these known cases can be corrected by ScanDrive.
+Hence, running ScanDrive on "Rugged FAT" file system will result in:
+		KErrNone	If there was no File System corruption or ScanDrive has successfully repaired the File System.
+		KErrCorrupt If ScanDrive has found a File System error that it cannot repair.
+		Other system-wide error codes, see above.
+
+Running ScanDrive on removable media or media that has FAT file system not in
+"Rugged FAT" mode is not practical, because ScanDrive is not designed for this.
+Therefore, do not treat ScanDrive on removable media as a generic "disk repair utility".
 */
 	{
 	TRACEMULT2(UTF::EBorder, UTraceModuleEfsrv::EFsScanDrive, MODULEUID, Handle(), aDrive);
--- a/userlibandfileserver/fileserver/shostmassstorage/msproxy/hostusbmsproxy.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/shostmassstorage/msproxy/hostusbmsproxy.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -1,24 +1,18 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the License "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
 //
-// hostusbmsproxy.cpp
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
 //
-// This file system extension provides a way to access a drive on the MS system in "raw format".
-// It can be used to test large files / drives
+// Contributors:
+//
+// Description:
+// This file system extension provides a way to access a drive on the MS system
+// in "raw format". It can be used to test large files / drives
 //
 
 /** @file
@@ -486,6 +480,7 @@
 	return KErrNone;
 	}
 
+
 /**
 Write to the proxy drive and pass flags to driver
 
@@ -521,6 +516,7 @@
 	return iUsbHostMsLun.Write(iMsDataMemMap.GetDataPos(aPos), aSrc.Length(), aSrc);
 	}
 
+
 /**
 Get the proxy drive's capabilities information.
 
@@ -566,19 +562,22 @@
                     capsInfo.iNumberOfBlocks, capsInfo.iBlockLength,
 		            caps().iSize, caps().iMediaAtt);
 		}
-	else
+	else if (KErrNotReady)
         {
         __HOSTPRINT(_L("<<< HOST Caps Media Not Present"));
-		c.iType = EMediaNotPresent;
-		if(r != KErrNotReady)
-			r = KErrUnknown;
+		c.iType = EMediaNotPresent;		
+		r = KErrNone;
+        }
+    else
+        {
+        __HOSTPRINT(_L("<<< HOST Caps Unknown Error"));
+		r = KErrUnknown;
         }
 	anInfo = caps.Left(Min(caps.Length(),anInfo.MaxLength()));
 	return r;
 	}
 
 
-
 /**
 Format the proxy drive. The drive is assumed to be a single partition. The
 partition size is equivalent to the size of the media.
--- a/userlibandfileserver/fileserver/shostmassstorage/server/protocol/cmassstoragefsm.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/protocol/cmassstoragefsm.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -129,6 +129,7 @@
         User::Leave(KErrNotSupported);
         break;
     default:
+        __SCSIPRINT(_L("INQUIRY Command returned KErrUnknown"));
         User::Leave(KErrUnknown);
         break;
         }
@@ -150,6 +151,7 @@
         User::Leave(KErrNotSupported);
         break;
     default:
+        __SCSIPRINT(_L("INQUIRY Command returned KErrUnknown"));
         User::Leave(KErrUnknown);
         break;
         }
--- a/userlibandfileserver/fileserver/shostmassstorage/server/protocol/cscsiprotocol.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/protocol/cscsiprotocol.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -26,8 +26,6 @@
 #include "shared.h"
 #include "msgservice.h"
 
-#include "mscutils.h"
-
 #include "mtransport.h"
 #include "mprotocol.h"
 #include "tscsiclientreq.h"
@@ -45,7 +43,6 @@
 #include "usbmshostpanic.h"
 
 
-
 /**
 Create the CScsiProtocol object.
 
@@ -68,8 +65,8 @@
 void CScsiProtocol::ConstructL(TLun aLun)
     {
 	__MSFNLOG
+	// iState = EEntry;
     iFsm = CMassStorageFsm::NewL(*this);
-	iState = EDisconnected;
 
     const TInt blockLength = 0x200;
 
@@ -99,6 +96,7 @@
 void CScsiProtocol::InitialiseUnitL()
     {
 	__MSFNLOG
+    iState = EDisconnected;
 
 	// A device may take time to mount the media. If the device fails attempt to
 	// retry the connection for a number of seconds
@@ -107,10 +105,9 @@
         {
         retryCounter--;
         iFsm->ConnectLogicalUnitL();
-        iState = iFsm->IsConnected() ? EConnected: EDisconnected;
-
-        if (iState == EConnected)
+        if (iFsm->IsConnected())
             {
+            iState = EConnected;
             break;
             }
         User::After(1000 * 200);    // 200 mS
@@ -162,8 +159,7 @@
     if (err)
         {
         __SCSIPRINT1(_L("READ(10) Err=%d"), err);
-        DoCheckConditionL();
-        User::LeaveIfError(KErrAbort);
+        User::LeaveIfError(DoCheckConditionL());
         }
 
     // handle residue
@@ -189,8 +185,7 @@
         TInt err = iSbcInterface->Read10L(aPos/blockLen, aCopybuf, len);
         if (err)
             {
-            DoCheckConditionL();
-            User::LeaveIfError(KErrAbort);
+            User::LeaveIfError(DoCheckConditionL());
             }
         }
     }
@@ -217,8 +212,7 @@
 	TInt err = iSbcInterface->Write10L(aPos/blockLen, aCopybuf, aOffset, len);
     if (err)
         {
-        DoCheckConditionL();
-        User::LeaveIfError(KErrAbort);
+        User::LeaveIfError(DoCheckConditionL());
         }
 
     while (len != aLen)
@@ -242,8 +236,7 @@
         TInt err = iSbcInterface->Write10L(aPos/blockLen, buf, aOffset, len);
         if (err)
             {
-            DoCheckConditionL();
-            User::LeaveIfError(KErrAbort);
+            User::LeaveIfError(DoCheckConditionL());
             }
         }
     }
@@ -268,15 +261,11 @@
         err = iSbcInterface->ReadCapacity10L(lastLba, blockLength);
         } while (err == KErrCommandStalled && stallCounter-- > 0);
 
-
     if (err)
         {
-        if (err == KErrCommandFailed)
-            {
-            // Clear sense error
-            DoCheckConditionL();
-            }
-        User::LeaveIfError(KErrAbort);
+        // DoCheckConditionL clears sense error
+        // Media not present will return KErrNotReady so leave here
+        User::LeaveIfError(DoCheckConditionL());
         }
 
     // update iWriteProtect
@@ -286,14 +275,24 @@
         if (err == KErrCommandFailed)
             {
             // Clear sense error
-            DoCheckConditionL();
+            err = DoCheckConditionL();
+            // ignore error if unsupported
+            if (err != KErrUnknown)
+                {
+                User::LeaveIfError(err);
+                }
             }
 
         err = MsModeSense6L();
         if (err == KErrCommandFailed)
             {
             // Clear sense error
-            DoCheckConditionL();
+            err = DoCheckConditionL();
+            // ignore error if unsupported
+            if (err != KErrUnknown)
+                {
+                User::LeaveIfError(err);
+                }
             }           
         }
 
@@ -481,33 +480,49 @@
     }
 
 
-void CScsiProtocol::DoCheckConditionL()
+TInt CScsiProtocol::DoCheckConditionL()
     {
 	__MSFNLOG
     User::LeaveIfError(MsRequestSenseL());
 
+    TInt err;
+
     // Check if init is needed
     if (iSenseInfo.iSenseCode == TSenseInfo::ENotReady &&
         iSenseInfo.iAdditional == TSenseInfo::EAscLogicalUnitNotReady &&
         iSenseInfo.iQualifier == TSenseInfo::EAscqInitializingCommandRequired)
         {
         // start unit
-        TInt err = iSbcInterface->StartStopUnitL(ETrue);
-
+        err = iSbcInterface->StartStopUnitL(ETrue);
         if (err)
             {
             User::LeaveIfError(MsRequestSenseL());
             }
-
         }
 
-    TInt r = GetSystemWideSenseError(iSenseInfo);
+    err = GetSystemWideSenseError(iSenseInfo);
 
-    if (((r == KErrNotReady) && (iState == EConnected)) ||
-        r == KErrDisconnected)
-	    {
-        CompleteNotifyChangeL();
+    TScsiState nextState = iState;
+    if (err == KErrDisconnected)
+        {
+        nextState = EDisconnected;
+        }
+    else if (err == KErrNotReady)
+        {
+        nextState = EMediaNotPresent;
         }
+    else
+        {
+        // no state change;
+        }
+
+    if (nextState != iState)
+        {
+        iMediaChangeNotifier.DoNotifyL();
+        iState = nextState;
+        }
+           
+    return err;
     }
 
 
@@ -730,7 +745,7 @@
     __MSFNLOG
 	TInt err = KErrNone;
 
-	if(iFsm->IsRemovableMedia() || iState == EDisconnected)
+	if(iFsm->IsRemovableMedia() || iState != EConnected)
         {
 		iFsm->SetStatusCheck();
 		TRAP(err, iFsm->ConnectLogicalUnitL());
@@ -760,18 +775,6 @@
         }
 	}
 
-void CScsiProtocol::CompleteNotifyChangeL()
-	{
-    __MSFNLOG
-    if (!iFsm->IsStatusCheck())
-		{
-		if (iState == EConnected)
-			{
-			iState = EDisconnected;
-            iMediaChangeNotifier.DoNotifyL();
-			}
-		}
-	}
 
 RMediaChangeNotifier::RMediaChangeNotifier()
 :   iRegistered(EFalse)
--- a/userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/cscsiprotocol.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/cscsiprotocol.h	Wed Mar 31 23:38:45 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -36,7 +36,7 @@
     void DoCancelL();
 
 private:
-	void CompleteNotifierL(TInt);
+	void CompleteNotifierL(TInt aReason);
 
 private:
     /** Notification service */
@@ -55,6 +55,8 @@
    /** SCSI state */
    enum TScsiState
         {
+        EEntry,
+        EMediaNotPresent,
         EConnected,
         EDisconnected
         };
@@ -88,8 +90,8 @@
 	void NotifyChange(const RMessage2& aMessage);
     void ForceCompleteNotifyChangeL();
     void CancelChangeNotifierL();
-	void CompleteNotifyChangeL();
-	void SuspendL();
+
+    void SuspendL();
 	void ResumeL();
     TBool IsConnected();
 
@@ -116,7 +118,7 @@
 private:
     void ResetSbc();
 
-    void DoCheckConditionL();
+    TInt DoCheckConditionL();
 
 	TInt GetSystemWideSenseError(const TSenseInfo& aSenseInfo);
 	TInt ProcessAsCodes(const TSenseInfo& aSenseInfo);
--- a/userlibandfileserver/fileserver/shostmassstorage/server/shared/msctypes.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/shared/msctypes.h	Wed Mar 31 23:38:45 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -47,9 +47,7 @@
 /** Transport layer error code */
 const TInt KErrCommandFailed = 0x100;
 /** Transport layer error code */
-const TInt KErrCommandNotSupported = 0x101;
-/** Transport layer error code */
-const TInt KErrCommandStalled = 0x102;
+const TInt KErrCommandStalled = 0x101;
 
 
 /**
--- a/userlibandfileserver/fileserver/shostmassstorage/server/transport/cbulkonlytransport.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/transport/cbulkonlytransport.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -75,7 +75,7 @@
     {
     __MSFNSLOG
 	User::LeaveIfError(iInterface.Open(aInterfaceId));
-	iUsbInterfaceHandler = CUsbInterfaceHandler::NewL(iInterface);
+	iUsbInterfaceHandler = CUsbInterfaceHandler::NewL(iInterface, iBulkPipeIn);
 	InitialiseTransport();
     }
 
@@ -342,14 +342,22 @@
 	r = ProcessInTransferL(dataReceived);
     if (!r)
         {
-
+        TRAP(r, aResp->DecodeL(data));
         if (dataReceived == 0)
             {
+
+            // Some devices are found not to support DataResidue and return zero
+            // bytes received. This state is NOT treated as an error condition
+            // and we assume that all bytes are valid. For SCSI command set
+            // applicable to Mass Storage a device must always return data so
+            // the zero byte condition is not possible with compliant devices.
+            //
+            // List of known non-compliant devices:
+            // 1 Transcend JetFlashV30 VendorID=JetFlash ProductID=TS#GJFV30
+            // (# is device size in G)
+
             __BOTPRINT1(_L("Warning: No data received"), dataReceived);
-            return KErrCommandNotSupported;
             }
-
-        TRAP(r, aResp->DecodeL(data));
         }
 	return r;
 	}
--- a/userlibandfileserver/fileserver/shostmassstorage/server/transport/cusbifacehandler.cpp	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/transport/cusbifacehandler.cpp	Wed Mar 31 23:38:45 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -33,14 +33,15 @@
 #include "debug.h"
 #include "msdebug.h"
 
-CUsbInterfaceHandler* CUsbInterfaceHandler::NewL(RUsbInterface &aInterface)
+CUsbInterfaceHandler* CUsbInterfaceHandler::NewL(RUsbInterface &aInterface, RUsbPipe& aBulkPipeIn)
 	{
-	return new (ELeave) CUsbInterfaceHandler(aInterface);
+	return new (ELeave) CUsbInterfaceHandler(aInterface, aBulkPipeIn);
 	}
 
-CUsbInterfaceHandler::CUsbInterfaceHandler(RUsbInterface &aInterface)
+CUsbInterfaceHandler::CUsbInterfaceHandler(RUsbInterface &aInterface, RUsbPipe& aBulkPipeIn)
 :	CActive(EPriorityStandard),
-	iInterface(aInterface)
+	iInterface(aInterface),
+    iBulkPipeIn(aBulkPipeIn)
 	{
     __MSFNLOG
 	CActiveScheduler::Add(this);
@@ -75,26 +76,20 @@
 
 	if (error == KErrUsbStalled && iState == EGetMaxLun)
         {
-		__BOTPRINT(_L("...KErrUsbStalled"));
-		iState = EReset;
-		Reset();
-		return;
+        // Devices that do not support multiple LUNs may STALL this command
+		__BOTPRINT(_L("...KErrUsbStalled"));		
+        iBulkPipeIn.ClearRemoteStall();
+        error = KErrNone;     
         }
 
-	if (error == KErrNone)
+	else if (error == KErrNone)
         {
 		__BOTPRINT(_L("...KErrNone"));
-
 		if (iState == EGetMaxLun)
             {
 			__BOTPRINT(_L("...sending GetMaxLun response"));
 			*ipGetMaxLun = iBuffer[0];
             }
-		else
-            {
-			__BOTPRINT(_L("...defaulting to 0"));
-			*ipGetMaxLun = 0;
-            }
         }
     else
         {
@@ -117,6 +112,7 @@
 	iBotGetMaxLun = aMessage;
 	iState = EGetMaxLun;
 	ipGetMaxLun = aMaxLun;
+    *ipGetMaxLun = 0;       // default response is MaxLUN=0
 
 	reqDetails.iRequestType = 0xA1;
 	reqDetails.iRequest = 0xFE;
@@ -129,19 +125,3 @@
 	SetActive();
 	}
 
-
-void CUsbInterfaceHandler::Reset()
-	{
-    __MSFNLOG
-	RUsbInterface::TUsbTransferRequestDetails reqDetails;
-	_LIT8(KNullDesC8,"");
-
-	reqDetails.iRequestType = 0x21;
-	reqDetails.iRequest = 0xFF;
-	reqDetails.iValue = 0x0000;
-	reqDetails.iIndex = 0x0000;
-	reqDetails.iFlags = 0x04;		// Short transfer OK
-
-	iInterface.Ep0Transfer(reqDetails, KNullDesC8, (TDes8 &) KNullDesC8, iStatus);
-    SetActive();
-	}
--- a/userlibandfileserver/fileserver/shostmassstorage/server/transport/include/cusbifacehandler.h	Mon Mar 15 12:45:50 2010 +0200
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/transport/include/cusbifacehandler.h	Wed Mar 31 23:38:45 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of the License "Eclipse Public License v1.0"
@@ -24,14 +24,14 @@
 class CUsbInterfaceHandler : public CActive
 	{
 public:
-	CUsbInterfaceHandler(RUsbInterface &aInterface);
+    static CUsbInterfaceHandler* NewL(RUsbInterface &aInterface, RUsbPipe& aBulkPipeIn);
+	CUsbInterfaceHandler(RUsbInterface &aInterface, RUsbPipe& aBulkPipeIn);
 	~CUsbInterfaceHandler();
+
 	void GetMaxLun(TLun* aReceiveData, const RMessage2& aMessage);
-	static CUsbInterfaceHandler* NewL(RUsbInterface &aInterface);
-
+	
 private:
 	void RunL();
-	void Reset();
 	void DoCancel();
 
     enum TState
@@ -47,6 +47,7 @@
 	TLun* ipGetMaxLun;
 
 	RUsbInterface& iInterface;
+    RUsbPipe& iBulkPipeIn;
 	TBuf8<1> iBuffer;
 	};
 
--- a/userlibandfileserver/fileserver/smassstorage/inc/tfatbootsector.inl	Mon Mar 15 12:45:50 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,458 +0,0 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the License "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Inline methods of TFatBootSector class.
-// 
-//
-
-/**
- @file
- @internalTechnology
- 
- Returns Sectors in Fat table for 32 bit volume
- 
- @return iFatSectors32
-*/
-inline TUint32 TFatBootSector::FatSectors32() const	
-	{return iFatSectors32;}
-/**
-Fat flags
-
-@return iFATFlags
-*/
-inline TUint16 TFatBootSector::FATFlags() const		
-	{return iFATFlags;}
-/**
-Version number of the file system
-
-@return iVersionNumber
-*/
-inline TUint16 TFatBootSector::VersionNumber() const		
-	{return iVersionNumber;}
-/**
-Cluster number of the root directory
-
-@return iRootClusterNum
-*/
-inline TUint32 TFatBootSector::RootClusterNum() const	
-	{return iRootClusterNum;}
-/**
-Sector number containing the FSIInfo structure
-
-@return iFSInfoSectorNum
-*/
-inline TUint16 TFatBootSector::FSInfoSectorNum() const
-	{return iFSInfoSectorNum;}
-/**
-Backup boot sector
-
-@return iBkBootRecSector
-*/
-inline TUint16 TFatBootSector::BkBootRecSector() const
-	{return iBkBootRecSector;}
-/**
-Sets the number of sectors in Fat table for 32 bit volume
-
-@param aFatSectors32
-*/
-inline void TFatBootSector::SetFatSectors32(TUint32	aFatSectors32)
-	{iFatSectors32 = aFatSectors32;}
-/**
-Sets the Fat flags
-
-@param aFATFlags
-*/
-inline void TFatBootSector::SetFATFlags(TUint16 aFATFlags)
-	{iFATFlags = aFATFlags;}
-/**
-Sets the version number of the file system
-
-@param aVersionNumber
-*/
-inline void TFatBootSector::SetVersionNumber(TUint16 aVersionNumber)
-	{iVersionNumber = aVersionNumber;}
-/**
-Sets the cluster number of the root directory
-
-@param aRootClusterNum
-*/
-inline void TFatBootSector::SetRootClusterNum(TUint32 aRootClusterNum)	
-	{iRootClusterNum = aRootClusterNum;}
-/**
-Set the sector number containing the FSIInfo structure
-
-@param aFSInfoSectorNum
-*/
-inline void TFatBootSector::SetFSInfoSectorNum(TUint16 aFSInfoSectorNum)
-	{iFSInfoSectorNum = aFSInfoSectorNum;}
-/**
-Set the backup boot sector
-
-@param aBkBootRecSector
-*/
-inline void TFatBootSector::SetBkBootRecSector(TUint16 aBkBootRecSector)
-	{iBkBootRecSector = aBkBootRecSector;}	
-/**
-Quick test as to whether the volume is Fat32
-
-@return True for Fat32
-*/
-inline TBool TFatBootSector::Is32BitFat()
-	{return(iRootDirEntries==0);}
-/**
-Returns the vendor ID of the file system that formatted the volume
-
-@return A descriptor containing the vendor ID 
-*/
-inline const TPtrC8 TFatBootSector::VendorId() const
-	{return TPtrC8(iVendorId,KVendorIdSize);}
-/**
-Return the bytes per sector
-
-@return iBytesPerSector
-*/
-inline TUint16 TFatBootSector::BytesPerSector() const
-	{return iBytesPerSector;}
-/**
-Returns the sectors per cluster ratio
-
-@return iSectorsPerCluster
-*/
-inline TInt TFatBootSector::SectorsPerCluster() const
-	{return iSectorsPerCluster;}
-/**
-Returns the number of reserved sectors on the volume
-
-@return iReservedSectors
-*/
-inline TInt TFatBootSector::ReservedSectors() const
-	{return iReservedSectors;}
-/**
-Returns the number of Fats on the volume
-
-@return iNumberOfFats
-*/
-inline TInt TFatBootSector::NumberOfFats() const
-	{return iNumberOfFats;}
-/**
-Returns the number of entries allowed in the root directory, specific to Fat12/16, zero for FAT32
-
-@return iRootDirEntries
-*/
-inline TInt TFatBootSector::RootDirEntries() const
-	{return iRootDirEntries;}
-/**
-Returns the total sectors on the volume, zero for FAT32
-
-@return iTotalSectors
-*/
-inline TInt TFatBootSector::TotalSectors() const
-	{return iTotalSectors;}
-/**
-Returns the media descriptor
-
-@return iMediaDescriptor
-*/
-inline TUint8 TFatBootSector::MediaDescriptor() const
-	{return iMediaDescriptor;}
-/**
-Returns sectors used for the Fat table, zero for FAT32
-
-@return iFatSectors
-*/
-inline TInt TFatBootSector::FatSectors() const
-	{return iFatSectors;}
-/**
-Returns sectors per track
-
-@return iSectorsPerTrack
-*/
-inline TInt TFatBootSector::SectorsPerTrack() const
-	{return iSectorsPerTrack;}
-/**
-Returns the number of heads 
-
-@return iNumberOfHeads
-*/
-inline TInt TFatBootSector::NumberOfHeads() const
-	{return iNumberOfHeads;}
-/**
-Returns the number of hidden sectors in the volume
-
-@return iHiddenSectors
-*/
-inline TInt TFatBootSector::HiddenSectors() const
-	{return iHiddenSectors;}
-/**
-Returns total sectors in the volume, Used if totalSectors > 65535
-
-@return iHugeSectors
-*/
-inline TInt TFatBootSector::HugeSectors() const
-	{return iHugeSectors;}
-/**
-Returns the physical drive number, not used in Symbian OS
-
-@return iPhysicalDriveNumber
-*/
-inline TInt TFatBootSector::PhysicalDriveNumber() const
-	{return iPhysicalDriveNumber;}
-/**
-Returns the extended boot signiture
-
-@return iExtendedBootSignature
-*/
-inline TInt TFatBootSector::ExtendedBootSignature() const
-	{return iExtendedBootSignature;}
-/**
-Returns the unique volume ID
-
-@return iUniqueID
-*/
-inline TUint32 TFatBootSector::UniqueID() const
-	{return iUniqueID;}
-/**
-Returns the volume's label
-
-@return A descriptor containing the volume label
-*/
-inline const TPtrC8 TFatBootSector::VolumeLabel() const
-	{return TPtrC8(iVolumeLabel,KVolumeLabelSize);}
-/**
-Returns the file system type
-
-@return A descriptor containing the file system type
-*/
-inline const TPtrC8 TFatBootSector::FileSysType() const
-	{return TPtrC8(iFileSysType,KFileSysTypeSize);}
-/**
-Returns the boot sector signiture
-
-@return KBootSectorSignature
-*/
-inline TInt TFatBootSector::BootSectorSignature() const
-	{return KBootSectorSignature;}
-/**
-Set the jump instruction 
-*/
-inline void TFatBootSector::SetJumpInstruction()
-	{iJumpInstruction[0]=0xE9;iJumpInstruction[2]=0x90;}
-/**
-Set the vendor ID of the file system that formatted the volume
-
-@param aDes Descriptor containing the Vendor ID
-*/
-inline void TFatBootSector::SetVendorID(const TDesC8& aDes)
-	{
-	__ASSERT_DEBUG(aDes.Length()<=KVendorIdSize,User::Panic(_L("FATFILESYS"),1));
-	TPtr8 buf(iVendorId,KVendorIdSize);
-	buf=aDes;
-	}
-/**
-Sets the bytes per sector 
-
-@param aBytesPerSector Number of bytes per sector
-*/
-inline void TFatBootSector::SetBytesPerSector(TInt aBytesPerSector)
-	{
-	__ASSERT_DEBUG(!(aBytesPerSector&~KMaxTUint16),User::Panic(_L("FATFILESYS"),1));
-	iBytesPerSector=(TUint16)aBytesPerSector;
-	}
-/**
-Set the sectors per cluster ratio
-
-@param aSectorsPerCluster Number of sectors per cluster
-*/
-inline void TFatBootSector::SetSectorsPerCluster(TInt aSectorsPerCluster)
-	{
-	__ASSERT_DEBUG(!(aSectorsPerCluster&~KMaxTUint8),User::Panic(_L("FATFILESYS"),1));
-	iSectorsPerCluster=(TUint8)aSectorsPerCluster;
-	}
-/**
-Sets the number of reserved sectors on the volume
-
-@param aReservedSectors Number of reserved sectors
-*/
-inline void TFatBootSector::SetReservedSectors(TInt aReservedSectors)
-	{
-	__ASSERT_DEBUG(!(aReservedSectors&~KMaxTUint16),User::Panic(_L("FATFILESYS"),1));
-	iReservedSectors=(TUint16)aReservedSectors;
-	}
-/**
-Sets the number of Fats on the volume
-
-@param aNumberOfFats Number of fats
-*/
-inline void TFatBootSector::SetNumberOfFats(TInt aNumberOfFats)
-	{
-	__ASSERT_DEBUG(!(aNumberOfFats&~KMaxTUint8),User::Panic(_L("FATFILESYS"),1));
-	iNumberOfFats=(TUint8)aNumberOfFats;
-	}
-/**
-Number of entries allowed in the root directory, specific to Fat12/16, zero for FAT32
-
-@param aRootDirEntries
-*/
-inline void TFatBootSector::SetRootDirEntries(TInt aRootDirEntries)
-	{
-	__ASSERT_DEBUG(!(aRootDirEntries&~KMaxTUint16),User::Panic(_L("FATFILESYS"),1));
-	iRootDirEntries=(TUint16)aRootDirEntries;
-	}
-/**
-Total sectors on the volume, zero for FAT32
-
-@param aTotalSectors Total number of sectors
-*/
-inline void TFatBootSector::SetTotalSectors(TInt aTotalSectors)
-	{
-	__ASSERT_DEBUG(!(aTotalSectors&~KMaxTUint16),User::Panic(_L("FATFILESYS"),1));
-	iTotalSectors=(TUint16)aTotalSectors;
-	}
-/**
-Set the media descriptor
-
-@param aMediaDescriptor
-*/
-inline void TFatBootSector::SetMediaDescriptor(TUint8 aMediaDescriptor)
-	{iMediaDescriptor=aMediaDescriptor;}
-/**
-Sectors used for the Fat table, zero for FAT32
-
-@param aFatSectors Number of Fat sectors
-*/
-inline void TFatBootSector::SetFatSectors(TInt aFatSectors)
-	{
-	__ASSERT_DEBUG(!(aFatSectors&~KMaxTUint16),User::Panic(_L("FATFILESYS"),1));
-	iFatSectors=(TUint16)aFatSectors;
-	}
-/**
-Set the sectors per track
-
-@param aSectorsPerTrack Number of sectors per track
-*/
-inline void TFatBootSector::SetSectorsPerTrack(TInt aSectorsPerTrack)
-	{
-	__ASSERT_DEBUG(!(aSectorsPerTrack&~KMaxTUint16),User::Panic(_L("FATFILESYS"),1));
-	iSectorsPerTrack=(TUint16)aSectorsPerTrack;
-	}
-/**
-Set the number of heads
-
-@param aNumberOfHeads Number of heads
-*/
-inline void TFatBootSector::SetNumberOfHeads(TInt aNumberOfHeads)
-	{
-	__ASSERT_DEBUG(!(aNumberOfHeads&~KMaxTUint16),User::Panic(_L("FATFILESYS"),1));
-	iNumberOfHeads=(TUint16)aNumberOfHeads;
-	}
-/**
-Set the number of hidden sectors in the volume
-
-@param aHiddenSectors Number of hidden sectors
-*/
-inline void TFatBootSector::SetHiddenSectors(TUint32 aHiddenSectors)
-	{
-	iHiddenSectors=(TUint32)(aHiddenSectors);
-	}
-/**
-Set the total sectors in the volume, Used if totalSectors > 65535
-
-@param aHugeSectors
-*/
-inline void TFatBootSector::SetHugeSectors(TUint32 aHugeSectors)
-	{iHugeSectors=aHugeSectors;}
-/**
-Physical drive number, not used in Symbian OS
-
-@param aPhysicalDriveNumber Physical drive number 
-*/
-inline void TFatBootSector::SetPhysicalDriveNumber(TInt aPhysicalDriveNumber)
-	{
-	__ASSERT_DEBUG(!(aPhysicalDriveNumber&~KMaxTUint8),User::Panic(_L("FATFILESYS"),1));
-	iPhysicalDriveNumber=(TUint8)aPhysicalDriveNumber;
-	}
-/**
-Set the reserved byte value
-
-@param aReservedByte Value for reserved byte
-*/
-inline void TFatBootSector::SetReservedByte(TUint8 aReservedByte)
-	{iReserved=aReservedByte;}
-/**
-Set the extended boot signiture
-
-@param anExtendedBootSignature The extended boot signiture
-*/
-inline void TFatBootSector::SetExtendedBootSignature(TInt anExtendedBootSignature)
-	{
-	__ASSERT_DEBUG(!(anExtendedBootSignature&~KMaxTUint8),User::Panic(_L("FATFILESYS"),1));
-	iExtendedBootSignature=(TUint8)anExtendedBootSignature;
-	}
-/**
-Set the unique volume ID
-
-@param anUniqueID Set the unique ID
-*/
-inline void TFatBootSector::SetUniqueID(TUint32 anUniqueID)
-	{iUniqueID=anUniqueID;}
-/**
-Set the volume's label
-
-@param aDes A descriptor containg the volume label
-*/
-inline void TFatBootSector::SetVolumeLabel(const TDesC8& aDes)
-	{
-	__ASSERT_DEBUG(aDes.Length()<=KVolumeLabelSize,User::Panic(_L("FATFILESYS"),1));
-	TPtr8 buf(iVolumeLabel,KVolumeLabelSize);
-	buf=aDes;
-	}
-/**
-Set the file system type
-
-@param aDes A descriptor containing the file system type
-*/
-inline void TFatBootSector::SetFileSysType(const TDesC8& aDes)
-	{
-	__ASSERT_DEBUG(aDes.Length()<=8,User::Panic(_L("FATFILESYS"),1));
-	TPtr8 buf(iFileSysType,8);
-	buf=aDes;
-	}
-/**
-Tests if the volume is Fat 16 or not
-
-@return True if the volume is Fat16
-*/
-inline TBool TFatBootSector::Is16BitFat()
-	{return(FileSysType()==_L8("FAT16   "));}
-/**
-Returns the position of the first sector of the first Fat
-
-@return The first Fat sector's byte position
-*/
-inline TInt TFatBootSector::FirstFatSectorPos()
-	{return(ReservedSectors()*BytesPerSector());}
-/**
-Returns the start sector number of the root directory
-
-@return Start sector number of the root directory
-*/
-inline TInt TFatBootSector::RootDirStartSector()
-	{return(ReservedSectors()+FatSectors()*NumberOfFats());}
-/**
-Returns the sector number of the first sector after the root directory 
-
-@return 
-*/
-inline TInt TFatBootSector::FirstFreeSector()
-	{return(RootDirStartSector()+(RootDirEntries()*KSizeOfFatDirEntry+BytesPerSector()-1)/BytesPerSector());}
-